fix: data fix for contradictory jersey state (#171) #197
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!197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "171-fix-contradictory-jersey-state"
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
jersey_option=opt_out+jersey_order_status=pendingin the players table, but a pending Reversible Jersey order (#14) in the orders tableChanges
scripts/fix_contradictory_jersey_state.py: Standalone data fix script with dry-run/commit modes. Resets player jersey fields to NULL/none, cancels pending orders, queries siblings under same parent for same contradictory statetests/test_fix_contradictory_jersey_state.py: 10 tests covering detection logic, single-player fix, sibling inclusion, clean-sibling skip, missing-player error, and direct order cancellationTest Plan
BASKETBALL_DATABASE_URL=<prod_url> python scripts/fix_contradictory_jersey_state.py--commitafter verifying dry-run outputReview Checklist
Related Notes
forgejo_admin/basketball-api#170-- parent bug (webhook sync gap)project-westside-basketball-- the project this work belongs toQA Review
Scope check: Script + tests only, no app code changes. Matches issue #171 acceptance criteria (player reset, order cancel, sibling check).
Script review (
scripts/fix_contradictory_jersey_state.py):backfill_stripe.pypattern: dry-run default,--commitflag, argparse CLIdb.commit()/db.rollback()withfinally: db.close()parent_idcheckedTest review (
tests/test_fix_contradictory_jersey_state.py):unittest.mock.patchon constants for auto-generated IDs -- correct approachRuff: format and check both pass.
Full suite: 605 passed, 1 pre-existing failure (unrelated).
No issues found.
VERDICT: APPROVE