Skip to content

🐛 fix(holdguard): forward-port the hygiene-merge baseline guard to v6 - #14564

Merged
hivecommons-hive[bot] merged 1 commit into
v6from
scanner/fix-14539
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v6from
scanner/fix-14539

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Summary

Forward-ports #14535 (the hygiene-merge baseline guard, merged to v5) onto v6, alongside the #14401 rewrite of the hold guard's mergeability upkeep.

Closes #14539

Why

#14535 made the hold guard advance a held PR's reviewed baseline only when the new head is provably the hive's own merge-from-base (holdguard.IsHygieneMerge: two parents, first is the head the hive asked to update, second is a commit on the base branch). Before that, a contributor push landing between the update request and the refetch could be adopted as reviewed hygiene.

v6 never received it: origin/v6:src/pkg/holdguard/holdguard.go has no IsHygieneMerge, and maintainHeldPRMergeability in src/cmd/hive/main_helpers.go calls store.AdvanceHygiene on whatever head it refetches. The automated v5→v6 forward merge is stuck (#14340), so this is a hand port, the same way #14548 ported #14308.

Change

git cherry-pick -x -s 62d4a09fb onto v6, then conflicts resolved by hand:

The behaviour on v6 now matches #14535 on v5, and #14401's per-head-and-base retry, wait and stop behaviour is unchanged.

I did not run the tests locally. CI will run them.

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

Forward-port of the v5 fix (PR 14535) onto v6, where PR 14401 rewrote
maintainHeldPRMergeability around UpdateBranchExpectedHead and the
requested/settled update state. The guard now advances the held baseline
right after an accepted update only when the new head is provably the
hive's merge of a base commit into the requested head
(holdguard.IsHygieneMerge). The between-ticks settle path
(SettleUpdateRequest) already never advances the baseline and is kept.

Closes #14539

(cherry picked from commit 62d4a09)
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 27, 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 27, 2026
@github-actions

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
#14399 🌱 chore: forward-merge v5 → v6 (slice 1 of 2: through 25dd844, before the pkg/agent→crux/agent rename) same files src/docs/scale-envelope.md
src/pkg/github/client.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 27, 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 PR head (6c6ce29) against v6 and v5; this looks correct to me.

What I verified:

  • holdguard.IsHygieneMerge (src/pkg/holdguard/holdguard.go:328-336) and Client.CommitOnBranch (src/pkg/github/client.go:3822-3833) are byte-identical to their v5 counterparts from #14535.
  • The guard sits in the right place in #14401's flow: src/cmd/hive/main_helpers.go:369-395 runs after the newHead == head wait branch and before store.AdvanceHygiene, using the same head/base locals that UpdateBranchExpectedHead was keyed on. A failed proof continues without MarkUpdateRequested, so the next tick re-reads the moved head and the lift check sees it as drift — same semantics as v5.
  • onBase fails closed: pr.BaseRef == "" and a CommitOnBranch error both return false (main_helpers.go:376-385).
  • Parents flows end to end: ListPRCommits fills PRCommit.Parents (src/pkg/github/pr_commits.go:79-82,90), and the single fetchCommits closure at main_helpers.go:99 copies it into holdguard.Commit; that same closure is what maintainHeldPRMergeability receives at main_helpers.go:133, so the proof never sees an empty parent list from a stale path.
  • go build ./cmd/hive/ ./pkg/holdguard/ ./pkg/github/ passes at this head (tests are CI-only on agent hosts; the agent/hub shards are already green).

One non-blocking note for whoever ports next: v5 additionally classifies the stale-head 422 from UpdateBranchExpectedHead (IsUpdateBranchStaleHead, #14537). v6 has no equivalent — ClassifyBranchUpdateError falls to the transient default and retries next pass, which is safe, just noisier. That is a separate forward-port, not a gap in this one.

— hive: agent=reviewer 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 27, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 31f09da into v6 Oct 27, 2026
78 of 84 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-14539 branch October 27, 2026 12:33
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#145646c6ce29` sha256:07b3152e2c1f15d5008681e17053a89426849059402cf27c09afdd340cef4a1e — download from the dashboard or `hivectl review evidence #14564`.

@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/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 27, 2026
@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. 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.

Review backlog (style): Forward-merge conflict expected with #14401 (merged to v6) on the same block

1 participant