Maven / GitLab CI Basics Interview Questions
What is the 'allow_failure' keyword and how does it affect pipeline status?
The allow_failure keyword controls whether a failing job causes the pipeline to fail. When set to true, the job can fail without marking the overall pipeline as failed - GitLab shows a warning icon on the job instead of a failure.
# allow_failure: true - job failure does not fail the pipeline linting: stage: test script: - eslint src/ --max-warnings 0 allow_failure: true # linting warnings won't block deployment # allow_failure with rules (preferred modern approach) code-quality: stage: test script: - run-quality-check.sh rules: - if: $CI_COMMIT_BRANCH allow_failure: true - if: $CI_COMMIT_TAG allow_failure: false # strict on releases # allow_failure with exit codes # Only allow specific non-zero exit codes: flaky-test: script: - run-flaky-tests.sh allow_failure: exit_codes: 137 # allow OOM kills (exit code 137) # allow_failure: true with manual jobs # makes the manual job non-blocking optional-deploy: when: manual allow_failure: true # pipeline passes without triggering this job
| allow_failure | Job fails | Pipeline result |
|---|---|---|
| false (default) | Yes | Pipeline fails |
| true | Yes | Pipeline passes with warning icon |
| exit_codes: [N] | Exit code N | Pipeline passes; other codes still fail pipeline |
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
