Record reason for skipping pipelines/jobs
Problem to solve
It is not always obvious - especially to someone who maybe didn't write the
.gitlab-ci.yml - why a particular job or pipeline is skipped. It can be for a combination of many things such as it was intentionally skipped, only/except rules, etc.
This change will help to improve the gitlab-ce~2024184 for ~Verify and thus contribute to our Verify North Stars.
Add a job type/status which makes it clear why the pipeline or job was skipped.
Reasons a job was skipped could include:
- Commit message contains
- Commit was pushed with
-o ci.skip(the original reason this issue was opened)
exceptrule caused it to be skipped.
Permissions and Security
This change does not impact or change anything about permissions or security.
What does success look like, and how can we measure that?
Links / references
Original DescriptionThe following discussion from gitlab-ce!15643 should be addressed:
I wonder if we should somehow provide a feedback in the UI. It is not immediately obvious that a pipeline has been skipped because of push options. When someone pushes a commit with
[ci skip]this message is visible in the commit message / description in the UI, whereas when someone uses push options, it is not clear why pipeline has been skipped.
Does this feature need gitlab-ce~2024184 work? /cc @dimitrieh
Right now, the
ci.skip push option is handled the same as
[ci skip] in a commit message:
lib/gitlab/ci/pipeline/chain/skip.rb and the
pipeline.status is set to "skipped".
[ci skip] messages were the only way to skip, the commit message was evidence as to why the pipeline was skipped. But now with push options, there's no indicator.
It may be worthwhile to add additional state to the pipeline, recording the reason so it can be retrieved via the web UI, as well as the pipelines API.