Skip to content

✨ feat(settings): expose merge-train controls in Auto-merge - #16680

Merged
hivecommons-hive[bot] merged 3 commits into
hivecommons:v5from
thatguywob:scanner/fix-16677
Nov 5, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
hivecommons:v5from
thatguywob:scanner/fix-16677

Conversation

@thatguywob

Copy link
Copy Markdown
Contributor

Operators currently have to edit YAML to tune the conflict-aware merge train. Add a Merge train block under Settings → Auto-merge, immediately above Native GitHub merge queue, with the enabled switch, rebase attempts per front, and stall-warning seconds. Each control includes its YAML hint and help text; the operator reference and copy inventory document the same controls.

Add owner-only partial PATCH support for the nested auto-merge settings and governor stall warning, retain the existing auto-merge PUT writer, and echo effective values with bot-author metadata. Reject invalid values before mutation, roll back failed saves, and audit changes as config_auto_merge/config_governor. Explicit zero stall-warning seconds now disables warnings and survives YAML persistence; omitted settings retain the 3600-second default. Zero rebase attempts retains the existing default of two.

Validation: added API round-trip, validation, ownership, save-failure rollback, audit, YAML persistence, and static settings/YAML-hint coverage. Tests, builds, linters, and guards were not run locally per AGENTS.md; CI is the validation authority. Go files were formatted with gofmt, and the generated dashboard HTML was updated from its manifest sources.

Closes #16677

— hive: agent=scanner backend=codex model=gpt-6.1-sol effort=high


🐝 Hive Agent: contributor | SHA: 175fe6b25

Expose nested merge-train controls with owner-only partial API updates and persistence-aware explicit-zero stall warnings.

Hive-Run: hivecommons#16677
Hive-Plan: merge-train-settings
Hive-Spec: hivecommons#16677#proposed
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 5, 2026
@thatguywob

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.

— hive: agent=scanner backend=codex model=gpt-6.1-sol effort=high


🐝 Hive Agent: contributor | SHA: 175fe6b25

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • relative links and anchors resolve

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Your relay session received this as a fix-pr task and launched a parallel fix session; your current work continues.

Resync the 201 route citations shifted by the new merge-train PATCH registrations using the repository citation fixer.

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
Document the registered auto-merge and governor PATCH routes in OpenAPI and the API reference, including merge-train validation and effective responses. Fixes the CI route parity failure.

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
@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 Nov 5, 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 the tree at this head, including the consumers — looks correct to me. The three claims in the body that could have been wrong are not:

  • Explicit zero disables warnings. pkg/dashboard/stage_tracker_merge_train_postpass.go:271 already guards opts.StallWarn > 0, so a 0 from MergeTrainStallWarn() (pkg/config/config.go:5289, now honouring mergeTrainStallWarnSet) turns the stall flag off rather than marking every head stalled.
  • Zero survives YAML persistence. MarshalYAML appends merge_train_stall_warn_s: 0 under the governor mapping (config.go:7184-7189); that mapping always exists because Governor is tagged yaml:"governor" without omitempty (config.go:83), and the loader only sets mergeTrainStallWarnSet when the key is present and non-null, so the round trip is stable.
  • Rollback on failed save. api_config_automerge.go:280 snapshots cfg.AutoMerge before the merge-train writes at :281-288 and restores it at :389-390; MergeTrain.Enabled is replaced with a fresh pointer, not mutated through the old one, so the snapshot is intact. The new handleGovernorMergeTrainPatch (api_governor_merge_train.go:28-35) does the same for cfg.Governor and is behind requireOwnerRole.

Nothing here needs a human to re-derive; the remaining checks were still running when I read it.

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

@hivecommons-hive

hivecommons-hive Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Read the Go and JS changes against the v5 tree at 1d3610d; the wiring is correct end-to-end and I found no defects. CI was still running when I read it (build-go, docker, overlayfs-exec-guard in progress; Sign-off survives the squash / native-queue-policy showed cancelled, presumably re-queued), so this is a code read, not a green-CI confirmation.

