buildtest icon indicating copy to clipboard operation
buildtest copied to clipboard

Use latest jsonschema version v4.18 or higher

Open shahzebsiddiqui opened this issue 2 years ago • 1 comments

According to https://github.com/python-jsonschema/jsonschema/releases/tag/v4.18.0 the RefResolver has been deprecated in favor of referencing library which requires a bit of work to change the codebase. This will impact the way we call custom_validator method https://github.com/buildtesters/buildtest/blob/ba44c82e9f9680a114f709bf5f3e558372fea520/buildtest/schemas/defaults.py#L84-L112

What we need to do

  • [ ] Update the requirements.txt and pyproject.toml from jsonschema < 4.18 to jsonschema >= 4.18
  • [ ] Update the file https://github.com/buildtesters/buildtest/blob/devel/buildtest/schemas/defaults.py. The variable schema_table may not be needed we need to update all references.

To summarize the following line needs to be changed since resolver needs to be handled via Registry().with_resource()

resolver = RefResolver.from_schema(
    schema_table["definitions.schema.json"]["recipe"], store=schema_store
)

For more details also check out https://python-jsonschema.readthedocs.io/en/stable/referencing/

shahzebsiddiqui avatar Jul 06 '23 19:07 shahzebsiddiqui

According to https://github.com/python-jsonschema/jsonschema/releases/tag/v4.18.0 the RefResolver has been deprecated in favor of referencing library which requires a bit of work to change the codebase. This will impact the way we call custom_validator method

https://github.com/buildtesters/buildtest/blob/ba44c82e9f9680a114f709bf5f3e558372fea520/buildtest/schemas/defaults.py#L84-L112

upfated

Mariamajib avatar Jul 13 '23 15:07 Mariamajib

@Xiangs18 i created a PR https://github.com/buildtesters/buildtest/pull/1793 so feel free to get started from here.

shahzebsiddiqui avatar Jun 28 '24 16:06 shahzebsiddiqui

this was addressed in https://github.com/buildtesters/buildtest/pull/1802

shahzebsiddiqui avatar Aug 05 '24 18:08 shahzebsiddiqui