Skip to content

fix: Guard against missing pipeline key in clean-globs codemod#12235

Merged
anthonyshew merged 2 commits intomainfrom
fix/clean-globs-missing-pipeline
Mar 11, 2026
Merged

fix: Guard against missing pipeline key in clean-globs codemod#12235
anthonyshew merged 2 commits intomainfrom
fix/clean-globs-missing-pipeline

Conversation

@anthonyshew
Copy link
Copy Markdown
Contributor

@anthonyshew anthonyshew commented Mar 11, 2026

Summary

Several codemod transforms crash with TypeError: Cannot convert undefined or null to object when turbo.json has no pipeline key (e.g., already migrated to tasks, or simply absent).

The isPipelineKeyMissing utility exists for exactly this purpose, but several transforms weren't using it.

Changes

  • clean-globsmigrateConfig called Object.entries(config.pipeline) unconditionally. Added isPipelineKeyMissing guard.
  • rename-output-mode — Same issue. Added isPipelineKeyMissing guard to migrateConfig.
  • rename-pipelinemigrateConfig destructured pipeline without checking, producing { tasks: undefined }. Added isPipelineKeyMissing guard.
  • migrate-dot-env — Workspace config loop called migrateConfig unconditionally. Added "pipeline" in config || "tasks" in config guard (this transform uses forEachTaskDef which handles both keys).

Testing

Added a test fixture and test case for clean-globs with a missing pipeline key. All 36 tests across the 4 affected transforms pass.

@anthonyshew anthonyshew requested a review from a team as a code owner March 11, 2026 01:44
@anthonyshew anthonyshew requested review from tknickman and removed request for a team March 11, 2026 01:44
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am
examples-vite-web Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am
turbo-site Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am
turborepo-agents Ready Ready Preview, Comment, Open in v0 Mar 11, 2026 1:56am

@anthonyshew anthonyshew changed the title fix: Guard against missing pipeline key in clean-globs codemod fix: Guard against missing pipeline key in clean-globs codemod Mar 11, 2026
Comment thread packages/turbo-codemod/src/transforms/clean-globs.ts Outdated
@anthonyshew anthonyshew enabled auto-merge (squash) March 11, 2026 01:55
@anthonyshew anthonyshew merged commit 10386ae into main Mar 11, 2026
46 checks passed
@anthonyshew anthonyshew deleted the fix/clean-globs-missing-pipeline branch March 11, 2026 02:01
github-actions Bot added a commit that referenced this pull request Mar 11, 2026
## Release v2.8.16

Versioned docs: https://v2-8-16.turborepo.dev

### Changes

- docs: Remove CONSOLE DO NOT TRACK link (#12232) (`5bd21fb`)
- release(turborepo): 2.8.16-canary.1 (#12233) (`e03a168`)
- docs: missing `migrate` word (#12234) (`3f7edba`)
- fix: Guard against missing `pipeline` key in `clean-globs` codemod
(#12235) (`10386ae`)

---------

Co-authored-by: Turbobot <turbobot@vercel.com>
github-actions Bot added a commit that referenced this pull request Mar 11, 2026
## Release v2.8.17-canary.1

Versioned docs: https://v2-8-17-canary-1.turborepo.dev

### Changes

- docs: Remove CONSOLE DO NOT TRACK link (#12232) (`5bd21fb`)
- release(turborepo): 2.8.16-canary.1 (#12233) (`e03a168`)
- docs: missing `migrate` word (#12234) (`3f7edba`)
- fix: Guard against missing `pipeline` key in `clean-globs` codemod
(#12235) (`10386ae`)
- release(turborepo): 2.8.16 (#12236) (`5c90bba`)
- ci: Create GitHub Releases directly in release pipeline (#12237)
(`9c0ec69`)
- refactor: Replace Bun binary with tsdown + esbuild in `@turbo/gen`
(#12240) (`6520a23`)
- fix: Remove stale build-gen references from release workflow (#12241)
(`ecba351`)

Co-authored-by: Turbobot <turbobot@vercel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant