Skip to content

Conversation

@erka
Copy link
Contributor

@erka erka commented Oct 24, 2025

This PR

  • Add WithProvider option for registering named providers with optional hooks
  • Remove ProviderMap type in favor of variadic functional options
  • Change NamedProvider from struct to interface
  • Update NewProvider signature to take strategy first, then options
  • Add Track method support to MultiProvider for tracking events
  • Update tests, documentation and examples to reflect new API

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 90.57971% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.07%. Comparing base (7fd7ab6) to head (08f4ade).

Files with missing lines Patch % Lines
openfeature/multi/multiprovider.go 91.45% 7 Missing and 3 partials ⚠️
openfeature/multi/isolation.go 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #444      +/-   ##
==========================================
+ Coverage   82.89%   83.07%   +0.17%     
==========================================
  Files          27       27              
  Lines        2327     1985     -342     
==========================================
- Hits         1929     1649     -280     
+ Misses        363      299      -64     
- Partials       35       37       +2     
Flag Coverage Δ
e2e 83.07% <90.57%> (+0.17%) ⬆️
unit 83.07% <90.57%> (+0.17%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@erka
Copy link
Contributor Author

erka commented Oct 24, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements the Tracker interface for the multi-provider, enabling the forwarding of tracking calls to all ready providers that support tracking. The changes include adding the Tracker interface implementation to the Provider struct, modifying the NewProvider function to handle provider hooks correctly, updating the event handling logic in the Init function, and implementing the Track function to forward tracking calls. Additionally, the pull request includes corresponding unit tests to verify the functionality of the Tracker implementation.

@erka erka marked this pull request as ready for review October 25, 2025 19:21
@erka erka requested review from a team as code owners October 25, 2025 19:21
@erka erka force-pushed the rd/multi-provider-track branch 2 times, most recently from 0769cea to ac0a95e Compare October 27, 2025 18:20
@erka erka changed the title feat(multi): implement Tracker interface and fix event handling refactor(multi): simplify API with functional options pattern Oct 27, 2025
@erka
Copy link
Contributor Author

erka commented Oct 27, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a functional options pattern to simplify the API of the multi-provider, replaces the ProviderMap type with variadic functional options, changes NamedProvider from a struct to an interface, updates the NewProvider signature, adds Track method support, and updates tests and documentation. The changes enhance the flexibility and maintainability of the multi-provider. I have provided comments to address potential issues related to error handling, interface usage, and code clarity.

@erka erka force-pushed the rd/multi-provider-track branch from 10d7a98 to 7a2c8ce Compare October 27, 2025 19:00
@toddbaert
Copy link
Member

I think @thisthat was just mentioning the other day we should do this.

Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no issues with the changes but I think the title should be feat(multi): add tracking, functional options or something like that, since we added that new functionality.

Also it's probably worth noting there's breaking changes here with the multi-provider, but I think that's fine since we explicitly said it's experimental, and it's an auxiliary feature (so let's not add a ! to the title).

@toddbaert
Copy link
Member

toddbaert commented Oct 29, 2025

@erka I'm sorry, I during review I accidentally removed your changes, and GH auto-closes PRs when that happens.

I opened a new one here with all your commits. We can either continue there, or you can try to open this PR again if you move the changes back to this branch (I think that works).

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.

2 participants