Repository navigation
Follow label renames from GitHub's label webhook - #522
Merged
Merged
Conversation
A label renamed on GitHub sends no labeled/unlabeled event for the PRs and issues carrying it, so Pulldasher kept every merged PR (and open ones until their next event) under the old name. ops P-strapi-shared-fields became P-strapi-cli and its five PRs still listed under the old slug. The `label` event's `edited` action with `changes.name` now renames the stored label on every row in that repo, in place, so who added it and when stay (a refresh would lose both: the events keep the old name). Open PRs are sent to boards again. A project label's rename moves the issues added by hand or by a link, the roadmap item and the ongoing mark once no repo still has a PR or issue under the old label, since each repo's rename arrives on its own. bin/repair-renamed-labels lists stored labels their repo no longer has, finds each one's new name from the carrying items on GitHub, and with --apply renames them the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UPDATE IGNORE turns MySQL's "data too long" into a warning and cuts the new name to pull_labels.title's 32 characters, so a long rename would store a name GitHub doesn't have. Delete the rows already under the new name first, then a plain UPDATE, which fails like an insert does. The repair script read every item carrying a stale label off GitHub. An old label on thousands of merged PRs would spend the board's hourly quota (the script runs with the board's token), so it reads the newest 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task
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.
🤖
When someone renames a project label on GitHub, Pulldasher keeps showing that project's PRs under the old name. GitHub tells us about a rename once, through the repo's
labelevent, and Pulldasher never listened for it. Today opsP-strapi-shared-fieldsisP-strapi-clion GitHub, but/api/v1/projectsstill lists ops#1254, #1255, #1251, #1204 and #1198 understrapi-shared-fields, and Decide flags it as new.Changes
labelevent withaction: editedandchanges.namenow renames the stored label on every PR and issue in that repo.renameProjectalso moves the hand-added issues (project_issues), the roadmap item and the ongoing mark to the new slug.bin/repair-renamed-labelslists stored labels their repo no longer has, with each one's new name taken from up to 5 of the affected items on GitHub (an old label on thousands of PRs would otherwise spend the board's GitHub quota).--applyrenames them the same way. A label with no single new name is listed and skipped.Important
Turn on the Labels event in the Pulldasher webhook, or this code never runs. The webhook is set at the org level, and my token can't read org hooks (
admin:org_hook), so I couldn't check whether it's ticked.config.example.jsdoesn't list it either.Stale project labels on prod today (7)
Found by reading
/api/v1/projectsover the last 400 days and checking eachP-label against its repo's labels on GitHub. The new names come from one item each. Only project labels are listed; the script's dry run also covers the others.P-strapi-shared-fieldsP-strapi-cliP-security-auditP-security-remediationP-workbench-tabP-workbench(already a project in ifixit)P-webview-status-bar-insetP-app-safe-area-insetsP-dev-monitoringP-dev-ci-contentionP-architecture-summaryP-pr-architectureP-content-smallOnce this is deployed, the managing-projects skill's
plan.mjs(#65343) can rename labels in place again instead of moving each PR to a new label. ItsrenameIncomment explains the workaround.Not handled: a label deleted on GitHub also leaves rows behind. That's the
deletedaction on the same event, and it can be a follow-up.QA
npm test. The six tests intest/hooks-label-rename.test.jspass.bin/repair-renamed-labelswith no flag. It lists each stale label with its new name and changes nothing.P-label. Reload: its PRs show under the new name.This isn't deployed anywhere; prod waits for Jarred's go-ahead.
🤖 Generated with Claude Code