Why would this pipeline not execute?

Hi community

I have a pipeline that I had developed on a standalone instance, and over there the execution is done every time, as expected. The rules work as expected. But, when I copy the EXACT same pipeline file to a GitLab premium instance, the pipeline just won’t execute when I commit to the feature branch. So far, the only difference I can come up with, is the fact that the premium setup contains Approval rules, but even if I disable all of them, my pipeline still does not work the way I want it to.

stages:
  - dryrun
  - test-topology
  - apply-topology

# Job1
dry-run-julieops-on-kafka-tst:
  stage: dryrun
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "test"
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED == 'false'
    
  script:
    - echo "DryRun from JO on kafka-tst"

# Job2
dry-run-julieops-on-kafka-prd:
  stage: dryrun
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED == 'false'
  script:
    - echo "DryRun from JO on kafka-prd"

# Job 3
current-commit-against-test-topology:
  stage: test-topology
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED == 'false'
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "test"

  script:
    - echo "Run current commit on docker instance with test topology"

# Job 4
current-commit-against-prod-topology:
  stage: test-topology
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED == 'false'
  script:
    - echo "Run current commit on docker instance with prod topology"

# Job 5
apply-julieops-on-kafka-tst:
  stage: apply-topology
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "test" && $CI_MERGE_REQUEST_APPROVED == 'true'
  script:
    - echo "Run current commit on kafka-tst environment"

# Job 6
apply-julieops-on-kafka-prd:
  stage: apply-topology
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production" && $CI_MERGE_REQUEST_APPROVED == 'true'
  script:
    - echo "Run current commit on kafka-prd environment"

I have 3 protected branches: main, test and production

My workflow at the moment is:

Create an issue and immediately create a branch + MR. Push code to this branch and then jobs 1,2,3 and 4 need to kick off. When the feature branch is merged to main, nothing should happen. At this point all testing should have been done and there is no need for another test.

Next step is merge from main to test. A new MR is created. At this point, jobs 1,3 & 5 needs to execute. When all testing is done, a new MR is created to merge from test to production. At this point I want jobs 2,4 & 6 to execute.

In my test instance this works great. In the production instance where we have a premium account, nothing happens when I push code to my Feature Branch. But the moment I merge from main to test all happens as expected.

The approval rules settings are as follows:

So what am I missing here? Why is nothing triggered when I commit to feature branch? And more importantly, why is my standalone working but premium not? Any ideas which settings in Premium can cause a ‘block’ for this pipeline to run during a commit to feature branch?

Thanks for any help in advance.

The only other difference I could find between premium and non-premium instances, were that non-premium is currently on 16.5.1, and the premium one is on 16.3.2. Looking at the changelog I don’t see anything that would warrant this behaviour, but I am no expert.

This seems to be because of the versions. I installed a dev environment with 16.3.2, loaded my pipeline definition file, and tried to execute the pipeline by pushing code to it. It did not trigger anything. I then upgraded my dev install to 16.5.1, add one line of code to an already existing file, and it immediately triggered the pipeline. So it would seem that something from the 16.5.1 upgrade ‘fixed’ my problem. No idea why. Marking as solved, but for posterity anybody with expert knowledge might want to chime in here?
Thanks

My final pipeline for GL 16.5.1 looks like this:

stages:
  - dryrun
  - test-topology
  - apply-topology

dry-run-julieops-on-kafka-tst:
  stage: dryrun
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "test"
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED == 'false'
    
  script:
    - echo "DryRun from JO on kafka-tst"

dry-run-julieops-on-kafka-prd:
  stage: dryrun
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED == 'false'
  script:
    - echo "DryRun from JO on kafka-prd"

current-commit-against-test-topology:
  stage: test-topology
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED == 'false'
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "test"

  script:
    - echo "Run current commit on docker instance with test topology"

current-commit-against-prod-topology:
  stage: test-topology
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED == 'false'
  script:
    - echo "Run current commit on docker instance with prod topology"


apply-julieops-on-kafka-tst:
  stage: apply-topology
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "test"
      when: manual
  script:
    - echo "Run current commit on kafka-tst environment"
  needs: ["current-commit-against-test-topology"]

apply-julieops-on-kafka-prd:
  stage: apply-topology
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"
      when: manual
  script:
    - echo "Run current commit on kafka-prd environment"
  needs: ["current-commit-against-prod-topology"]

This pipeline will execute exactly like I wanted. Especially for the apply-topology stage. These two jobs will respectively wait for the test and prod jobs to finish, and pause the pipeline for manual intervention. Then when the maintainer is ready they can resume the pipeline, and merge the code to test and production branches respectively.