Skip to content

Add zio-openfeature-ofrep module with WireMock-backed tests#119

Merged
EtaCassiopeia merged 6 commits into
mainfrom
feat/ofrep-provider
May 13, 2026
Merged

Add zio-openfeature-ofrep module with WireMock-backed tests#119
EtaCassiopeia merged 6 commits into
mainfrom
feat/ofrep-provider

Conversation

@EtaCassiopeia
Copy link
Copy Markdown
Owner

@EtaCassiopeia EtaCassiopeia commented May 13, 2026

Summary

Adds OFREP (OpenFeature Remote Evaluation Protocol) support as a new sbt sub-module, zio-openfeature-ofrep. OFREP is the standard HTTP protocol for vendor-neutral remote flag evaluation; see https://github.com/open-feature/protocol.

OFREPProvider is a small Scala-friendly factory namespace over the OpenFeature Java SDK's dev.openfeature.contrib.providers.ofrep.OfrepProvider. There is no wrapper class — the factories return the contrib provider directly, so it composes with every existing FeatureFlags.fromProvider* builder.

Why a separate module instead of extras/?

The OFREP contrib provider pulls Jackson (core / databind / jsr310), Guava, Commons Validator, and SLF4J via its HTTP client stack. Putting it in extras would force that footprint on users who only want HoconProvider or EnvVarProvider. The ofrep/ module isolates it.

Changes

  • New ofrep/ sbt module, aggregated by the root project.
    • ofrep/src/main/scala/zio/openfeature/ofrep/OFREPProvider.scala — factory object with three signatures:
      • OFREPProvider() — delegates to the contrib zero-arg constructor (defaults to http://localhost:8016).
      • OFREPProvider(baseUrl: String) — common case.
      • OFREPProvider.fromOptions(opts: OfrepProviderOptions) — full configuration.
    • ofrep/src/test/... — 4 factory unit tests + 8 WireMock integration tests covering all 5 evaluation methods, 404 → FLAG_NOT_FOUND, 401 → non-null error code, and targeting-key/attribute body forwarding.
  • build.sbt: new ofrep module, added to root aggregate. jackson-core dependencyOverrides is scoped to the ofrep module (not ThisBuild) so the rest of the project isn't dragged into Jackson alignment it doesn't need. Override pinned to 2.21.2 to match what OFREP pulls and avoid a split Jackson family at runtime.
  • Docs: new `## OFREP Provider` section in docs/extras.md (dep snippet, usage, configuration options table, async init, transitive-deps note). docs/providers.md Built-in Providers table is split into the extras group and the standalone ofrep module.

Notes

  • Experimental. The contrib provider artifact is at 0.0.1 and OFREP itself is pre-1.0. Both the wire protocol and this Scala facade may change in breaking ways. The class scaladoc and the docs both flag this. Pin the dependency deliberately.
  • WireMock is test-only and stays in the ofrep module's Test scope.
  • The integration spec runs sequentially (TestAspect.sequential) because the contrib provider 0.0.1's internal executor handling is order-sensitive when multiple providers come and go in the same JVM.

@EtaCassiopeia EtaCassiopeia changed the title Add OFREPProvider in extras Add zio-openfeature-ofrep module with WireMock-backed tests May 13, 2026
@EtaCassiopeia EtaCassiopeia merged commit 80984ac into main May 13, 2026
1 check passed
@EtaCassiopeia EtaCassiopeia deleted the feat/ofrep-provider branch May 13, 2026 02: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.

1 participant