Skip to content

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...

Screen_Shot_2020-03-24_at_17.14.22

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

  1. Always make the review-deploy job manual.
  2. Move review-build-cng to the review stage so that review-build-cng and review-deploy can be started without the other being done first.
  3. Always try to trigger review-deploy at the end of review-build-cng.
  4. In review-deploy:
    1. If review-build-cng is not started, start it.
    2. Wait for review-build-cng to finish.
    3. Proceed to deployment.
    4. At the end, play review-qa-smoke and review-performance.
  5. In review-qa-smoke and review-performance, wait for review-deploy to be finished, then download its environment_url.txt artifact.

Note that #31264 (closed) would allow to avoid most if not all of these workarounds.

Edited by Jason Yavorsky