Skip to content

πŸ› ci(v6-topup): never auto-drop v5 changes to the split config.go - #18309

Merged
kubestellar-prow[bot] merged 1 commit into
v5from
fix/v6-topup-config-nodrop
Nov 15, 2026
Merged

kubestellar-prow[bot] merged 1 commit into
v5from
fix/v6-topup-config-nodrop

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Problem

.github/scripts/v6-topup-autoresolve.sh (#18277) kept v6's side of any src/pkg/config/config.go conflict. v6 split the old config.go monolith into topical files (#9386, #9956). So a conflict there means v5 changed config.go since the last top-up, and keeping v6's side dropped that change without any message. #18222's keystore sealing nearly went this way; it survived only because it was hand-ported into v6's load.go/save.go. #18300's meetings config block would have been next.

Change

  • The config.go "keep v6" rule is removed. A config.go conflict now counts as an unknown pattern. The resolver refuses and prints the git diff <merge-base> MERGE_HEAD -- src/pkg/config/config.go command for a hand port.
  • I did not add a smarter "safe subset" rule. Under a UU conflict, v5's diff against the merge-base is never empty. Telling whether v6 already has an equivalent change somewhere in the split files means matching code that has moved, and that cannot be proven safe mechanically.
  • I re-checked the other rules for the same silent-drop risk:
    • discord/ and discord-syntax.yml modify/delete: keep v6's deletion. This is intentional (v6 removed discord in fix: discord legacy bot removal, MESSAGE_CONTENT docs, poll backoff [scanner]Β #9277), so the rule is unchanged.
    • CHANGELOG.md: git merge-file --union keeps both sides' lines, so no v5 text is dropped. Unchanged.
    • integration-governance.cjs: the resolver acts only when every hunk on both sides is the TRUSTED_SCRIPTS_TREE literal. It then re-pins to the merged src/scripts tree, and any other hunk is refused. Unchanged.
    • static/index.html: the resolver regenerates the file from static-src/manifest.txt as a byte-exact concatenation. That is the same output as webstatic.ConcatIndex, which go generate (gen/concat.go) and TestIndexHTMLIsGenerated use, and it never takes one side. It runs only when no static-src file is conflicted. The manifest path check now matches ParseIndexManifest's clean-relative-path rule.
  • Tests: the throwaway-repo test gains config-go-real-field-refused. In that case v5 adds a real Config field to config.go while v6 has the split version. The test asserts that the resolver exits non-zero, leaves config.go unmerged and prints the hand-port hint. As a control, the new case fails against the previous resolver.

πŸ€– Generated with Claude Code

The resolver kept v6's side of any src/pkg/config/config.go conflict. v6
split that monolith into topical files, so a conflict there means v5
changed config.go since the last top-up and keeping v6's side drops the
change without a trace (#18222's keystore sealing survived only through a
hand port; #18300's meetings block was next).

config.go is no longer a known pattern: the resolver now refuses and
prints the diff command for a hand port. The manifest path check for the
index.html regeneration now matches webstatic.ParseIndexManifest's
clean-relative-path rule. The throwaway-repo test gains a case where v5
adds a real config field and asserts the resolver refuses and leaves the
file unmerged.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 15, 2026
@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 15, 2026
@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 15, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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

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

  • P3 info intent-alignment β€” Manifest path check tightening is adjacent to the stated goal (.github/scripts/v6-topup-autoresolve.sh:116): The clean-relative-path case widening for static-src manifest lines is unrelated to config.go auto-drop, but the PR body discloses it and it only makes the resolver stricter (refuses more). Advisory …
  • P3 info style β€” Unrelated manifest path rule change bundled (.github/scripts/v6-topup-autoresolve.sh:119): The ParseIndexManifest-style path check in v6-topup-autoresolve.sh is unrelated to the config.go title and is untested.

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

Style review @ 44808dc β€” the resolver change reads fine. One test-readability issue to fix:

case_config_real_field inverts the expect convention, so a setup failure reads as a pass (.github/scripts/test-v6-topup-autoresolve.sh, new case, ~L121-131)

The sibling fail cases (case_unknown_conflict, case_pin_file_real_edit) just run bash "$RESOLVER" last and let its non-zero exit be the result. The new case instead returns 0 for every bug path and return 1 only on the happy path. expect ... fail treats rc!=0 as pass, so this works, but it is the reverse of the file's other cases. It also has a trap: the setup line git merge ... && { echo "expected conflicts"; return 1; } returns 1. If the merge ever stops conflicting (fixture drift), the case reports ok instead of failing, so the regression test passes without testing anything.

Suggested shape: match the siblings, run the resolver last, and make the assertions explicit.

-  git merge --no-ff -q v5 -m merge >/dev/null 2>&1 && { echo "expected conflicts"; return 1; }
+  git merge --no-ff -q v5 -m merge >/dev/null 2>&1 || true
+  git status --porcelain | grep -q '^UU src/pkg/config/config.go$' || { echo "setup: no config.go conflict"; return 0; }

This leaves the failed-setup path returning 0, which expect fail flags. Do the same for the other return 0 guards, and keep return 1 only as the final refusal path. Better still, add a small expect_refusal helper rather than relying on inverted return codes.

Minor, out-of-scope: the manifest clean-path rule change in v6-topup-autoresolve.sh (~L119) is unrelated to the title and has no test. It is worth a line in the PR body, which does mention it, or a separate PR.

β€” hive: agent=adjudicator-4 backend=claude model=claude-sonnet-5-5 claude=2.1.325

@kubestellar-prow
kubestellar-prow Bot merged commit c217b1f into v5 Nov 15, 2026
89 of 95 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/v6-topup-config-nodrop branch November 15, 2026 17:31
@hivecommons-hive

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 diff and the resolver script. The change looks correct to me.

  • v6-topup-autoresolve.sh: UU src/pkg/config/config.go is removed from both known and the case arm, so any config.go conflict now falls into the "outside the known patterns" branch and exits 1 with the hand-port hint.
  • test-v6-topup-autoresolve.sh: case_config_real_field is registered with expect ... fail. Every early return 0 in it (resolver exited 0, config.go resolved, hint missing) makes the test fail, and only the intended path returns 1, so the control works.
  • The manifest path check now rejects ./x, a//b, a/./b, a/../b, trailing /, /. and /.., in line with the stated ParseIndexManifest rule.

I'm routing rather than leaving a plain confirmation because the PR edits .github/workflows/v6-topup.yml (comment-only) and the CI resolver that runs in it, and I do not sign off on workflow files.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. 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