Skip to content

feat(validation-gen): support validation ratcheting for list #132469

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

yongruilin
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds support validation ratcheting for list.
The commits cherry-picked here, have been reviewed and merged in dev repo.

Which issue(s) this PR is related to:

Ref:

Special notes for your reviewer:

The related KEP has been merged:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/5073-declarative-validation-with-validation-gen/README.md

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/code-generation kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. labels Jun 23, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 23, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG Apps Jun 23, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yongruilin
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@yongruilin
Copy link
Contributor Author

/cc @aaron-prindle @jpbetz @thockin
/sig api-machinery
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 23, 2025
@yongruilin yongruilin force-pushed the master_vg_ratcheting-list branch from 6874397 to fb477ed Compare June 23, 2025 21:33
thockin and others added 6 commits June 23, 2025 21:41
Co-authored-by: Yongrui Lin <[email protected]>
- identify listtype=set and store in shared listMetadata
- pass in cmp for lookup in eachVal
- add validate.SemanticDeepEqual as cmpArg for non-comparable args
- Only use simple comparison for built-in types
yongruilin and others added 8 commits June 23, 2025 21:44
- Introduced SliceFalselyComparableField to Struct and ImmutableStruct
- Updated validation logic to handle unique and deep equality checks for falsely comparable structs
- Enhanced test cases to validate the new field's behavior
- Updated EachSliceVal to support a match function and an equivalence comparison function, enhancing its flexibility for validation.
- Adjusted related validation logic and tests to utilize the new structure, ensuring backward compatibility and improved validation accuracy.
@yongruilin yongruilin force-pushed the master_vg_ratcheting-list branch from fb477ed to 2cf7f44 Compare June 23, 2025 21:46
@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code-generation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

4 participants