Fail the parent pipeline when rollback steps occurs from the child pipeline

Describe your question in as much detail as possible:
Hi there, I am looking to fail the pipeline when the rollback steps are kicked off. Below is the scenario and I have attached screenshot to better understand.

We have two job in a stage which drives decision saying ‘stay’ & ‘no-stay’ . Both are manual steps. If the prod deployment looks good ‘stay’ job button is clicked. If the no-stay is clicked it kicks off the downstream pipeline which are nothing but rollback steps. At the end of the job I fail it by issuing
exit code 1. This fails the ‘no-stay’ job but pipeline is in still blocked status since the ‘stay’ isn’t executed. My question is how do I skip or fail ‘stay’ job so that parent pipeline updates the failed status.

Any advise to handle this kind of scenario. Open for suggestions. Thank you.

  • What are you seeing, and how does that differ from what you expect to see?
    I am seeing as screenshot below. I want to see failed status instead of blocked.

  • What version are you on? Are you using self-managed or
    I am using gitlab version 3.12.0-pre.

    • GitLab (Hint: /help):
    • Runner (Hint: /admin/runners):
  • Add the CI configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml)

Below is the code snippet job that I have.

  stage: deploy:status
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
      when: manual
    - echo "===== The descision is stay. ====="
    - echo "Deployment in production is successfull"
    name: prod_support_team

  stage: deploy:status
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
      when: manual
      allow_failure: false
    include: .gitlab-ci-rollback.yml
    strategy: depend
  • What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

Trying to figure out how this can be implemented and just referring to documentation.

Thanks for taking the time to be thorough in your request, it really helps! :blush: Hope the explanation helps in understanding.

Hey @snim2 , can you please provide any inputs on this. I would appreciate it. Thank you for your time.

  • Sumit