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

To make devfile v2 validation work, update justify library #18901

Closed
sparkoo opened this issue Jan 27, 2021 · 1 comment
Closed

To make devfile v2 validation work, update justify library #18901

sparkoo opened this issue Jan 27, 2021 · 1 comment
Assignees
Labels
area/che-server kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@sparkoo
Copy link
Member

sparkoo commented Jan 27, 2021

Describe the bug

We currently use org.leadpony.justify:justify:0.14.0 for devfile schema validation. However, this version fails to read devfile 2.0 schema (https://github.com/devfile/api/releases/tag/v2.0.0). It fails when parsing the version regex:

org.leadpony.justify.api.JsonValidatingException: [1472,125] The value must be a valid regular expression.
[3246,120] The value must be a valid regular expression.
	at org.leadpony.justify.internal.schema.io.Draft07SchemaReader.dispatchProblems(Draft07SchemaReader.java:1119)
	at org.leadpony.justify.internal.schema.io.Draft07SchemaReader.read(Draft07SchemaReader.java:140)
	at org.leadpony.justify.api.JsonValidationService.readSchema(JsonValidationService.java:157)
	at JsonSchemaFail.test(JsonSchemaFail.java:33)
	at JsonSchemaFail.main(JsonSchemaFail.java:24)

fails on this https://github.com/devfile/api/blob/2.0.x/schemas/latest/devfile.json#L1472

Steps to reproduce

reproducer: https://gist.githubusercontent.com/sparkoo/a395f98a6c5ffead01f816890f6ea445/raw/cfe531301d11545cb0271cba083f771b62d99dfd/JsonSchemaFail.java

You can use jbang to run the reproducer, just download the file and run
docker run -v pwd:/ws:z --workdir=/ws quay.io/jbangdev/jbang-action JsonSchemaFail.java

Expected behavior

To make devfile 2.0 schema validation working, we must have library that is capable to work with the schema. The latest version of justify 3.1.0 seems to work fine -> https://gist.githubusercontent.com/sparkoo/a395f98a6c5ffead01f816890f6ea445/raw/cfe531301d11545cb0271cba083f771b62d99dfd/JsonSchemaPass.java (same code just different dependency)

Be aware that new version now depends on org.glassfish:jakarta.json instead of org.glassfish:javax.json.

Additional context

@sparkoo sparkoo added kind/bug Outline of a bug - must adhere to the bug report template. area/che-server labels Jan 27, 2021
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Jan 27, 2021
@davidfestal davidfestal added severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Jan 27, 2021
@sparkoo sparkoo self-assigned this Feb 9, 2021
@sparkoo
Copy link
Member Author

sparkoo commented Feb 11, 2021

fixed by #19010

@sparkoo sparkoo closed this as completed Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/che-server kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

3 participants