Skip to content

Commit 88da062

Browse files
committed
fix(ci): avoid github api cache bust in project image
1 parent 5ba9e51 commit 88da062

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

packages/container/src/core/templates/dockerfile-prelude.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ RUN printf "%s\\n" "ALL ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/zz-all \
8484
&& chmod 0440 /etc/sudoers.d/zz-all`
8585

8686
const planToGitBranch = "main"
87-
const planToGitCommitMetadataUrl = `https://api.github.com/repos/ProverCoderAI/plan-to-git/commits/${planToGitBranch}`
87+
const planToGitCommitPatchUrl = `https://github.com/ProverCoderAI/plan-to-git/commit/${planToGitBranch}.patch`
8888

8989
// CHANGE: install plan-to-git in generated project containers.
9090
// WHY: issue #397 requires multi-agent plan capture, Claude Code hooks, temp-backed state, and explicit PR sync.
@@ -94,11 +94,11 @@ const planToGitCommitMetadataUrl = `https://api.github.com/repos/ProverCoderAI/p
9494
// FORMAT THEOREM: image_build_success -> executable(/usr/local/bin/plan-to-git)
9595
// PURITY: SHELL
9696
// EFFECT: Docker build downloads and installs the current main branch Rust CLI from GitHub.
97-
// INVARIANT: plan-to-git is available on PATH with Claude hooks and sync --pr before agent hooks or git post-push actions run; moving main changes the remote ADD input and invalidates the install layer.
97+
// INVARIANT: plan-to-git is available on PATH with Claude hooks and sync --pr before agent hooks or git post-push actions run; moving main changes the remote patch ADD input and invalidates the install layer without GitHub API quota dependency.
9898
// COMPLEXITY: O(network + cargo_build)
9999
const renderDockerfilePlanToGit = (): string =>
100100
`# Install plan-to-git for multi-agent plan capture and explicit PR sync (issue #397)
101-
ADD ${planToGitCommitMetadataUrl} /tmp/docker-git-plan-to-git-main.json
101+
ADD ${planToGitCommitPatchUrl} /tmp/docker-git-plan-to-git-main.patch
102102
RUN cargo install --git https://github.com/ProverCoderAI/plan-to-git --branch ${planToGitBranch} --locked --bins --root /usr/local \
103103
&& /usr/local/bin/plan-to-git --help >/dev/null \
104104
&& /usr/local/bin/plan-to-git --help | grep -q -- "--repo" \

packages/container/tests/core/templates.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ describe("renderDockerfile", () => {
208208
"rtk --version",
209209
"rtk gain >/dev/null 2>&1 || true",
210210
"# Install plan-to-git for multi-agent plan capture and explicit PR sync (issue #397)",
211-
"ADD https://api.github.com/repos/ProverCoderAI/plan-to-git/commits/main /tmp/docker-git-plan-to-git-main.json",
211+
"ADD https://github.com/ProverCoderAI/plan-to-git/commit/main.patch /tmp/docker-git-plan-to-git-main.patch",
212212
"cargo install --git https://github.com/ProverCoderAI/plan-to-git --branch main --locked --bins --root /usr/local",
213213
"/usr/local/bin/plan-to-git --help >/dev/null",
214214
'/usr/local/bin/plan-to-git --help | grep -q -- "--repo"',

packages/lib/src/usecases/auth-claude.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,16 @@ const persistClaudeOauthToken = (
7070
const tokenPath = claudeOauthTokenPath(accountPath)
7171
const tempDir = yield* _(fs.makeTempDirectory({ directory: accountPath, prefix: ".oauth-token-write-" }))
7272
const tempPath = path.join(tempDir, ".oauth-token")
73+
const cleanupTempDir = fs.remove(tempDir, { recursive: true, force: true }).pipe(
74+
Effect.orElseSucceed(() => void 0)
75+
)
7376
yield* _(
7477
Effect.gen(function*(_) {
7578
yield* _(fs.writeFileString(tempPath, formatClaudeOauthTokenFile(token), { mode: claudeOauthTokenFileMode }))
7679
yield* _(fs.chmod(tempPath, claudeOauthTokenFileMode))
7780
yield* _(fs.rename(tempPath, tokenPath))
7881
yield* _(fs.chmod(tokenPath, claudeOauthTokenFileMode))
79-
}).pipe(
80-
Effect.ensuring(fs.remove(tempDir, { recursive: true, force: true }).pipe(Effect.orElseSucceed(() => void 0)))
81-
)
82+
}).pipe(Effect.ensuring(cleanupTempDir))
8283
)
8384
})
8485

0 commit comments

Comments
 (0)