fix(import): stamp importer git identity on checkpoint commits#1846
Open
peyton-alt wants to merge 1 commit into
Open
fix(import): stamp importer git identity on checkpoint commits#1846peyton-alt wants to merge 1 commit into
peyton-alt wants to merge 1 commit into
Conversation
entire import wrote checkpoint commits with an empty git author signature. On the GitHub->mirror ingestion path, the data plane has no pusher identity for imported sessions and falls back to the checkpoint commit's git author; an empty author meant imported sessions couldn't be attributed to the importer. Resolve the author once per import run via the existing checkpoint.GetGitAuthorFromRepo (author email is HMAC'd, never stored) and thread it into every written checkpoint's commit, fixing attribution via existing, de-identifying machinery. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUDkzmpwgC4BiZ894UfnTy
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes entire import attribution by ensuring imported checkpoint commits are created with a non-empty git author signature, using the same repo-based identity resolution (checkpoint.GetGitAuthorFromRepo) as other checkpoint write paths. This restores downstream attribution behavior on the GitHub→mirror ingestion path, where commit author is used as a fallback identity.
Changes:
- Resolve git author name/email once per import run and stamp it onto each imported checkpoint commit.
- Extend agent-import E2E-ish tests to assert checkpoint commit author behavior for both configured and unconfigured git identities.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/entire/cli/agentimport/agentimport.go | Resolve importer git identity once and pass it through to checkpoint writes via AuthorName / AuthorEmail. |
| cmd/entire/cli/agentimport/agentimport_test.go | Add tests asserting imported checkpoint commit author uses repo identity and falls back to Unknown/unknown@local when unconfigured. |
Comment on lines
+441
to
+446
| // Cannot use t.Parallel(): isolates HOME via t.Setenv so this repo's | ||
| // global git config resolution can't see the developer's real ~/.gitconfig. | ||
| home := t.TempDir() | ||
| t.Setenv("HOME", home) | ||
| t.Setenv("XDG_CONFIG_HOME", "") | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
entire importwrites checkpoint commits with an empty git author signature —writeTurnnever setAuthorName/AuthorEmailandCreateCommitapplies them verbatim. That breaks importer attribution on the data plane's GitHub→mirror ingestion path: mirror-sync pushes carry no pusher identity, so entire-api falls back to the checkpoint commit's git author — which is empty for imports, leaving them permanently unattributable there.This resolves the importer's identity once per import run via the checkpoint package's
GetGitAuthorFromRepo(the same fallback every other checkpoint write path uses) and stamps it on each import commit. The data plane's existing author machinery then attributes imports with no special casing — and it de-identifies (the email is HMAC'd, never stored).Companion to entirehq/entire-api#405 (data-plane import ingestion) and entirehq/entire.io#3310 (BFF import ingestion); follows up #1825.
Test plan
Unknown/unknown@local(HOME/XDG isolated)mise run test— 8303 tests green;mise run test:integrationgreen;mise run lint0 issues🤖 Generated with Claude Code
https://claude.ai/code/session_01QUDkzmpwgC4BiZ894UfnTy
Note
Low Risk
Localized change to the import write path using an existing attribution helper; behavior matches other checkpoint commits, with new tests covering configured and default authors.
Overview
entire importpreviously wrote checkpoint commits with an empty git author becausewriteTurnnever setAuthorName/AuthorEmail. On GitHub→mirror ingestion, when there is no pusher identity, the data plane falls back to the checkpoint commit author—so imported sessions stayed unattributed.The import run now resolves the importer’s identity once via
checkpoint.GetGitAuthorFromRepo(same helper as other checkpoint writes) and passes it into each imported checkpoint write so commits carry a real signature, orUnknown/unknown@localwhen git user config is missing.Tests assert the commit author matches repo-local git config and the unconfigured fallback.
Reviewed by Cursor Bugbot for commit 4df67dc. Configure here.