Skip to content

Conversation

@bencehornak
Copy link
Contributor

@bencehornak bencehornak commented Jun 23, 2025

This PR

Implements an OFREP provider for Kotlin Multiplatform. The implementation was initially based on @thomaspoignant's OFREP implementation, then I made a bunch of changes to make it compatible with multiple platforms:

  • Replaced Java APIs with Kotlin APIs
  • Replaced jUnit with kotlin-test
  • Replaced OkHttp with Ktor
  • Replaced GSON with kotlinx-serialization
  • Replaced the Java Timer with Kotlin Coroutines
  • ...

Now the project is compatible with multiple platforms, and can be easily extended to other ones by changing the targets in the build.gradle.kts:

Supported Platform Supported versions
Android
JVM JDK 11+
Native Linux x64
Native Other native targets
Javascript (Node.js)
Javascript (Browser)
Wasm

Notes

I have based these changes on the unmerged open-feature/kotlin-sdk#148, which brings in multiplatform support for the SDK.

Prerequisites

How to test

For manual testing: set up a local OFREP provider and try out various evaluations.

Signed-off-by: Bence Hornák <[email protected]>
Signed-off-by: Bence Hornák <[email protected]>
Signed-off-by: Bence Hornák <[email protected]>
Signed-off-by: Bence Hornák <[email protected]>
Signed-off-by: Bence Hornák <[email protected]>
Signed-off-by: Bence Hornák <[email protected]>
Signed-off-by: Bence Hornák <[email protected]>
Signed-off-by: Bence Hornák <[email protected]>
@bencehornak bencehornak changed the title Multiplatform OFREP provider feat: Multiplatform OFREP provider Jun 23, 2025
@thomaspoignant
Copy link
Member

@bencehornak do you know why the CI is failing?
If you need help on this one let me know.

@bencehornak
Copy link
Contributor Author

@thomaspoignant the CI I have fixed in #15, I'm waiting for approvals. If you give it, I can merge it and rebase this one :)

Signed-off-by: Bence Hornák <[email protected]>
@bencehornak
Copy link
Contributor Author

@thomaspoignant I have fixed the CI. From my side the only thing missing is some manual testing. I have no experience with any OFREP backends, can you help with performing some manual tests?

@thomaspoignant
Copy link
Member

thomaspoignant commented Aug 27, 2025

@thomaspoignant I have fixed the CI. From my side the only thing missing is some manual testing. I have no experience with any OFREP backends, can you help with performing some manual tests?

If you want to have a OFREP backend running locally you can use GO Feature Flag easily.

You can launch those 2 commands:

Download an example of a basic configuration file.

curl https://raw.githubusercontent.com/thomaspoignant/go-feature-flag/main/cmd/relayproxy/testdata/dockerhub-example/goff-proxy.yaml -o goff-proxy.yaml

Launch GO Feature Flag in a container

docker run \
  -p 1031:1031 \
  -v $(pwd)/goff-proxy.yaml:/goff/goff-proxy.yaml \
  gofeatureflag/go-feature-flag:latest

It will start GO Feature Flag on port 1031, you can now set your OFREP endpoint to http://localhost:1031 and you should be good to go.

Signed-off-by: Bence Hornák <[email protected]>
Signed-off-by: Bence Hornák <[email protected]>
@bencehornak
Copy link
Contributor Author

@thomaspoignant thanks for the hint, I've added some integration tests with the GOFF container, and fixed some bugs thanks to that. The PR is ready from my side.

@beeme1mr beeme1mr merged commit deb4242 into open-feature:main Sep 8, 2025
3 checks passed
@bencehornak bencehornak deleted the ofrep-provider branch September 8, 2025 17:08
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.

3 participants