Skip to content

πŸ› [fix] setup: restore every card status after any board option rewrite - #27

Merged
EricTechPro merged 1 commit into
mainfrom
fix/board-migrate-restores-statuses
Oct 4, 2026
Merged

EricTechPro merged 1 commit into
mainfrom
fix/board-migrate-restores-statuses

Conversation

@EricTechPro

Copy link
Copy Markdown
Owner

Note

Draft Β· ready for review

Problem

board-migrate --prune-empty rewrites the Status options with updateProjectV2Field. That gives every option a new id and GitHub clears the Status of every card on the board. The restore step only ran for added columns or Skipped removal, never for --prune-empty, so nothing put the statuses back. On a live board (EricTechPro project #15) all 114 cards dropped to "No status".

Solution

  • Every option rewrite goes through one rewrite() helper that sets rewrote = True. The restore runs when rewrote and not dry, whichever path triggered the rewrite.
  • Before the first rewrite, the {item_id: status} snapshot is written to .claude/super-board/backup/board-<number>-<timestamp>.json. Its path comes back as status_backup, so a run that crashes partway can still be recovered by hand.
  • gh project item-list returns status under the lowercase key status (checked read-only against two live boards). If no card has that key, statuses are re-read over GraphQL with fieldValueByName(name:"Status"), so the snapshot cannot end up all-empty by accident.
  • Item reads now use --limit 5000 instead of 500, because a 541-card board would have lost 41 statuses.
  • Release 3.0.5.

Acceptance criteria

  • --prune-empty on a board whose cards have statuses restores every status the rewrite wiped.
    • tests/test-setup.sh scenario 10: the stub wipes all statuses like GitHub does, and three cards are restored. On the old code this fails with every card null.
  • The snapshot is on disk before the first rewrite and holds the statuses from before it.
    • Scenarios 8 and 10 read the backup file back.
  • The GraphQL fallback produces a snapshot that can be restored.
    • Scenario 11: a gh that returns no status key, and two cards restored.
  • --dry-run writes nothing.
    • Scenario 12: board state is byte-identical, there are no item-edit, label create or issue edit calls, there is only the one options read, and no backup file.
  • Offline safety suite passes.
    • All suites pass. test-file-bug.sh passes when the host session's SUPER_QA_* / BUILD_LOOP_* env vars are unset. It fails the same way on main when they are set, so that failure is not from this change.

Iteration history

Lane Done Time Details
Builder Yes Oct 3 Bug reproduced red against the old code in the gh stub, then fixed. No real board was written to.

Risk

🟑 Medium · This touches live board writes. The change adds a restore pass and a local backup file and removes no behaviour. Restoring may make extra item-edit calls on large boards, which is the cost of not losing data. The GraphQL fallback only runs when gh surfaces no status at all.

πŸ€– Generated with Claude Code

- board-migrate --prune-empty rewrote the Status options without restoring, so every card on a live board fell to "No status".
- Restore now runs after any updateProjectV2Field rewrite, tracked with one flag.
- Snapshot of every card's status is written to .claude/super-board/backup/board-<n>-<ts>.json before the first rewrite; path returned as status_backup.
- Statuses fall back to GraphQL fieldValueByName("Status") when item-list surfaces no status key; item reads go past 500 cards.
- Offline scenarios cover prune-empty on a board in use, the GraphQL fallback and a dry run with no writes; release 3.0.5.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@EricTechPro
EricTechPro marked this pull request as ready for review October 4, 2026 05:13
@EricTechPro
EricTechPro merged commit d5ef1c8 into main Oct 4, 2026
8 checks passed
@EricTechPro
EricTechPro deleted the fix/board-migrate-restores-statuses branch October 4, 2026 05:13
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more β†’

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account β†’

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us β†’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant