Skip to content
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

CEL MaxLength integration #108419

Merged

Conversation

DangerOnTheRanger
Copy link
Contributor

@DangerOnTheRanger DangerOnTheRanger commented Mar 1, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR extracts the OpenAPIv3 maxLength property (or its equivalent for non-string datatypes) when given by the user and estimating it otherwise before reporting the total expression cost from cel.Compile; each expression passed through Compile now has a static cost returned with it. The final piece of the puzzle (which will be in #108612) will be to then use those costs to determine what to run and what not to run for the sake of apiserver performance. Part of #107573.

Which issue(s) this PR fixes:

Special notes for your reviewer:

da68d7bb21fe42f53c7357073dbf66a21328e61b can be ignored/does not need to be reviewed; that commit is purely from running ./hack/pin-dependency.sh github.com/google/cel-go 9ef90eddf66efeea82f81bf35326ca85f99f859e and then running update-vendor.sh.

Does this PR introduce a user-facing change?

NONE

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


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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/dependency Issues or PRs related to dependency changes sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 1, 2022
@k8s-ci-robot k8s-ci-robot requested review from jpbetz, logicalhan and a team March 1, 2022 15:52
@DangerOnTheRanger
Copy link
Contributor Author

/hold still missing a couple corner cases

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 1, 2022
@DangerOnTheRanger DangerOnTheRanger changed the title [WIP] CEL MaxLength integration CEL MaxLength integration Mar 1, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 1, 2022
@jpbetz
Copy link
Contributor

jpbetz commented Mar 1, 2022

/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 Mar 1, 2022
@liggitt
Copy link
Member

liggitt commented Mar 15, 2022

The final piece of the puzzle (which will be in another PR) will be to then use those costs to determine what to run and what not to run for the sake of apiserver performance.

Is that where we'll handle things like a rule with cost 1 on a list with maxItems: 1, but which is inside multiple nested lists of unbounded length?

@DangerOnTheRanger
Copy link
Contributor Author

The final piece of the puzzle (which will be in another PR) will be to then use those costs to determine what to run and what not to run for the sake of apiserver performance.

Is that where we'll handle things like a rule with cost 1 on a list with maxItems: 1, but which is inside multiple nested lists of unbounded length?

Right - #108612 will handle things like that when it merges.

@DangerOnTheRanger
Copy link
Contributor Author

/retest

@liggitt
Copy link
Member

liggitt commented Mar 15, 2022

lgtm once squashed and CI is green

@DangerOnTheRanger
Copy link
Contributor Author

/retest

@DangerOnTheRanger
Copy link
Contributor Author

/retest

2 similar comments
@DangerOnTheRanger
Copy link
Contributor Author

/retest

@DangerOnTheRanger
Copy link
Contributor Author

/retest

@jpbetz
Copy link
Contributor

jpbetz commented Mar 16, 2022

/retest

@liggitt
Copy link
Member

liggitt commented Mar 16, 2022

/lgtm
/approve

unhold at will

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 16, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DangerOnTheRanger, liggitt

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2022
@liggitt
Copy link
Member

liggitt commented Mar 16, 2022

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 16, 2022
@DangerOnTheRanger
Copy link
Contributor Author

/retest

1 similar comment
@DangerOnTheRanger
Copy link
Contributor Author

/retest

@k8s-ci-robot
Copy link
Contributor

@DangerOnTheRanger: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-e2e-kind-ipv6 83e4d19 link unknown /test pull-kubernetes-e2e-kind-ipv6

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@DangerOnTheRanger
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 1d7599b into kubernetes:master Mar 16, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/dependency Issues or PRs related to dependency changes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants