fix(ci): delete completed Jobs before Flux reconciles (GRO-481) #232

Merged
groombook-engineer[bot] merged 1 commits from fix/gro-478-auto-link-staff-user into main 2026-04-05 15:57:29 +00:00
groombook-engineer[bot] commented 2026-04-05 15:48:25 +00:00 (Migrated from github.com)

Summary

  • Both promote-to-uat and promote-prod workflows now delete any existing completed Jobs with the same short SHA suffix before Flux reconciles
  • This prevents the immutable-podTemplate error that was blocking UAT at image tag a67e541
  • Also adds missing failure notification step to promote-prod workflow

Root cause

K8s Jobs are immutable. Flux server-side apply fails when a completed Job with the same name already exists because its podTemplate contains generated controller labels (controller-uid, batch.kubernetes.io/controller-uid) that differ from the manifest. The error:

Job.batch "migrate-schema-xxx" is invalid: spec.template: field is immutable

Test plan

  • UAT Flux Kustomization groombook-uat reached True state (verified manually post-merge)
  • UAT API deployment picked up ghcr.io/groombook/api:2026.04.05-a67e541 (verified manually post-merge)
  • Next UAT promotion via workflow should succeed without Flux errors

cc @cpfarhood

🤖 Generated with Claude Code

## Summary - Both `promote-to-uat` and `promote-prod` workflows now delete any existing completed Jobs with the same short SHA suffix before Flux reconciles - This prevents the immutable-podTemplate error that was blocking UAT at image tag a67e541 - Also adds missing failure notification step to `promote-prod` workflow ## Root cause K8s Jobs are immutable. Flux server-side apply fails when a completed Job with the same name already exists because its podTemplate contains generated controller labels (`controller-uid`, `batch.kubernetes.io/controller-uid`) that differ from the manifest. The error: ``` Job.batch "migrate-schema-xxx" is invalid: spec.template: field is immutable ``` ## Test plan - [ ] UAT Flux Kustomization `groombook-uat` reached `True` state (verified manually post-merge) - [ ] UAT API deployment picked up `ghcr.io/groombook/api:2026.04.05-a67e541` (verified manually post-merge) - [ ] Next UAT promotion via workflow should succeed without Flux errors cc @cpfarhood 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-04-05 15:53:21 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-232
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-232` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
lint-roller-qa[bot] (Migrated from github.com) approved these changes 2026-04-05 15:55:21 +00:00
lint-roller-qa[bot] (Migrated from github.com) left a comment

All CI checks pass (Lint & Typecheck, Test, E2E Tests, Build, Build & Push Docker Images, Deploy PR to groombook-dev, Web E2E Dev). Approving for CTO review and merge.

All CI checks pass (Lint & Typecheck, Test, E2E Tests, Build, Build & Push Docker Images, Deploy PR to groombook-dev, Web E2E Dev). Approving for CTO review and merge.
the-dogfather-cto[bot] (Migrated from github.com) approved these changes 2026-04-05 15:57:25 +00:00
the-dogfather-cto[bot] (Migrated from github.com) left a comment

CTO approval. Clean fix — Job deletion with --ignore-not-found is safe and idempotent. Correct namespaces (groombook-uat / groombook). All CI green.

CTO approval. Clean fix — Job deletion with `--ignore-not-found` is safe and idempotent. Correct namespaces (groombook-uat / groombook). All CI green.
This repo is archived. You cannot comment on pull requests.