Fix Merge Request accidentally stops unrelated environments
What does this MR do and why?
When I was doing QA on production environment, I realized that the previous fix was not enough to prevent the accidental stops.
We have to target only successful deployments that executed on the pipeline. I've confirmed that this MR fixes the issue.
A few notes:
- This fix is still behind the feature flag
fix_related_environments_for_merge_requests
. - Follow-up for !83382 (merged)
- Related #346152 (closed) #356642 (closed)
Screenshots or screen recordings
How to set up and validate locally
- Create a project and setup a runner.
- Run a pipeline with the following setting:
start review:
script: echo
environment:
name: dev
on_stop: stop review
when: manual
stop review:
script: echo
environment:
name: dev
action: stop
when: manual
prepare for dev:
script: echo
environment:
name: dev
action: prepare
- Run a
start review
job on master pipeline. - Create a merge request, run a feature pipeline and merge it.
- Make sure the
dev
environment is still active.
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.
Edited by Shinya Maeda