Skip to content

refactor(devcontainer): support local environment overrides - #433

Merged
plexoos merged 1 commit into
mainfrom
update-env-docs
Aug 3, 2026
Merged

refactor(devcontainer): support local environment overrides#433
plexoos merged 1 commit into
mainfrom
update-env-docs

Conversation

@plexoos

@plexoos plexoos commented Aug 1, 2026

Copy link
Copy Markdown
Member

Move the tracked Dev Container build defaults from the repository-level .env file to .devcontainer/.env.defaults.

Generate an ignored .env.compose during initializeCommand by copying the defaults and appending optional values from .env.local. Point .devcontainer/.env at the generated file so Compose discovers the merged configuration without requiring an extra setup command.

Ignore root-level .env variants in Git and Docker build contexts, document dependency overrides and per-checkout Compose project names, and broaden the editor guidance to IDEs implementing the Development Container Specification.

Move the tracked Dev Container build defaults from the repository-level .env file to .devcontainer/.env.defaults.

Generate an ignored .env.compose during initializeCommand by copying the defaults and appending optional values from .env.local. Point .devcontainer/.env at the generated file so Compose discovers the merged configuration without requiring an extra setup command.

Ignore root-level .env variants in Git and Docker build contexts, document dependency overrides and per-checkout Compose project names, and broaden the editor guidance to IDEs implementing the Development Container Specification.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b54e192188

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

checkout_name=$(basename -- "${repo_root}")

cp "${repo_root}/.devcontainer/.env.defaults" "${compose_env}"
printf '\nCOMPOSE_PROJECT_NAME=simphony-%s-%s\n' ${user_name} ${checkout_name} >> ${compose_env}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Quote the Compose environment redirection

When the checkout resides in a path containing whitespace, ${compose_env} expands into multiple redirection words, so Bash exits with ambiguous redirect under set -e before .env.compose is populated. This makes devcontainer up unable to initialize for such checkouts; quote the redirection target and the two printf arguments.

Useful? React with 👍 / 👎.

Copilot AI 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.

Pull request overview

Refactors the Dev Container environment configuration to support per-checkout local overrides by moving tracked defaults into .devcontainer/.env.defaults and generating a merged Compose env file during initialization.

Changes:

  • Move default dependency version settings into .devcontainer/.env.defaults and update docs accordingly.
  • Add an initialization script and hook it from devcontainer.json to generate a merged env file.
  • Ignore root-level .env.* variants in Git and Docker build contexts.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Updates guidance to reference .devcontainer/.env.defaults and local override flow.
docs/getting-started.md Documents .env.local overrides, generated .env.compose, and project-name configuration.
.gitignore Ignores root .env.* variants to prevent accidental commits of local env files.
.dockerignore Excludes .env.* from Docker build context.
.devcontainer/initialize-compose-env.sh New script to assemble merged Compose env configuration at init time.
.devcontainer/devcontainer.json Runs the new init script via initializeCommand.
.devcontainer/.env.defaults Adds the tracked default OS/toolchain version settings for Dev Container builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +15
compose_env="${repo_root}/.env.compose"
user_name=${USER:-$(id -un)}
checkout_name=$(basename -- "${repo_root}")

cp "${repo_root}/.devcontainer/.env.defaults" "${compose_env}"
printf '\nCOMPOSE_PROJECT_NAME=simphony-%s-%s\n' ${user_name} ${checkout_name} >> ${compose_env}
if [[ -f "${repo_root}/.env.local" ]]; then
printf '\n' >> "${compose_env}"
cat "${repo_root}/.env.local" >> "${compose_env}"
fi
@plexoos
plexoos merged commit 08e6fec into main Aug 3, 2026
24 checks passed
@plexoos
plexoos deleted the update-env-docs branch August 3, 2026 19:25
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.

2 participants