fix(review): trust a linked issue closed by this PR's own merge for label propagation - #4534
Merged
Merged
Conversation
…abel propagation (#4528) Merging a PR with "Closes #N" auto-closes issue #N as an immediate side effect of the merge, which defeated the propagation lookup's open-issue-only check seconds later and stripped the just-applied gittensor:feature/priority labels back down to a title-guessed gittensor:bug. Extends the trust condition to accept a closed issue when it was closed at or after this PR's own merge, while still rejecting an issue closed before the PR merged (the anti-gaming case the open-only check originally existed to block).
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4534 +/- ##
=======================================
Coverage 94.04% 94.04%
=======================================
Files 422 422
Lines 37574 37579 +5
Branches 13724 13729 +5
=======================================
+ Hits 35335 35340 +5
Misses 1583 1583
Partials 656 656
🚀 New features to boost your workflow:
|
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.
Summary
Closes #Nauto-closes issue #N as an immediate side effect of the merge.resolveIssueLabelsForPropagation(src/review/linked-issue-label-propagation-fetch.ts) only trusted an open linked issue, so the next time the type-label decision ran for that PR (a near-simultaneous webhook, or the periodic sweep), it found the issue closed, propagation returned no labels, and the code fell back to a blunt title-regex guess — actively removing the correctgittensor:feature/gittensor:prioritylabels it had just applied seconds earlier and replacing them withgittensor:bug.isLinkedIssueTrustworthy) to also accept a closed issue when it was closed at or after this PR's own merge — i.e. closed as a byproduct of this exact PR's "Closes #N" merge, GitHub's standard auto-close. An issue closed before this PR merged still doesn't count, preserving the original anti-gaming intent (a PR can't borrow a label from some unrelated, already-resolved issue).closedAtto the linked-issue facts fetch (src/github/backfill.ts) — same REST payload, no new API call — and threadsprMergedAtfrom the PR's ownmergedAtthrough the propagation fetch call site (src/queue/processors.ts).Closes #4528
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typechecktest/unit/backfill.test.ts,test/unit/linked-issue-label-propagation-fetch.test.ts,test/unit/linked-issue-hard-rules.test.ts,test/unit/queue.test.ts— 1175/1175 passing, including a full webhook-simulation regression test reproducing the exact PR feat(miner-manage-ui): fold run-state into the manage-status panel #4494 incident.npm audit --audit-level=moderate— 0 vulnerabilitiesclosed_atfallback) and a named regression test for the bug.npm run actionlint,npm run test:workers,npm run build:mcp,npm run test:mcp-pack,npm run ui:openapi:check,npm run ui:lint,npm run ui:typecheck,npm run ui:build— not run locally; this diff is scoped entirely tosrc/github/backfill.ts,src/review/linked-issue-label-propagation-fetch.ts, andsrc/queue/processors.ts(no UI/MCP/OpenAPI/wrangler/workers surface touched), so CI's fulltest:cigate covers these.npm run test:coverage(full unsharded) — kicked off locally but not confirmed complete before pushing; Codecov'scodecov/patchcheck on this PR is the authoritative signal.Safety
Notes
Root-caused via a live-audit-log investigation: 87 real label downgrades across gittensory + metagraphed in a 49-hour window, 79 still wrong on GitHub at time of filing, 39 with the
gittensor:priorityreward multiplier permanently lost. Backfill of the currently-mislabeled PRs is a separate follow-up, tracked outside this PR.