-
Notifications
You must be signed in to change notification settings - Fork 94
fix: fixing sync return format missing flag layer #1827
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: fixing sync return format missing flag layer #1827
Conversation
…ider Signed-off-by: Simon Schrottner <[email protected]>
✅ Deploy Preview for polite-licorice-3db33c canceled.
|
Summary of ChangesHello @aepfli, 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 a critical bug in the flag synchronization API where the JSON response format was incorrect. Previously, flag data was directly returned without being encapsulated under a designated 'flags' key. This fix ensures that all flag data is properly nested, aligning the API's output with the expected structure and preventing potential parsing issues for consumers. 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
|
|
we definitely need to get everything going for #1821 to prevent this issue in the future |
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 addresses a bug in the flag sync response format by adding a missing 'flags' layer. The changes in SyncFlags and FetchAllFlags correctly implement this fix. I've suggested a small refactoring to abstract the duplicated logic for creating this response structure into a helper function to improve code maintainability. Additionally, it's worth noting that the existing tests may not be robust enough to catch this kind of structural regression in the JSON response. Strengthening them by unmarshalling and asserting on the response structure could prevent similar issues in the future.
Signed-off-by: Simon Schrottner <[email protected]>
Signed-off-by: Simon Schrottner <[email protected]>
7ccd39b to
402a01a
Compare
bcfd5dc to
69a17a5
Compare
|
Yep, 💯 I found this late last week and was intending to open a bug as well. We need to enhance our testing to run in-process tests to find this - there's much less surface area to test with in-process mode on flagd itself (since evaluation happens in the workload) but it's required to find things like this. Thanks! |
69a17a5 to
bb91ffa
Compare
Signed-off-by: Simon Schrottner <[email protected]>
bb91ffa to
0a5755e
Compare
|
/gemini review |
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 correctly fixes a bug in the flag synchronization response format by adding the missing 'flags' layer. The changes in flagd/pkg/service/flag-sync/handler.go are appropriate. I've included a suggestion to refactor some duplicated code to improve maintainability. Additionally, this PR introduces a significant and beneficial refactoring of the integration tests, moving to a testcontainers-based setup, which is a great improvement for test reliability and isolation. I've noted one minor typo in the new test configuration.
Signed-off-by: Simon Schrottner <[email protected]>
dc8a8e0 to
6392628
Compare
|



with #1797 we introduced this bug, that the format of the response is not correct.
current state:
should be:
Clarification from @toddbaert - this is an UNRELEASED bug so far.