Make it easy for includes to add jobs at beginning/end of pipeline
What does this MR do?
Related issue #31441 (closed)
Documentation MR: !18664 (merged)
This adds two new pre-defined stages called .pre
and .post
to pipelines.
These exist alongside the other predefined stages, build, test, deploy
, and are sequenced as follows:
.pre
build
test
deploy
.post
.pre
would always be guaranteed to be the first stage, and .post
would always be guaranteed to be the last.
Unlike build, test, deploy
, these stages can not be overriden and they will always be present in the pipeline, wrapping the user defined stages.
If you write a job in your include that needs to run at the beginning, you'd insert it as follows:
my_job:
stage: .pre
Any other includes that also need to run at the beginning would use this pre-defined .pre
stage, and all of these would run in parallel. .post
is used and works the same, but is always at the end of the pipeline.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team