Skip to content

fix(slicer): give the union commit an explicit git identity#1057

Open
Defilan wants to merge 1 commit into
defilantech:mainfrom
Defilan:fix/slicer-integrate-git-identity
Open

fix(slicer): give the union commit an explicit git identity#1057
Defilan wants to merge 1 commit into
defilantech:mainfrom
Defilan:fix/slicer-integrate-git-identity

Conversation

@Defilan

@Defilan Defilan commented Jul 10, 2026

Copy link
Copy Markdown
Member

What

Give the slicer's union commit an explicit git author identity, so integrate succeeds in a pod that has no user.name/user.email configured.

Why

Fixes #1056. On the first end-to-end lab run where every slice reached GO, integrate ran on the in-cluster foreman-agent pod and died at the union commit:

integrate: commit union: exit status 128: Author identity unknown
fatal: unable to auto-detect email address (got 'unknown@foreman-agent-<hash>.(none)')

integrate.go committed the union with a bare git commit, relying on ambient git identity the pod's clone does not have. That surfaced as GATE-ERROR, cascade-failing reconcile even though all slices were green. The coder's own commits avoid this because repo/branch.go already sets GIT_COMMITTER_NAME=foreman / GIT_COMMITTER_EMAIL=foreman@llmkube.dev; the slicer integrate path never got the same treatment. The package's unit tests missed it because the fixture (initRepo) configures a local identity, masking the production condition.

How

  • integrate.go: pass git -c user.name=foreman -c user.email=foreman@llmkube.dev commit -m <msg>, matching the foreman bot identity used for the coder's commits.
  • Add TestIntegrate_NoAmbientGitIdentity: neutralizes global/system git config, strips the fixture's local identity, runs Integrate, and asserts the union commit lands under the foreman bot identity. Fails before the fix (wrong author on a dev box, or the exit-128 error in CI/pod), passes after.

Testing

  • go test ./pkg/foreman/slicer/ — all pass, including the new regression test.
  • go build ./..., go vet ./pkg/foreman/slicer/, golangci-lint run ./pkg/foreman/slicer/... — clean.
  • Validated end-to-end in the lab: with the pod given a git identity as a temporary workaround, the same sliced Workload drives integrate past the union commit (this PR removes the need for that workaround).

Checklist

  • Tests added/updated
  • go build ./... passes
  • Lint passes
  • Commit is DCO signed-off

Assisted-by: Claude (Anthropic) — analysis, regression test, and patch; reviewed by the maintainer.

The integrate agent builds the union commit in a pod whose clone has no
user.name/user.email in any git config scope. A bare `git commit` there
dies with "Author identity unknown" (exit 128), so integrate returns
GATE-ERROR and reconcile cascade-fails even when every slice is green.

Pass the foreman bot identity (foreman <foreman@llmkube.dev>) explicitly
via `git -c`, matching repo/branch.go which does the same for the coder's
own commits. Add a regression test that runs Integrate with no ambient git
identity and asserts the union commit lands under the bot identity; the
existing fixture masked this by configuring a local identity.

Fixes defilantech#1056

Signed-off-by: Christopher Maher <chris@mahercode.io>
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/foreman/slicer/integrate.go 75.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Slicer integrate union commit fails without ambient git identity (GATE-ERROR)

1 participant