Feature - Added route:loops for detecting redirect loops in routes#127
Open
mattsinagra-upsun wants to merge 3 commits into
Open
Feature - Added route:loops for detecting redirect loops in routes#127mattsinagra-upsun wants to merge 3 commits into
mattsinagra-upsun wants to merge 3 commits into
Conversation
… routes.yaml files, repo routes.yaml files or config.yaml route sections to check for routing loops
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new route:loops CLI command and supporting library code to detect redirect loops across Platform.sh/Upsun route configurations (local YAML or live via route:list).
Changes:
- Introduces
internal/routeloopspackage for parsing routes from YAML/CSV and detecting redirect cycles. - Adds
route:loopscommand with text/JSON output, local-file discovery, and--livesupport. - Registers the new command in the root command set and in the
listcommand’s augmented output.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/routeloops/routeloops.go | Core redirect-cycle detection + URL normalization logic. |
| internal/routeloops/parse.go | Parsers for routes.yaml/Upsun config + local project discovery + live CSV parsing. |
| internal/routeloops/routeloops_test.go | Unit tests for detection, normalization, and parsing/discovery helpers. |
| commands/route_loops.go | New route:loops cobra command, output formatting, and route loading paths. |
| commands/root.go | Registers the new cobra command. |
| commands/list.go | Adds route:loops to the enhanced list output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Feature - Added route:loops for detecting loops within path specified routes.yaml files, repo routes.yaml files or config.yaml route sections to check for routing loops