Repository navigation
π [fix] setup: restore every card status after any board option rewrite - #27
Merged
Merged
Conversation
- 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>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more β On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Draft Β· ready for review
Problem
board-migrate --prune-emptyrewrites the Status options withupdateProjectV2Field. 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
rewrite()helper that setsrewrote = True. The restore runs whenrewrote and not dry, whichever path triggered the rewrite.{item_id: status}snapshot is written to.claude/super-board/backup/board-<number>-<timestamp>.json. Its path comes back asstatus_backup, so a run that crashes partway can still be recovered by hand.gh project item-listreturns status under the lowercase keystatus(checked read-only against two live boards). If no card has that key, statuses are re-read over GraphQL withfieldValueByName(name:"Status"), so the snapshot cannot end up all-empty by accident.--limit 5000instead of 500, because a 541-card board would have lost 41 statuses.Acceptance criteria
--prune-emptyon a board whose cards have statuses restores every status the rewrite wiped.tests/test-setup.shscenario 10: the stub wipes all statuses like GitHub does, and three cards are restored. On the old code this fails with every cardnull.statuskey, and two cards restored.--dry-runwrites nothing.test-file-bug.shpasses when the host session'sSUPER_QA_*/BUILD_LOOP_*env vars are unset. It fails the same way onmainwhen they are set, so that failure is not from this change.Iteration history
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