Ensure Deployment existence when a deployment job is played or retried
Problem
Currently, Environments are created when a pipeline is created. However, environments can be deleted after the pipeline creation, and if a deployment job runs after the deletion, the job doesn't have any environment associated data, such as CI_ENVIRONMENT_*
variables (i.e. silently fall back to a normal job).
Deployment jobs should always have Environment related information, and should never fall back to a normal job.
Related to #375075 (comment 1128753021) #377968 (closed)
Related bugs
Missing info in the job itself:
See #377968 (closed) for more information.
Proposal
Prevent deployment jobs from running when the corresponding deployment record doesn't exist
Edited by Shinya Maeda