feat: add devcontainer for VS Code and GitHub Codespaces#692
Open
dlevy-msft-sql wants to merge 1 commit intomicrosoft:mainfrom
Open
feat: add devcontainer for VS Code and GitHub Codespaces#692dlevy-msft-sql wants to merge 1 commit intomicrosoft:mainfrom
dlevy-msft-sql wants to merge 1 commit intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a VS Code / GitHub Codespaces devcontainer setup to make onboarding and running integration tests against a local SQL Server container easier and more consistent.
Changes:
- Introduces a full
.devcontainer/configuration (Dockerfile, docker-compose, devcontainer.json, post-create provisioning, and SQL bootstrap script). - Documents devcontainer usage in both the root README and a dedicated
.devcontainer/README.md. - Adds a root
.dockerignoreto reduce Docker build context noise.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds “Open in Dev Containers” badge and a Development section with quickstart/manual setup. |
| .dockerignore | Defines ignore rules for Docker builds from the repo root. |
| .devcontainer/Dockerfile | Dev image with Go toolchain + common Go dev tools and dependencies. |
| .devcontainer/docker-compose.yml | Orchestrates devcontainer + SQL Server sidecar with healthcheck. |
| .devcontainer/devcontainer.json | VS Code devcontainer configuration, extensions, forwarded ports, env vars, post-create command. |
| .devcontainer/post-create.sh | Post-create setup: downloads deps, builds sqlcmd, validates build, waits for DB, runs setup.sql, adds aliases. |
| .devcontainer/mssql/setup.sql | Creates a SqlCmdTest database and sample objects for quick testing. |
| .devcontainer/README.md | Detailed documentation for devcontainer usage, troubleshooting, and customization. |
4b40af5 to
9ea062d
Compare
- Go 1.24 with gopls, delve, staticcheck, golangci-lint - SQL Server 2025 (Developer Edition) with health checks - go-sqlcmd built and installed from source (dogfooding!) - Pre-configured VS Code extensions (Go, MSSQL, Copilot, etc.) - Environment variables pre-set for testing - Add Development section to README with quick start guide - Add 'Open in Dev Containers' badge to README
cd49443 to
0e4fea5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a development container setup for easier onboarding and consistent development environments.
What's Included
Development Environment
SQL Server 2025
SqlCmdTest) created on startupVS Code Extensions (pre-installed)
Features
sqlcmd create mssql, etc.)Environment Variables
Pre-configured so tests run immediately:
SQLCMDSERVER=localhostSQLCMDUSER=saSQLCMDPASSWORD=SqlCmd@2025!SQLCMDDATABASE=masterHelpful Aliases
gtestgbuildginstallglintsqltest-dbUsage
VS Code
GitHub Codespaces
gtestto verify everything worksRelation to go-mssqldb
This follows the same pattern as go-mssqldb PR #317, making it easy for contributors to work on both projects with consistent environments.