Skip to content

Add --base-url flag for connector testability#16

Open
robert-chiniquy wants to merge 4 commits intomainfrom
rch/testability/fix-base-url
Open

Add --base-url flag for connector testability#16
robert-chiniquy wants to merge 4 commits intomainfrom
rch/testability/fix-base-url

Conversation

@robert-chiniquy
Copy link
Copy Markdown

Summary

Adds the --base-url CLI flag to enable overriding the default API endpoint for testing purposes.

Changes

  • Added BaseURLField to configuration
  • Updated client/connector to accept and use the base URL override
  • When --base-url is provided, it takes precedence over the default API URL

Files Modified

cmd/baton-zoom/config.go,cmd/baton-zoom/main.go,pkg/connector/connector.go,pkg/zoom/client.go

Testing

The connector can now be tested against mock servers:

baton-zoom --base-url http://localhost:8080 [other-flags]

Related

Part of the Connector Testability initiative.

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-zoom/config.go,cmd/baton-zoom/main.go,pkg/connector/connector.go,pkg/zoom/client.go
@robert-chiniquy robert-chiniquy requested a review from a team February 8, 2026 07:46
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 8, 2026

Warning

Rate limit exceeded

@robert-chiniquy has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 22 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rch/testability/fix-base-url

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@russellhaering russellhaering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean base-url override, all URL references properly updated.

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)
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

Claude finished @robert-chiniquy's task in 1m 13s —— View job


PR Review: Add --base-url flag for connector testability

  • Gather context and read changed files
  • Review code changes
  • Post review findings

Verdict: Looks good — clean, minimal change that follows the established pattern for base-url overrides. Two reviewers have already approved. I have a few observations:

What works well

  • Proper field configuration (config.go:23-28): WithHidden(true) and WithExportTarget(field.ExportTargetCLIOnly) correctly prevent this testing-only flag from appearing in hosted UI.
  • Clean default handling (client.go:29-31): The empty-string check in NewClient means callers don't need to worry about whether the flag was provided.
  • Consistent replacement: All 17 URL construction sites in client.go were updated from the package-level baseUrl constant to c.baseURL — no stale references left behind.
  • Test updated (integration_test.go:53): The test helper passes "" to get the default, matching the new signature.

Observation: Auth URL not overridable

RequestAccessToken (client.go:58-92) still hardcodes defaultAuthURL and is a package-level function (not a method on Client). This means when testing against a mock server with --base-url, the connector will still attempt to authenticate against https://zoom.us/oauth/token before using the mock for API calls.

This is fine for the current scope — tests can pre-generate a token and skip the auth call, or a mock server can be set up on a separate port for auth. Just noting it for awareness in case future test setups hit this.

Nit: Naming inconsistency (non-blocking)

The old constant was baseUrl (camelCase), now renamed to defaultBaseURL (correct Go convention for acronyms). The auth constant was similarly fixed from authUrl to defaultAuthURL. Good cleanup.

Overall: LGTM — this is a straightforward, well-scoped change that enables mock server testing without affecting production behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants