Skip to content

πŸ”’ fix(contributor-lane): stop /hive approve promising a merge for a workflow head that removes tests - #15048

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/approve-reply-tests-removed
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/approve-reply-tests-removed

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #15027 (merged). The hive's review of #15027 raised one low finding, filed as backlog issue #15034:

The /hive approve reply (pkg/github/automerge/pr_approve_command.go) chooses its "a trusted merger's Approve review lets the lane merge" caption from the workflow-path fence alone. Since #15027, the contributor lane checks removed tests before the owner-approval release. A head that edits workflow files and also removes tests stops at contributor-lane:tests-removed, which no approval overrides. The reply therefore told the owner to approve a head the lane will not merge.

The fix was pushed to #15027's branch about ten seconds after the hive merged it, so it never reached v6. It lands here, with its own changelog fragment.

Change

  • pr_approve_command.go: a workflow-path head whose diff also removes tests gets the manual-merge reply, not the approval caption. This is one added condition.
  • Tests: two cases in pr_approve_command_test.go. A workflow-only head keeps the approval caption; a workflow head that also removes tests gets the manual-merge reply.
  • Changelog: changelog.d/fixed-approve-reply-tests-removed.md.

Testing

From src/, TZ=UTC, -count=1:

  • go test ./pkg/github/automerge/ passes.
  • gofmt and go vet are clean.
  • check-changelog-fragment.sh v6 passes.

Mutation check: with the new condition removed, the new case fails.

Contributor checklist

  • Changelog: changelog.d/fixed-approve-reply-tests-removed.md.
  • Targets v6.
  • The title uses the emoji convention.
  • Commits include DCO sign-off.
  • Docs: none (the reply text is the user-facing surface).
  • No secrets, credentials or local runtime state are committed.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…orkflow head that removes tests

The /hive approve reply keyed its "a trusted merger's Approve review
lets the lane merge" caption on the workflow-path fence alone. Since
hivecommons#15027 the lane checks removed tests before the owner-approval release,
so a head that edits workflows and removes tests stops at
tests-removed, and that caption sent the owner to approve a head the
lane will not merge. Such a head now gets the manual-merge reply.

Raised by the hive review of hivecommons#15027 (backlog hivecommons#15034); the fix was pushed
to hivecommons#15027's branch seconds after it merged, so it lands here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@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 28, 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 hanthor 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login 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 merged commit f3e4df7 into hivecommons:v6 Oct 28, 2026
67 of 71 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#15048a41f817` sha256:fe52aceda997deed0808fb2dc2b383c3607f4b6e6373189a9f7e276e0af8041b β€” download from the dashboard or `hivectl review evidence #15048`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @Danathar holds role owner and GitHub permission maintain on repo; CI green at a41f817.

@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/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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read against v6. Looks correct to me, and this is the better of the two open fixes for #15034.

  • The guard is the right one: contributorLaneDiffReason returns workflow-path as soon as any workflow path matches (src/pkg/github/automerge/automerge_contributor_lane.go:1079-1083) and only falls through to contributorLaneTestsRemovedReason otherwise, so a head with both never reported tests-removed to this reply. Checking contributorLaneTestsRemovedReason(files) == "" directly (pr_approve_command.go:91) closes that gap without changing the lane itself.
  • The table test's new releaseFence column also gives the positive "merges only on a hive owner's explicit approval" caption its first test β€” before this, ContributorLanePolicy{Enabled: true} was hard-coded so that branch was never exercised. The new negative row would fail without the guard.
  • #15041 (hive scanner) carries a byte-identical production change and the same changelog.d/fixed-approve-reply-tests-removed.md filename, so they conflict; I have left a note there recommending it be closed in favour of this one.

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

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

Labels

author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant