Repository navigation
π Create a governor issue in every repo of a multi-repo hive - #18534
Conversation
The pinned advisory (governor) issue was only ever ensured for the primary repo: the boot ensure, the per-cycle re-ensure and the digest post all keyed on advisory.PrimaryRepo, so every other repo in project.repos never got one. Ensure every non-primary managed repo each eval cycle until it resolves (repos added in Settings included), store the number per repo, post the same digest to each, and surface repos the hive cannot write to as per-repo dashboard warnings with an hourly retry. Fixes #18448 Signed-off-by: Andy Anderson <andy@clubanderson.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 |
|
@nate-double-u FYI, this is the fix for #18448 (governor issue missing in multi-repo hives). |
Open PR overlap checkβ
Resolved: no conflicting open PRs or same-file overlaps remain against |
Mutation testing5 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the
Verdict: |
There was a problem hiding this comment.
Read the diff (new advisory_repo_issues.go, the two main_eval_cycle.go call sites, advisory.ManagedRepos). The mechanism looks correct to me: ManagedRepos dedupes bare/org-qualified spellings and keeps primary first, advisorySecondaryRepos drops index 0, the ensure loop skips resolved repos and backs off refused ones, and the tests cover restart reuse and the no-write-access alert path.
One open question I could not settle from the diff (not a defect I can cite): postAdvisoryDigestToSecondaryRepos (advisory_repo_issues.go, called at main_eval_cycle.go ~L1621) posts the same rendered digest β all agents' open advisory beads β to every repo in project.repos. If a hive mixes a private repo with a public one, bead text derived from the private repo would be written into a public issue. If the digest is already scoped per repo, or the repos are required to share visibility, this is moot; otherwise a maintainer may want to decide whether the secondary post should be limited to same-visibility repos.
Looks otherwise correct; I did not run anything.
β hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.325
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>
) 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>
Fixes #18448
Root cause
The pinned advisory (governor) issue was only ever ensured for one repo. The boot ensure, the eval-cycle re-ensure (
ensurePinnedAdvisoryIssue), the App reinit / primary-change paths and the digest post all key onadvisory.PrimaryRepo(cfg)(the configured primary, orproject.repos[0]). No code path ever iterated the rest ofproject.repos, so in a two-repo hive the second repo never got an issue.Fix
advisory.ManagedRepos(cfg): primary first, then everyproject.reposentry, deduplicated (bare vs org-qualified, case-insensitive).ensureSecondaryAdvisoryIssues(new,cmd/hive/advisory_repo_issues.go) runs every eval cycle next to the primary ensure: each non-primary repo without a resolved issue is ensured viaEnsureAdvisoryIssue, which reuses an existing issue by title/label (or reopens a closed one) before creating, so restarts never duplicate. Numbers are stored per repo inadvisoryIssues. Repos added in Settings are picked up on the next cycle with no restart.advisory-repo-issue:<repo>system alert), and backed off for an hour; other repos are unaffected. Transient errors retry next cycle with no alert. Paused repos are skipped quietly. Alerts clear once the repo resolves or leavesproject.repos.Tests
cmd/hive/advisory_repo_issues_test.go: multi-repo creation, idempotency across cycles and restart, repo added later, no-write-access (alert, backoff, recovery clears alert), transient retry, Issues-disabled and paused, stale alert cleanup, secondary digest posting.pkg/github/advisory_multi_repo_test.go: stateful fake GitHub; two repos each get one issue, and a fresh client reuses both.pkg/advisory/policy_managed_repos_test.go:ManagedReposordering and dedupe.π€ Generated with Claude Code