fix(review): resolve an ambiguous null prMergedAt with a live recheck before downgrading a label - #4980
Conversation
… before downgrading a label (#4818) A pull_request_review/_comment/_thread webhook's embedded PR snapshot can predate an imminent merge by a few ms; if that pass then gets delayed behind other queued work long enough for the real merge (and the linked issue's consequent auto-close) to land first, isLinkedIssueTrustworthy saw a closed issue with a null prMergedAt and silently treated it as a confirmed negative, downgrading a correctly-propagated gittensor:feature/priority label to gittensor:bug. Resolve that one ambiguous case with a fresh live check of the PR's own merge state instead of trusting whichever webhook happened to trigger the pass. Closes #4975
|
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 #4980 +/- ##
=======================================
Coverage 94.30% 94.30%
=======================================
Files 453 453
Lines 38993 39003 +10
Branches 14217 14221 +4
=======================================
+ Hits 36772 36782 +10
Misses 1572 1572
Partials 649 649
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-11 06:46:27 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 1 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
handlePullRequestWebhookEventtreats any PR-family webhook's embeddedpull_requestsnapshot as authoritative, includingpull_request_review/pull_request_review_comment/pull_request_review_thread. When an approval fires a few ms before an "approve and merge" action, that snapshot'smerged_atreadsnull— if the pass is then delayed behind other queued work long enough for the real merge (and the linked issue's auto-close) to land first,isLinkedIssueTrustworthysaw a closed issue with a nullprMergedAtand silently treated it as a confirmed negative, downgrading a correctly-propagatedgittensor:feature/gittensor:prioritylabel togittensor:bug.GET /pulls/{n}check of the PR's own actual merge state — only in that one narrow branch (closed issue + nullprMergedAt), so the common path pays zero extra API cost. Does not change the original anti-gaming behavior: a linked issue closed independently, before the PR in question ever merged, still correctly fails to propagate.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #4975).Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocallynpm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
test:coverage(full unsharded): not run end-to-end locally — ran scopedvitest --coveragefor the touched test file instead and confirmed via the generated lcov report that the new/changed lines insrc/review/linked-issue-label-propagation-fetch.tsand the newfetchLivePullRequestMergedAtinsrc/github/backfill.tsare 100% line and branch covered (56/56 lines, 59/59 branches on the propagation-fetch file). Also rannpm run test:changed(the full affected-import-graph suite): 7943 tests passed, 0 failed. CI's owntest:coverage/codecov/patchrun is authoritative for the final number.test:workers/build:mcp/test:mcp-pack/ui:openapi:check/ui:lint/ui:typecheck/ui:build: not run — this change touches onlysrc/github/backfill.ts,src/queue/processors.ts, andsrc/review/linked-issue-label-propagation-fetch.ts(backend webhook/label logic), with no UI, MCP, Worker-pool, or OpenAPI-surface changes, so these are not applicable.Safety
inconclusive: true, never a silent confirmed-negative.)UI Evidencesection below. (N/A — no UI changes.)Notes