Keep environments and environment folders separate when grouping
requested to merge 28701-when-grouping-similar-environments-environments-aren-t-shown-if-they-share-the-name-of-the into master
What does this MR do and why?
This MR prevents environments that share a name with an environment folder from being inaccessible on the project environment page
Implementation details
This was caused by grouping the SQL query by COALESCE(environment_type, name)
which would group environments together if their folder name and the environment name were the same.
I've updated it to group by ID as well, so that environments that don't share a folder are not grouped together
'COALESCE(environment_type, id::text)', 'COALESCE(environment_type, name)'
Performance compared to the previous query is very similar
Screenshots or screen recordings
How to set up and validate locally
- Create an environment named 'production' in a project
- Create 2 environments that live in a production folder (i.e.
production/foo
andproduction/baz
) - Notice how the folder and original environment are listed separately on the project environments page
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #28701 (closed)
Edited by Allen Cook