smarkets / marge-bot

A merge-bot for GitLab
BSD 3-Clause "New" or "Revised" License
701 stars 136 forks source link

Ignore jobs with manual trigger in CI #338

Closed Knapock closed 1 year ago

Knapock commented 2 years ago

Marge bot gets stuck when there are manual jobs pending in CI.
This PR assumes they are not necessary for a MR to be merged and considers the "manual" CI status as a valid status for merge.

alatiera commented 2 years ago

This PR assumes they are not necessary for a MR to be merged and considers the "manual" CI status as a valid status for merge.

What we do instead, in gstreamer, in a couple of projects is to have manual jobs that are triggered by developers for testing, and a rule where we match on the mr assignee being marge and then make those jobs when: always. That way we use the manual status to avoid triggering expensive pipelines while the MR is still in its early stages and there might be a lot of iterations. So for our case manual is valid pipeline status.

Knapock commented 2 years ago

What we do instead, in gstreamer, in a couple of projects is to have manual jobs that are triggered by developers for testing, and a rule where we match on the mr assignee being marge and then make those jobs when: always. That way we use the manual status to avoid triggering expensive pipelines while the MR is still in its early stages and there might be a lot of iterations. So for our case manual is valid pipeline status.

I had thought of that, but it can happen that no pipeline is triggered when a MR is assigned to Marge, because there is no rebase needed for example, and then this doesn't work. Our MRs get stuck until somebody else merges something and the MR needs to be rebased.

There's another PR in this repo that adds an option for Marge to trigger pending manual jobs. I guess I can build on that and add an option to ignore them, this could fit both our workflows. EDIT: see https://github.com/smarkets/marge-bot/pull/226