GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(core): support {env:VAR:-fallback} defaults in config substitution by dezren39 · Pull Request #232 · developing-today-forks/opencode Conversation
|
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit details
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. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: d2cd1f03e9
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| If the environment variable is not set, it will be replaced with an empty string. | ||
|
|
||
| Add a default with `{env:VARIABLE_NAME:-fallback}` to substitute a fallback value instead when the variable is unset or empty: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Document the fallback in the deployed docs tree
This addition will not reach the published documentation: .github/workflows/deploy-www.yml:28-36 builds and deploys services/www, whose loader reads services/www/src/docs/content (services/www/src/content.config.ts:5-10), while that tree's config.mdx still only documents the empty-string behavior. Move or duplicate this section into the deployed config guide so users can discover the new syntax.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const env = (escape: boolean) => | ||
| input.text.replace(/\{env:([^}]+)\}/g, (_, name: string) => { | ||
| const value = (input.env?.[name] ?? process.env[name]) || "" | ||
| input.text.replace(/\{env:([^}]+)\}/g, (_, token: string) => { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Preserve braces that occur inside fallback values
When an unset variable's fallback contains a closing brace before the end, this regex terminates the placeholder at that brace and effectively moves it to the end of the fallback. For example, the supported unquoted-fragment form {env:X:-{"nested":{"enabled":true},"other":1}} silently becomes {"nested":{"enabled":true,"other":1}}, changing the configuration's structure while remaining valid JSON. Parse the placeholder in a way that preserves nested or otherwise embedded braces in fallback values.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.