Skip to content

🐛 gfi: promise an automatic merge only where the hive merges - #18832

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/gfi-welcome-auto-merge-promise
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/gfi-welcome-auto-merge-promise

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

The good-first-issue welcome comment always promised that the hive "merges green PRs from claimed contributors automatically", and its paste-to-agent prompt said the contributor lane "can auto-merge it once CI is green". Where a repository's auto-merge is off, the contributor lane skips that repository and a maintainer merges, so the invite promised something the hive does not do there.

The comment now promises an automatic merge only where the hive's contributor lane would merge. Elsewhere it says the hive reviews the PR and a maintainer merges it. Repositories the hive does merge get byte-identical text.

What happened

Cause

  • gfi.DefaultTemplate step 4 and Vars.AgentPrompt are unconditional, and gfi.Vars carries nothing about merging.
  • The contributor lane gates every repository on repoAutoMergeAllowed, wired from Config.RepoAutoMergeEnabled. That is false below L6, and at L6 where project.repo_policies[].auto_merge: false.

The same wording gap was closed for kicks and the dashboard in #17543 and #17550.

What changed

  • gfi.Vars.AutoMerge (new): whether the hive merges this repository's contributor PRs itself. Filled per issue from SweepOptions.RepoAutoMerge, which gfiSweepOptions wires to cfg.RepoAutoMergeEnabled. When the func is unset the sweep keeps today's promise, so unwired callers render as before. gfi stays stdlib-only.
  • With AutoMerge false:
    • the heading drops "(no waiting on a human)";
    • step 4 reads "Hive runs CI and reviews the PR; a maintainer of this repository merges it.";
    • the footer link is labelled "contributor lane" (same target);
    • the agent prompt ends "so the hive's contributor lane links it to your claim; the hive reviews it and a maintainer merges it."
  • With AutoMerge true nothing changes.
  • A custom good_first_issue.comment_template can use {{ if .AutoMerge }}.
  • Existing invites: the sweep upserts by marker. After a restart (for example the upgrade that ships this), an issue still wearing the label is selected again and its comment is edited in place to the right wording; no new comment is posted. Within one process, issues already selected are not re-rendered.
  • Docs (good-first-issue.md: the flow, the off wording, the new template variable) and a changelog fragment.

Not in this PR

  • Whether GFI should advertise at all in repositories with auto-merge off. That's an owner call, and good_first_issue.repos already restricts it.
  • The docs links in the comment that point at blob/v5.
  • Withdrawing an invite once a PR covers the issue, and skip labels. That's a separate PR.

Tests

  • pkg/gfi/automerge_test.go:
    • with AutoMerge true the default template renders byte-identical to the pre-change template, and the agent prompt is unchanged;
    • with it false there is no "automatically", "no waiting on a human" or "can auto-merge", and the maintainer wording is present;
    • a custom template can branch on .AutoMerge;
    • the sweep renders per repository, a nil func keeps the promise, and a restarted pass edits an old invite in place.
  • cmd/hive/gfi_wire_test.go: gfiSweepOptions wires the func from config: an auto_merge: false repo, a repo with no override at L6, and every repo below L6.

Only gofmt -l was run locally (AGENTS.md bans local go test/go build/go vet); this PR's CI is the test run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

The good-first-issue welcome comment and its agent prompt always said the
hive merges green PRs from claimed contributors automatically. Where a
repository's auto-merge is off (below L6, or repo_policies auto_merge:
false) the contributor lane skips the repo and a maintainer merges, so the
invite promised something the hive does not do there.

gfi.Vars gains AutoMerge, filled per issue from SweepOptions.RepoAutoMerge,
which gfiSweepOptions wires to Config.RepoAutoMergeEnabled. With it on the
rendered text is byte-identical to before; with it off the heading, step 4,
the footer link label and the agent prompt say a maintainer merges.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 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

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

Docs currency looks fine: the flow, off-wording, and .AutoMerge variable are documented and a changelog fragment is included. One out-of-scope note: the first-timer PR welcome (good-first-issue.md:259) still implies auto-merge unconditionally. Not blocking.

— hive: agent=adjudicator-5 backend=claude model=claude-sonnet-5-5 claude=2.1.326

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Review follow-ups: 1 open of 1 (below review.backlog.min_severity: P2)

Non-blocking findings below the backlog filing line, listed here instead of as issues. Tick them off as they are fixed; set review.backlog.min_severity: P3 to file every finding.

  • P3 low docs-currency — First-timer PR welcome still implies auto-merge unconditionally (src/docs/good-first-issue.md:259): The first-timer PR welcome described at good-first-issue.md:259 says trust-tier progression 'unlocks contributor-lane auto-merge' with no auto-merge-off caveat. This is the same class of over-promise…
Evidence bundle `#18832ab48d97` sha256:bd3255b36b7f6420de719e54b4418df076df9229263b9621e061f14c63daa9dc — download from the dashboard or `hivectl review evidence #18832`.

@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
#18834 🐛 gfi: withdraw the invite once a PR covers the issue; never advertise relay-refused issues same files src/cmd/hive/gfi_wire.go
src/cmd/hive/gfi_wire_test.go
src/docs/good-first-issue.md
src/pkg/gfi/gfi.go

@hivecommons-hive
hivecommons-hive Bot merged commit 40b4910 into hivecommons:v6 Nov 17, 2026
81 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant