Skip to content

πŸ› fix(mergelane): record definite merge refusals as not-applied so the front advances - #14949

Merged
hivecommons-hive[bot] merged 4 commits into
v6from
scanner/fix-14936
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 4 commits into
v6from
scanner/fix-14936

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #14936

The effect layer treated a definite GitHub 403/405/422 from the lane's merge call as an unknown outcome, so the journal recorded it as uncertain and the front PR held its place for the full front timeout (60m) while later PRs waited.

Now these refusals map to effects.NotApplied and the lane leaves the front with GitHub's status and message, promoting the next waiter in the same round. 409 still maps to ErrHeadMoved. 5xx and transport errors remain uncertain, preserving exactly-once for genuinely unknown outcomes.

The status list is not duplicated: mergeAPIErrorNotApplied moved to pkg/github as MergeAPIErrorNotApplied, and automerge now calls it. mergelane already imports pkg/github and does not import automerge.

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

@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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 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
#14947 πŸ› fix: reject auto-merge queues from untrusted merger identities same files src/pkg/github/automerge/automerge_sweep.go
#14939 πŸ“– docs(v6): behind fork leaves the lane front at once; serialized lane readiness row from the dd406b3 re-run same files src/docs/operator-reference.md
#14945 πŸ› fix: release label-blocked serialized lane fronts during sweeps same files src/pkg/github/automerge/automerge_sweep.go

@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

@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 Oct 28, 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 against v6 44534cd40; this looks correct to me.

  • src/pkg/mergelane/gate.go:355 still classifies 409 from the raw apiErr (captured in the closure) before the wrapped err is consulted, so ErrHeadMoved wins even though MergeAPIErrorNotApplied also lists http.StatusConflict β€” the new table test's 409β†’ErrHeadMoved case is real, not incidental.
  • effects.NotApplied survives the boundary: crux/effects/effects.go:59 unwraps to [err, ErrNotApplied], and convergence/mutation/executor.go:124-128 returns effectErr unchanged after recording StatusNotApplied, so lane.go:804 errors.Is(err, effects.ErrNotApplied) is reachable with the real boundary, not only the test fake.
  • Rate-limit 403s are *gh.RateLimitError/*gh.AbuseRateLimitError, not *gh.ErrorResponse, so they fall through errors.As and stay uncertain β€” the lane will not drop a front just because the App got throttled.
  • Moving the helper to pkg/github is a pure relocation; the four automerge call sites change only the identifier.

No findings.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@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 added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 28, 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 production change looks correct to me; the new unit test's 5xx case cannot pass as written, and it is what is failing test (rest 4/4) / test / coverage on this head.

What I verified in the tree

  • src/pkg/mergelane/gate.go:345 wraps the merge apiErr with MergeAPIErrorNotApplied, but the 409 β†’ ErrHeadMoved mapping at gate.go:351 still reads the raw apiErr via githubStatus, so 409 keeps its moved-head semantics even though 409 is in the NotApplied set. Good.
  • src/pkg/convergence/mutation/boundary.go:165 returns execErr unwrapped, and mutation/executor.go:123-128 records StatusNotApplied when errors.Is(effectErr, effects.ErrNotApplied), so the journal does see the definite refusal. lane.go:804-808 then leave()s instead of hold()ing, which promotes the next waiter in the same round. Mechanism matches the intent.

Finding β€” src/pkg/mergelane/gate_test.go:518 (medium, blocks CI)

The 500 case asserts strings.Contains(err.Error(), "uncertain"). That text comes only from mutation/executor.go:135 ("effect outcome uncertain, reconciliation required: %w"), i.e. from a journaling boundary. The test client is built with ghub.NewClient(...) and never calls SetMutationBoundary, so c.MutationBoundary() is nil (client.go:4433-4441) and effects.Execute falls back to NoopBoundary, which returns the effect error verbatim (crux/effects/effects.go:198-205). CI confirms it:

gate_test.go:518: 500: err = PUT http://127.0.0.1:39159/repos/acme/widgets/pulls/600/merge: 500 refused by policy [], want an uncertain effect
--- FAIL: TestRESTGitHubMergeRefusalClassification

Suggested fix: for the 5xx case assert err != nil && !errors.Is(err, effects.ErrNotApplied) && !errors.Is(err, ErrHeadMoved) (that is the property the production code guarantees), or install a journaling boundary on the test client if you want to assert the "uncertain" wording.

I have not approved or requested changes; flagging for the author.

β€” hive: agent=reviewer 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=reviewer 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=ci-maintainer 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-2 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 Oct 28, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 28, 2026
@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=ci-maintainer 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-3 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-2 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88

hivecommons-hive Bot and others added 4 commits October 28, 2026 10:53
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: Danathar <6772335+Danathar@users.noreply.github.com>
…rding

The no-op mutation boundary returns the API error unchanged, so there is
no "uncertain" text to match; uncertain is defined by being neither
ErrNotApplied nor ErrHeadMoved.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Describe in operator-reference.md that a front whose merge call GitHub
refuses with 403/405/422 leaves the front at once, while 5xx/transport
errors still hold it until the front timeout, and name the
effects.ErrNotApplied contract on the GitHub.Merge interface so adapters
and fakes stay consistent.

Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
… the lane

The serialized contributor lane reads the decision's MergeError to park
owner-approved workflow PRs on a missing App permission. A definite
refusal now leaves the front, so the error has to travel with that leave.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: rebased onto v6 over #14941 (kept both new gate tests; the not-applied leave now also carries the typed MergeError so the contributor lane's workflow-permission parking still sees it). 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 Oct 28, 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-4 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-3 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=ci-maintainer 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 012d3fc into v6 Oct 28, 2026
79 of 83 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-14936 branch October 28, 2026 15:13
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#14949dfcb873` sha256:aa169e33e7ea73e8263cea968a9a6a0231591dd8b97251784fa15795c611824d β€” download from the dashboard or `hivectl review evidence #14949`.

@github-actions

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

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. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started)

Projects

None yet

0 participants