-
Couldn't load subscription status.
- Fork 302
feat: migrate from GitPod to GitHub Codespaces #1678
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
feat: migrate from GitPod to GitHub Codespaces #1678
Conversation
Add comprehensive GitHub Codespaces configuration to replace GitPod as the primary cloud development environment (GitPod free tier has sunset). Changes: - Add .devcontainer/devcontainer.json with Docker-in-Docker and GitHub CLI - Add .devcontainer/setup.sh for automated environment setup - Add dockerfiles/codespacesURL.sh for Codespaces URL configuration - Add CODESPACES_MIGRATION_PLAN.md with detailed migration strategy - Update README.md with Codespaces quick start and instructions - Update .gitignore for local development files - Set default empty values for GITPOD_WORKSPACE_URL to suppress warnings Features: - Automatic yq installation for YAML processing - Port forwarding for Jenkins (8080) with public visibility - Environment-aware URL configuration using CODESPACE_NAME - Maintains backward compatibility with GitPod configuration - 60 hours/month free tier (sufficient for all tutorials) - Welcome message displayed on every terminal session The migration maintains dual support for both Codespaces and GitPod during the transition period, allowing users to choose their preferred environment.
Configure setup script to append welcome message to .bashrc so it displays automatically on every new terminal session in Codespaces. This is more reliable than postStartCommand which doesn't always show output in the terminal.
Add gh CLI command to automatically set port 8080 to public during setup. Create .devcontainer/README.md with manual steps for port visibility. The devcontainer.json visibility setting doesn't reliably work, so we now: 1. Attempt automatic setting via gh CLI in setup.sh 2. Provide clear manual steps in README if automation fails This addresses the persistent issue where ports default to private even with visibility: public in devcontainer.json.
Change onAutoForward from 'openPreview' to 'openBrowser' to avoid preview pane issues with Jenkins security headers. The VS Code preview shows 'Please reopen the preview' due to Jenkins X-Frame-Options headers. Opening in a regular browser tab works fine. Updated README to clarify this behavior.
Add note that GitPod is legacy (free tier sunset) and we've migrated to GitHub Codespaces. Disable Dependabot monitoring of GitPod image updates by setting open-pull-requests-limit to 0. Codespaces uses devcontainer.json which cannot be monitored by Dependabot (not a Dockerfile). Manual updates as needed.
- Pin yq version to v4.44.3 with curl fallback - Pin devcontainer features (Docker 27.0, gh CLI 2.62) - Add shell safety flags (set -Eeuo pipefail) - Replace hardcoded paths with git rev-parse - Improve variable quoting throughout scripts - Add validation checks (yq exists, gh authenticated) - Enhance error handling in all scripts Addresses all valid suggestions from AI reviewers (CodeRabbitAI and Gemini).
- Add updatecli manifest for yq, Docker, and GitHub CLI versions - Update dependabot.yml to reference UpdateCLI for Codespaces deps - Clarify port visibility is not blocking access in README - Document that private ports work for Codespace owners UpdateCLI will now automatically create PRs when new versions of devcontainer dependencies are available.
The dockerhub-image-exists condition was missing the required sourceid attribute, causing UpdateCLI validation to fail. Tested locally with updatecli diff - manifest now works correctly and detects available updates: - yq: v4.44.3 → v4.48.1 - Docker: 27.0 → 28.5 - GitHub CLI: 2.62 → 2.81.0 The manifest will run successfully once this PR is merged to main.
Fixed three pattern matching issues: 1. yq pattern: Added missing closing brace '}' before final quote 2. Docker pattern: Simplified to match line-by-line with search filter 3. GitHub CLI pattern: Simplified to match line-by-line with search filter Tested locally - all targets now detect updates correctly: - ⚠ [yq-setup-script] v4.44.3 → v4.48.1 - ⚠ [docker-feature-version] 27.0 → 28.5 - ⚠ [github-cli-feature-version] 2.62 → 2.81.0
Replaced echo with printf for lines containing ANSI color codes to improve portability across different shells. Fixes Codacy warnings: - Line 44: echo → printf for color formatting - Line 45: echo → printf with proper format string - Line 51: echo → printf in loop with format placeholders The echo command's handling of escape sequences is not standardized across shells. printf is the portable solution and is recommended by POSIX for formatted output.
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 PR migrates the primary cloud development environment from GitPod to GitHub Codespaces due to GitPod's free tier reduction (10h/month vs Codespaces' 60h/month). The migration introduces comprehensive devcontainer configuration, automated dependency tracking via UpdateCLI, and improved shell scripting practices while maintaining backward compatibility with GitPod during the transition period.
Key changes:
- Complete Codespaces configuration with Docker-in-Docker, automated setup, and dynamic Jenkins URL configuration
- UpdateCLI manifest for automatic dependency version tracking (yq, Docker, GitHub CLI)
- Enhanced shell safety with modern bash practices and pinned dependency versions
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| updatecli/updatecli.d/codespaces.yaml | Automated dependency tracking configuration for devcontainer dependencies |
| dockerfiles/codespacesURL.sh | Dynamic Jenkins URL configuration script for Codespaces environment |
| docker-compose.yaml | Set default empty values for GITPOD_WORKSPACE_URL to suppress warnings |
| README.md | Updated documentation with Codespaces quick start and marked GitPod as legacy |
| CODESPACES_MIGRATION_PLAN.md | Comprehensive migration plan and implementation guide |
| .github/dependabot.yml | Disabled Dependabot for legacy GitPod Dockerfile updates |
| .devcontainer/setup.sh | Codespaces initialization script with yq installation and environment setup |
| .devcontainer/devcontainer.json | Dev container specification with Docker-in-Docker and port forwarding |
| .devcontainer/README.md | Codespaces-specific documentation and troubleshooting guide |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
dockerfiles/codespacesURL.sh
Outdated
|
|
||
| # Build the profiles list message | ||
| for target in "${targets[@]}"; do | ||
| message+="\033[36m${target}\033[0m, " |
Copilot
AI
Oct 15, 2025
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.
[nitpick] Using echo with ANSI escape sequences on line 47 (printf \"%b\\n\" \"${message}\") is correct, but building the message string with escape sequences using += can be error-prone. Consider building an array and using printf directly in the loop for better maintainability and consistency with the other printf statements in the script.
Replace string concatenation with direct printf calls for building the profiles list message. This is more maintainable and consistent with other printf statements in the script. Benefits: - Avoids error-prone string building with ANSI escape sequences - More consistent with the rest of the script - Cleaner and easier to maintain - No temporary variables needed Addresses Copilot AI code review suggestion.
Summary
Migrates the primary cloud development environment from GitPod to GitHub Codespaces as GitPod's free tier has sunset (now 10h/month vs Codespaces' 60h/month).
Changes
Core Migration
.devcontainer/configuration with Docker-in-Docker and GitHub CLICode Quality Improvements
set -Eeuo pipefailgit rev-parseechowithprintffor ANSI escape sequences (portability)Automated Dependency Tracking
Documentation
Backward Compatibility
Testing
Benefits
Migration Status