Skip to content

Fix red CI: hermetic git identity in publish test, modernize workflows#12

Merged
disk0Dancer merged 2 commits into
mainfrom
fix/ci-hermetic-publish-test
Jul 15, 2026
Merged

Fix red CI: hermetic git identity in publish test, modernize workflows#12
disk0Dancer merged 2 commits into
mainfrom
fix/ci-hermetic-publish-test

Conversation

@disk0Dancer

Copy link
Copy Markdown
Owner

Why

CI on main has been red since the merge of #10 (run 24828582828): TestSyncGitRepositoryExistingRepoPreservesRemoteFiles fails on Linux runners with fatal: empty ident name not allowed. The test configures user.name/user.email only in the seed repo, but syncGitRepository commits in its own clone directory, relying on a global git identity that CI runners don't have (macOS masks this by deriving identity from the system user, which is why it passes locally).

Changes

  • Set GIT_AUTHOR_*/GIT_COMMITTER_* env vars in the test (t.Setenv) so identity applies to all git subprocesses regardless of working directory.
  • Remove the manual actions/cache step in ci.yml — it conflicted with setup-go's built-in cache, producing hundreds of tar: Cannot open: File exists warnings; use setup-go with cache: true instead.
  • Bump actions to Node 24 versions across all workflows: checkout@v5, setup-go@v6, golangci-lint-action@v8 (Node 20 deprecation).
  • Reorder CI steps: go vet and go build before tests, so cheap checks always report even when tests fail.

Verification

  • go test -race ./... green locally in a hermetic env (HOME=$(mktemp -d) GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null).
  • go build ./..., go vet ./..., gofmt -l . clean.

🤖 Generated with Claude Code

- Set GIT_AUTHOR_*/GIT_COMMITTER_* env in TestSyncGitRepositoryExistingRepoPreservesRemoteFiles
  so commits made in syncGitRepository's own clone don't depend on the runner's
  global git config (Linux runners have no identity -> 'empty ident name' failure).
- Drop manual actions/cache step that conflicted with setup-go's built-in cache
  (hundreds of 'tar: Cannot open: File exists' warnings).
- Bump actions to Node 24 versions: checkout@v5, setup-go@v6, golangci-lint-action@v8.
- Run go vet and go build before tests so cheap checks always report.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 15, 2026 15:06
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes a Linux CI failure in the publish tests caused by missing git identity on GitHub-hosted runners, and modernizes GitHub Actions workflows to newer major versions while simplifying Go caching.

Changes:

  • Make the publish sync test hermetic w.r.t. git identity by setting GIT_AUTHOR_* / GIT_COMMITTER_* environment variables.
  • Update workflows to newer action majors (checkout@v5, setup-go@v6, golangci-lint-action@v8) and remove the redundant actions/cache step in CI in favor of setup-go’s built-in cache.
  • Reorder CI so go vet / go build run before tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/publish/publish_test.go Sets git author/committer env vars so commits made from cloned working dirs don’t rely on global git config.
.github/workflows/ci.yml Uses setup-go caching, bumps actions, and reorders checks to run vet/build before tests.
.github/workflows/ci-autofix.yml Bumps checkout/setup-go/golangci-lint-action major versions.
.github/workflows/pages.yml Bumps checkout major version.
.github/workflows/release.yml Bumps checkout/setup-go major versions in release workflows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

git init --bare uses the machine's init.defaultBranch (master on stock CI
runners), leaving the bare repo HEAD pointing at a branch that is never
pushed; the verify clone then checks out an empty tree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@disk0Dancer disk0Dancer merged commit 354f870 into main Jul 15, 2026
4 checks passed
@disk0Dancer disk0Dancer deleted the fix/ci-hermetic-publish-test branch July 15, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants