Skip to content

fix(git): rebuild fixture templates the CI cache emptied - #396

Merged
AbysmalBiscuit merged 2 commits into
mainfrom
template-skeleton
Oct 16, 2026
Merged

AbysmalBiscuit merged 2 commits into
mainfrom
template-skeleton

Conversation

@AbysmalBiscuit

Copy link
Copy Markdown
Owner

Agent summary

Problem

CI fails on every OS once Swatinem/rust-cache restores a target saved after #393. Hundreds of tests panic with read template head: NotFound or not a git repository. When rust-cache saves target/, it deletes every file in directories that aren't Cargo profiles but keeps the directories. Each template under target/tmp therefore comes back as an empty skeleton. Template::of sees no head, 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 head is 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

  1. test a_template_emptied_to_its_directories_is_rebuilt, failing on the test-only commit and passing with the fix

🤖 Generated with Claude Opus 5.5 via Claude Code

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T16:39:33.677096Z e615946 PR opened
ℹ️ 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" or "@codex security review".

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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/devkit-git/src/template.rs

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ 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.

P1 Badge 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.

@github-actions
github-actions Bot dismissed their stale review October 16, 2026 16:42

Superseded by the review of 57317a5

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ 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.

@AbysmalBiscuit
AbysmalBiscuit merged commit 577479f into main Oct 16, 2026
23 checks passed
@AbysmalBiscuit
AbysmalBiscuit deleted the template-skeleton branch October 16, 2026 17:00
AbysmalBiscuit added a commit that referenced this pull request Oct 16, 2026
🤖 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant