Skip to content

fix(sim-setup): quote env values containing $ so dotenv, Bun, and Compose don't expand them - #9861

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/sim-setup-env-dollar
Nov 10, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/sim-setup-env-dollar

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • sim-setup wrote env values containing $ unquoted (SMTP_PASSWORD=pa$$word). Next's dotenv, Bun, and Docker Compose all expand $NAME in unquoted values, so a password or API key containing $ was silently corrupted and auth failed with no error
  • Single quotes don't fix it: Next and Bun expand $NAME even inside single quotes. Values containing $ are now written as "…\$…", the one form Next, Bun, and Compose all read literally; a value that also has a double quote, backslash, or backtick is refused with a clear message instead of written in a form that would expand
  • parseValue unescapes \$ in double-quoted values so sim-setup reads its own writes back unchanged

Type of Change

  • Bug fix

Testing

  • packages/sim-setup/src/env-files.test.ts: the written file is loaded through @next/env loadEnvConfig for pa$$word, key$HOME, key${HOME}suffix, it's $5, plus a parseEnv round-trip; all 5 new cases fail on the pre-PR code (and on a single-quote attempt) and pass now, 15/15
  • Bun and a real docker compose run with env_file checked by hand against the same written file: every value read literally
  • biome on the changed files; full type-check, audits, and suite left to CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 10, 2026 11:31pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issue was found.

Summary

sim-setup now writes dollar-containing values inside double quotes with each $ escaped.

  • Environment values keep their dollar signs when setup writes them.

Reviews (2) · Last reviewed commit: "fix(sim-setup): write $ as \$ in double ..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

This branch was previously deployed

1 inactive deployment
Preview — 3590acce Deployed Nov 10, 2026 by vercel[bot]
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