Repository navigation
π Keep exactly one advisory report per hive, in the primary repo - #18570
Conversation
A candidate build opened a "[governor] π Hive Advisory Report" in every repo of project.repos. Commit 8f0a2f6 (#18534) added ensureSecondaryAdvisoryIssues and postAdvisoryDigestToSecondaryRepos, wired into runEvalCycle, which ensured (and so created) an advisory issue in every non-primary managed repo each eval cycle and posted the digest to each. Remove the per-repo ensure and digest post and ManagedRepos, so only project.primary_repo is ever ensured or posted to. The single report is still resolved by title and the hive/advisory label before any create, so a restart reuses the open report. Tests pin the primary-only rule for multi-repo and standalone configs, restart idempotency at the cycle seam and at the client (both title spellings, zero creates, zero edits), and an AST guard that fails if an advisory writer is wired a second time or called inside a loop. Fixes #18568 Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. βΉοΈ Sentinel: informational, author is trusted (owner), merge is not blocked. Head
No |
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at d0d9f8d. |
Summary
A hive keeps exactly one
π Hive Advisory Report, inproject.primary_repo. It never opens one in a non-primary repo.Root cause
Commit 8f0a2f6 (#18534, for #18448) added
ensureSecondaryAdvisoryIssuesandpostAdvisoryDigestToSecondaryRepos(src/cmd/hive/advisory_repo_issues.go) and wired both intorunEvalCycle. Every eval cycle, they ensured, and so created, an advisory issue in every repo inproject.reposother than the primary, and posted the digest to each. Two hives on the new candidate builds opened one in every monitored repo within minutes of rolling: the hivecommons hive opened 10, and a standalone multi-repo hive opened 1.The effective config is not the cause:
project.primary_repowas correctlyhive.advisory.PrimaryRepofalls back torepos[0]only when no primary is set, and never to all repos.Change
advisory_repo_issues.goand its test), their two call sites inmain_eval_cycle.go, andadvisory.ManagedRepos.main_eval_cycle.goandpkg/advisory/policy.goare now byte-identical to their pre-π Create a governor issue in every repo of a multi-repo hiveΒ #18534 versions, apart from one comment.EnsureAdvisoryIssuefinds the open report by title (either spelling) and thehive/advisorylabel before it creates anything, so a restart reuses it.src/docs/advisory.md) and achangelog.dfragment.This reverses the per-repo behavior #18448 asked for, at the operator's direction: a hive has a single advisory report in its primary repo.
Not included: self-cleanup of stray reports
This PR does not auto-close reports a hive already opened in non-primary repos. The App identity can be shared by several hives, so one hive's non-primary repo can be another hive's primary, and an automatic close could hit a legitimate report. The strays were closed by hand. This build never ensures a non-primary repo again, so it never reopens them.
Tests
pkg/advisory/policy_primary_only_test.go: multi-repo and standalone configs resolve to exactly one report repo.cmd/hive/advisory_primary_only_test.go: across several eval cycles only the primary is ensured, and each restart re-ensures only the primary and adopts the existing number. An AST guard fails ifEnsureAdvisoryIssue,PostAdvisoryDigestor the cycle's ensure dep is wired more than once, or if an advisory write is called inside a loop. As a positive control, the guard flags the π Create a governor issue in every repo of a multi-repo hiveΒ #18534 tree: wiring counts 2/2 instead of 1/1.pkg/github/advisory_restart_idempotent_test.go: three restarts against an existing open report (legacy and[governor]titles) give zero creates and zero edits. A cold start creates exactly one report and reuses it after a restart.Fixes #18568
π€ Generated with Claude Code