-
Notifications
You must be signed in to change notification settings - Fork 59
chore(config-cat): Update ConfigCat providers to use the new ConfigCat SDK #1371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Adam Simon <[email protected]>
Signed-off-by: Adam Simon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @adams85, I'm Gemini Code Assist1! 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 focuses on a significant upgrade of the ConfigCat OpenFeature providers by integrating the new, unified ConfigCat SDK. This modernization effort streamlines the underlying SDK usage and refines how user context is translated for feature flag evaluations, ensuring consistency and robustness across the providers. The changes also improve the readiness signal for the providers, making their state more transparent.
Highlights
- SDK Migration: The ConfigCat providers have been updated to use the new, unified ConfigCat SDK for JavaScript, replacing the separate
configcat-js-ssrandconfigcat-nodepackages. This simplifies dependency management and aligns with the latest SDK architecture. - Improved Evaluation Context Mapping: The mapping of evaluation context to ConfigCat user objects has been enhanced to match the behavior of other ConfigCat OpenFeature providers. This includes: 1. The
targetingKeyproperty is now explicitly included in the custom user attributes. 2. IftargetingKeyis not specified, theidentifierattribute is used as a fallback for the user identifier. If neither is present, the SDK will use an empty string. - Updated Error Handling and Event Emission: The providers now leverage the new
EvaluationErrorCodefrom the unified SDK for more precise error translation, replacing the previous string-based error parsing. Additionally, thePROVIDER_READYevent is now emitted more reliably based on the ConfigCat client's initialization state via itsconfigChangedhook.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 👍 and 👎 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.
Footnotes
-
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. ↩
There was a problem hiding this 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 is a significant and well-executed update, migrating the ConfigCat providers to the new unified ConfigCat SDK. The changes bring several improvements, including more robust error handling using error codes instead of string parsing, and a much cleaner provider readiness logic. The evaluation context mapping has been updated to align with other ConfigCat providers, which is a welcome standardization, although it introduces some breaking changes as noted in the description.
I've identified a high-severity issue regarding type safety when handling the identifier in the evaluation context, and a couple of medium-severity documentation inconsistencies that should be addressed to avoid confusion for developers using these providers.
Signed-off-by: Adam Simon <[email protected]>
Signed-off-by: Adam Simon <[email protected]>
36ad932 to
6561083
Compare
…t SDK (open-feature#1371) Signed-off-by: Adam Simon <[email protected]> Co-authored-by: Adam Simon <[email protected]> Signed-off-by: wadii <[email protected]>
…t SDK (#1371) Signed-off-by: Adam Simon <[email protected]> Co-authored-by: Adam Simon <[email protected]> Signed-off-by: Thomas Poignant <[email protected]>
This PR
Updates ConfigCat providers to use the new, unified ConfigCat SDK for JavaScript.
Also, improves the evaluation context to user object mapping to match the behavior of other ConfigCat OpenFeature providers. This comes with some minor breaking changes though:
targetingKeyproperty is also included in the custom user attributes.targetingKeyis not specified, a User Object is still created and theidentifierattribute is used as a fallback. In case that's not specified either, the SDK will use an empty string as the user identifier during feature flag evaluation.Follow-up Tasks
The PR introduces significant breaking changes, so it should be released with an increased major version.