Add --base-url flag for connector testability#9
Conversation
This change adds a --base-url CLI flag to allow overriding the default API endpoint for testing purposes. When provided, the connector will use this URL instead of the hardcoded production API URL. This is part of the Connector Testability initiative to enable mock server testing without modifying connector code. Files changed: cmd/baton-fastly/main.go,pkg/config/conf.gen.go,pkg/config/config.go,pkg/connector/connector.go
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes introduce a new "base-url" configuration parameter to override the Fastly API URL for testing purposes. A BaseUrl field is added to the generated Fastly struct, a new StringField configuration is created, and the connector's initialization function is updated to accept and conditionally use the baseURL parameter. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
russellhaering
left a comment
There was a problem hiding this comment.
LGTM - base-url flag implementation looks correct. Properly uses fastly.NewClientForEndpoint when baseURL is non-empty, falls back to fastly.NewClient for default behavior.
base-url is a dev/testing concern, not user-facing configuration. Mark it WithHidden(true) so it doesn't appear in the hosted UI. Good feedback from Geoff: ConductorOne/baton-trayai#63 (comment)
Summary
Adds the
--base-urlCLI flag to enable overriding the default API endpoint for testing purposes.Changes
BaseURLFieldto configuration--base-urlis provided, it takes precedence over the default API URLFiles Modified
Testing
The connector can now be tested against mock servers:
Related
Part of the Connector Testability initiative.
Summary by CodeRabbit