Kakawait
Kakawait

Reputation: 4029

Gitlab CI rules keyword mark job as blocking instead of skip when using when keyword

Until now I'm using gitlab-ci job to deploy in prod with when: manual but I recently have requirement to auto-deploy in prod when schedule job is running (that will add specific variable)

Thus I changed when: manual with rules keyword as following:

rules:
  # deploy if schedule is triggered and thus variable is present
  - if: '$DEPLOYMENT_SCHEDULE == "true"'
    when: always
  # Else (if master branch) keep job as manual (as before)
  - if: '$CI_COMMIT_REF_NAME == "master"'
    when: manual

However the pipeline view has changed a bit, because:

  1. When I was using when: manual, pipeline is considered as passed

when manual

  1. With rules: (when merge on master without DEPLOYMENT_SCHEDULE), pipeline is considered as blocked

with rules


Is there something I miss? How can I have same pipeline result with rules keyword?

Upvotes: 9

Views: 1793

Answers (1)

alex-at-gitlab
alex-at-gitlab

Reputation: 41

@kakawait I believe there's a bug report open on this issue at https://gitlab.com/gitlab-org/gitlab/issues/30075

What is the current bug behavior?

Shows the pipeline status as skipped even though the only job included is a manual action.

What is the expected correct behavior?

The pipeline status should reflect the manual action status.

Upvotes: 2

Related Questions