Add zio-openfeature-ofrep module with WireMock-backed tests#119
Merged
Conversation
…warn, sequential aspect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.OFREPProvideris a small Scala-friendly factory namespace over the OpenFeature Java SDK'sdev.openfeature.contrib.providers.ofrep.OfrepProvider. There is no wrapper class — the factories return the contrib provider directly, so it composes with every existingFeatureFlags.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
extraswould force that footprint on users who only wantHoconProviderorEnvVarProvider. Theofrep/module isolates it.Changes
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 tohttp://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: newofrepmodule, added to root aggregate.jackson-coredependencyOverridesis scoped to theofrepmodule (notThisBuild) so the rest of the project isn't dragged into Jackson alignment it doesn't need. Override pinned to2.21.2to match what OFREP pulls and avoid a split Jackson family at runtime.docs/extras.md(dep snippet, usage, configuration options table, async init, transitive-deps note).docs/providers.mdBuilt-in Providers table is split into theextrasgroup and the standaloneofrepmodule.Notes
0.0.1and 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.ofrepmodule'sTestscope.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.