-
Notifications
You must be signed in to change notification settings - Fork 8
Feat: docker swarm support #44
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
Summary of ChangesHello @mesudip, 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 Nginx proxy by integrating robust support for Docker Swarm services. It achieves this through a fundamental refactoring that introduces a generic Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 introduces significant new functionality by adding support for Docker Swarm. The core of this change is a well-executed refactoring that abstracts away from Docker containers into a more generic BackendTarget, which can represent either a container or a Swarm service. This abstraction is consistently applied across the codebase. The DockerEventListener has been enhanced to use threading, allowing it to monitor events from both a local Docker daemon and a remote Swarm manager simultaneously, which is a robust solution. Furthermore, the test suite has been substantially improved and expanded to validate the new Swarm integration modes and backend types, which is commendable. My review includes a few suggestions to fix minor typos, improve exception handling, and adhere to Python best practices, which will enhance the overall quality and robustness of the code.
| def get_container_env_map(container: DockerContainer): | ||
| container_env = container.attrs["Config"]["Env"] | ||
| env_list = [x.split("=", 1) for x in container_env] if container_env else [] | ||
| return {x[0]: x[1] for x in env_list if len(x) == 2} |
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.
The value of the environment variable is not being stripped of whitespace. This could lead to unexpected behavior if environment variables have leading or trailing spaces. The previous implementation in Container.py included .strip(), and it would be good to retain that behavior for consistency and robustness.
| return {x[0]: x[1] for x in env_list if len(x) == 2} | |
| return {x[0]: x[1].strip() for x in env_list if len(x) == 2} |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #44 +/- ##
==========================================
+ Coverage 69.76% 71.24% +1.47%
==========================================
Files 39 45 +6
Lines 3165 3884 +719
Branches 406 496 +90
==========================================
+ Hits 2208 2767 +559
- Misses 820 945 +125
- Partials 137 172 +35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
598b1c4 to
d1b4035
Compare
No description provided.