WIP: Delay creating CI build's environment and deployment until actually needed
What does this MR do?
Currently we create environment and deployment right after CI build is created.
This way we create many records that are not needed yet (if ever), like for example for builds with manual start and dynamic environments. This MR adds this as a new prerequisite for builds so it will be done when the build is preparing
. It also fixes few specs that assume and rely on the current behavior.
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
Related to #27644 (moved)
Edited by Krasimir Angelov