- 
                Notifications
    
You must be signed in to change notification settings  - Fork 58
 
fix: flagsmith string to double conversion issue(#1557) #1620
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
base: main
Are you sure you want to change the base?
fix: flagsmith string to double conversion issue(#1557) #1620
Conversation
Signed-off-by: Kush Batra <kush.batra@gmail.com>
          Summary of ChangesHello @kushbatra, 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 resolves an issue in the Flagsmith provider where numeric flag values, when returned as strings, were not correctly converted to their expected  Highlights
 Using Gemini Code AssistThe 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  
 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  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
  | 
    
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 successfully addresses an issue where string representations of numbers from Flagsmith were not correctly converted to Double or Integer types. The changes in FlagsmithProvider introduce parsing logic for these cases, and the new tests in FlagsmithProviderTest effectively validate this new functionality. My review includes a couple of suggestions to refactor the new code to improve maintainability by reducing duplication in both the provider logic and the tests.
        
          
                ...s/flagsmith/src/main/java/dev.openfeature.contrib.providers.flagsmith/FlagsmithProvider.java
          
            Show resolved
            Hide resolved
        
              
          
                ...agsmith/src/test/java/dev.openfeature.contrib.providers.flagsmith/FlagsmithProviderTest.java
          
            Show resolved
            Hide resolved
        
      | 
           I’ve raised this PR to address the feedback from PR-1617. After several review iterations, I’ve resolved the Gemini-related comments and ensured the main logic and additional use cases are implemented. If there are further suggestions, I’d be happy to consider them in a separate PR or issue. Thank you for your ongoing feedback and support!  | 
    
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.
Looks good! There are some code format issues, which can be fixed with mvn spotless:apply
This PR
This PR fixes the issue where FlagsmithProvider.getDoubleDetails fails to parse flag values returned as strings (e.g., "42.42") from Flagsmith. Previously, the provider expected a java.lang.Double and returned an error if the value was a string. With this change, the provider will attempt to parse string values to Double when evaluating double flags, ensuring compatibility with Flagsmith environments that store numeric values as strings. Similar case is handled for Integer as well.
Related Issues
Fixes #1557
Notes
Follow-up Tasks
How to test