Skip to content

Conversation

@JesseStutler
Copy link
Member

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 func Convert_scheduling_QueueSpec_To_v1beta1_QueueSpec is manually written, it misses lots of fields such as Deserved, 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

… for Queue.Spec

Signed-off-by: jessestutler <chenzicong4@huawei.com>
Copy link

@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.

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 State field has been removed from QueueSpec in pkg/apis/scheduling/types.go. This field was previously marked as deprecated and has been moved to QueueStatus.
  • Automated API Conversion: The manual conversion function for QueueSpec (Convert_scheduling_QueueSpec_To_v1beta1_QueueSpec) has been removed from pkg/apis/scheduling/v1beta1/conversion.go and is now automatically generated. This ensures that all fields, including newly added ones like Deserved and Affinity, are correctly handled during API version conversions without requiring manual updates.
  • Generated Code Updates: The zz_generated.conversion.go file has been updated to reflect the new auto-generated conversion logic for QueueSpec and QueueList, leveraging unsafe.Pointer for 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

  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.

@JesseStutler
Copy link
Member Author

Copy link

@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 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.

@JesseStutler
Copy link
Member Author

/cc @kingeasternsun

@Monokaix
Copy link
Member

Remove this field will cause API uncompatible.

@JesseStutler
Copy link
Member Author

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

@hwdef
Copy link
Member

hwdef commented Sep 18, 2025

Generally speaking, adding fields does not require updating the version, but deleting fields requires updating the crd version.

@JesseStutler
Copy link
Member Author

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

@hwdef
Copy link
Member

hwdef commented Sep 18, 2025

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.
/lgtm

@kevin-wangzefeng
Copy link
Member

Not specific to this PR, we need a integration test with the main repo to ensure API changes won't break any existing implementation.

Copy link
Member

@kevin-wangzefeng kevin-wangzefeng left a comment

Choose a reason for hiding this comment

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

/approve
Thanks

@volcano-sh-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot merged commit da96989 into volcano-sh:master Sep 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When Queue is converted from core version to v1beta1 version, the Affinity assignment is lost

5 participants