Skip to content

Add devcontainer configuration#68

Merged
neekolas merged 1 commit intoxmtp:mainfrom
xmtp-coder-agent:fix/issue-67
Mar 24, 2026
Merged

Add devcontainer configuration#68
neekolas merged 1 commit intoxmtp:mainfrom
xmtp-coder-agent:fix/issue-67

Conversation

@xmtp-coder-agent
Copy link
Copy Markdown
Collaborator

@xmtp-coder-agent xmtp-coder-agent commented Mar 24, 2026

Resolves #67

Summary

  • Adds .devcontainer/devcontainer.json and dev/docker/devcontainer.Dockerfile following the xmtpd devcontainer pattern
  • Includes: Go 1.25, golangci-lint v2, buf CLI, gopls (via Go VS Code extension), shellcheck, Docker-in-Docker (non-Moby), and GitHub CLI
  • Verified the devcontainer builds successfully using the devcontainer CLI

What's included

  • Go 1.25 — matches go.mod
  • golangci-lint v2 — compatible with the v2 config in dev/.golangci.yaml
  • Buf CLI — for proto generation (dev/gen-proto)
  • Gopls — via the golang.go VS Code extension
  • Shellcheck — for dev/lint-shellcheck
  • Docker-in-Docker (non-Moby) — for ./dev/up and integration tests
  • GitHub CLI — for workflow interactions

Test plan

  • devcontainer build --workspace-folder . completes successfully

🤖 Generated with Claude Code

Note

Add VS Code Dev Container configuration for Go development

  • Adds devcontainer.json configuring a VS Code Dev Container with Go language server support, the golang.go and ms-azuretools.vscode-docker extensions, and go mod tidy as a post-create command.
  • Adds devcontainer.Dockerfile based on golang:1.25, installing golangci-lint v2.1.6, buf, shellcheck, and jq.
  • Enables docker-in-docker (without Moby) and GitHub CLI as Dev Container features, with a vscode remote user.

Macroscope summarized 3ed7ab5.

Summary by CodeRabbit

  • Chores
    • Added containerized development environment configuration to streamline local development with Go tooling and VS Code integration.

Sets up a devcontainer with Go 1.25, golangci-lint v2, buf CLI,
gopls (via Go extension), shellcheck, and Docker-in-Docker (non-Moby),
following the xmtpd repo pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@xmtp-coder-agent xmtp-coder-agent requested a review from a team as a code owner March 24, 2026 08:49
"installZsh": true
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": false
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have you verified that docker commands succeed from inside the devcontainer in this repo?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ping on this

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Walkthrough

Added Dev Container configuration files to establish a containerized Go development environment with essential tooling. Includes a devcontainer.json configuration and a corresponding Dockerfile that installs Go 1.25, golangci-lint, buf CLI, and additional utilities for development.

Changes

Cohort / File(s) Summary
Dev Container Configuration
.devcontainer/devcontainer.json
Configures VS Code Dev Container with Go 1.25 environment, installs golang.go and vscode-docker extensions, enables GitHub CLI and Docker-in-Docker features (Moby disabled), sets workspace environment variables, and runs go mod tidy post-creation.
Dev Container Dockerfile
dev/docker/devcontainer.Dockerfile
Builds from golang:1.25 base image and installs development tooling: golangci-lint (v2.1.6), buf CLI, shellcheck, and jq packages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰 A cozy warren of Go tools we've arranged,
With linters and buffers, no setup exchanged,
Devcontainer magic makes coding a breeze,
Docker-in-Docker—no Moby to please!
Now developers hop into ready-made ease. 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding devcontainer configuration files.
Linked Issues check ✅ Passed All requirements from issue #67 are met: Go 1.25, Buf CLI, golangci-lint v2, Docker-in-Docker (non-Moby), gopls (via golang.go extension), and shellcheck are installed; devcontainer builds successfully.
Out of Scope Changes check ✅ Passed All changes are directly related to the devcontainer setup objective; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
dev/docker/devcontainer.Dockerfile (1)

9-12: Consider adding apt cleanup to reduce image size.

This is optional for a dev container, but adding --no-install-recommends and cleaning up the apt cache would reduce the image footprint.

