Add AFTER_SCRIPT_IGNORE_ERRORS variable allow not ignoring after_script errors
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA
What does this MR do?
Add AFTER_SCRIPT_IGNORE_ERRORS variable allow not ignoring after_script errors
By default errors in after_script
are ignored. This is not the desired behaviour for many uses of after_script
, for example if you use it to check git is clean after each step then you don't want to ignore errors.
Arguably the behaviour should always have been to observe errors, since ignoring errors within the script is always possible (e.g. ./my_after_script.sh || true
) but observing them if they are ignored by the runner is impossible.
This commit adds a variable AFTER_SCRIPT_IGNORE_ERRORS
that can be set to false
to not ignore errors in all after_script
s. The default is true
and it also uses true
if there's a parse error.
Why was this MR needed?
It's impossible to get this behaviour from the existing after_script
. You can just add some extra stuff to the end of script
, but that doesn't scale if you have lots of jobs, whereas with after_script
you can have them all inherit a default one.
What's the best way to test this MR?
No idea; I'm afraid I haven't tested it at all!
What are the relevant issue numbers?
Merge request reports
Activity
Hey @timmmm!
Thank you for your contribution to GitLab. Please refer to the contribution documentation for an overview of the process.
Did you know about our community forks? Working from there will make your contribution process easier. Please check it out!
When you're ready for a first review, post
@gitlab-bot ready
. If you know a relevant reviewer(s) (for example, someone that was involved in a related issue), you can also assign them directly with@gitlab-bot ready @user1 @user2
.At any time, if you need help, feel free to post
@gitlab-bot help
or initiate a mentor session on Discord. Read more on how to get help.You can make AI-generated contributions to GitLab! If you use AI-generated content please check the box added to the top of your merge request description.
Some contributions require several iterations of review and we try to mentor contributors during this process. However, we understand that some reviews can be very time consuming. If you would prefer for us to continue the work you've submitted now or at any point in the future please let us know.
If you're okay with being part of our review process (and we hope you are!), there are several initial checks we ask you to make:
- The merge request description clearly explains:
- The problem being solved.
- The best way a reviewer can test your changes (is it possible to provide an example?).
- If the pipeline failed, do you need help identifying what failed?
- Check that Go code follows our Go guidelines.
- Read our contributing to GitLab Runner document.
This message was generated automatically. You're welcome to improve it.
- The merge request description clearly explains:
added Community contribution workflowin dev labels
assigned to @timmmm
added linked-issue label
mentioned in issue gitlab#21008 (closed)
added Category:Runner Core devopsverify grouprunner labels
added sectionci label
added 21 commits
-
d71a0249...aa5b94d8 - 20 commits from branch
gitlab-org:main
- e455b145 - Add AFTER_SCRIPT_IGNORE_ERRORS variable
-
d71a0249...aa5b94d8 - 20 commits from branch
@gitlab-bot ready
added workflowready for review label and removed workflowin dev label
Hi Coach
@pslaughter
, this Community contribution is ready for review or needs your coaching.- Do you have capacity and domain expertise to review this? If not, find one or more reviewers and assign to them.
- If you've reviewed it, add the workflowin dev label if these changes need more work before the next review.
This message was generated automatically. You're welcome to improve it.
requested review from @pslaughter
Thanks @timmmm for working on this
@ratchade could you please review this Community contribution? Thanks!
requested review from @ratchade and removed review request for @pslaughter
added typefeature label
- Resolved by Romuald Atchadé
Thank you @timmmm for taking time to contribute to GitLab.
We usually cover new feature with unit and/or integration tests. Would you mind adding some units tests ? and an integration test with the executordocker would also be helpful ?
I also think we should document this new variable. Can documentation be added ?
added workflowin dev label and removed workflowready for review label
- Resolved by Tim
added 45 commits
-
e455b145...a723d6de - 44 commits from branch
gitlab-org:main
- 5d1c787d - Add AFTER_SCRIPT_IGNORE_ERRORS variable
-
e455b145...a723d6de - 44 commits from branch