Skip to content

Add MultiProviderStrategy aliases#118

Merged
EtaCassiopeia merged 3 commits into
mainfrom
feat/multiprovider-strategy-aliases
May 13, 2026
Merged

Add MultiProviderStrategy aliases#118
EtaCassiopeia merged 3 commits into
mainfrom
feat/multiprovider-strategy-aliases

Conversation

@EtaCassiopeia
Copy link
Copy Markdown
Owner

@EtaCassiopeia EtaCassiopeia commented May 13, 2026

Summary

FeatureFlags.fromMultiProvider(providers, strategy) accepts a dev.openfeature.sdk.multiprovider.Strategy, so to pick a non-default strategy callers currently have to import the Java SDK package:

```scala
import dev.openfeature.sdk.multiprovider.FirstSuccessfulStrategy
fromMultiProvider(providers, new FirstSuccessfulStrategy)
```

This PR adds a small Scala-friendly facade so the same call becomes:

```scala
import zio.openfeature.MultiProviderStrategy
fromMultiProvider(providers, MultiProviderStrategy.firstSuccessful)
```

Changes

  • New `core/src/main/scala/zio/openfeature/MultiProviderStrategy.scala` — exposes the two built-in strategies (`firstMatch`, `firstSuccessful`) plus a `Strategy` type alias.
  • New `core/src/test/scala/zio/openfeature/MultiProviderStrategySpec.scala` — three tests pinning the aliases.

No edits to existing public API; pure addition.

@EtaCassiopeia EtaCassiopeia merged commit 0a3e58a into main May 13, 2026
1 check passed
@EtaCassiopeia EtaCassiopeia deleted the feat/multiprovider-strategy-aliases branch May 13, 2026 01:52
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