FAQ | This is a LIVE service | Changelog

pre-commit job runs duplicate pipelines which causes uncorrect MR pass

👓 What did you see?

pre-commit job causes 2 pipeline runs, one for branch/push and one for MR. The MR pipeline then has just pre-commit job and will falsey show a pass when other jobs fail.

What did you expect to see?

Any failures report a negative result.

💻 Where does this happen?

Lab allocator project pipelines.

🔬 How do I recreate this?

Run a pipeline with auto-devops + pre-commit template. Push code and raise an MR.

📚 Any additional information?

Adding 'Workflows/Branch-Pipelines.gitlab-ci.yml' fixes the issue but introduces another.

The behaviour in lab alloc with 'Workflows/Branch-Pipelines.gitlab-ci.yml' and the our pre-commit is as follows:

  • pre-commit runs if you push to a new branch
  • pre-commit continues if you create an MR
  • pre-commit is not run on new pushes to a branch when the MR is open.

So I think the issue lies more with the rules section of pre-commit. I'm going to remove the above import and override the pre-commit rules section in lab alloc.