Repository navigation
fix(git): rebuild fixture templates the CI cache emptied - #396
Conversation
rust-cache deletes every file under target/tmp when it saves the target and keeps the directories, so a restored run finds each template as a skeleton with no head and no repository. Template::of then hands back the skeleton and every test that copies it fails. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
A template directory without its head file is not one a builder finished, since builders publish complete directories by rename. Templates are numbered and every process walks the same numbers, so a skeleton is skipped for the next number instead of being handed out. A process that cannot publish what it built uses its own copy. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e615946f9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
⚡ Grok Review
Reviewed commit: e615946f9b
❌ Patch is incorrect: 1 finding.
The added test fails because Template::of still returns an emptied directory when rename cannot replace it, so callers keep panicking on a missing template head.
Rebuild a template whose head file is gone
crates/devkit-git/src/template.rs#L40-L70
After rust-cache restores target/tmp, each template directory remains as an empty skeleton with no head file. Template::of sees that head is missing, builds a fresh copy, then std::fs::rename fails because the destination is a non-empty directory. It deletes the copy it just built and returns the skeleton, so head() panics with read template head: NotFound and later git calls fail with not a git repository. Callers in tests/common/ghfake.rs, tests/docm_cli.rs, and crates/devkit-docs/tests/common/mod.rs all go through this path. Skip a directory that has no head, and if publishing the built copy fails while no complete template is in its place, return the copy that was just built.
Superseded by the review of 57317a5
There was a problem hiding this comment.
⚡ Grok Review
Reviewed commit: 57317a5e13
✅ No issues found.
The emptied-template rebuild skips a directory that has no head file, publishes the next numbered copy, and falls back to the built copy when rename fails, so existing callers and tests still receive a usable fixture.
🤖 I have created a release *beep* *boop* --- ## [0.14.23](v0.14.22...v0.14.23) (2026-10-16) ### Features * **pr:** check repro items red to green ([#383](#383)) ([2df9708](2df9708)) * **pr:** flag weakened tests between base and head ([#358](#358)) ([370a637](370a637)) * **pr:** require a passing verify run at HEAD ([#375](#375)) ([e557d03](e557d03)) * **tasks:** record every devrun task run ([#357](#357)) ([c64ebff](c64ebff)) * **ticket:** check ticket fields on MCP writes and discover them ([#377](#377)) ([d0e753d](d0e753d)) * **ticket:** create and edit Linear tickets ([#376](#376)) ([37a0289](37a0289)) * **ticket:** declare ticket fields and write them on GitHub ([#366](#366)) ([8f74838](8f74838)) * **todo:** install a todo shim for devkit todo ([#353](#353)) ([d9dfb2f](d9dfb2f)) * **todo:** name todos readably in messages ([#391](#391)) ([0cb1e29](0cb1e29)) * **todo:** promote a todo to a ticket ([#388](#388)) ([8f961ae](8f961ae)) * **todo:** push ticket parents and blockers ([#384](#384)) ([a14d187](a14d187)) * **todo:** push ticket status changes to the tracker ([#381](#381)) ([06fdaf2](06fdaf2)) * **todo:** refresh tickets and move them on todo changes ([#367](#367)) ([c6e7566](c6e7566)) * **todo:** resolve ticket keys and word names as ids ([#389](#389)) ([e161dfb](e161dfb)) * **todo:** show readable todo names in listings ([#390](#390)) ([362aad5](362aad5)) * **todo:** sync GitHub tickets into the todo store ([#359](#359)) ([8a897af](8a897af)) * **tracker:** sync Linear tickets into the todo store ([#369](#369)) ([916bad4](916bad4)) ### Bug Fixes * **deps:** bump rustls to 0.23.46 ([#361](#361)) ([4bf0dc0](4bf0dc0)) * **git:** rebuild fixture templates the CI cache emptied ([#396](#396)) ([577479f](577479f)) * **rules:** readers no longer wait on a cache refresh ([#394](#394)) ([5d9ca92](5d9ca92)) * windows probe, console and stdio defects slowing CI ([#393](#393)) ([2ba4653](2ba4653)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Agent summary
Problem
CI fails on every OS once
Swatinem/rust-cacherestores a target saved after #393. Hundreds of tests panic withread template head: NotFoundornot a git repository. When rust-cache savestarget/, it deletes every file in directories that aren't Cargo profiles but keeps the directories. Each template undertarget/tmptherefore comes back as an empty skeleton.Template::ofsees nohead, builds a fresh copy, fails to rename it over the non-empty skeleton, throws its own copy away, and returns the skeleton.Change
A template directory without
headis passed over instead of returned. Templates are numbered, and every process walks the same numbers, so they still agree on one complete template. When publishing a built template fails and no complete one is in its place, the process uses the copy it built.Proof
🤖 Generated with Claude Opus 5.5 via Claude Code