Skip to content

πŸ› blocked sweep: wait on every blocked-on marker, not just the first - #18840

Merged
hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:fix/blocked-all-markers
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:fix/blocked-all-markers

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

When one blocked-on comment (or the issue body) names two or more blockers, the blocked sweep read only the first marker. Once that blocker closed, it removed blocked and said "This issue is actionable again", even though another named blocker was still open.

With this change the sweep reads every marker, PR and issue forms alike, and lifts blocked only once all of them are settled. A single marker behaves exactly as before.

What happened

Seen on projectbluefin/testsuite#1023 (Eastern times):

Cause

  • blockedSweepComments (issue_blocked.go:1098-1124 at d058541) keeps the first marker of the newest marker-bearing comment. ParseBlockedOnMarker and parseBlockedOnIssueMarker each return one match.
  • A PR marker is tried first, so a comment holding a pr= and an issue= marker ignored the issue blocker.
  • The body path (blockedFilterReason) also names only the first marker.
  • reconcileBlockedOnIssue and the PR branch of reconcileBlockedTargets then settle that one target.

The PR side already does this right: blockedPRMarkedTargets (#17689) reads every marker and lifts only once all have settled.

What changed

Reading markers (issue_blocked.go)

  • parseBlockedOnRefs returns every distinct marker of both forms, in order.
  • The rule for which source counts is unchanged: the newest marker-bearing comment, else the body.
  • The comment scan and the body (SweepBlockedIssues, and the enumeration row via a new RepoWorkIssue.BlockedOn) record the full list only when it names more than one blocker.

Settling (reconcileBlockedOnAll)

  • With several blockers, each is read:
    • a PR is settled once merged or closed;
    • an issue is settled once closed.
  • A closed blocker replaced by one that is still open counts as that open one. That covers a superseding PR, and an issue's duplicate or successor (blockedIssueSuccessorOf, the same lookup and grace the single-issue path uses).
  • While any blocker is open, blocked stays, only help wanted is stripped, and no note is posted.
  • Once all are settled: one unblock and one note, e.g. "Unblocked: o/r#200 and o/r#201 are no longer open." The note respects project.issue_filter admission like the PR note.
  • A lookup error is counted and keeps the block for that pass.

Re-target

  • When one of several blockers is replaced, one comment carries the markers of every blocker still open, the untouched ones included. The newest-comment rule then still names all of them.
  • It goes through the write-back gate (gate_comment), like the issue successor re-target.
  • On a pass whose comment budget ran out, it reads the comments first, so it never posts twice.

Docs: the blocked row and section in labels-and-control-signals/reference.md, plus a changelog fragment.

Not in this PR

  • The work-row reason still names one blocker (the first marker, or the first still-open one once the sweep has read the comments), so IsBlockedIssueReason, ParseBlockedOnReason and the dashboard caption are unchanged.
  • Native GitHub "blocked by" dependencies and the stage/stalled dwell policy are out of scope.
  • A separate, existing gap: when the sweep reads an issue-form marker from a comment, it records the row's reason as blocked on owner/repo#N (the PR form, without issue ). If a later pass's comment budget skips that issue, the sweep looks the blocker up as a PR. This affects single markers too and is left for its own change.

Tests

  • TestParseBlockedOnRefs:
    • both forms, in order;
    • duplicates folded case-insensitively, and a malformed marker skipped;
    • one marker sets no BlockedOn;
    • the BlockedOn round trip, and the prose list.
  • TestReconcileBlockedIssuesWaitsOnEveryMarker, next to TestReconcileBlockedIssuesBlockedOnIssue:
    • the testsuite#1023 shape (first closed, second open): blocked stays, help wanted is stripped, no note;
    • both closed: one unblock, one note naming both;
    • a merged pr= marker beside an open issue= marker: both are read, and the block stays;
    • one of two blockers replaced by an open issue: one re-target comment carrying both open markers, and none again on the next pass;
    • markers in the body only (enumeration row): the block stays while the second is open.
  • blockedSuccessorFake now also serves /pulls/N for the PR-marker case.
  • Existing single-marker tests are unchanged.

Only gofmt -l was run locally (AGENTS.md bans local go test/go build/go vet); CI runs the tests.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

One comment (or the body) may name several blockers. The sweep read
only the first marker and lifted blocked when it settled, while another
named blocker was still open (projectbluefin/testsuite#1023). Every
marker of either form in the newest marker-bearing comment, else the
body, now counts: blocked comes off once all are settled, with one
note naming them; a re-target of one carries the others' markers
forward. A single marker keeps the existing path.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 17, 2026
The re-target note for several blockers is a notification-capable write
carrying the machine-read blocked-on markers, like
blockedSuccessorRetargetIssue; class it protocol_command in
notificationWriteSites and the notifications doc table so
TestNotificationWriteSitesInventory passes.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Danathar this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • check-failure

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 (8 waiting): fixes are handed out before new work as soon as you have capacity.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18848 πŸ› writeback: let the hive move a stage label it applied on a PR older than the backfill cutoff same files src/pkg/github/client.go
#18842 πŸ› base red: remember the base's red checks and read new heads from them same files src/pkg/github/client.go
#18667 πŸ› automerge: refuse an unsigned squash only where the repo requires DCO same files src/pkg/github/client.go

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#1884047b9d72` sha256:5524a0cb82fc8a369fc1b10dca99527c19489b10b17520980685e75c694fc861 β€” download from the dashboard or `hivectl review evidence #18840`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant