Conversation
Co-authored-by: justin <justin@wandb.com>
|
Cursor Agent can help with this pull request. Just |
📝 WalkthroughWalkthroughThe PR adds support for applying YAML files from remote HTTP(S) URLs in the apply command. It introduces a new input handling module that detects URLs and fetches them via HTTP, updates ExpandGlob to recognize URL patterns, replaces ParseFile with ParseInput throughout the flow, and adds comprehensive tests for URL validation and HTTP error scenarios. Changes
Sequence DiagramsequenceDiagram
participant User as User/CLI
participant Apply as Apply Command
participant Input as Input Handler
participant HTTP as HTTP Client
participant Parser as YAML Parser
User->>Apply: apply <input>
alt input is URL
Apply->>Input: ParseInput(ctx, url)
Input->>Input: isHTTPURL(url)
Input->>HTTP: GET with 30s timeout
HTTP-->>Input: response body
Input->>Parser: ParseYAML(body)
Parser-->>Input: []Document
Input-->>Apply: []Document
else input is file path
Apply->>Input: ParseInput(ctx, path)
Input->>Input: ParseFile(path)
Input-->>Apply: []Document
end
Apply->>Apply: Apply documents
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Add support for HTTP(S) URLs as input to
ctrlc apply -fto allow applying configurations directly from remote YAML files.Note
Medium Risk
Introduces outbound HTTP fetching and URL handling in the CLI apply path, which can affect reliability and security expectations (timeouts, remote content, and error handling).
Overview
ctrlc apply -fnow accepts HTTP(S) URLs in addition to local file paths/globs, and the help text/examples were updated accordingly.Input handling was extended with
ParseInputto fetch remote YAML (30s timeout, error on non-2xx) and parse it like local files, whileexpandGlobwas updated to treat URLs as explicit candidates with include/exclude semantics; new tests cover URL inclusion/exclusion and HTTP fetch/status error cases.Written by Cursor Bugbot for commit faadf78. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
New Features
Improvements