Skip to content

feat: support custom resolve base URL - #254

Merged
nicklasl merged 4 commits into
mainfrom
nicklasl/configurable-resolve-base-url
Aug 19, 2026
Merged

feat: support custom resolve base URL#254
nicklasl merged 4 commits into
mainfrom
nicklasl/configurable-resolve-base-url

Conversation

@nicklasl

@nicklasl nicklasl commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

  • add a resolveBaseUrl factory option for resolve and apply requests
  • preserve regional defaults and keep event tracking on the Confidence events endpoint
  • document sidecar setup

Testing

  • focused resolve base URL tests
  • existing remote client tests
  • assembleDebug
  • ktlintCheck

@nicklasl
nicklasl marked this pull request as ready for review August 18, 2026 14:50
@nicklasl
nicklasl marked this pull request as draft August 18, 2026 14:51
Comment thread Confidence/src/main/java/com/spotify/confidence/ResolveBaseUrl.kt Outdated
Comment thread README.md Outdated
nicklasl and others added 3 commits August 19, 2026 07:10
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
@nicklasl
nicklasl force-pushed the nicklasl/configurable-resolve-base-url branch from f8e38af to 979668d Compare August 19, 2026 05:10
@nicklasl

Copy link
Copy Markdown
Member Author

Verified this end to end with ConfidenceDemoApp on a Pixel 9 emulator running Android 16.

Setup:

  • Ran a deterministic local HTTP resolver on localhost:8090.
  • Used adb reverse tcp:8090 tcp:8090 so emulator localhost reached the host server.
  • Temporarily enabled cleartext HTTP and configured the demo with http://localhost:8090. Both changes were restored afterward.
  • Built :ConfidenceDemoApp:assembleDebug, installed it, cleared app data, and cold-started it.

SDK flow exercised:

ConfidenceFactory.create(
    context,
    clientSecret,
    "http://localhost:8090",
    initialContext = initialContext,
    region = ConfidenceRegion.EUROPE,
    loggingLevel = LoggingLevel.VERBOSE
)
ConfidenceFeatureProvider.create(confidence, InitialisationStrategy.FetchAndActivate)
OpenFeatureAPI.setProviderAndWait(provider)
client.getStringValue("flaggy.str", "client side default")
client.getStringDetails("hawkflag.color", "Gray")

Verification:

  • Captured POST /v1/flags:resolve at the configured base URL.
  • The mock response returned flaggy.str = custom-base-url-e2e and hawkflag.color = magenta with resolveToken = e2e-token.
  • Captured two POST /v1/flags:apply requests at the same base URL, both carrying e2e-token.
  • SDK logs showed Resolve Completed and TARGETING_MATCH with the expected variant and no error.
  • The running app displayed Hello custom-base-url-e2e! and rendered the surface magenta.

No demo-app or E2E scaffolding changes were committed; the worktree was clean after verification.

@nicklasl
nicklasl marked this pull request as ready for review August 19, 2026 06:28
@nicklasl
nicklasl merged commit 4846272 into main Aug 19, 2026
2 checks passed
@nicklasl
nicklasl deleted the nicklasl/configurable-resolve-base-url branch August 19, 2026 12:10
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.

2 participants