Skip to content

feat(symbols): derive the upload endpoint from --base-uri - #773

Open
abelonogov-ld wants to merge 1 commit into
mainfrom
andrey/symbols-backend-url-from-base-uri
Open

feat(symbols): derive the upload endpoint from --base-uri#773
abelonogov-ld wants to merge 1 commit into
mainfrom
andrey/symbols-backend-url-from-base-uri

Conversation

@abelonogov-ld

Copy link
Copy Markdown
Contributor

Summary

Uploading symbols to anything other than production took two flags that had to agree: --base-uri to name the instance, and --backend-url to name that same instance's observability API. Staging looked like this:

ldcli symbols upload --type android --project my-project \
  --base-uri https://ld-stg.launchdarkly.com \
  --backend-url https://pri.observability.ld-stg.launchdarkly.com \
  --access-token api-...

The second flag is derivable from the first. Every instance publishes its observability API under a host named for the instance, which is exactly how the production default in this file was already built, so --backend-url now defaults to the API of whichever instance --base-uri names and the command above loses a line.

Only LaunchDarkly's own hosts are derived from. A base URI aimed at a local stack or a proxy says nothing about where its observability API listens, so those keep today's production default, and --backend-url still overrides everything — which is how local development already points at http://localhost:8082/private.

Behavior for the default base URI is unchanged: app.launchdarkly.com derives the same pri.observability.app.launchdarkly.com the constant held. The flag's registered default moves from that constant to empty so the derivation can run; --help now names the production URL in the description instead.

Test plan

  • go test ./cmd/symbols/ — new TestDefaultBackendURLFor covers production, staging, a regional host, trailing slashes and whitespace, and the cases that fall back to the default (local stack, a host that merely ends in the domain name, unset, unparseable)
  • go build ./...
  • Upload Android symbols to staging with only --base-uri https://ld-stg.launchdarkly.com and confirm they land

Made with Cursor

Uploading to any instance other than production took two flags that had to
agree: --base-uri to name the instance, and --backend-url to name that same
instance's observability API. The second is derivable from the first, since
every instance publishes the API under a host named for it, which is how the
production default was already built.

--backend-url now defaults to the API of whichever instance --base-uri names,
so staging is one flag. Only LaunchDarkly's own hosts are derived from: a base
URI aimed at a local stack says nothing about where its observability API
listens, so those keep the production default and --backend-url still overrides.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abelonogov-ld
abelonogov-ld requested a review from Vadman97 August 5, 2026 01:59
@abelonogov-ld
abelonogov-ld enabled auto-merge (squash) August 5, 2026 02:14
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.

1 participant