Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/build-devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- main
paths:
- '.devcontainer/**'
- '.github/workflows/build-devcontainer.yml'
workflow_dispatch:

env:
Expand All @@ -31,6 +32,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Read VSCODE_COMMIT from devcontainer.json
id: vscode-commit
run: |
VSCODE_COMMIT=$(grep 'VSCODE_COMMIT' .devcontainer/devcontainer.json | tr -d '"' | cut -d " " -f 2)

Copilot AI Sep 25, 2025

Copy link

Choose a reason for hiding this comment

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

This command assumes a specific format for the VSCODE_COMMIT field in the JSON file. The cut -d " " -f 2 will fail if there are variations in spacing or if the field is formatted differently (e.g., \"VSCODE_COMMIT\":\"value\"). Consider using jq for more reliable JSON parsing: jq -r '.build.args.VSCODE_COMMIT // empty' .devcontainer/devcontainer.json

Suggested change
VSCODE_COMMIT=$(grep 'VSCODE_COMMIT' .devcontainer/devcontainer.json | tr -d '"' | cut -d " " -f 2)
VSCODE_COMMIT=$(jq -r '.build.args.VSCODE_COMMIT // empty' .devcontainer/devcontainer.json)

Copilot uses AI. Check for mistakes.
VSCODE_SHORT=${VSCODE_COMMIT:0:7}
echo "vscode_commit=$VSCODE_COMMIT" >> $GITHUB_OUTPUT
echo "vscode_short=$VSCODE_SHORT" >> $GITHUB_OUTPUT
echo "Full VSCODE_COMMIT: $VSCODE_COMMIT"
echo "Short VSCODE_COMMIT: $VSCODE_SHORT"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -52,6 +63,8 @@ jobs:
type=ref,event=tag
type=sha,prefix={{branch}}-,enable={{is_default_branch}}
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=vscode-${{ steps.vscode-commit.outputs.vscode_short }}
type=raw,value=vscode-${{ steps.vscode-commit.outputs.vscode_short }}-{{sha}}

- name: Extract tag names only
id: tags
Expand Down Expand Up @@ -136,6 +149,8 @@ jobs:
echo "🏷️ Image: ${{ env.IMAGE_NAME }}"
echo "🆔 Tags: ${{ steps.meta.outputs.tags }}"
echo "📝 Labels: ${{ steps.meta.outputs.labels }}"
echo "🔧 VSCode Commit: ${{ steps.vscode-commit.outputs.vscode_commit }}"
echo "📋 Short Commit: ${{ steps.vscode-commit.outputs.vscode_short }}"
echo ""
echo "To use this dev container:"
echo "1. Reference it in your devcontainer.json:"
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ This dev container is automatically built and published to GitHub Container Regi
- `main` - Latest build from main branch
- `main-<commit-sha>` - Specific commit builds from main branch
- `pr-<number>` - Pull request builds for testing
- `vscode-<vscode-commit-sha>` - Builds with specific VS Code versions
- `vscode-<vscode-commit-sha>-<commit-sha>` - Combination of VS Code and git commit
Comment on lines +22 to +23

Copilot AI Sep 25, 2025

Copy link

Choose a reason for hiding this comment

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

There's an inconsistency in the commit SHA format description. Line 123 uses vscode-<commit-sha> while line 22 uses vscode-<vscode-commit-sha>. The format should be consistent throughout the documentation.

Copilot uses AI. Check for mistakes.

**Recommended**: Use `latest` for stable deployments or `main-<commit-sha>` for reproducible builds.

Expand Down Expand Up @@ -64,6 +66,7 @@ This includes:

- **Base**: Ubuntu 24.04 (Noble) via Microsoft's devcontainers base image
- **Python**: System Python with development tools (via devcontainer feature)
- **R**: Full R language support with development tools (via Rocker Project devcontainer feature)
- **Git**: Latest version with configuration support
- **Shell**: Zsh with Oh My Zsh (via common-utils feature)
- **Quarto**: Document publishing platform (latest version)
Expand All @@ -77,6 +80,21 @@ This includes:
- Rainbow CSV
- **VS Code Server**: Pre-installed for immediate development

## 📊 R Language Support

This dev container includes comprehensive R language support through the [Rocker Project's devcontainer features](https://github.com/rocker-org/devcontainer-features). The R feature provides:

### Features Available
- **R Installation**: Latest R version via apt package manager
- **Development Tools**: devtools, renv for package management
- **IDE Integration**:
- languageserver package for VS Code R extension support
- httpgd package for interactive graphics
- rmarkdown for document generation
- **Jupyter Integration**: R kernel for Jupyter notebooks
- **Interactive Console**: radian (enhanced R console with syntax highlighting)
- **Debugging Support**: vscDebugger package for VS Code R debugging

## ⚙️ VS Code Server

The container comes with VS Code Server pre-installed for immediate development. For TRE-specific VS Code Server configuration, see the [SDF TRE Setup Guide](SDF_TRE_SETUP.md).
Expand All @@ -94,10 +112,13 @@ The container is built automatically with smart tagging:

- **Main Branch Pushes**: Creates `latest`, `main`, and `main-<commit-sha>` tags
- **Pull Requests**: Creates `pr-<number>` tags for testing
- **VS Code Commits**: Creates `vscode-<vscode-commit-sha>` and `vscode-<vscode-commit-sha>-<commit-sha>` tags
- **Manual Dispatch**: Available for on-demand builds
- **Platform**: linux/amd64 optimized for development speed

### Tag Strategy
- Use `latest` for the most recent stable release
- Use `main-<commit-sha>` when you need reproducible builds
- Use `pr-<number>` tags to test specific pull request changes
- Use `vscode-<commit-sha>` tags to match specific VS Code versions
- Use `vscode-<commit-sha>-<container-commit-sha>` tags for a combination of VS Code and git commits
Loading