fix: rename migration 041 streamlit_ro → 044 to resolve dual-revision collision [CRITICAL] #444
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api!444
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-041-streamlit-ro-rename"
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?
Summary
Second hot-fix in the migration-collision pair. PR #442 fixed the dual-040 collision but the basketball-api pod is STILL CrashLoopBackOff because there's a SECOND collision at revision 041:
041_add_contract_audit_log.py— applied in production (contract_audit_logtable exists)041_add_westside_streamlit_ro_role.py— never applied (westside_streamlit_rorole does NOT exist)The crashing pod (20 hours old, 240 restarts) shows
Revision 041 is present more than oncein its alembic startup logs. This collision predated PR #433/#442 — basketball-api has been silently degraded for 20 hours, masked by RollingUpdate keeping the old pod serving.This PR renames the never-applied streamlit_ro_role file to 044 (after my 043 jersey migration), placing it at the end of the chain. The contract_audit_log file (which IS in production) is untouched.
Changes
alembic/versions/041_add_westside_streamlit_ro_role.py→alembic/versions/044_add_westside_streamlit_ro_role.pyrevision = "041"→revision = "044"down_revision = "040"→down_revision = "043"Revision ID: 041→044,Revises: 040→Revises: 043New chain:
039 → 040 queens → 041 contract_audit → 042 alice_dedupe → 043 jersey_public_orders → 044 streamlit_ro_roleTest Plan
alembic headsreturns a single head → expect044alembic upgrade headfrom 042 (current prod state) → applies 043, then 044, cleanlyalembic downgrade -1reverses 044 → 043 cleanly (drops the postgres role)alembic upgrade headre-applies cleanlykubectl -n basketball-api exec postgres-... -- psql -tc "SELECT 1 FROM pg_roles WHERE rolname='westside_streamlit_ro';"returns 1kubectl -n basketball-api exec postgres-... -- psql -tc "\dt jersey_public_orders"shows the tableSynced / HealthyReview Checklist
041_add_contract_audit_log.pyNOT touched (it's already applied in prod)alembic headsreturns single head locallyRelated Notes
arch-jersey-intake— architecture docstory:WS-S31— parent user storyforgejo_admin/basketball-api#441— sister 040 collision bug (fixed by PR #442)Closes #443
PR #444 Review
DOMAIN REVIEW
Stack: Alembic migration (Python). Emergency hot-fix #2 in the dual-collision pair (companion to PR #442). Verified against the diff returned by
review_pr:alembic/versions/041_add_westside_streamlit_ro_role.py->alembic/versions/044_add_westside_streamlit_ro_role.py.changed_files: 1,additions: 4,deletions: 4,similarity index 98%. Confirmed.revision = "041"->revision = "044",down_revision = "040"->down_revision = "043". Confirmed.Revision ID: 041->044,Revises: 040->Revises: 043. Confirmed.op.*or function body hunks appear. The 98% similarity index corroborates this — rename + metadata only.041_add_contract_audit_log.pyuntouched: Not in the diff. The production-applied migration is preserved. Confirmed.changed_files: 1. Confirmed.changed_files: 1. Confirmed.westside_streamlit_ro) viaop+ environment-sourced password. It is a role/grant migration, not a table migration, so chaining it after043_jersey_public_ordersis safe regardless of grant scope (role creation does not require the jersey table to exist; any grants on specific tables would still resolve because 043 runs first).New chain:
039 -> 040 queens -> 041 contract_audit -> 042 alice_dedupe -> 043 jersey_public_orders -> 044 streamlit_ro_role. Single head at 044.This is the correct surgical fix for the "Revision 041 is present more than once" alembic startup failure that has kept the pod in CrashLoopBackOff for 20 hours (masked by RollingUpdate). Renames the never-applied sibling to the tail of the chain; leaves the production-applied
041_add_contract_audit_logexactly where prod'salembic_versiontable already points.BLOCKERS
None.
NITS
None raised — same emergency profile as PR #442. Cosmetic nits are deferred to a post-recovery cleanup ticket per the nits-to-epilogue convention.
SOP COMPLIANCE
fix-041-streamlit-ro-rename, references #443)story:WS-S31) and sister PR (#442)PROCESS OBSERVATIONS
VERDICT: APPROVED