Skip to content

✨ feat(acmm): capability-based merge-queue credit and personal-account gap ticket - #10895

Merged
hivecommons-hive[bot] merged 2 commits into
v6from
scanner/fix-10891
Oct 6, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v6from
scanner/fix-10891

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #10891
Part of #10884

Summary

acmm:merge-queue now tests the capability on the default branch instead of a file name. The criterion ID stays the same.

  • Capability credit (R23): the check passes through SatisfiedBy, so it counts toward the level, when GitHub's merge queue is on (a merge_queue rule found by ReadBranchRules from ✨ github: lane-only branch-rules reader (ruleset required checks, up-to-date enforcement, native merge-queue detection) #10887): "satisfied by GitHub merge queue". It also passes when the repo's merge_strategy is hive-serialized (✨ config: per-repo merge_strategy (direct | hive-serialized) with validation, asymmetric permission and API #10886) and the branch has a known, non-empty required-check set: "satisfied by Hive serialized merge lane". The dashboard now shows satisfied_by as a chip on the row and in the row's detail.
  • File-only passes (R24): a pass that rests only on one of the four marker files keeps passing and keeps counting (new file_only flag), and the row is labelled "file only, not verified". Readiness can only go up. The operational acmm_level is untouched.
  • Owner action (R25): an owner sees Use serialized merge lane on a failing merge-queue row. It calls POST /api/repos/merge-strategy. If the lane is already on, the row says it still needs required checks. RepoEvaluation now carries merge_strategy for this.
  • Personal-account ticket (R26): if owner.type == "User", the gap ticket for this check explains that GitHub's merge queue is unavailable and that the serialized merge lane plus required checks satisfies the check. It never asks for a file and gets only the acmm label (no ai-fix-requested). This applies to both the single "Open Issue" and the "Open Issues for L6" batch, because the batch posts to the same endpoint. The response now includes labels, so the dashboard's "created with … labels" note is accurate.
  • Organization repos (R27): the ticket is unchanged. The owner lookup runs only for this criterion, and any repo whose owner type can't be read gets the organization ticket. A golden test pins the title, body and labels.
  • Descriptions (R28): the tooltip and the Level 6 description now read "a merge queue or equivalent serialized merging" and mention no file.
  • Docs: src/docs/acmm-waivers.md has a section on Hive-verified credit. Changelog fragment added.

The Hive lane is never called a "merge queue". Merge paths are not touched.

Acceptance criteria covered

AC27, AC28, AC29, AC30, AC31 (single and batch), AC32 (golden test), AC33. Tests are in src/pkg/dashboard/acmm_merge_queue_test.go. They cover the eval paths through a fake GitHub API, the ticket content and labels, and the dashboard row helpers (run with node). No time.Sleep.

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

…gap ticket

acmm:merge-queue now passes on the default branch when GitHub's merge
queue is on, or when the repo is hive-serialized with a known, non-empty
required-check set, credited through SatisfiedBy so it counts toward the
level. Marker-file-only passes keep passing, labelled "file only, not
verified". Failing rows offer an owner the serialized merge lane.
Personal-account repos get a truthful gap ticket without
ai-fix-requested; organization repos keep today's ticket (golden test).

Closes #10891
Part of #10884

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 6, 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 6, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Oct 6, 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.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Deferred to shared CI incident #10899: test (rest 5/5) and relative links and anchors resolve fail identically on the v6 default branch (head 009369a), so this PR's red checks are inherited, not PR-local. Baseline fix is #10900; this PR will be re-run once v6 is 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 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.

Looks correct to me; the two red checks are pre-existing on v6 HEAD.

Read acmm_merge_queue.go and the api_acmm_eval.go hunks against the v6 tree:

  • applyMergeQueueCredit runs before the waiver branch and only sets Passed=true on verified capability, so a repo that fails both the file check and the capability still falls through to its waiver exactly as before (api_acmm_eval.go, the if !res.Passed block is unchanged in meaning). A file-only pass stays Passed=true and only gains FileOnly, so no level regresses — matches the body's "no readiness regression" claim.
  • Aggregate precedence is Hive credit → file-only → waiver → detected, and aggFileOnly is only consulted when no repo earned capability credit, which is the right ordering for the fleet row.
  • s.deps.Config and ghClient are already dereferenced/guarded earlier in evaluateAllRepos (api_acmm_eval.go:501-520), and Config.RepoMergeStrategy is nil-receiver safe (src/pkg/config/repo_policy.go:291-299), so the new MergeStrategy: field and acmmMergeQueueCredit cannot nil-deref.
  • ReadBranchRules(ctx, client, owner, repo, branch, set, known) (src/pkg/github/branch_rules.go:52) and AutoMergeConfig.RequiredCheckSet() (src/pkg/config/review_config.go:426) match the call sites; MergeQueueKnown && MergeQueue is the correct guard given MergeQueueKnown=false when the rules endpoint is unreadable (branch_rules.go:40-43).
  • The dashboard action posts to POST /api/repos/merge-strategy, which is registered on v6 (src/pkg/dashboard/api.go:320) with the merge_strategy JSON field the UI sends. No native prompt/alert/confirm dialogs introduced.
  • In handleACMMCreateIssue, moving the ctx creation above acmmIssueContent is needed for the owner lookup and does not change the timeout semantics for the Linear/GitHub create paths.

Cost note (not a defect): the capability check adds a Repositories.Get plus the branch-rules reads per repo per evaluation, inside the existing acmmPerRepoTimeout. Fine for the current fleet sizes; worth knowing if evaluations ever get slow.

CI on cbdf8bb: test (rest 5/5) failed in runner setup (npm not on PATH, #10518) and relative links and anchors resolve reports api-reference citation drift in pkg/dashboard/api.go, which this PR does not touch; both are failure on current v6 HEAD too. A re-run / base fix, not a change here.

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

…citations

TestInvalidMergeStrategyFailsValidationAndStopsAutoMerge hit the
RequireAgents guard before reaching the merge_strategy check; give the
fixture one agent so Validate() reports the invalid strategy. Re-run
check-api-reference-citations.sh --fix for line drift in api.go.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 6, 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.

Looks correct to me at f6c3ff9; all checks are green now.

The delta since the last hive review (cbdf8bb) is two things, both verified against the v6 tree:

  • src/pkg/config/repo_merge_strategy_test.go:77 — adding one agent to the fixture is the right fix: Validate() returns "no agents configured" at src/pkg/config/validate.go:88 before it reaches ValidateRepoMergeStrategy at :95, so without it the test never exercised the assertion it names.
  • src/docs/api-reference.md — citation line refresh only, no prose change.

One low-severity open question for the author/maintainer, not a blocker:

acmmMergeQueueCapability (src/pkg/dashboard/acmm_merge_queue.go:31) grants "satisfied by Hive serialized merge lane" when rules.Known && len(rules.Required) > 0. ReadBranchRules seeds Required from the hive's auto_merge.required_checks config (src/pkg/github/branch_rules.go:58-62) and sets Known whenever the union is non-empty and both GitHub reads succeeded (:113-118). So a hive-serialized repo with no branch protection or rulesets still earns credit if the operator config lists any required check. The personal-account ticket (acmm_merge_queue.go:131-132) and src/docs/acmm-waivers.md tell the owner to put the check "in a branch ruleset or in branch protection", which is stricter than what is actually credited. This matches how the serialized lane itself gates merges, so it may be intended — if so, the ticket/doc wording could say "in Hive's auto_merge.required_checks, a ruleset, or branch protection"; if not, the lane branch should check for a GitHub-sourced check rather than the union. Either is a one-line follow-up.

I have not approved or changed anything.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 86d6254 into v6 Oct 6, 2026
64 of 67 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-10891 branch October 6, 2026 18:29
@github-actions

github-actions Bot commented Oct 6, 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

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

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants