Skip to content

Conversation

@stewartadam
Copy link
Member

Pull Request

Description

Captures learnings from recent customer projects to enhance the build speed and launch reliability of the dev container.

  • removes unused Python feature from container, which was causing compilation of Python on build
  • add volume mounts for node_modules and user config for better I/O performance
  • normalize workspace mount to /workspace for consistency across environments
  • add CA certificate injection for corporate TLS inspection (ZScaler, etc.)
  • add git config include parsing workaround for devcontainer identity issues
  • add containerEnv vars for pip, nodejs, and uv SSL certificate bundles

Related Issue(s)

Type of Change

Select all that apply:

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with prompt-builder agent and addressed all feedback
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)

Note for AI Artifact Contributors:

  • Agents: Research, indexing/referencing other project (using standard VS Code GitHub Copilot/MCP tools), planning, and general implementation agents likely already exist. Review .github/agents/ before creating new ones.
  • Skills: Must include both bash and PowerShell scripts. See Skills.
  • Model Versions: Only contributions targeting the latest Anthropic and OpenAI models will be accepted. Older model versions (e.g., GPT-3.5, Claude 3) will be rejected.
  • See Agents Not Accepted and Model Version Requirements.

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Sample Prompts (for AI Artifact Contributions)

User Request:

Execution Flow:

Output Artifacts:

Success Indicators:

For detailed contribution requirements, see:

Testing

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)
  • Tests added for new functionality (if applicable)

AI Artifact Contributions

  • Used /prompt-analyze to review contribution
  • Addressed all feedback from prompt-builder review
  • Verified contribution follows common standards and type-specific requirements

Required Automated Checks

The following validation commands must pass before merging:

  • Markdown linting: npm run lint:md
  • Spell checking: npm run spell-check
  • Frontmatter validation: npm run lint:frontmatter
  • Link validation: npm run lint:md-links
  • PowerShell analysis: npm run lint:ps

Security Considerations

  • This PR does not contain any sensitive or NDA information
  • Any new dependencies have been reviewed for security issues
  • Security-related scripts follow the principle of least privilege

Additional Notes

stewartadam and others added 6 commits January 27, 2026 10:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 11, 2026 00:27
@stewartadam stewartadam requested a review from a team as a code owner February 11, 2026 00:27
@stewartadam
Copy link
Member Author

Follow up to #119.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.19%. Comparing base (8133b36) to head (2323b86).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #472      +/-   ##
==========================================
- Coverage   76.22%   76.19%   -0.03%     
==========================================
  Files          20       20              
  Lines        3503     3503              
==========================================
- Hits         2670     2669       -1     
- Misses        833      834       +1     
Flag Coverage Δ
pester 76.19% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves devcontainer build/attach performance and reliability by removing unneeded features, standardizing the workspace path, and adding volume mounts and git-config handling for better cross-environment behavior.

Changes:

  • Standardize devcontainer workspace to /workspace and add volumes for user config + node_modules.
  • Add post-create ownership workaround for mounted volumes and a post-attach git identity reconfiguration step.
  • Add repository-level ignores/attributes to support the new devcontainer flow (gitconfig exports, dockerignore, line ending rules).

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.gitignore Ignores generated gitconfig export files used by the devcontainer attach workaround.
.gitattributes Adds explicit checkout line-ending rules for scripts and Dockerfiles.
.dockerignore Excludes .git and node_modules from Docker build contexts for speed/smaller contexts.
.devcontainer/scripts/post-create.sh Adds volume ownership fix step and installs Node dependencies during container setup.
.devcontainer/scripts/post-attach.sh Applies exported git identity settings inside the container after attach.
.devcontainer/devcontainer.json Normalizes workspace mount/folder, adds volumes, removes unused features, and wires initialize/postAttach commands.
.devcontainer/README.md Updates documented toolset and troubleshooting guidance to match the new devcontainer behavior.

Comment on lines +6 to +9
*.ps1 text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf

Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Setting *.ps1 to eol=crlf will break direct execution on Linux/macOS when scripts rely on their #!/usr/bin/env pwsh shebang (the \r yields /usr/bin/env^M: bad interpreter). Repo docs show running these scripts as ./scripts/.../*.ps1. Consider removing the forced CRLF for *.ps1 (or switching to eol=lf) to keep cross-platform executability.

Suggested change
*.ps1 text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
## Cross-platform PowerShell scripts - use LF for shebang compatibility
*.ps1 text eol=lf

Copilot uses AI. Check for mistakes.
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
// Rename the mount to /workspace for a predictable workspace paths in our scripts.
// The source path might also contain special characters, so it needs escaped double quotes.
"workspaceMount": "\"source=${localWorkspaceFolder}\",target=/workspace,type=bind",
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

workspaceMount includes literal quotes around the source= value. Docker’s --mount parser treats those quotes as part of the path, which can cause the bind mount to fail and prevent the devcontainer from starting. Consider removing the embedded quotes and relying on the mount string being passed as a single argument (spaces in paths are already handled).

Suggested change
"workspaceMount": "\"source=${localWorkspaceFolder}\",target=/workspace,type=bind",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",

Copilot uses AI. Check for mistakes.
Comment on lines +30 to 33
}

npm_install() {
echo "Installing NPM dependencies..."
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

This script switches from npm ci to npm install. Since the repo includes a package-lock.json, npm ci is the reproducible and typically faster choice for container provisioning; npm install may modify the lockfile and produce non-deterministic installs. Consider using npm ci here.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +22
fi

echo "Setting volume ownership for $volume_path"
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The volume ownership workaround uses sudo chown without -R and without non-interactive mode. If the volume already contains root-owned files, ownership may remain incorrect; and if sudo ever prompts, postCreateCommand can hang. Consider using recursive ownership and sudo -n (fail fast) for this step.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
#!/usr/bin/env bash
set -euo pipefail

Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

This script doesn’t follow the structure used by the other devcontainer scripts in this repo (header comment + main() entrypoint). For consistency and easier maintenance, consider adding the standard header and wrapping execution in a main() function called at the end (see .devcontainer/scripts/on-create.sh).

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +17
while IFS='=' read -r key value; do
local key value
case "$key" in
user.name | user.email | user.signingkey | commit.gpgsign)
echo "Set Git config ${key}=${value}"
git config --global "$key" "$value"
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Inside the while read loop, local key value is declared after the variables are populated and is re-declared on every iteration. Consider declaring the locals once at the start of the function (before the loop) and then only assigning within the loop; this avoids confusing scoping and is more ShellCheck-friendly.

Copilot uses AI. Check for mistakes.
Copy link
Member

@WilliamBerryiii WilliamBerryiii left a comment

Choose a reason for hiding this comment

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

Looking sharp

}
},
// This is to ensure support for config includes is properly handled, see microsoft/vscode-remote-release#2084
"initializeCommand": {
Copy link
Member

Choose a reason for hiding this comment

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

initializeCommand is exporting every global config key, not just identity fields but you only need: user.name, user.email, user.signingkey, commit.gpgsign, right?

{
"type": "volume",
"source": "${devcontainerId}-userconfig",
"target": "/home/vscode/.config"
Copy link
Member

Choose a reason for hiding this comment

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

should this just be the /home/vscode/.config/gh folder?

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
Copy link
Member

Choose a reason for hiding this comment

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

Can you set the SPDX and license header?

# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT

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.

3 participants