Failed nightly tests not block merge if exists merge request pipeline


  • self managed v. 15.4
  • We are using merge request pipelines, because we need dependency job.rules.changes on changes in merge request, not in current push (developer change c++ part and pipeline fail, developer change php part and pipeline succeed, because are tested only php part and c++ not).
  • We are running nightly regress tests on all branches at night by script in scheduled job.
  • If nightly tests failed, merge of branch is not blocked, because script create non merge request pipeline and MR pipeline have priority.
  • Api can create merge request pipelines, but can’t define variables - I can’t initiate specific nightly tests


  • Is any way, how run pipeline with variables so that the result affects the ability to perform a merge?

It occurred to me to set the project variable before creating the pipeline, but this looks like race-condition and if script crash, all next pipelines do nightly tests… and this would not be good.

Thanks for all the replies

Our workflow is:

    # Do not run a new pipelines on external ao3 repository
    - if: '$CI_PROJECT_NAME == "ao3-externals"'
      when: never
    # Always run on default branch
    - if: '$CI_COMMIT_BRANCH == "production"'
        ACTION: 'regres_e2e'
    # Always run on cbt branch, remove this huge branch after merge to default branch
    - if: '$CI_COMMIT_BRANCH == "cbt"'
    # Do not run new pipeline when commit is on branch without merge request
      when: never
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_PIPELINE_SOURCE == "pipeline"'
    - if: '$CI_PIPELINE_SOURCE == "trigger"'
    - if: '$CI_PIPELINE_SOURCE == "api"'
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
    - if: '$CI_PIPELINE_SOURCE == "web"'
    - if: '$CI_PIPELINE_SOURCE == "webide"'
    # Run pipeline on Merge Requests
      when: never
    - if: "$CI_COMMIT_TAG"
    - if: "$CI_COMMIT_BRANCH"

Typical job start is:

  stage: test
    - if: '$ACTION == "build_gol"'
        - core/Design/**/*
        - ci/docker/cm-compiler/**/*
        - ci/docker/cppcheck/**/*
    - if: '$ACTION == "regres_e2e"'
    - if: '$ACTION == "cppcheck"'
    - build_cppcheck_image