Repository navigation
Conversation
Include the carrying PR in the issue-link memo key so row-specific closer exclusions cannot leak into sibling rows. Cover both row orders and cached rebuilds. Hive-Run: hivecommons#15495 Hive-Plan: correctness-link-memo Hive-Spec: issue-15495#exclude-sensitive-cache-key Signed-off-by: mendezr <mendezr@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
stage 080-awaiting-merge-admission β 050-review-pending: required-check-pending:Sign-off survives the squash |
|
@mendezr this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Your relay session received this as a |
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
There was a problem hiding this comment.
Read stageTrackerEnrichSoftLinks and IssueLinkState at v5. The fix is correct and the mechanism is real.
src/pkg/dashboard/stage_tracker.go:2974(v5) passespr.Numberas theexcludeargument toIssueLinkState, andsrc/pkg/github/advisory_work.go:105uses that exclusion to pick the merged closer (closedByPullRequestReference(..., exclude)). So the cachedclosedBygenuinely depends on which carrying PR asked. The v5 keyowner/name#issueatstage_tracker.go:2970lets the first PR's answer be served to a sibling PR referencing the same issue, which is wrong whenever the first PR is itself the closer. Adding@<pr.Number>to the key fixes that.- The updated budget expectations in
stage_tracker_test.go(closer reads 1β2, GETs 4β5/6/11) follow directly from the extra distinct key; I checked them against the fixture's two sibling PRs. The newstage_tracker_link_memo_test.goexercises both row orders, which is the case the old key got wrong.
One practical point: the cost is one more issues GET per (issue, sibling PR) pair per TTL, drawn from the per-rebuild stageTrackerLinkLookups budget. That is the correct trade for a right answer, just worth knowing.
Red check: changelog-fragment-guard fails because src/pkg/dashboard/stage_tracker.go is a non-test src/ change with no changelog.d/ fragment (AGENTS.md:16). Either add changelog.d/fixed-15495.md with a single - bullet, or β since the PR body says there is no current UI behaviour change β a maintainer could apply no-changelog. This is a fork branch, so I cannot push the fragment.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Read against v5 at 87f900d (after #15480 merged β the issue-only key is still on base, so #15495 is live and this is in scope). The change is correct, but I'd suggest a cheaper shape before it lands.
What the diff does. stage_tracker.go:2972: the memo key becomes owner/repo#issue@carryingPR. Because closedByPullRequestReference (pr_supersession_sweep.go:470) already skips !node.Merged, and tracker Items only list open PRs (stage_tracker.go:85), the exclude is a no-op today β so the new key changes no result on the current tracker. The PR body and changelog say this plainly, which I appreciate.
The cost (medium). Scoping the key per PR means an issue referenced by N open PRs now costs N IssueLinkState calls instead of one β one issues GET plus one GraphQL closer read each. Your own test shows it: GETs 4β5, 9β11 after TTL, closer reads 1β2 (stage_tracker_test.go:1117-1143). Those calls come out of stageTrackerLinkLookups = 10 per rebuild (stage_tracker.go:2894), and "several open PRs on one issue" is exactly the duplicate/follow-up situation the tracker is trying to label, so this is where the budget is already tightest. Rows past the 10th wait for later rebuilds.
Suggested alternative. Keep the key as owner/repo#issue, call IssueLinkState(ctx, owner, name, li.Number, 0) (exclude nothing) so the memo holds the issue's true merged closer, and filter at the consumer: at stage_tracker.go:~3000, set li.ClosedBy = in.closedBy only when in.closedBy != pr.Number. That gives per-row correctness for the future merged-rows case with one lookup per issue, and IssueLinkState already treats exclude as "skip this number", so 0 is a safe sentinel. The regression test in stage_tracker_link_memo_test.go would still pass with the same assertions on ClosedBy and the old lookup counts could stay at 4/9.
Not a defect as written; flagging because #15495 was filed as info/P3 and a fix that raises API spend in the hot case seems like the wrong trade for it. Happy to be overruled if the budget headroom is known to be ample.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
@mendezr this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Your relay session received this as a |
|
stage 080-awaiting-merge-admission β 072-returned-to-contributor: reviewer-verdict:changes_requested |
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
|
@mendezr this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Your relay session received this as a |
Dashboard shuffle 2/3 failed before tests ran: gotestsum installation could not download golang.org/x/text v0.17.0 because proxy.golang.org returned an HTTP/2 INTERNAL_ERROR. Retrigger CI without changing the tracker fix. Signed-off-by: mendezr <mendezr@users.noreply.github.com>
There was a problem hiding this comment.
Read stageTrackerEnrichSoftLinks and IssueLinkState/closedByPullRequestReference on v5: this looks correct to me. Passing 0 as currentPR means node.Number == currentPR never excludes a real PR (pr_supersession_sweep.go:470), the memo key stays owner/repo#issue, and the per-row in.closedBy != pr.Number restores the exclusion where it belongs. The test exercises both row orders and read counts.
One robustness note, not a defect: the fixture at src/pkg/dashboard/stage_tracker_link_memo_test.go:20 serves closer nodes with no url. #15509 (open, same base) adds a URL filter in closedByPullRequestReference; if it lands first in its current form this test will see ClosedBy == 0. Adding "url":"https://github.com/hivecommons/hive/pull/70" to the node keeps this green either way.
Minor behavioural difference worth knowing: previously an issue closed by two merged PRs, one of them the carrying row, would have shown the other closer; now the first merged node wins before the row-level exclusion, so that row shows none. Given merged PRs are not tracker rows today, that is academic.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the memo and the lookup it fronts; the change is correct for today's rows, with one small caveat worth knowing about.
src/pkg/dashboard/stage_tracker.go:2971keys the memo byowner/repo#issueonly, so before this change whichever sibling PR filled the entry first decided theclosedByevery other sibling saw. Caching the unfiltered answer (IssueLinkState(..., 0)at:2975) and excludingpr.Numberper row at:2989-2992is the right split, and the test covers both orders and the shared-read budget.- Caveat:
closedByPullRequestReference(src/pkg/github/pr_supersession_sweep.go:473-480) returns the first merged node, not all of them. With the exclusion now applied after the lookup, an issue closed by two merged PRs where the carrying PR happens to be listed first yieldsclosedBy == pr.Number, and the row shows no closer rather than the sibling. That is only reachable if merged PRs ever become tracker rows β which, as the body says, they are not today β so I would not hold the PR on it, but a future change that admits merged rows will need the lookup to return the full closer list rather than the first match.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 095-pre-merge-soak β 060-reviewed: check-pending |
There was a problem hiding this comment.
The memo change itself is right: caching the unfiltered closer under owner/repo#issue and excluding the carrying PR per row (stage_tracker.go:3026-3029) is the correct place for the exclusion, since the key never carried the PR number. Two things to fix/know before this lands:
1. The new test will fail once #15509 merges (and vice-versa). stage_tracker_link_memo_test.go:20 serves a closer node with no url:
{"number":70,"merged":true,"mergedAt":"..."}
#15509 (same base, further along in checks) adds sameRepoPullURL to closedByPullRequestReference (pkg/github/pr_supersession_sweep.go:475), which drops any node whose URL path is not /hivecommons/hive/pull/70. With that in place facts.ClosedBy is 0 for both rows and the assertion closer = 0, want 70 for PR #90 fails. One-line fix: add "url":"https://github.com/hivecommons/hive/pull/70" to the node, which is also what GitHub actually returns.
2. Semantic change in the lookup, low impact today. Passing exclude=0 means closedByPullRequestReference now returns the first merged closer rather than the first merged closer that isn't the carrying PR (pr_supersession_sweep.go:470-477 returns on the first match). If the carrying PR is ever a merged row and GitHub lists it first, a second genuine closer is no longer surfaced β the row gets ClosedBy=0. As the body says tracker rows are open-only today, so this is a note for the "if merged rows are included later" scenario this PR is defending, not a blocker; mentioning it because that is precisely the case the PR cites.
Fix (1) and this looks good to me.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 080-awaiting-merge-admission: no activity for 30m0s: merge-train:queued-behind#15425:2/5:0/0:dashboard-sections.md,stage_tracker.go,tracker-row.js,index.html |
|
@mendezr this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity. |
|
stage 080-awaiting-merge-admission β 072-returned-to-contributor: contributor-lane:changes-requested |
|
superseded by #15537 (with credit to the original author) Rationale: the contributor's PR is neither mergeable nor current, so the hive's supersedes it with credit. Closed by the hive as the owner's delegate (rule |
Summary
Fixes #15495
Validation
gofmt -lreports no formatting changes.