java-sdk icon indicating copy to clipboard operation
java-sdk copied to clipboard

feat: Add multi-provider support

Open suvaidkhan opened this issue 5 months ago • 13 comments

This PR

  • Added Multiprovider class
  • Added Strategies
  • Added a new dependency for JSON

Related Issues

Resolves #1486

Follow-up Tasks

Multiprovider should be removed from the contrib codebase

suvaidkhan avatar Jul 01 '25 07:07 suvaidkhan

Codecov Report

:x: Patch coverage is 96.38554% with 3 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 93.45%. Comparing base (e67f598) to head (84bc45a). :warning: Report is 85 commits behind head on main.

Files with missing lines Patch % Lines
...v/openfeature/sdk/multiprovider/MultiProvider.java 94.64% 2 Missing and 1 partial :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1500      +/-   ##
============================================
+ Coverage     92.97%   93.45%   +0.47%     
- Complexity      488      519      +31     
============================================
  Files            46       50       +4     
  Lines          1182     1253      +71     
  Branches        103      112       +9     
============================================
+ Hits           1099     1171      +72     
+ Misses           53       51       -2     
- Partials         30       31       +1     
Flag Coverage Δ
unittests 93.45% <96.38%> (+0.47%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jul 01 '25 08:07 codecov[bot]

Looks good so far! I'm not sure if we want to add a json dependecy (which might also produce the License Compliance error) "just" so that we can build up the metadata name string.

Should I construct the json using Strings?

suvaidkhan avatar Jul 03 '25 08:07 suvaidkhan

Maybe it would be worth it. @toddbaert what do you think?

chrfwow avatar Jul 03 '25 11:07 chrfwow

@chrfwow @toddbaert any updates on this?

suvaidkhan avatar Jul 08 '25 18:07 suvaidkhan

Thank you, great effort. I am looking forward to having the multiprovider migrated. For me, the added dependency is currently a show stopper, because I think we can handle that with proper and simple data classes, even with better metadata support overall (not losing information from the sub providers). I added simple but untested code snippets to my review. Please let me know what you think about this approach.

Looks good to me. I'll add these changes and some UTs to make sure it's working correctly.

suvaidkhan avatar Jul 10 '25 03:07 suvaidkhan

Hey @aepfli @chrfwow this is ready for review

suvaidkhan avatar Jul 22 '25 06:07 suvaidkhan

/gemini review

aepfli avatar Aug 26 '25 11:08 aepfli

okay @suvaidkhan - as we now have gemini support, i executed the gemini review, and i think the initialization issue seems to be critical. We do have two options here - first we add the feedback for gemini now, and wait for your implementation before merging, or second option, we are merging this, and create an issue to address the gemini feedback regarding initialization. wdyt?

aepfli avatar Aug 26 '25 11:08 aepfli

okay @suvaidkhan - as we now have gemini support, i executed the gemini review, and i think the initialization issue seems to be critical. We do have two options here - first we add the feedback for gemini now, and wait for your implementation before merging, or second option, we are merging this, and create an issue to address the gemini feedback regarding initialization. wdyt?

I'm fine with both But I think it makes more sense to fix the issue before merging

suvaidkhan avatar Aug 26 '25 22:08 suvaidkhan

@suvaidkhan are you still working on this?

chrfwow avatar Sep 25 '25 09:09 chrfwow

@suvaidkhan are you still working on this?

Hey yes sorry this slipped my mind, I'll take care of the null pointer asap

suvaidkhan avatar Sep 26 '25 02:09 suvaidkhan

@suvaidkhan your proposal looks already quite handy. Looking forward to use it soon instead of the Java Contrib MultiProvider.

guidobrei avatar Nov 21 '25 18:11 guidobrei