What I verified:

  • Explicit-zero stall warning is safe. MergeTrainStallWarn() (config.go:5289) can now return 0; its only consumer is stage_tracker_merge_train.go:135 → stage_tracker_merge_train_postpass.go:271, which is already guarded by opts.StallWarn > 0, so zero disables the stall chip rather than marking every head stalled.
  • YAML round-trip. Governor has no omitempty (config.go:83), so the governor mapping MarshalYAML appends merge_train_stall_warn_s: 0 to always exists; omitempty on the int field means there is never a duplicate key; UnmarshalYAML (config.go:298-302) re-arms mergeTrainStallWarnSet on reload.
  • Owner gating parity. Both the new PATCH /api/config/governor handler (api_governor_merge_train.go:10) and the existing auto-merge writer (api_config_automerge.go:138) call requireOwnerRole; config_governor is added to auditSensitiveActions (audit.go:76).
  • New governor save branch cannot swallow other settings. linear-repos-save.js:764 routes section === 'governor' to the new PATCH; the only control that stages under that section is the stall input (config-features.js:420). Nothing else in static-src calls markDirty('governor', …).
  • Toggle ↔ save path. data-section="merge-train" (config-features.js:411) → toggleConfigSwitch (config-helpers.js:10) → markDirtyMergeTrain stages under auto-merge.merge_train, which the existing PUT /api/config/auto-merge branch (linear-repos-save.js:770) sends; the handler's new MergeTrain pointer fields (api_config_automerge.go:146) apply only the keys present. EffectiveMaxRebaseAttempts (config.go:8599) treats 0 as default, matching the validation message.
  • Removing the two auto_merge.merge_train.* lines from settings_parity_allowlist.txt is backed by yamlHint(...) references at config-features.js:412,415.

Not read line-by-line: the regenerated dashboard/openapi.json, static/index.html, and the eight src/docs/api-reference/*.md citation shifts — CI's dist-sync and citation guards cover those.

Note for the maintainer: the PR is opened from thatguywob/hive but the body is hive-agent authored (agent=scanner backend=codex model=gpt-6.1-sol); not a defect, just provenance.

Evidence bundle `#166801d3610d` sha256:93855418d3cbdc2c62d44cead4e47931a7addc93e96f4b7ba93cc3ef5c136d47 — download from the dashboard or `hivectl review evidence #16680`.

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#16736 ✨ feat(github): auto-approve gated Actions runs for trusted actors same files src/docs/operator-reference/README.md
src/pkg/config/config.go
src/pkg/dashboard/settings_parity_allowlist.txt
#16696 🐛 fix(dashboard): keep the Navigation label visible at phone widths same files src/pkg/dashboard/static/index.html
#16607 ✨ feat(github): enforce pin-only exception in merge-request relay same files src/docs/operator-reference/README.md
src/pkg/config/config.go
#16755 🐛 fix: decision pills no longer flash disabled while the viewer's role loads same files src/pkg/dashboard/static/index.html

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Ready for a human merge: verdict approved @1d3610d, 65/65 checks green, DCO yes, soak 10m0s elapsed. Blocked only by role/contributor (no verified hive claim or registry tier).

The hive never approves on your behalf: /lgtm /approve (or merge) if you accept it.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

@hivecommons-hive[bot]: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/approve

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

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

Approved by @clubanderson for Hive auto-merge on green CI.

Approved from the Hive dashboard by @clubanderson as the owner decision on a Ready-for-human-merge pull request; the hive's merge sweep merges it on green CI.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hivecommons-hive[bot]
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

Copy link
Copy Markdown
Contributor

@hivecommons-hive[bot]: changing LGTM is restricted to collaborators

Details

In response to this:

Approved by @clubanderson for Hive auto-merge on green CI.

Approved from the Hive dashboard by @clubanderson as the owner decision on a Ready-for-human-merge pull request; the hive's merge sweep merges it on green CI.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@hivecommons-hive hivecommons-hive Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive queued this PR but could not set the prow/lgtm commit status, so Prow may strip the lgtm label and the auto-merge queue may not hold.

@hivecommons-hive
hivecommons-hive Bot merged commit 102d718 into hivecommons:v5 Nov 5, 2026
76 of 79 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. lgtm Indicates that a PR is ready to be merged. 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.

✨ settings: expose merge-train knobs (enabled, max_rebase_attempts, stall warning) in Auto-merge

1 participant