Limit number of shown environments
What does this MR do?
This MR limits in context of Merge Request a list of shown environments. Previously we would show all environments containing the SHA of the head commit of Merge Request. However, with introducing of dynamically created environments this lead to a cases that we would show multiple review apps, for different branches, because these branches would contain a new questioned commit.
This MR changes what environments we test against presence of the commit, to:
- We look for environments with deployments to source_branch of source_project: used for deployments to per-branch environments,
- We look for environments with deployments to target_branch of target_project: used for deployments to staging / production environments,
- We look for environments with deployments for tags on target_project: used for staging / production environments.
Why was this MR needed?
To improve a list of returned environments when we introduced ability to create dynamic environments for review apps: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6323
Screenshots (if relevant)
This allows us to limit this list:
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
None yet, but they would be created when users would start using review apps
.