-
Notifications
You must be signed in to change notification settings - Fork 93
Remove deprecated field in Queue.Spec, and generate auto convert func for Queue.Spec #186
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
Remove deprecated field in Queue.Spec, and generate auto convert func for Queue.Spec #186
Conversation
… for Queue.Spec Signed-off-by: jessestutler <chenzicong4@huawei.com>
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.
Summary of Changes
Hello @JesseStutler, 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 improves the maintainability and correctness of API version conversions for Queue resources. By removing a deprecated field that blocked auto-generation and transitioning from a manually maintained conversion function to an automatically generated one, the PR ensures that all QueueSpec fields are properly handled across API versions, reducing the risk of data loss or inconsistencies and simplifying future API evolution.
Highlights
- API Definition Cleanup: The deprecated
Statefield has been removed fromQueueSpecinpkg/apis/scheduling/types.go. This field was previously marked as deprecated and has been moved toQueueStatus. - Automated API Conversion: The manual conversion function for
QueueSpec(Convert_scheduling_QueueSpec_To_v1beta1_QueueSpec) has been removed frompkg/apis/scheduling/v1beta1/conversion.goand is now automatically generated. This ensures that all fields, including newly added ones likeDeservedandAffinity, are correctly handled during API version conversions without requiring manual updates. - Generated Code Updates: The
zz_generated.conversion.gofile has been updated to reflect the new auto-generated conversion logic forQueueSpecandQueueList, leveragingunsafe.Pointerfor efficient deep copying of list items.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 is currently in preview and 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 to provide feedback.
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
-
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. ↩
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 removes a deprecated field in Queue.Spec and generates auto convert functions for Queue.Spec. The changes improve maintainability by automating the conversion process. However, the use of unsafe.Pointer in the generated code raises concerns about long-term safety and maintainability.
|
/cc @kingeasternsun |
|
Remove this field will cause API uncompatible. |
Not really, I have deleted the field in the core type, core type always have the latest fields. Users are directly using the queue definition from v1beta1, but the Queue in v1beta1 doesn't have this field. This will affect the generation of the convert function. Now, manual conversion is missing many fields @Monokaix |
|
Generally speaking, adding fields does not require updating the version, but deleting fields requires updating the crd version. |
@hwdef In v1beta1, the Queue does not have this field, so regenerating the CRD will not make any changes. I just modified the versionless queue, which is the core type. This queue is not directly used by users, generally, it's used by internal components such as vc-scheduler for conversion purposes, so there's no impact |
It make sense. |
|
Not specific to this PR, we need a integration test with the main repo to ensure API changes won't break any existing implementation. |
kevin-wangzefeng
left a comment
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.
/approve
Thanks
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kevin-wangzefeng The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #185
Currently core version of QueueSpec contains a deprecated field
State, this field has already moved to QueueStatus. Therefore we should delete it. Otherwise it will block us from generating auto-converting func. And currently the converting funcConvert_scheduling_QueueSpec_To_v1beta1_QueueSpecis manually written, it misses lots of fields such asDeserved,Affinity, etc. If contributors add more fields to QueueSpec, they may miss adding deep copy logic to this converting func, which should be automatically generated instead of manually modified