Skip to content

Conversation

@augustinasrce
Copy link
Contributor

This PR

Adds unix socket client for GoFeatureFlag

Related Issues

For #4244

Notes

Follow-up Tasks

How to test

Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @augustinasrce, 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 significantly enhances the GoFeatureFlag Ruby provider by adding support for Unix domain socket communication. This change involves a substantial refactoring of the client architecture, introducing a common base for API clients and specific implementations for HTTP and Unix sockets. The provider can now be configured to use either communication method, providing greater flexibility for deployment scenarios where Unix sockets might be preferred for performance or security reasons.

Highlights

  • Unix Socket Client: Introduced a new client for GoFeatureFlag that communicates over Unix domain sockets, offering an alternative to HTTP for inter-process communication.
  • Client Refactoring: The existing HTTP client logic has been refactored into a common base class (Common) and a dedicated HTTP client class (HttpApi), improving modularity and reusability.
  • Dynamic Client Selection: The GoFeatureFlag::Provider now dynamically selects between the HTTP and Unix clients based on a new type option in the provider's configuration.
  • Endpoint Validation: The Options class has been updated to include a type attribute and now performs endpoint validation specific to the chosen client type (e.g., checking for file existence for Unix sockets).
  • New HttpUnix Class: A new HttpUnix class has been added to handle HTTP requests over Unix sockets, leveraging Net::HTTP and UNIXSocket.
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 👍 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

  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.

@thomaspoignant thomaspoignant changed the title GoFeatureFlag: unix client feat(GoFeatureFlag): unix client Nov 12, 2025
@augustinasrce augustinasrce changed the title feat(GoFeatureFlag): unix client feat: GoFeatureFlag unix client Nov 12, 2025
Copy link
Contributor

@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 Unix socket client for GoFeatureFlag, which is a great addition. The implementation involves refactoring the existing HTTP client into a common base class with two specific implementations for HTTP and Unix sockets. While the overall structure is good, I've found several critical issues that need to be addressed before merging. These include a NameError due to an undefined variable, another NameError from a missing method in the Unix socket communication logic, and an incorrect case statement that makes a code path unreachable. Additionally, I've pointed out some opportunities for improvement regarding code duplication and the use of internal debug methods. Addressing these points will significantly improve the robustness and maintainability of the new code.

Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
Signed-off-by: Augustinas Sueris <augustinas.sueris@vinted.com>
@augustinasrce augustinasrce changed the title feat: GoFeatureFlag unix client feat(GoFeatureFlag): unix client Nov 12, 2025
Copy link
Member

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

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

Hey @augustinasrce thanks a lot for this pull request, this looks really great.
I have only one question around the instrumentation part and a nitpick change on the error message.

…/go-feature-flag/go_feature_flag_provider.rb

Co-authored-by: Thomas Poignant <thomas.poignant@gmail.com>
Signed-off-by: Augustinas <augustinas.sueris@gmail.com>
@thomaspoignant thomaspoignant merged commit 3f68ce8 into open-feature:main Nov 19, 2025
14 checks passed
Zaimwa9 pushed a commit to Zaimwa9/ruby-sdk-contrib that referenced this pull request Nov 21, 2025
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Zaimwa9 pushed a commit to Zaimwa9/ruby-sdk-contrib that referenced this pull request Nov 26, 2025
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Zaimwa9 pushed a commit to Zaimwa9/ruby-sdk-contrib that referenced this pull request Nov 26, 2025
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
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