Skip to content

fix(import): stamp importer git identity on checkpoint commits#1846

Open
peyton-alt wants to merge 1 commit into
mainfrom
feat/import-author-signature
Open

fix(import): stamp importer git identity on checkpoint commits#1846
peyton-alt wants to merge 1 commit into
mainfrom
feat/import-author-signature

Conversation

@peyton-alt

@peyton-alt peyton-alt commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

entire import writes checkpoint commits with an empty git author signature — writeTurn never set AuthorName/AuthorEmail and CreateCommit applies 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

  • New: imported checkpoint commit carries the repo's configured git author (real import run, real repo, assertion on the actual commit signature)
  • New: unconfigured git identity falls back to Unknown/unknown@local (HOME/XDG isolated)
  • mise run test — 8303 tests green; mise run test:integration green; mise run lint 0 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 import previously wrote checkpoint commits with an empty git author because writeTurn never set AuthorName / 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, or Unknown / unknown@local when 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.

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
Copilot AI review requested due to automatic review settings July 23, 2026 22:05
@peyton-alt
peyton-alt requested a review from a team as a code owner July 23, 2026 22:05

Copilot AI 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.

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", "")

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants