Manual `review-deploy` isn't playable until previous jobs are done
When Review Apps deployments are manual, review-deploy isn't playable until previous jobs are done, which is a problem since review-build-cng tries to play it, but it doesn't success since the job isn't playable at this point.
This works if you retry review-build-cng once it's finished once, but it's wasting 20 minutes of compute and clock time since it's rebuilding the CNG components...
Unfortunately, if we add needs: [] to review-deploy, that'll either block the pipeline if review-build-cng is never played (see #199979 (closed)), or start review-deploy before review-build-cng when Review Apps deployments are automated (i.e. MR with frontend changes). Being able to specify a different needs depending on when could improve that (i.e. needs: [] for when: manual and needs: ["review-build-cng"] for when: on_success).
A solution would be to put both jobs in the same stage but we'd need #30632 (closed) to be implemented.
Working solution
- Always make the
review-deployjob manual. - Move
review-build-cngto thereviewstage so thatreview-build-cngandreview-deploycan be started without the other being done first. - Always try to trigger
review-deployat the end ofreview-build-cng. - In
review-deploy:- If
review-build-cngis not started, start it. - Wait for
review-build-cngto finish. - Proceed to deployment.
- At the end, play
review-qa-smokeandreview-performance.
- If
- In
review-qa-smokeandreview-performance, wait forreview-deployto be finished, then download itsenvironment_url.txtartifact.
Note that #31264 (closed) would allow to avoid most if not all of these workarounds.
