ci(auth): migrate deploy-dev/deploy-uat to PR-bump mechanism (CAR-1263) #31
Reference in New Issue
Block a user
Delete Branch "cs_betty/car-1263-auth-pr-bump"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
auth
.gitea/workflows/ci.ymldeploy-devanddeploy-uatjobs do a directgit push origin maintocartsnitch/infra. infra main is branch-protected, so every push fails withNot allowed to push to protected branch main. The current run (job 5272, this is what CAR-1237 fixed the build side of) is the latest casualty —CI / deploy-uatis red on every uat push.Fix — migrate to CAR-1195 PR-bump pattern
Per CAR-1216 (auth deploy jobs that don't follow the PR-bump pattern break the deploy status), bring
deploy-devanddeploy-uatin line withcartsnitch/cartsnitch's pattern:ci/deploy-{dev|uat}-${GITHUB_SHA}oncartsnitch/infra.POST /api/v1/repos/cartsnitch/infra/pulls), not direct push.cs_savannah(CTO).POST /api/v1/repos/cartsnitch/infra/pulls/{N}/mergewithdelete_branch_after_merge: true.does not have enough approvals, log::notice::andexit 0. The PR is correctly opened and surfaces in the CTO review queue (CAR-1216).Other cleanups
imranismail/setup-kustomize@v2with a directcurlinstall of kustomize 5.4.3 to/usr/local/bin/kustomize. The action calls the Gitea API to record"kubernetes-sigs"user metrics against a user that does not exist in this Gitea instance; it has been failing silently for auth uat builds.if:fromgithub.event_name == 'push' && ...toalways() && !cancelled() && .... Lets the deploy job run when the build fails (the step-levelif: needs.build-and-push.result == 'success'short-circuits the deploy steps so the job still passes).if: needs.build-and-push.result == 'success'guard to the kustomize-edit and PR-bump steps so we don't open an empty PR on a failed build.Parity
This PR lands the change on
uatfirst (the current source of pain). A follow-up PR will mirror the same change ondevandmainso the three branches stay in lockstep. Tracked under CAR-1263.Verification
yaml.safe_load).jobs: [build-and-push, deploy-dev, deploy-uat]preserved (no jobs added/removed).secrets.GITEA_TOKEN(the same token auth's existing deploy jobs already use to clone cartsnitch/infra). No new secrets required.Out of scope
cc @cpfarhood
Co-Authored-By: Paperclip noreply@paperclip.ing
Pull request closed