“Merge When Pipeline Succeeds” with manual jobs

Replace this template with your information

Is there a way to have manual jobs (like deploy stage) but allow “Merge When Pipeline Succeeds” for non-manual jobs?

Occasionally we would like to “Merge When Pipeline Succeeds” without running the manual jobs.

According to this article it is not possible but that article is two years old so I don’t know if it is accurate.

1 Like

Yes there is! You can set allow_failure to true and the pipelines will be set to success even if you manual jobs are not yet run.

manual-job-when:
  when: manual
  allow_failure: true 
manual-job-rules:
  rules:
    - if: '$CI_MERGE_REQUEST_IID'
      when: manual
      allow_failure: true

For more information take a look at this issue

2 Likes

For stages containing on_stop and action: stop pairs, both jobs have to include allow_failure: true in order to make automerge work.

While allow_failure: true makes the pipeline succeed, I have another problem with that:

We use the when:manual in a first job of a row of deployment jobs where the following ones use needs:.

Now when setting the first deployment job to allow_failure, the following ones all run, even if the job was failed.

That means that I have no means of creating a pipeline that

  • runs some build and test jobs (and enters success state after they succeed)
  • has a manual job followed by some more jobs needing that one
  • does not run the following jobs if the manual job fails

This is due to the fact that the allow_failure here seems to have two meanings:

  • ignore the job when calculating success
  • decide on whether to continue

Thus I have no means of creating the pipeline I’m after here.

Why do I need this? Because we have renovate-bot pipelines I want to automerge if tests succeed, but I still want to be able to deploy them if need arises (otherwise I’d just remove the deployment jobs from these branches)

I have the same issue with this as @svenXY, how should I do this ?