Hello,
We have pipelines that runs terraform code:
- when a MR is opened, we have 3 jobs that runs: terraform validate, terraform format, terraform plan
- the format step auto format the code and push a new commit to the source branch
- the plan adds the generated plan in the discussion (and clear the older ones)
- when the MR is merged the plan is applied
- we enable the option that a pipeline must succeed to allow merge request to be merged.
What is expected:
The format step push the diff commit without triggering a new pipeline, and we can merge the request.
What happens:
The format step push the diff commit without triggering a new pipeline. However:
- the MR is blocked with " Checking pipeline status." and the wheel spinning indefinitely
- the “Merge” button is grayed out with the message: Merge blocked: all merge request dependencies must be merged or closed.
Which version of gitlab:
GitLab Community Edition [14.8.4]
Pipeline configuration:
Each job in the merge request pipeline had:
rules: - if: '$CI_COMMIT_TITLE !~ /^auto format$/ && $CI_PIPELINE_SOURCE == "merge_request_event"'
The jobs that runs when merged have:
rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
We tried to use “git push -o ci.skip” but it created a skipped pipeline and the merge request pipeline is also triggered.
We tried to change the title test to $GITLAB_USER_LOGIN == "git-automation"
, and finally we tried:
workflow:
rules:
- if: $GITLAB_USER_LOGIN == "git-automation"
when: never
job:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
I guess that something is waiting for a new pipeline consecutive to the push that is not created. What is the way to go ?
Regards
Jérôme