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

Start using JSON Schema for validation #83

Closed
wants to merge 1 commit into from
Closed

Start using JSON Schema for validation #83

wants to merge 1 commit into from

Conversation

csomh
Copy link
Contributor

@csomh csomh commented Mar 22, 2019

Refactor CRD and CSV validation, and use JSON Schema
instead of nested if-s.

This should make future validation easier.

TODO:

  • write some documentation explaining all this.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 22, 2019
@openshift-ci-robot openshift-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 22, 2019
@openshift-ci-robot
Copy link

Hi @csomh. Thanks for your PR.

I'm waiting for a operator-framework or openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 22, 2019
@csomh
Copy link
Contributor Author

csomh commented Mar 22, 2019

This should resolve #17 and #39.

@kevinrizza
Copy link
Member

@csomh Just wanted to say good work on this! It seems like it satisfies a lot of the basic cases, and allows us to just codify the more complex comparisons. I would like to take some time and ensure that all of the use cases that were covered previously are still working here -- but in general I do like this approach.

One thing I want to point out is that this does change the formatting of most/all of the log messages, which to me is a breaking change -- so we would have to either update this PR to retain the old format of the logs or we would need to bump the major version. I would prefer the former.

@scoheb
Copy link
Member

scoheb commented Mar 25, 2019

FYI @kevinrizza as one of the consumers of courier...CVP does not rely on the format of the log messages.

@csomh csomh changed the title WIP: Start using JSON Schema for validation Start using JSON Schema for validation Mar 26, 2019
@openshift-ci-robot openshift-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 26, 2019
@csomh
Copy link
Contributor Author

csomh commented Mar 26, 2019

@kevinrizza thanks!

As for the format of log messages: would it be possible to sync releasing this change with the future fix for #74, which will probably also change the format of the log messages?

I'm asking this, because keeping the old format of the messages requires parsing the error.message from jsonschema and reconstructing the current error messages. But then, the current error messages resulting from validation issues will probably not match in style the new error messages that will pop up due to fine tuning the schemas.

I would rather stick to the current concatenate error.absolute_path with error.message approach, as it's short, simple and provides a consistent style on the long run.

@kevinrizza
Copy link
Member

@csomh Agreed, if we are going to make format changes to all of the log messages, my preference would be to make a more sweeping change that would give more detail as to what csv or crd is causing the error. I'm not opposed to the changes to the logger in principle, just to the timing of them. If that is directly tied to this PR because of technical reasons, then lets hold this pr until we make that change as well.

@openshift-ci-robot openshift-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 2, 2019
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 27, 2019
Refactor CRD and CSV validation, and use JSON Schema
instead of nested if-s.

This should make future validation easier.

Signed-off-by: Hunor Csomortáni <[email protected]>
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 29, 2019
@openshift-ci-robot
Copy link

@csomh: PR needs rebase.

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.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 31, 2019
@csomh
Copy link
Contributor Author

csomh commented Dec 13, 2021

I think this isn't relevant anymore 🙂 Closing.

@csomh csomh closed this Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants