Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
4d060c0
feat(099): implement browser-based VS Code extension preview (Phase 1)
claude Feb 20, 2026
78dd9c4
docs: add research note on code-server E2E testing in cloud sessions
claude Feb 20, 2026
3470727
docs: focus code-server research on Docker path that mirrors Heroku
claude Feb 20, 2026
6377ce9
Merge remote-tracking branch 'origin/main' into claude/implement-spec…
claude Feb 20, 2026
421dcbc
evidence(099): add code-server screenshot for PR
claude Feb 20, 2026
40f92a5
fix(099): move Dockerfile to repo root for Heroku build context
claude Feb 20, 2026
903d7e6
fix(099): multi-stage Docker build to compile .vsix from source
claude Feb 20, 2026
e930d2a
fix: upgrade vsix-builder to Node 20 for undici compatibility
claude Feb 20, 2026
daa5528
fix: install vsix extension as coder user so code-server finds it
claude Feb 20, 2026
9d15fa5
fix: add extension install diagnostics and open workspace file
claude Feb 21, 2026
07b0fe1
fix: add .dockerignore and simplify build verification
claude Feb 21, 2026
9f2e2fc
fix: collapse vsix-builder into single RUN to prevent Heroku OOM
claude Feb 21, 2026
bdfb92e
fix: chown vsix file so coder user can delete it after install
claude Feb 21, 2026
fd2026f
fix: improve extension loading in code-server
claude Feb 21, 2026
8a5940a
fix: install extension at runtime to fix code-server discovery (coder…
claude Feb 21, 2026
3e6fd37
fix: nonce-based CSP for webviews + pre-seed STAC store in preview
claude Feb 21, 2026
a441dca
chore: tidy preview logging and remove --log trace
claude Feb 21, 2026
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
34 changes: 34 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Dockerfile.preview build context exclusions
# Heroku builds from git, but these further reduce context size

# Version control
.git
.github

# Development environments
.venv
.pytest_cache
.specify
.claude
.vscode

# Local node_modules (rebuilt inside Docker)
node_modules
**/node_modules

# Build artifacts (rebuilt inside Docker)
**/dist
**/*.vsix

# Documentation not needed at runtime
docs
specs
*.md
!preview/workspace/WELCOME.md

# Test files
**/__tests__
**/*.test.*
**/*.spec.*
**/playwright-report
**/test-results
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions Dockerfile.preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Browser-based VS Code Extension Preview
# Runs code-server with the Debrief extension and sample data pre-installed.
#
# Build: docker build -t debrief-preview -f Dockerfile.preview .
# Run: docker run -p 8080:8080 -e PORT=8080 debrief-preview
#
# Heroku Review Apps: heroku.yml points here. Heroku sets $PORT automatically.

# ---------------------------------------------------------------------------
# Stage 1: Build the VS Code extension .vsix from source
# ---------------------------------------------------------------------------
FROM node:20-slim AS vsix-builder

RUN npm install -g pnpm@9

WORKDIR /build

# Copy workspace config and all source upfront
# (Heroku has no Docker layer cache, so separate COPY-for-cache is pointless)
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY shared/schemas/ ./shared/schemas/
COPY shared/components/ ./shared/components/
COPY shared/utils/ ./shared/utils/
COPY shared/config-ts/package.json ./shared/config-ts/
COPY services/session-state/ ./services/session-state/
COPY apps/vscode/ ./apps/vscode/
COPY apps/loader/package.json ./apps/loader/
COPY apps/web-shell/package.json ./apps/web-shell/

# Install, build, package, then delete node_modules — all in ONE layer.
# Docker commits layer diffs: creating + deleting node_modules in the same
# RUN means Docker never snapshots the ~500MB node_modules directory.
# This prevents OOM on Heroku's constrained build dynos.
RUN pnpm install --filter debrief-vscode... --no-frozen-lockfile && \
pnpm --filter debrief-vscode... build && \
cd apps/vscode && npx @vscode/vsce package --no-dependencies && \
cd /build && \
rm -rf node_modules

# ---------------------------------------------------------------------------
# Stage 2: Final image with code-server + Python services + extension
# ---------------------------------------------------------------------------
FROM codercom/code-server:latest

USER root

# Install Python 3.11 and system dependencies for Debrief services
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 \
python3.11-venv \
python3-pip \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install uv for Python package management
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"

# Copy Python service sources
COPY services/io /workspace/services/io
COPY services/stac /workspace/services/stac
COPY services/calc /workspace/services/calc
COPY shared/schemas /workspace/shared/schemas

# Install Python services in a virtual environment
WORKDIR /workspace
RUN uv venv /opt/debrief-venv && \
VIRTUAL_ENV=/opt/debrief-venv uv pip install \
./shared/schemas \
./services/io \
./services/stac \
./services/calc
ENV PATH="/opt/debrief-venv/bin:$PATH"

# Copy preview workspace with sample data
COPY preview/workspace /workspace/preview
COPY preview/entrypoint.sh /opt/entrypoint.sh
RUN chmod +x /opt/entrypoint.sh

# Keep the .vsix in the image — the entrypoint installs it at runtime.
# code-server's --install-extension at build time writes to extensions.json,
# but this manifest can be lost at runtime (known issue: coder/code-server#7326).
# Installing at container startup guarantees the extensions.json is fresh.
USER coder
COPY --chown=coder:coder --from=vsix-builder /build/apps/vscode/*.vsix /opt/debrief.vsix

ENV PORT=8080
EXPOSE 8080

ENTRYPOINT ["/opt/entrypoint.sh"]
22 changes: 22 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,28 @@ tasks:
- task: lint
- task: test

preview:build:
desc: "Build the preview container (code-server + Debrief extension)"
preconditions:
- sh: command -v docker
msg: "Docker not found. Install Docker to build the preview container."
cmds:
- docker build -t debrief-preview -f Dockerfile.preview .

preview:run:
desc: "Run the preview container locally (http://localhost:8080)"
preconditions:
- sh: docker image inspect debrief-preview >/dev/null 2>&1
msg: "Preview image not built. Run 'task preview:build' first."
cmds:
- docker run --rm -p 8080:8080 -e PORT=8080 debrief-preview

preview:package:
desc: "Package the VS Code extension as .vsix"
deps: [build]
cmds:
- cd apps/vscode && npx vsce package --no-dependencies

clean:
desc: "Remove build artifacts and caches"
cmds:
Expand Down
17 changes: 17 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "debrief-preview",
"description": "Browser-based VS Code extension preview for Debrief PRs",
"stack": "container",
"formation": {
"web": {
"quantity": 1,
"size": "basic"
}
},
"environments": {
"review": {
"scripts": {},
"addons": []
}
}
}
12 changes: 12 additions & 0 deletions apps/vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.vscode/**
src/**
e2e/**
**/*.test.ts
**/*.spec.ts
tsconfig.json
vitest.config.ts
playwright.config.ts
.eslintrc.*
.prettierrc*
CHANGELOG.md
node_modules/**
1 change: 1 addition & 0 deletions apps/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"directory": "apps/vscode"
},
"activationEvents": [
"onStartupFinished",
"onFileSystem:stac",
"onView:debrief.stacExplorer",
"onCommand:debrief.openPlot"
Expand Down
Loading
Loading