-
Notifications
You must be signed in to change notification settings - Fork 26
fix aenv service create and rm update image #61
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?
Conversation
Summary of ChangesHello @JacksonMei, 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 streamlines 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 two main changes: it removes the ability to update a service's container image via aenv service update, and it enhances aenv service create to fetch missing configuration from envhub.
The removal of the image update functionality is consistently applied across the CLI, API client, API service, and documentation.
The enhancement to service creation is a great improvement, making the CLI more flexible. The implementation correctly falls back to envhub configuration for most parameters. However, I've noticed a logical inconsistency in how the replicas parameter is handled in the API service compared to other parameters like port and storageSize. My review includes a suggestion to align this for consistency.
Overall, the changes are well-structured. Addressing the noted inconsistency will make the new feature more robust and predictable.
| // Override replicas from request, otherwise use envhub config | ||
| backendEnv.DeployConfig["replicas"] = req.Replicas |
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 logic for setting replicas is inconsistent with other newly added logic for parameters like port and storageSize. The current implementation unconditionally overrides the replicas value from the request and does not fall back to the serviceConfig from envhub as the comment suggests. This differs from how port, storageSize, etc., are handled, which correctly implement the fallback logic.
To ensure consistency, the logic for replicas should be updated to also fall back to serviceConfig if not provided in the request. Note that for this to work as intended, the default assignment if req.Replicas == 0 { req.Replicas = 1 } (around line 89) should be removed to allow the request's replicas to be 0 when not specified, thus triggering the fallback.
| // Override replicas from request, otherwise use envhub config | |
| backendEnv.DeployConfig["replicas"] = req.Replicas | |
| // Override replicas from request, otherwise use envhub config | |
| if req.Replicas > 0 { | |
| backendEnv.DeployConfig["replicas"] = req.Replicas | |
| } else if replicas, ok := serviceConfig["replicas"].(float64); ok { | |
| backendEnv.DeployConfig["replicas"] = int32(replicas) | |
| } |
No description provided.