Skip to content

test(e2e): run the git merge suite's git through gitexec - #1179

Draft
sbalabanov wants to merge 1 commit into
mainfrom
sergeyb/test-e2e-git-merge-gitexec
Draft

sbalabanov wants to merge 1 commit into
mainfrom
sergeyb/test-e2e-git-merge-gitexec

Conversation

@sbalabanov

@sbalabanov sbalabanov commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

TLDR: TestGitMergeE2E now runs git through gitexec, so it passes on hosts whose system git is older than the pinned git.

Summary

  • GitMergeSuite.runGit ran the pinned git with exec.Command and the inherited environment. The pinned binary's compiled-in exec path does not exist, so its sub-commands fell back to the system git on PATH, and host git config applied. On a host with git 2.39 this failed with fatal: unsupported section for hidden refs: fetch.
  • runGit now calls gitexec.Output, which puts the pinned git's directory first on PATH and scrubs host git config. This is the same helper the Tango suite already uses.
  • configureWorkClone no longer sets commit.gpgsign or a core.hooksPath pointing at an empty directory. gitexec ignores system and global config, so these repo-local overrides no longer guard anything.
  • Test-only change, one file.

Test Plan

Run locally (needs Docker):

./tool/bazel test //test/e2e/submitqueue:go_default_test --test_filter=TestGitMergeE2E --test_sharding_strategy=disabled --runs_per_test=3 --nocache_test_results --test_output=errors
  • Before the change, on a host with /usr/bin/git 2.39.5: 3/3 failed with the hidden-refs error.
  • After the change, same host and command: 3/3 passed.
  • make fmt lint check-gazelle check-tidy: all pass (run on the committed tree).
  • grep -rn 'exec.Command(s.git' test/e2e returns nothing.

🤖 Generated with Claude Code

@sbalabanov sbalabanov left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[flaky-1-d2-reviewer] nit: no must-fix; one optional nit inline. I checked that gitexec.Output builds a fresh environment for every git call in the suite: the scrub set plus PATH with the pinned git's directory first. runGit is the suite's only git path. git-upload-pack, git-receive-pack and git-upload-archive are copies of :git in the same Bazel package, so fetch, clone, push and the rev-list --exclude-hidden=fetch connectivity check all resolve to the pinned build. Git's stderr still reaches the failure message through CommandError.Error(); only the bare exit status is dropped when stderr is non-empty. The diff matches the spec and the Tango precedent. The implementer worktree's three after-fix runs show only the e2e-submitqueue-git stack and end in PASS. The PR body has a TLDR, a Test Plan that matches what was run, and no Revert Plan or Issue Links sections.

Comment thread test/e2e/submitqueue/git_suite_test.go Resolved
TestGitMergeE2E failed on every run on hosts whose /usr/bin/git is older than the pinned git, with "fatal: unsupported section for hidden refs: fetch" from git fetch.

The suite ran the pinned git with exec.Command and the inherited environment. The pinned binary's compiled-in exec path does not exist, so its sub-commands resolve git from PATH, which under Bazel's strict environment is the older system git. Host git config also applied to the test repositories.

Routing runGit through gitexec.Output puts the pinned git's directory first on PATH and scrubs host git config, matching what the Tango suite already does. That makes the clone's commit.gpgsign and core.hooksPath overrides dead, so they are removed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sbalabanov
sbalabanov force-pushed the sergeyb/test-e2e-git-merge-gitexec branch from dfad2dc to 5cb720b Compare December 3, 2026 21:21

@sbalabanov sbalabanov left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[flaky-1-d2-reviewer] nit: The code at 5cb720b looks good. The PR body is still accurate, but it no longer covers the whole change. Squash commits on main carry the PR body, so removing commit.gpgsign and the .no-hooks core.hooksPath block from configureWorkClone would land with no explanation; only the amended commit body mentions it. Suggest one Summary bullet, e.g. "configureWorkClone drops its commit.gpgsign and core.hooksPath overrides, which the scrub makes dead."

I checked that nothing relied on the removed lines:

  • Both were set only in the work clone's local config. Runway never reads it; it merges through the bare repo.
  • With system and global config scrubbed, only repo-local config can turn on signing or set core.hooksPath. The test writes that config itself, and clone does not copy it from the source.
  • The pinned git is built without RUNTIME_PREFIX, so its default template dir is /share/git-core/templates, which does not exist here. GIT_TEMPLATE_DIR and init.templateDir cannot reach git, so the clone gets no active hooks.
  • .no-hooks was an empty directory: git add . never tracked it and nothing asserted on it.
  • The os, filepath and require imports are still used, and gofmt is clean.
  • The implementer worktree's three runs at 21:21Z, just before the amend (the tree is clean at 5cb720b), each brought up only e2e-submitqueue-git and ended in PASS.

@sbalabanov

Copy link
Copy Markdown
Collaborator Author

[flaky-1-d2-implementer] fixed in PR body: added a Summary bullet noting that the dead commit.gpgsign and core.hooksPath settings are removed from configureWorkClone, and why.

This branch has not been deployed

No deployments
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.

1 participant