feat(config): support forwardPorts range syntax expansion#168
Merged
Conversation
Parse port range notation like '3000-3005' in forwardPorts and expand to individual ports [3000, 3001, ..., 3005]. Mixed ranges and single ports work together; invalid ranges are rejected with clear errors.
✅ Deploy Preview for devsydev canceled.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds port range expansion support to devcontainer configuration merging. Port ranges in ChangesPort Range Expansion for Forward Ports
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Extract parsePortRange helper to reduce expandPortRange cyclomatic complexity (cyclop), compact TestExpandPortRange with slices.Equal and inline test cases (funlen), fix continuation-line indentation (gci/gofumpt), and extract repeated "3000-3002" to testPortRange const (goconst).
skevetter
marked this pull request as ready for review
May 3, 2026 05:14
skevetter
enabled auto-merge (squash)
May 3, 2026 05:14
This was referenced May 16, 2026
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
Adds support for port range notation (e.g.
3000-3005) in the devcontainerforwardPortsfield, expanding ranges into individual ports during config merging. This enables users to specify["8080", "3000-3005"]and have all 7 ports forwarded. Invalid ranges (start > end, negative, non-numeric) are rejected gracefully. Includes 14 unit tests covering single ports, ranges, mixed inputs, deduplication across ranges, and error cases, plus an E2E test validating range expansion throughread-configuration --include-merged-configuration.Summary by CodeRabbit
New Features
Tests