Link merge requests for all non review app deploys
What does this MR do?
This changes how we link merge requests to deployments so that:
- We link merge requests for any deployment that is not in the "created" state.
- We do not link merge requests to review app deployments.
We want to link deployments regardless of their status so that we can also show failed and running deploys in the merge request widget (and perhaps in other places). We don't want to link review app deployments since this is not useful, and may lead to deployments to different review app environments showing up on a merge request page.
This builds on the refactoring of the deployment model introduced in merge request !20474 (merged), and moves the linking of merge requests to Deployments::FinishedWorker. This worker is scheduled every time a deployment transitions to a finished state.
As part of these changes we also change Deployment#link_merge_requests so that it ignores any already linked merge requests. This way if a deployment changes its status multiple times, we don't error with duplicate key errors.
This fixes #38092 (closed), #38000 (closed).
Does this MR meet the acceptance criteria?
Conformity
Merge request reports
Activity
changed milestone to %12.6
added deploy devopsrelease [DEPRECATED] teamDelivery typebug + 1 deleted label
added 134 commits
-
72364704...63534f6e - 132 commits from branch
master
- f5cd42e1 - Always use state machine for deployments
- 2db6463a - Link merge requests for all non review app deploys
-
72364704...63534f6e - 132 commits from branch
1 Message Consider setting merge_request
to 21254 in changelogs/unreleased/fix-linking-merge-requests.yml. See the documentation.Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category (e.g. frontend or backend), and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has randomly picked a candidate for each review slot. Feel free to override this selection if you think someone else would be better-suited, or the chosen person is unavailable.
Once you've decided who will review this merge request, mention them as you normally would! Danger does not (yet?) automatically notify them for you.
Category Reviewer Maintainer backend Jarka Košanová ( @jarka
)Robert Speicher ( @rspeicher
)Generated by
DangerEdited by 🤖 GitLab Bot 🤖added 311 commits
-
2db6463a...cb01f843 - 309 commits from branch
master
- fb3083b3 - Always use state machine for deployments
- ad65f9a1 - Link merge requests for all non review app deploys
-
2db6463a...cb01f843 - 309 commits from branch
added 92 commits
-
ad65f9a1...4618707d - 90 commits from branch
master
- 23439b3a - Always use state machine for deployments
- 42dc8473 - Link merge requests for all non review app deploys
-
ad65f9a1...4618707d - 90 commits from branch
added 746 commits
-
d14d7a68...849b2c77 - 745 commits from branch
master
- 3b217c68 - Link merge requests for all non review app deploys
-
d14d7a68...849b2c77 - 745 commits from branch
- Resolved by Yorick Peterse
- Resolved by Yorick Peterse
@yorickpeterse Thanks. I left a few questions. Let me know what you think.
added 1 commit
- e5027a9b - Link merge requests for all non review app deploys
- Resolved by Yorick Peterse
@yorickpeterse Thanks. LGTM
assigned to @rspeicher
@rspeicher Could you take a look as a maintainer? Thanks!
changed milestone to %12.7
added missed:12.6 label
mentioned in issue #38092 (closed)
added 913 commits
-
e5027a9b...df0d8f2c - 912 commits from branch
master
- b5076761 - Link merge requests for all non review app deploys
-
e5027a9b...df0d8f2c - 912 commits from branch
- Resolved by Robert Speicher
- Resolved by Robert Speicher
- Resolved by Yorick Peterse
@yorickpeterse Looks good, just some minor questions.
unassigned @rspeicher
assigned to @rspeicher
added 161 commits
-
b5076761...870c49ae - 160 commits from branch
master
- 67c20fc4 - Link merge requests for all non review app deploys
-
b5076761...870c49ae - 160 commits from branch
@yorickpeterse LGTM, thanks!
enabled an automatic merge when the pipeline for 67c20fc4 succeeds
mentioned in commit 5278996c
This merge request has been deployed to the GitLab.com environment
gstg
in GitLab auto-deploy version12.7.202001050505-0b0892e71da.6254680766a
.A list of all the deployed commits can be found here.
If this message is incorrect, please create an issue in the Release Tools project.added workflowstaging label
This merge request has been deployed to the GitLab.com environment
gprd-cny
in GitLab auto-deploy version12.7.202001051105-de02d30675f.6ee76535eb4
.A list of all the deployed commits can be found here.
If this message is incorrect, please create an issue in the Release Tools project.added workflowcanary label and removed workflowstaging label
mentioned in issue #35741
This merge request has been deployed to the GitLab.com environment
gprd
in GitLab auto-deploy version12.7.202001062105-f2d6a8f3378.85c0781518c
.A list of all the deployed commits can be found here.
If this message is incorrect, please create an issue in the Release Tools project.added workflowproduction label and removed workflowcanary label
mentioned in epic &1936
mentioned in commit 7816adee