Run MR pipeline on "Run pipeline" button with rules

Hello. We use an on-prem GitLab server. One of the rules for launching our MR pipeline is its state. It should not be Draft or WIP, as I stated below.

  rules:
  - if: $CI_MERGE_REQUEST_TITLE =~ /^WIP/ || $CI_MERGE_REQUEST_TITLE =~ /^Draft/
    when: never
  - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
  - if: '$CI_PIPELINE_SOURCE == "web"'

But in this form, it does not start in all cases with the error: “No stages/jobs for this pipeline”. Our developers want the MR pipeline to start when you click on the “Run pipeline” button in the “pipelines” section of the current MR. I did not find any indicator for clicking on this button, neither in the webhook nor anywhere else. Is there a way to make an exception to run the pipeline in this case, but keep it for the rest?

1 Like

Sorry, I forgot to clarify. There are two different “Run pipeline” buttons, one in the “Pipelines” section and another in “Merge requests” as you can see on these screenshots:

The rule - if: '$CI_PIPELINE_SOURCE == "web"' will work only for the former. It won’t for the latter as GitLab sees it as a merge_request_event, not the web. I need to run it in both cases but I can’t find a way to trace the button push in the second one.

1 Like

I discovered this same issue today and posted here: 'Run pipeline' button for merge requests does not appear unless only: [merge_requests] is set (#326541) · Issues · GitLab.org / GitLab · GitLab

I can’t figure out how to allow merged results pipelines to run on Draft MRs when developers click the Run pipeline button

I submitted Always run a pipeline when user clicks Run pipeline from MR (#370502) · Issues · GitLab.org / GitLab · GitLab