Skip to content

feat(codemods): require clean Git worktree - #15782

Open
NuroDev wants to merge 3 commits into
mainfrom
NuroDev/codemod-clean-worktree
Open

NuroDev wants to merge 3 commits into
mainfrom
NuroDev/codemod-clean-worktree

Conversation

@NuroDev

@NuroDev NuroDev commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Add a clean Git worktree guard before codemods run. Staged, unstaged, and untracked changes now stop write operations by default, while --force provides an explicit bypass. Directories outside a Git worktree and dry runs continue to work.

The guard ignores inherited Git repository-selection environment variables, ensuring it always checks the requested target directory.

This also declares the generated Cloudflare configuration types as Turbo build outputs so cached fixture builds restore everything needed by typechecking.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: CLI help and the package README are updated.

Validation:

  • Package tests pass
  • Package source and test type checks pass
  • Package build, lint, and formatting checks pass
  • Full repository check passes

Note

This is a contribution from an AI agent: Codex, GPT-5.


Devin Review

@changeset-bot

changeset-bot Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ea5e732

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/codemods Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

ask-bonk[bot]

This comment was marked as resolved.

@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

Adds a clean-worktree guard and package module entrypoint.

Posted 1 inline suggestion.

github run

@devin-ai-integration devin-ai-integration Bot 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.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@workers-devprod
workers-devprod requested review from a team and tpmmorris and removed request for a team September 22, 2026 17:38
@workers-devprod

workers-devprod commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@pkg-pr-new

pkg-pr-new Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15782

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15782

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15782

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15782

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@15782

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15782

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15782

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15782

miniflare

npm i https://pkg.pr.new/miniflare@15782

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15782

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15782

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@15782

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15782

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15782

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15782

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15782

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15782

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15782

wrangler

npm i https://pkg.pr.new/wrangler@15782

commit: ea5e732

@NuroDev NuroDev self-assigned this Sep 22, 2026
@NuroDev
NuroDev force-pushed the NuroDev/codemod-clean-worktree branch from bd537c3 to 325e193 Compare September 22, 2026 17:40
@NuroDev
NuroDev added this pull request to stack #15785 September 22, 2026 17:42
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@NuroDev
NuroDev force-pushed the NuroDev/codemod-clean-worktree branch 2 times, most recently from 8bbb440 to 616cea5 Compare September 23, 2026 09:27

@tpmmorris tpmmorris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Comment thread packages/codemods/src/git.ts

@workers-devprod workers-devprod 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.

Codeowners reviews satisfied

@NuroDev
NuroDev force-pushed the NuroDev/codemod-clean-worktree branch 3 times, most recently from 7c51596 to 8ddbe6c Compare September 24, 2026 13:12
@NuroDev
NuroDev removed this pull request from stack #15785 September 24, 2026 14:58
@NuroDev
NuroDev added this pull request to stack #15839 September 24, 2026 14:58
@NuroDev
NuroDev force-pushed the NuroDev/codemod-clean-worktree branch from 8ddbe6c to 7b8a305 Compare September 24, 2026 15:04
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@NuroDev
NuroDev force-pushed the NuroDev/codemod-clean-worktree branch from 1b42429 to 808327b Compare September 24, 2026 16:27
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@NuroDev

NuroDev commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

Devin is just nit picking forever now. I'm going to just do this myself.

@NuroDev
NuroDev marked this pull request as draft September 24, 2026 17:05
@NuroDev
NuroDev force-pushed the NuroDev/codemod-clean-worktree branch 2 times, most recently from 3297a9e to 7b8a305 Compare September 24, 2026 17:12
@NuroDev
NuroDev force-pushed the NuroDev/codemod-clean-worktree branch from 7b8a305 to ea5e732 Compare September 24, 2026 17:41
@NuroDev
NuroDev marked this pull request as ready for review September 24, 2026 17:48

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 2 new potential issues.

Devin Review

Comment thread packages/codemods/src/git.ts
Comment thread .changeset/clean-codemods-check.md
@NuroDev
NuroDev removed this pull request from stack #15839 September 24, 2026 18:00
@NuroDev
NuroDev added this pull request to stack #15854 September 24, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants