From ba1b0ebcc08118df0f8ef4e30bae1ca53d71fa8b Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Wed, 8 Jul 2026 02:30:36 +0530 Subject: [PATCH] fix(ci): raise max-parallel to 9, make gitops push failures actually fail the job Bumped runner.capacity from 1 to 3 on all 3 runner pods (9 total concurrent slots - nodes were sitting at 7-11% CPU during builds, so plenty of headroom), matched here with max-parallel: 9. Also fixed a real bug: the gitops-push retry loop had no check after exhausting all attempts, so a job whose every push attempt failed would still exit 0 and report "success" - which is exactly what happened on the previous run (verified: all 20 services built and pushed their images correctly, but the actual GITOPS_PAT secret was invalid/expired, and the retry loop silently swallowed the resulting failure across all 20 jobs). Fixed the secret itself (confirmed the existing admin-scoped Forgejo token has valid push access to ashwin/nxtgauge-gitops and rotated GITOPS_PAT to it), and added an explicit exit 1 if the retry loop exhausts without a successful push. Co-Authored-By: Claude Sonnet 5 --- .forgejo/workflows/build.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 6ac6ae7..605f2b7 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -15,7 +15,7 @@ jobs: runs-on: docker-ready strategy: fail-fast: false - max-parallel: 3 + max-parallel: 9 matrix: service: - gateway @@ -171,15 +171,17 @@ jobs: git clone "https://forgejo-actions:${GITOPS_PAT}@${GITOPS_SERVER}/${GITOPS_OWNER}/${GITOPS_REPO}.git" /tmp/nxtgauge-gitops cd /tmp/nxtgauge-gitops - # Up to 3 of these jobs can be pushing to the same gitops branch at + # Up to 9 of these jobs can be pushing to the same gitops branch at # once now - retry with a fresh pull+rebase on a non-fast-forward # rejection instead of assuming we're the only writer. - for attempt in 1 2 3 4 5; do + pushed=false + for attempt in 1 2 3 4 5 6 7 8; do git checkout "$GITOPS_BRANCH" ./scripts/set-backend-rust-release.sh "$service" "$DIGEST" if git diff --quiet; then echo "GitOps repo already up to date for $service." + pushed=true break fi @@ -192,11 +194,17 @@ jobs: git commit -m "chore(gitops): update ${service} image for ${SHA}" if git push origin "HEAD:${GITOPS_BRANCH}"; then + pushed=true break fi - echo "Push rejected (attempt $attempt/5), pulling latest and retrying..." + echo "Push rejected (attempt $attempt/8), pulling latest and retrying..." git fetch origin "$GITOPS_BRANCH" git reset --hard "origin/${GITOPS_BRANCH}" sleep $((attempt * 2)) done + + if [ "$pushed" != true ]; then + echo "Failed to push gitops update for $service after all retries" >&2 + exit 1 + fi