Guarantee a new pipeline
Related to: %(2023Q2) Reducing overall CI workload in `{nomadic-labs,tezos}/tezos` in tezos/tezos
We are in the process of making some changes in the tezos/tezos pipelines so that pipelines that are triggered by marge-bot will run some additional tests before an MR is merged. We would like to make sure such a pipeline always run before the MR is merged.
Normally, this will be ensured if marge rebases the MR when processing it, as this will create a new pipeline triggered by marge. However, if the MR processed by marge-bot is already rebased and has a successful pipeline, the marge-bot will not rebase and so no pipeline will be triggered in its name. In this case, we run the risk of not running the additional tests.
Marge-bot has an option --guarantee-final-pipeline
that seemingly should accomplish this. However, looking at the code, it seems like it is an internal smarkets
implementation (smarkets
authored marge-bot) that will do nothing in our setting.
We would need to modify this code so that it triggers a pipeline. In addition, we would like this pipeline to be a "merge request pipeline", so that we can e.g. rely on the changes:
clause in .gitlab-ci.yml
to run tests conditionally based on the changes in the MR. To accomplish this, we cannot trigger the pipeline directly through the gitlab api. However, although the MR is already rebased, we can do a "void rebase" (e.g. git commit --amend --no-edit
) and push. This will update the hash of the tip of the MR's branch, and hence the push will create a new merge request pipeline as desired.