Skip to content

Repair script: make stored labels match GitHub - #525

Merged
jarstelfox merged 1 commit into
masterfrom
claude/repair-clean
Oct 11, 2026
Merged

jarstelfox merged 1 commit into
masterfrom
claude/repair-clean

Conversation

@jarstelfox

Copy link
Copy Markdown
Member

🤖

After past label renames, Pulldasher still stored about 190 labels that their repos no longer have, and Jarred asked for the stored labels to match GitHub. The script used to fix only the 20 renames it was sure of. This version cleans up the rest:

  • Renamed labels: it checks every item carrying the old label on GitHub. An item that carries the new name gets its row renamed in place, which keeps who added it and when. An item that doesn't loses the old row.
  • Deleted labels: their rows go. GitHub takes a deleted label off every item.
  • Labels cut to 32 characters: a row whose full name still exists on GitHub (pull_labels.title holds 32) is kept.

The new name is now the one most of the sampled items carry, instead of one all of them must carry. One item missing a stored label used to empty the whole set. Each GitHub call waits 1.5s, because the board shares the token's hourly quota and I used it up earlier today with four prod restarts.

This version already ran on prod from a one-off container of the prod image, with a JSON backup of the four tables it touches saved first (~/pd-logs/backup-labels-1791698471.json on cominor).

🤖 Generated with Claude Code

Jarred wants the stored labels clean after past renames, not only the
20 renames the dry run proposed. --apply now:

- renames a stale label's row on each item that carries the new name on
  GitHub (checked item by item, so a wrong guess renames nothing), and
  drops it from items that don't
- drops every row of a label with no new name: GitHub takes a deleted
  label off every item
- keeps a row cut to pull_labels.title's 32 characters whose full label
  still exists (AppV2 "needs-further information collec")

The new name is now a vote across the sampled items instead of an
intersection, which one item with a missed labeled event emptied, and
two old labels may share one new name: per-item checks make that safe.
GitHub calls wait 1.5s each, since the board shares the token's quota.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jarstelfox
jarstelfox merged commit 0b9aed5 into master Oct 11, 2026
1 check passed
@jarstelfox
jarstelfox deleted the claude/repair-clean branch October 11, 2026 06:05
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