Allow strings and nested arrays of strings for before/after script
What does this MR do and why?
This Merge Request fixes #20957 (closed)
Nested "!reference[xxxx, script]" work
Nested "!reference[xxxx, before_script]" don't work
Nested "!reference[xxxx, after_script]" don't work
Looking at "Commands" and "Scripts" history, I wasn't able to find the reason for having 2 different objects
Therefore:
- "Scripts" are replaced by "Command"
- Tests are updated to change error message or remove case which are now allowed
Screenshots or screen recordings
CI configuration
default:
image: alpine
test1:
before_script:
- echo "test1 before_script"
script:
- echo "test1 script"
after_script:
- echo "test1 after_script"
test2:
before_script:
- !reference [test1, before_script]
- echo "test2 before_script"
script:
- !reference [test1, script]
- echo "test2 script"
after_script:
- !reference [test1, after_script]
- echo "test2 after_script"
test3:
before_script:
- !reference [test2, before_script]
- echo "test3 before_script"
script:
- !reference [test2, script]
- echo "test3 script"
after_script:
- !reference [test2, after_script]
- echo "test3 after_script"
Unpatched Gitlab:
https://gitlab.com/guillaume.chauvel/ci-before-after-script/-/blob/944af7a4379b24d1139c037fc03ce72a77c9c06f/.gitlab-ci.yml
This GitLab CI configuration is invalid: jobs:test3:before_script config should be an array containing strings and arrays of strings
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
Thank you for your contribution to GitLab. We believe that everyone can contribute and contributions like yours are what make GitLab great!
- Our Merge Request Coaches will ensure your contribution is reviewed in a timely manner*.
- If you haven't, please set up a
DANGER_GITLAB_API_TOKEN
. - You can comment
@gitlab-bot label ~"group::"
to add a group label. - After a few days, feel free to ask
@gitlab-bot help
or ping a Merge Request Coach. - Read more on how to get help.
This message was generated automatically. You're welcome to improve it.
added Community contribution label
- Resolved by Fabio Pitino
1 Warning This merge request changed CI config files but did not update the schema. Please consider updating the schema to reflect these changes:
lib/gitlab/ci/config/entry/default.rb
lib/gitlab/ci/config/entry/job.rb
lib/gitlab/ci/config/entry/root.rb
spec/lib/gitlab/ci/config/entry/root_spec.rb
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Serena Fang ( @serenafang
) (UTC-6)Aleksei Lipniagov ( @alipniagov
) (UTC+3)To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger
added 1 commit
- 2c310a8e - Set CI Config Entry 'Script' similar to 'Commands'
- Resolved by Guillaume CHAUVEL
- Resolved by Guillaume CHAUVEL
- Resolved by Guillaume CHAUVEL
added 1 commit
- acb3ed22 - Set CI Config Entry 'Script' similar to 'Commands'
added 120 commits
-
acb3ed22...d632ad44 - 119 commits from branch
gitlab-org:master
- 4ca25682 - Set CI Config Entry 'Script' similar to 'Commands'
-
acb3ed22...d632ad44 - 119 commits from branch
mentioned in issue gitlab-org/quality/triage-reports#5363 (closed)
changed milestone to %14.6
added grouppipeline authoring typebug + 1 deleted label
assigned to @guillaume.chauvel
added 153 commits
-
4ca25682...c867a760 - 152 commits from branch
gitlab-org:master
- fdcb770d - Change Gitlab::Ci::Config::Entry 'Script' content equals to 'Commands'
-
4ca25682...c867a760 - 152 commits from branch
Setting label(s) devopsverify sectionops based on grouppipeline authoring.
added devopsverify sectionops labels