Skip to content

fix(config): preserve colons in variable substitution default values#94

Merged
skevetter merged 1 commit into
mainfrom
fix/varsub-env-default
Apr 24, 2026
Merged

fix(config): preserve colons in variable substitution default values#94
skevetter merged 1 commit into
mainfrom
fix/varsub-env-default

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

  • Fix variable substitution bug where ${localEnv:VAR:http://proxy:8080} was truncated to just http because args[1] only took the first segment after splitting on colons. Now uses strings.Join(args[1:], ":") to rejoin the full default value.
  • Add unit tests for lookupValue covering set/unset vars, simple defaults, and colon-containing defaults, plus an end-to-end ResolveString test.
  • Add e2e test verifying default substitution in a real workspace with both simple and colon-containing defaults.

Fixes #9

)

When the default value in ${localEnv:VAR:default} contains colons (e.g.,
http://proxy:8080), only the first segment was returned because args[1]
discards everything after the first colon. Use strings.Join(args[1:], ":")
to rejoin the full default value.
@netlify

netlify Bot commented Apr 24, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit ddfc1a4
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/69eb001dc4e8e5000810b14c

@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 14 minutes and 2 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 14 minutes and 2 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: 1f1a48f0-e518-45f5-899e-17beee34dc3a

📥 Commits

Reviewing files that changed from the base of the PR and between 893db05 and ddfc1a4.

📒 Files selected for processing (4)
  • e2e/tests/up/provider_docker.go
  • e2e/tests/up/testdata/docker-variables-defaults/.devcontainer.json
  • 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.

@skevetter
skevetter merged commit 97f2d96 into main Apr 24, 2026
83 of 84 checks passed
@skevetter
skevetter deleted the fix/varsub-env-default branch April 24, 2026 06:19
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