-
Notifications
You must be signed in to change notification settings - Fork 90
feat: add devcontainer for VS Code and GitHub Codespaces #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds comprehensive development container support for VS Code and GitHub Codespaces, making it easier for contributors to set up a complete development environment with Go and SQL Server pre-configured.
Changes:
- Adds devcontainer configuration with Go 1.24, SQL Server, and pre-installed development tools
- Includes automated setup scripts, helpful aliases, and pre-configured environment variables for integration tests
- Updates README with a Development section explaining how to use the devcontainer
- Adds .dockerignore for optimized container builds
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.devcontainer/devcontainer.json |
Main devcontainer configuration with VS Code extensions, settings, and environment variables |
.devcontainer/docker-compose.yml |
Orchestrates Go development container with SQL Server 2025 sidecar |
.devcontainer/Dockerfile |
Defines Go 1.24 development image with tools (go-sqlcmd, golangci-lint, delve, etc.) |
.devcontainer/post-create.sh |
Post-creation setup script that downloads dependencies, waits for SQL Server, and creates helpful aliases |
.devcontainer/mssql/setup.sql |
SQL initialization script that creates test database and sample tables |
.devcontainer/README.md |
Comprehensive documentation for using and customizing the devcontainer |
.dockerignore |
Excludes unnecessary files from Docker build context |
README.md |
Adds Development section with quick start guide for devcontainers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 13 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Dockerfile: - Fix image tag format: 1.24-bookworm (not 1-1.24-bookworm) docker-compose.yml: - Add both SA_PASSWORD and MSSQL_SA_PASSWORD for CI compatibility (different SQL Server images use different env vars) post-create.sh: - Add dynamic workspace detection with robust fallback - Handles different clone names (go-sqlcmd, fork names, etc.) setup.sql: - Add TRY/CATCH error handling for contained database operations - Prevents script failure on unsupported SQL Server configurations .dockerignore: - Add .devcontainer/ to reduce build context size Reference: microsoft/go-mssqldb#317
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #317 +/- ##
==========================================
+ Coverage 75.41% 78.46% +3.05%
==========================================
Files 34 34
Lines 6597 6598 +1
==========================================
+ Hits 4975 5177 +202
+ Misses 1335 1139 -196
+ Partials 287 282 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f0fe189 to
fd4adc7
Compare
fd4adc7 to
71be9dc
Compare
- Go 1.24 with gopls, delve, staticcheck, golangci-lint - SQL Server 2025 (Developer Edition) with health checks - go-sqlcmd installed (uses go-mssqldb - dogfooding!) - Pre-configured VS Code extensions (Go, MSSQL, Copilot, etc.) - Environment variables pre-set for integration tests - Add Development section to README with quick start guide - Add 'Open in Dev Containers' badge to README - Update CI workflow with improved SQL Server readiness checks
71be9dc to
72cdb74
Compare
feat: Add devcontainer for VS Code and GitHub Codespaces
Summary
This PR adds a comprehensive development container that makes it easy for anyone to contribute to go-mssqldb. Just open the repo and start coding - SQL Server is ready!
What's Included
How to Use
🖥️ VS Code
go test ./...— SQL Server is ready!☁️ GitHub Codespaces
go test ./...Helpful Aliases
Once inside the container, these aliases are available:
Discoverability
.devcontainerexistsFiles Added
Screenshots
After opening in Dev Container, developers see:
Why This Matters