php-sdk
php-sdk copied to clipboard
feat: Implement Multiprovider feature
Task
Multiprovider feature: https://openfeature.dev/specification/appendix-a#multi-provider
Summary of Changes
Hello @Tmakinde, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request establishes the foundational Multiprovider class, which is crucial for handling multiple feature flag providers. It focuses on robust input validation and systematic registration of providers, ensuring data integrity and preventing naming conflicts, thereby setting the stage for advanced multiprovider capabilities.
Highlights
- New Multiprovider Class: Introduced a new
Multiproviderclass to manage multiple feature flag providers, aligning with the OpenFeature multiprovider specification. - Provider Data Validation: Implemented
validateProviderDatato ensure provider input arrays contain only supported keys, have non-empty names, and prevent duplicate explicit provider names. - Provider Registration and Unique Naming: Developed
registerProvidersanduniqueProviderNamemethods to register providers by name, automatically generating unique names for providers that are unnamed or have conflicting names by appending a numerical suffix.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.
Hey @Tmakinde , initial thoughts here is that other languages utilized the contrib repository for implementing the multi provider. The reasoning as I understand it is it's an extension of the primary provider, not a function of it itself.
That said it would be fairly straightforward to add support for it there
@beeme1mr is that the expectation for all languages?
Hey @Tmakinde , initial thoughts here is that other languages utilized the contrib repository for implementing the multi provider. The reasoning as I understand it is it's an extension of the primary provider, not a function of it itself.
That said it would be fairly straightforward to add support for it there
@beeme1mr is that the expectation for all languages?
Ooh.
Please let me know the best place to implement this.
@beeme1mr told me it should be in php-sdk repo.
Please confirm.
We've been slowly moving the multi-providers to the SDKs themselves. The logic being that it's easier to access and manage provider state from within the SDK and it shouldn't add too much complexity to the SDKs. The .NET SDK is a good example of what we're looking for.
We've been slowly moving the multi-providers to the SDKs themselves. The logic being that it's easier to access and manage provider state from within the SDK and it shouldn't add too much complexity to the SDKs. The .NET SDK is a good example of what we're looking for.
Thank you @beeme1mr
Codecov Report
:x: Patch coverage is 95.30686% with 13 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 96.23%. Comparing base (2123274) to head (418f73a).
:warning: Report is 24 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #159 +/- ##
============================================
+ Coverage 95.19% 96.23% +1.03%
- Complexity 227 343 +116
============================================
Files 40 49 +9
Lines 583 850 +267
============================================
+ Hits 555 818 +263
- Misses 28 32 +4
: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.