Optional cleanup
 # Add shellcheck and jq
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     shellcheck \
-    jq
+    jq \
+    && rm -rf /var/lib/apt/lists/*
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dev/docker/devcontainer.Dockerfile` around lines 9 - 12, The RUN step
installing shellcheck and jq should avoid extra packages and remove apt caches
to shrink the image; update the RUN that installs these tools (the Dockerfile
RUN that lists shellcheck and jq) to use --no-install-recommends during apt-get
install and add apt cleanup commands after install (apt-get clean and removal of
/var/lib/apt/lists/*) so the image does not retain package cache.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@dev/docker/devcontainer.Dockerfile`:
- Around line 6-7: Replace the non-deterministic installation of buf (RUN go
install github.com/bufbuild/buf/cmd/buf@latest) with a pinned released tag;
update the Dockerfile line to use a specific buf CLI version (for example
replace `@latest` with `@vX.Y.Z`) so the build is reproducible and consistent with
the pinned plugin versions (identify the RUN line installing buf in the
Dockerfile to change).

---

Nitpick comments:
In `@dev/docker/devcontainer.Dockerfile`:
- Around line 9-12: The RUN step installing shellcheck and jq should avoid extra
packages and remove apt caches to shrink the image; update the RUN that installs
these tools (the Dockerfile RUN that lists shellcheck and jq) to use
--no-install-recommends during apt-get install and add apt cleanup commands
after install (apt-get clean and removal of /var/lib/apt/lists/*) so the image
does not retain package cache.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 87cb3c39-4bb6-41a2-9497-6331dcb570fa

📥 Commits

Reviewing files that changed from the base of the PR and between 808663b and 3ed7ab5.

📒 Files selected for processing (2)
  • .devcontainer/devcontainer.json
  • dev/docker/devcontainer.Dockerfile

Comment on lines +6 to +7
# Install buf CLI
RUN go install github.com/bufbuild/buf/cmd/buf@latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

What is the latest stable version of buf CLI in March 2026?

💡 Result:

The latest stable version of the buf CLI in March 2026 is v1.66.1, released on 2026-03-09.

Citations:


🏁 Script executed:

# Check if the Dockerfile exists and examine the relevant lines
if [ -f "dev/docker/devcontainer.Dockerfile" ]; then
  echo "=== dev/docker/devcontainer.Dockerfile exists ==="
  head -20 dev/docker/devcontainer.Dockerfile
else
  echo "File not found: dev/docker/devcontainer.Dockerfile"
fi

Repository: xmtp/example-notification-server-go

Length of output: 429


🏁 Script executed:

# Check if proto/buf.gen.yaml exists and examine its content
if [ -f "proto/buf.gen.yaml" ]; then
  echo "=== proto/buf.gen.yaml exists ==="
  cat proto/buf.gen.yaml
else
  echo "File not found: proto/buf.gen.yaml"
fi

Repository: xmtp/example-notification-server-go

Length of output: 869


Pin the buf CLI version for reproducibility.

Using @latest risks breaking the build if buf CLI introduces breaking changes. The proto/buf.gen.yaml already pins specific plugin versions (e.g., buf.build/protocolbuffers/go:v1.36.6, buf.build/connectrpc/go:v1.19.1), so the CLI should also be pinned for consistency and reproducibility.

Proposed fix
 # Install buf CLI
-RUN go install github.com/bufbuild/buf/cmd/buf@latest
+RUN go install github.com/bufbuild/buf/cmd/buf@v1.66.1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Install buf CLI
RUN go install github.com/bufbuild/buf/cmd/buf@latest
# Install buf CLI
RUN go install github.com/bufbuild/buf/cmd/buf@v1.66.1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dev/docker/devcontainer.Dockerfile` around lines 6 - 7, Replace the
non-deterministic installation of buf (RUN go install
github.com/bufbuild/buf/cmd/buf@latest) with a pinned released tag; update the
Dockerfile line to use a specific buf CLI version (for example replace `@latest`
with `@vX.Y.Z`) so the build is reproducible and consistent with the pinned plugin
versions (identify the RUN line installing buf in the Dockerfile to change).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good call

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How about now?

@neekolas neekolas merged commit c82de5d into xmtp:main Mar 24, 2026
7 of 9 checks passed
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.

Devcontainer Setup

2 participants