Automatic toggling of merge train based on mirror status
In #960 (closed), we allowed for a branch divergence of master
between Canonical and Security by utilizing the merge-train project to merge the Canonical branch into its Security counterpart.
The divergence between mirrors still exists -- Canonical is unable to push master
-- because the Security mirror still contains commits that Canonical doesn't have (the merge-train commit, and any potential security fixes).
When a security release is completed and we sync Security back to Canonical, the divergence should no longer exist and the built-in mirroring should be sufficient again. At this point the merge-train is unnecessary.
We should investigate if we can toggle the scheduled merge-train task depending on the status of the mirror.
Implementation
Have a scheduled release-tools task that runs regularly and:
- Checks the status of
projects/gitlab-org%2Fgitlab/remote_mirrors
API- If the
last_error
message containsrefs/heads/master
, we need the merge-train -- toggle the https://ops.gitlab.net/gitlab-org/merge-train/-/pipeline_schedules/110/edit task on via API - Otherwise, toggle the task off
- If the