- Notifications
You must be signed in to change notification settings - Fork 636
Add a Make target that runs crd-schema-checker #4288
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
Conversation
Makefile Outdated
| define NL | ||
| | ||
| | ||
| endef |
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.
What is this?
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.
Defining a newline? Does the awk on l. 156 need a newline?
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.
What is this?
Defining a newline?
Yeah, this is a Make variable that contains one newline.
Does the
awkon l. 156 need a newline?
Without the newline, Make prints all the go run commands at once, then four outputs from the tool come out. With this, each command and its output are separated like this:
go run github.com/openshift/crd-schema-checker/cmd/crd-schema-checker@latest check-manifests --new-crd-filename 'config/crd/bases/postgresoperator.crunchydata.com_crunchybridgeclusters.yaml' 2>&1 | awk -f hack/check-manifests.awk ## ## wall of log lines ## go run github.com/openshift/crd-schema-checker/cmd/crd-schema-checker@latest check-manifests --new-crd-filename 'config/crd/bases/postgres-operator.crunchydata.com_pgadmins.yaml' 2>&1 | awk -f hack/check-manifests.awk ## ## wall of log lines ## go run github.com/openshift/crd-schema-checker/cmd/crd-schema-checker@latest check-manifests --new-crd-filename 'config/crd/bases/postgres-operator.crunchydata.com_pgupgrades.yaml' 2>&1 | awk -f hack/check-manifests.awk ## ## wall of log lines ## go run github.com/openshift/crd-schema-checker/cmd/crd-schema-checker@latest check-manifests --new-crd-filename 'config/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml' 2>&1 | awk -f hack/check-manifests.awk ## ## wall of log lines ##🤔 What's a better way to present / read this stuff?
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.
config/crd/bases/postgres-operator.crunchydata.com_pgadmins.yaml Outdated Show resolved Hide resolved
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.
No blockers
This tool estimates the total and relative cost of CEL validation rules. See: https://github.com/openshift/crd-schema-checker
| Just thinking aloud here, but this make target isn't wired up to any other make target, so we might want to write / think about some guidance about when to use it. It's not just for checking CEL rule budget, yeah? |
4ca0d19 to b5ab008 Compare
I don't understand the tool enough to give any guidance, really. I used it to check CEL budgets, but I have no idea how accurate that was (or if accuracy even matters). When we understand the tool better, we can configure it and wire it up as a blocking check.
|
b5ab008 to eeac678 Compare | I've reverted the CRD changes. This PR adds an easy way to invoke the schema checker. |
Checklist:
This tool helped me understand the cost of CEL validation rules as I was writing them.
The second and third commits are optional; I followed some of the recommendations emitted by the tool.Edit: Removed these commits.The output for PGUpgrades looks similar to: