From 9c699181fbc48defc1ea963f55e3890f100d2b00 Mon Sep 17 00:00:00 2001 From: Ryan Sutton Date: Thu, 2 Apr 2026 11:53:54 -0600 Subject: [PATCH] test: Fix test repos using git commit signing if global commit signing is enabled --- apps/code/src/main/services/archive/service.integration.test.ts | 1 + packages/agent/src/sagas/test-fixtures.ts | 1 + packages/agent/src/test/fixtures/api.ts | 1 + packages/git/src/queries.test.ts | 1 + packages/git/src/sagas/checkpoint.test.ts | 2 ++ 5 files changed, 6 insertions(+) diff --git a/apps/code/src/main/services/archive/service.integration.test.ts b/apps/code/src/main/services/archive/service.integration.test.ts index 2d525feac..f5f06d69b 100644 --- a/apps/code/src/main/services/archive/service.integration.test.ts +++ b/apps/code/src/main/services/archive/service.integration.test.ts @@ -46,6 +46,7 @@ async function createTempGitRepo(): Promise { stdio: "pipe", }); execSync("git config user.name 'Test'", { cwd: dir, stdio: "pipe" }); + execSync("git config commit.gpgsign false", { cwd: dir, stdio: "pipe" }); await fs.writeFile(path.join(dir, "README.md"), "# Test Repo"); execSync("git add . && git commit -m 'Initial commit'", { cwd: dir, diff --git a/packages/agent/src/sagas/test-fixtures.ts b/packages/agent/src/sagas/test-fixtures.ts index ee7059451..f569f5d68 100644 --- a/packages/agent/src/sagas/test-fixtures.ts +++ b/packages/agent/src/sagas/test-fixtures.ts @@ -38,6 +38,7 @@ export async function createTestRepo(prefix = "test-repo"): Promise { await git(["init"]); await git(["config", "user.email", "test@test.com"]); await git(["config", "user.name", "Test"]); + await git(["config", "commit.gpgsign", "false"]); await writeFile(join(repoPath, ".gitignore"), ".posthog/\n"); await writeFile(join(repoPath, "README.md"), "# Test Repo"); diff --git a/packages/agent/src/test/fixtures/api.ts b/packages/agent/src/test/fixtures/api.ts index 0555f5359..7ca431f3d 100644 --- a/packages/agent/src/test/fixtures/api.ts +++ b/packages/agent/src/test/fixtures/api.ts @@ -35,6 +35,7 @@ export async function createTestRepo(prefix = "test-repo"): Promise { await git(["init"]); await git(["config", "user.email", "test@test.com"]); await git(["config", "user.name", "Test"]); + await git(["config", "commit.gpgsign", "false"]); await writeFile(join(repoPath, ".gitignore"), ".posthog/\n"); await writeFile(join(repoPath, "README.md"), "# Test Repo"); diff --git a/packages/git/src/queries.test.ts b/packages/git/src/queries.test.ts index 49776d0ce..5579ff4b0 100644 --- a/packages/git/src/queries.test.ts +++ b/packages/git/src/queries.test.ts @@ -11,6 +11,7 @@ async function setupRepo(defaultBranch = "main"): Promise { await git.init(["--initial-branch", defaultBranch]); await git.addConfig("user.name", "Test"); await git.addConfig("user.email", "test@example.com"); + await git.addConfig("commit.gpgsign", "false"); await writeFile(path.join(dir, "file.txt"), "content\n"); await git.add(["file.txt"]); await git.commit("initial"); diff --git a/packages/git/src/sagas/checkpoint.test.ts b/packages/git/src/sagas/checkpoint.test.ts index 5f55828e5..68e891889 100644 --- a/packages/git/src/sagas/checkpoint.test.ts +++ b/packages/git/src/sagas/checkpoint.test.ts @@ -18,6 +18,7 @@ async function setupRepo(): Promise { await git.init(); await git.addConfig("user.name", "PostHog Code Test"); await git.addConfig("user.email", "posthog-code-test@example.com"); + await git.addConfig("commit.gpgsign", "false"); await writeFile(path.join(dir, "a.txt"), "one\n"); await writeFile(path.join(dir, "b.txt"), "base\n"); @@ -258,6 +259,7 @@ describe("checkpoint sagas", () => { await subGit.init(); await subGit.addConfig("user.name", "PostHog Code Test"); await subGit.addConfig("user.email", "posthog-code-test@example.com"); + await subGit.addConfig("commit.gpgsign", "false"); await writeFile(path.join(subRepo, "sub.txt"), "sub\n"); await subGit.add(["sub.txt"]); await subGit.commit("sub-init");