Open-CMSIS-Pack / devtools

Open-CMSIS-Pack development tools - C++
Apache License 2.0
69 stars 50 forks source link

`[cbuild schema]` Backward incompatibility introduced in version 2.3 of the schema #1553

Closed acabarbaye closed 1 week ago

acabarbaye commented 1 month ago

schema validation currently fails on some 2. versions of generated .cbuild.yml files due to the following issue:

MassStorage.cproject.yml solution: ../workspace/workspace/MassStorage/MassStorage.csolution.yml]]] against schema: jsonschema: '/build/generators/0' does not validate with https: [//raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/2.3.0/tools/projmgr/schemas/cbuild.schema.json#/properties/build/$ref/properties/generators/$ref/items/$ref/required](https://arm-ce.slack.com//raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/2.3.0/tools/projmgr/schemas/cbuild.schema.json#/properties/build/$ref/properties/generators/$ref/items/$ref/required): missing properties: 'from-pack'"

Generated cbuild file using cbuild 2.1 or 2.2 indeed does not have the following section from-pack

which was marked as required as part of release 2.3

Environment:

cbuild 2.1
cbuild 2.2
linux

And therefore, a breaking change was introduced in version 2.3 of the schema.

Potential Solution?

Make the schema backward compatible and remove from-pack from the list of required fields. Indeed, any change to a required list represents a breaking change

Impact

cbuild.yml is now parsed by our tools to determine artefacts produced by a build and therefore, needs to abide by the schema so that there is no parsing issues. We expect to only have to define one parser of cbuild files for all 2. versions of the schema. It is hence crucial that backward compatibility is ensured over all 2. versions.

Additional context Add any other context about the problem here.

ReinhardKeil commented 3 weeks ago

@acabarbaye when I understand this request correctly, you ask for a schema that is compatible with CMSIS-Toolbox 2.0, 2.1, 2.2, 2.3, 2.4, and so one.

In an cloud environment we will use the latest versions of the tools. There should be no need for this and we should be pragmatic here. The schema should therefore match the latest toolbox, but should in case of from-pack also tolerate YML inputs from previous versions. I believe this is already the case.

acabarbaye commented 2 weeks ago

@ReinhardKeil I probably didn't explain the problem we are facing properly. We are currently in the situation where "schema in case of from-pack" does not "tolerate YML inputs from previous versions". Indeed previous versions of the files do not set the from-pack which was introduced in 2.3 and since it is also marked as required as part of that version, this version of the schema cannot be used to parse/validate YML files from previous versions. Hence the break of backward compatility. My suggestion (and the patch we had to introduce) is to remove the from-pack from the required list.

jkrech commented 2 weeks ago

Action: remove the from-pack node from the required list and make it optional.