feat: enhance DevContainer for development-focused workflow#17
Open
feat: enhance DevContainer for development-focused workflow#17
Conversation
This commit restructures the development environment to provide a clear separation between rich development experience and clean CI testing. ## Key Changes ### DevContainer Enhancements - Enhanced DevContainer configuration for pure development focus - Added development-specific VS Code extensions and tools - Improved Dockerfile with additional development gems (pry, yard, etc.) - Clear environment variables to distinguish development vs CI modes ### CI Test Safety & Isolation - Added CIEnvironment module for automatic CI detection - Implemented automatic service URL cleaning in CI environments - Force memory adapters in CI regardless of TEST_ADAPTER setting - Added comprehensive logging of CI safety measures - Ensured tests can never accidentally use external services in CI ### Development Experience Improvements - Enhanced setup script with development-specific features - Clear distinction between development and CI commands - Rich service integration available in development (Redis, PostgreSQL, DynamoDB, Mock Server) - Service health checks and integration testing capabilities ### Documentation Updates - Comprehensive CLAUDE.md updates explaining development vs CI philosophy - Clear usage patterns for different testing scenarios - Environment-aware debugging tips and best practices - Development container feature documentation ## Benefits Achieved ✅ **Simple Mental Model**: DevContainer = development, CI = clean tests ✅ **Rich Development Experience**: Full services and tooling for developers ✅ **Fast CI Tests**: No infrastructure dependencies, pure memory/mocks ✅ **Automatic Safety**: Impossible for CI tests to use external services ✅ **Flexibility**: Choose appropriate testing level for the task ## Testing Philosophy ``` Development Container = Rich services + debugging tools + integration testing CI Environment = Pure memory + mocks + fast execution + no dependencies ``` This approach ensures developers have powerful tools while maintaining fast, reliable CI execution with zero infrastructure dependencies.
- Replace ENV[var] with ENV.fetch(var, nil) for better style - Ensures consistent environment variable access patterns
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 restructures the development environment to provide a clear separation between rich development experience and clean CI testing, implementing the philosophy that DevContainer = Development, CI = Clean Tests.
Key Improvements
🏗️ Development Environment
DEV_CONTAINERandDEVELOPMENT_MODEvariables🧪 CI Test Safety & Isolation
CIEnvironmentmodule detects CI vs development automatically🚀 Enhanced Development Experience
Architecture Philosophy
Testing Modes
CI Testing (Automatic)
Development Testing (DevContainer)
TEST_ADAPTER=allUsage Examples
Safety Features
Automatic Environment Detection
CI=true,GITHUB_ACTIONS=true,DEV_CONTAINER=true,DEVELOPMENT_MODE=trueService URL Protection
TEST_ADAPTER=memoryin CI regardless of configurationDevelopment Flexibility
Files Changed
Configuration
.devcontainer/devcontainer.json- Enhanced with development tools and extensions.devcontainer/Dockerfile.dev- Added development gems and environment setupTest Safety
test/test_helper.rb- AddedCIEnvironmentmodule for automatic CI detection and safetyServiceConfigurationwith CI-aware adapter selectionDevelopment Tools
scripts/setup-dev.sh- Enhanced development setup with service health checksCLAUDE.md- Comprehensive documentation of development vs CI philosophyDocker Infrastructure
Benefits
✅ Clear Mental Model: Developers know DevContainer = development, CI = clean tests
✅ Fast CI: Zero infrastructure dependencies, pure memory/mocks
✅ Rich Development: Full service integration available when needed
✅ Automatic Safety: Impossible for CI tests to accidentally use external services
✅ Developer Flexibility: Choose appropriate testing level for the task
✅ No Breaking Changes: Existing test suite continues to work perfectly
Test Plan
🤖 Generated with Claude Code