aminghadersohi opened a new pull request, #35842:
URL: https://github.com/apache/superset/pull/35842
## Summary
This PR refactors the devcontainer configuration to support multiple
development scenarios with a composable, multi-config approach. Developers can
now choose between standard Superset development or MCP-enabled development
environments while maintaining a single codebase.
**Note:** This PR was originally planned for authentication improvements,
but those changes were already incorporated in PR8. Instead, this PR now
contains the DevContainer multi-config setup (originally planned for PR10) to
avoid having an empty PR9.
**Key improvements:**
- ✅ Multi-config devcontainer structure (base + variants)
- ✅ Simplified setup and start scripts
- ✅ Optional MCP service activation
- ✅ Cleaner developer experience
- ✅ All 178 MCP service tests passing
## Changes
### 1. Multi-Config DevContainer Structure
**Base Configuration** (`devcontainer-base.json`)
- Shared settings for all devcontainer variants
- Universal base image approach
- Common extensions and settings
- Reduces configuration duplication
**Default Configuration** (`default/devcontainer.json`)
- Standard Superset development environment
- No MCP service dependencies
- Lightweight setup for core Superset work
**MCP-Enabled Configuration** (`with-mcp/devcontainer.json`)
- Full Superset + MCP service development
- Includes MCP-specific dependencies
- Enables MCP service testing and development
### 2. Simplified Setup Scripts
**setup-dev.sh**
- Streamlined setup process
- Universal base image approach (no version-specific logic)
- Cleaner error handling
- Reduced from complex version checks to simple universal setup
**start-superset.sh**
- Added `--mcp` flag for optional MCP service activation
- Simplified startup logic
- Better separation of concerns (Superset vs MCP)
- Cleaner process management
### 3. Docker Integration
**docker-bootstrap.sh**
- Added `mcp` command to bootstrap MCP service
- Integrates MCP setup into standard Docker workflows
- Enables MCP service in containerized environments
### 4. Documentation Cleanup
**Removed outdated README.md**
- Deleted outdated venv auto-activation documentation
- Modern devcontainers handle environment activation automatically
- Reduces confusion for new contributors
## Benefits
### For Developers
**Choose Your Environment:**
- Working on core Superset features? Use `default/` config
- Developing MCP tools? Use `with-mcp/` config
- Switch between environments without config conflicts
**Simplified Onboarding:**
- Clearer setup process
- Less configuration to understand
- Automatic environment setup
**Better Development Experience:**
- Faster container startup (default config is lighter)
- Optional MCP service (only when needed)
- Cleaner separation of concerns
### For the Codebase
**Maintainability:**
- Single source of truth for shared config (base)
- Easier to update common settings
- Less duplication across configs
**Flexibility:**
- Easy to add new development variants
- Composable configuration pattern
- Future-proof for additional scenarios
## Usage
### Selecting a Development Environment
**In VSCode:**
1. Open Command Palette (Cmd/Ctrl+Shift+P)
2. Select "Dev Containers: Reopen in Container"
3. Choose configuration:
- `.devcontainer/default/devcontainer.json` - Standard Superset
- `.devcontainer/with-mcp/devcontainer.json` - Superset + MCP
### Starting with MCP Service
```bash
# In devcontainer terminal
./start-superset.sh --mcp
```
The `--mcp` flag:
- Starts Superset on port 9001
- Starts MCP service on port 5008
- Enables full MCP tool development
### Standard Superset Development
```bash
# In devcontainer terminal
./start-superset.sh
```
Starts only Superset (no MCP service).
## Testing
**All MCP service tests passing:**
```bash
$ env PYTHONPATH=. pytest tests/unit_tests/mcp_service/ -q
178 passed in 6.99s
```
**Verified configurations:**
- ✅ Base config syntax valid
- ✅ Default variant builds and starts
- ✅ MCP variant builds and starts
- ✅ Setup scripts work in both configurations
- ✅ Start script `--mcp` flag works correctly
## Files Changed
```
.devcontainer/README.md | 11 deletions (removed)
.devcontainer/default/devcontainer.json | 19 insertions (new)
.devcontainer/devcontainer-base.json | 39 insertions (new)
.devcontainer/setup-dev.sh | simplified
.devcontainer/start-superset.sh | simplified + --mcp flag
.devcontainer/with-mcp/devcontainer.json | 29 insertions (new)
docker/docker-bootstrap.sh | 4 insertions (MCP bootstrap)
7 files changed, 132 insertions(+), 137 deletions(-)
```
## Migration Guide
### For Existing Developers
**If you're currently using a devcontainer:**
1. Rebuild your container when this PR merges
2. VSCode will prompt you to select a configuration
3. Choose:
- `default/` for standard Superset work
- `with-mcp/` if you're developing MCP tools
**If you're not using devcontainers:**
- No changes needed, this only affects devcontainer users
### Configuration Notes
**Base config includes:**
- Python and Node.js versions
- Common VSCode extensions (Python, ESLint, Prettier)
- Git configuration
- Port forwarding (8088, 9000, 9001)
**MCP config adds:**
- Port 5008 for MCP service
- MCP-specific environment variables
- Additional MCP dependencies
## Why This Change?
### Original PR9 Plan vs Reality
**Original Plan:** PR9 would contain "Authentication Improvements and
Architecture Cleanup"
**Reality:** During PR8 recovery, we discovered:
- Antonio's auth improvements already in PR8 (commit dd77c28a7)
- DAO Protocol removal not needed (never added to PR8)
- PR9 would be empty/identical to PR8
**Solution:** Move DevContainer multi-config (originally PR10) to PR9
- Avoids empty PR
- Maintains PR sequence (PR1-9)
- Provides meaningful developer experience improvements
## Related PRs
- **PR8:** Field-level permissions security layer (base for this PR)
- **PR16:** Originally contained this DevContainer work (now incorporated
here)
## Checklist
- [x] All tests passing (178/178 MCP tests)
- [x] Pre-commit hooks passing
- [x] DevContainer configs validated
- [x] Setup scripts tested
- [x] Start script tested with and without `--mcp`
- [x] Documentation updated
- [x] No breaking changes to existing development workflows
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]