Skip to content

fix(config): resolve undefined variables to empty string#96

Merged
skevetter merged 2 commits into
mainfrom
fix/undefined-vars-empty-string
Apr 24, 2026
Merged

fix(config): resolve undefined variables to empty string#96
skevetter merged 2 commits into
mainfrom
fix/undefined-vars-empty-string

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

  • Per the devcontainer spec, unresolvable variables like ${someUnknownVar} should be replaced with an empty string "" instead of remaining as literals in the output
  • Updated replaceWithContext to add an explicit containerEnv case (preserved for the later SubstituteContainerEnv pass) and changed the default case to return ""
  • Updated replaceWithContainerEnv default case to return "" for any remaining unresolved variables after both substitution passes
  • Added 3 unit tests verifying unknown vars resolve to empty, containerEnv is preserved, and replaceWithContainerEnv handles unknown vars
  • Added e2e test with docker-variables-unknown testdata confirming unknown variables become empty in a real workspace

…iteral

Per the devcontainer spec, unresolvable variables like ${someUnknownVar}
should become empty strings. The replaceWithContext and
replaceWithContainerEnv functions were returning the literal match
string, leaving ${var} tokens in the output. Now unknown variables
resolve to "" while ${containerEnv:...} references are still preserved
for the later SubstituteContainerEnv pass.
@netlify

netlify Bot commented Apr 24, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 82f1da5
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/69eb17f7df09d3000800df2b

@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@skevetter has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 20 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 19 minutes and 20 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7748d83-6d08-4a63-bd3c-7b8d485319d9

📥 Commits

Reviewing files that changed from the base of the PR and between 97f2d96 and 82f1da5.

📒 Files selected for processing (2)
  • pkg/devcontainer/config/substitute.go
  • pkg/devcontainer/config/substitute_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size/s and removed size/m labels Apr 24, 2026
@skevetter
skevetter merged commit 3701855 into main Apr 24, 2026
47 checks passed
@skevetter
skevetter deleted the fix/undefined-vars-empty-string branch April 24, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant