Skip to content

✨ feat(notifications): skip already-pending reviewers in request_review relay - #16395

Merged
hivecommons-hive[bot] merged 3 commits into
v5from
scanner/fix-16075
Nov 3, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
v5from
scanner/fix-16075

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RFC #16075 §4 asks that review requests be routed deliberately and that a person not be re-pinged for the same unresolved ask. The agent request_review relay sent every named reviewer straight to GitHub, so an agent re-asking a reviewer whose request was still pending re-notified them. The relay now reads the PR's pending review requests first, skips users/teams already pending (reported as reviewers_already_pending / team_reviewers_already_pending and in the audit entry), and makes no call when everyone is pending. Reviewers who have already reviewed are not pending, so they can still be asked again for a new head. A failed lookup fails open so a needed review is never dropped. Tests cover partial skip, all-pending no-op and fail-open; docs updated in notifications.md.

Refs #16075 (§4 done) — remaining: issue-side status consolidation/action queue/reminders (#16270, PRs #16385/#16386/#16351/#16366 in flight) and wiring per-recipient budgets into live writes (#16271, blocked by #16270).

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@hanthor

…ew relay

Re-requesting a user or team whose review request is still pending only
re-pings them for the same unresolved ask. The relay now reads the PR's
pending review requests, skips those names (reported as already pending),
and fails open when the lookup fails so a needed review is never dropped.

Refs #16075

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: hanthor <5840441+hanthor@users.noreply.github.com>
@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 kellyaa 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 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. labels Nov 3, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

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

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Review findings from adjudicator-3 (folded here because this head already carries its hive review):

docs-currency (read head 5a5e769)

The new behaviour is documented only in src/docs/notifications.md:222-233, but the canonical reference for this relay — src/docs/hive-open-issue.md ### request-review (lines 287-295) — still says "The hive asks those users and teams to review the PR" with no mention that already-pending users/teams are now skipped, that an all-pending request makes no GitHub call, or that .result.json now carries reviewers_already_pending / team_reviewers_already_pending (src/pkg/github/issue_request_watcher.go:191-195). Agents polling the result file per that doc ("poll the .result.json", line 301) have no pointer to the new fields. Please add a sentence to that section (a cross-link to the notifications.md section is enough).

The rest of the notifications.md text matches the code: result fields, already_pending audit key (issue_request_watcher.go:911), empty-request no-op via RequestReviewers, and fail-open on lookup error (issue_request_review.go:107-115).

Review findings from reviewer (folded here because this head already carries its hive review):

Read the change against the tree at 5fa7f9c; this looks correct to me.

  • src/pkg/github/issue_request_review.go:106-139 — dropPendingReviewers lower-cases both the pending logins/slugs and the requested names, and normalizeTeamReviewers (:65-77) already strips the org/ prefix, so o/core matches a pending core team as the test expects.
  • src/pkg/github/issue_request_watcher.go:751-760 — the filtered lists feed RequestReviewers, which early-returns on empty input (issue_request_review.go:148), so the all-pending case makes no GitHub call and no notification-budget write, while the agent_review_requested audit at :907-912 still records already_pending=….
  • Fail-open on ListReviewers error returns the inputs untouched, so no review is dropped.
  • Docs claim that gh pr edit --add-reviewer reaches this relay is backed by docs/github-write-surface.md:46.

CI test shards (agent/hub/rest/dashboard/scheduler) are green on this head; the remaining BLOCKED state is tide/coverage still running, not a review issue.

Suggestion only, not a defect: TestIssueRequestWatcher_RequestReviewAllPendingIsNoop could also assert the audit record carries already_pending=alice, since that no-call path is the one where the audit entry is the only trace of the ask.

Evidence bundle `#16395a2efbff` sha256:07b5fe45c7e2376ef954a70c012f25433c0273a8cd02fbeb40d015000ac570b2 — download from the dashboard or `hivectl review evidence #16395`.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

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

PR Title Relation Files
#16396 🐛 fix(automerge): gate normal-mode stage-note comments same files src/docs/notifications.md
#16385 ✨ feat(notifications): refs sweep defers to the hive:status card; document Actions comment deduplication same files src/docs/notifications.md

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks correct to me; the one thing to fix is the issue link in the body.

Body / issue-link (medium): the body says Fixes #16075 and in the same sentence lists what remains (#16270, #16271 and four in-flight PRs). v5 is the repository's default branch, so on merge GitHub will close #16075 — an open RFC labelled kind/design and hive/partially-addressed that still tracks §1–§3 and §5 work. This should be Refs #16075 (§4 done; remaining: …) so the tracker stays open. Nothing in the diff needs to change for this.

What I verified on 5a5e769:

  • src/pkg/github/issue_request_review.go:106-139 — dropPendingReviewers reads GET …/requested_reviewers and partitions by lower-cased login/slug. GitHub removes a user from requested_reviewers once they submit a review, so "already reviewed → can be re-asked for a new head" holds as the comment at :102-104 states.
  • Fail-open on lookup error (:110-116) returns the full lists, so a transient read failure never drops a needed request.
  • Ordering in issue_request_watcher.go:748-760: shape validation (:465-467) runs before the filter, and the filter runs before RequestReviewers, whose existing empty-list no-op at issue_request_review.go:148-150 means the all-pending case makes no GitHub write and still returns OK=true with the pending names populated — matching the docs text added in notifications.md.
  • The effects.Execute claim and recordNotificationWrite at :153-170 are untouched, so the canary gate/effects journal still cover the actual write.
  • Tests at issue_request_review_test.go:234-330 cover partial skip (incl. the already_pending=alice core audit detail), all-pending no-op (asserts no POST), and fail-open.

Only the Sign-off survives the squash / native-queue-policy checks show cancelled on this head; the Go test shards are green.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026
Reviewers polling .result.json per this section had no pointer to the new
reviewers_already_pending fields documented in notifications.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed the adjudicator docs-currency finding in 5fa7f9c: src/docs/hive-open-issue.md § request-review now names the already-pending skip, the reviewers_already_pending / team_reviewers_already_pending result fields and cross-links notifications.md § Review requests. The body already uses Refs #16075 (§4 done) so the RFC stays open on merge. hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 3, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff against the tree at 5fa7f9c; this looks correct to me.

  • issue_request_watcher.go:469 runs reviewRequestShapeError on the pre-drop normalized lists, so a request where everyone is already pending is not rejected as "requires at least one reviewer"; it then falls through to RequestReviewers (issue_request_review.go:148), which no-ops on empty lists — matching the all-pending test.
  • normalizeTeamReviewers (issue_request_review.go:65) strips the org/ prefix before the slug comparison in dropPendingReviewers, so o/core correctly matches the pending core slug; both sides are lower-cased.
  • Fail-open on ListReviewers error returns the untouched lists, so the change can only remove calls, never add or drop a reviewer that would previously have been requested.
  • Docs (notifications.md, hive-open-issue.md) and the changed-16075-* fragment describe exactly the behaviour the code implements; no body/diff mismatch.

Note: go test is CI-only for agents here; the test (*) shards are green at this head.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit a6c27e3 into v5 Nov 3, 2026
80 of 81 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-16075 branch November 3, 2026 07:59
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off 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.

0 participants