fix(connection): template HTTP connection fields - #2005
Conversation
Benchstat (Other)Base: 📊 1 minor regression(s) (all within 5% threshold)
✅ 2 improvement(s)
Full benchstat output |
Benchstat (RLS)Base: 📊 2 minor regression(s) (all within 5% threshold)
✅ 5 improvement(s)
Full benchstat output |
HTTP playbook actions template the action spec, but embedded HTTP connection fields were skipped unless the nested fields carried template tags. Values such as $(.params.url) could remain unresolved and be treated as literal relative URLs during request execution. Add template tags across HTTP connection, auth, OAuth, TLS, and AWS SigV4 fields so existing struct templating renders connection configuration before use.
84efe19 to
e034a11
Compare
WalkthroughThis PR adds ChangesTemplate support for credential and connection types
🚥 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. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@connection/http.go`:
- Line 104: The HTTPConnection struct currently inlines types.HTTPBasicAuth only
for JSON; update the struct tag for types.HTTPBasicAuth (the embedded type) to
include yaml:",inline" as well (e.g., add yaml:",inline" alongside
json:",inline") so YAML top-level auth fields map correctly; locate the
embedding of types.HTTPBasicAuth inside the HTTPConnection definition and modify
its struct tag accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 498964d5-3c2f-43da-8cf9-e97728698c79
📒 Files selected for processing (5)
connection/aws.goconnection/http.goconnection/http_test.gotypes/auth.gotypes/oauth.go
Gavel resultsGavel exited with code . |
related: flanksource/mission-control#3218
HTTP playbook actions can template the action itself, but embedded HTTP connection fields were skipped unless the fields also carried template tags.
This left values like
$(.params.url)unresolved, causing HTTP requests to run against literal relative URLs such as/$(.params.url).Add template tags across HTTP connection, auth, OAuth, TLS, and AWS SigV4 fields so existing playbook templating handles connection configuration correctly.
Summary by CodeRabbit