mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(coderd): use stable sorting for insights and improve test coverage (#9250)
Fixes #9213
This commit is contained in:
@@ -1788,13 +1788,13 @@ WITH latest_workspace_builds AS (
|
||||
array_agg(DISTINCT wb.template_id)::uuid[] AS template_ids,
|
||||
array_agg(wb.id)::uuid[] AS workspace_build_ids,
|
||||
tvp.name,
|
||||
tvp.type,
|
||||
tvp.display_name,
|
||||
tvp.description,
|
||||
tvp.options,
|
||||
tvp.type
|
||||
tvp.options
|
||||
FROM latest_workspace_builds wb
|
||||
JOIN template_version_parameters tvp ON (tvp.template_version_id = wb.template_version_id)
|
||||
GROUP BY tvp.name, tvp.display_name, tvp.description, tvp.options, tvp.type
|
||||
GROUP BY tvp.name, tvp.type, tvp.display_name, tvp.description, tvp.options
|
||||
)
|
||||
|
||||
SELECT
|
||||
@@ -1809,7 +1809,7 @@ SELECT
|
||||
COUNT(wbp.value) AS count
|
||||
FROM unique_template_params utp
|
||||
JOIN workspace_build_parameters wbp ON (utp.workspace_build_ids @> ARRAY[wbp.workspace_build_id] AND utp.name = wbp.name)
|
||||
GROUP BY utp.num, utp.name, utp.display_name, utp.description, utp.options, utp.template_ids, utp.type, wbp.value
|
||||
GROUP BY utp.num, utp.template_ids, utp.name, utp.type, utp.display_name, utp.description, utp.options, wbp.value
|
||||
`
|
||||
|
||||
type GetTemplateParameterInsightsParams struct {
|
||||
|
||||
Reference in New Issue
Block a user