mbox series

[RFC,0/5] Bitbake-setup configuration schema

Message ID 20251017231444.374436-1-yoann.congal@smile.fr
Headers show
Series Bitbake-setup configuration schema | expand

Message

Yoann Congal Oct. 17, 2025, 11:14 p.m. UTC
This series focuses on adding a JSON-schema for the bitbake-setup
configuration format. I still have some doubt about how strict I should
make the schema (hence this RFC).

Also I tested by adding a validation step to the bitbake-setup
selftest but it has non-stdlib dependcies (also a RFC about how to
handle that).

Regards,

Yoann Congal (5):
  schemas: import layers.schema.json from OE-Core
  schemas: add $schema specification to the layers schema
  schemas: Add bitbake-setup JSON schema
  bitbake-setup: Add an option to validate the schema
  lib/bb/tests/setup.py: validate JSON schema during tests

 bin/bitbake-setup                 |  41 ++++++++++++
 lib/bb/tests/setup.py             |   2 +-
 schemas/bitbake-setup.schema.json | 108 ++++++++++++++++++++++++++++++
 schemas/layers.schema.json        |  77 +++++++++++++++++++++
 4 files changed, 227 insertions(+), 1 deletion(-)
 create mode 100644 schemas/bitbake-setup.schema.json
 create mode 100644 schemas/layers.schema.json

Comments

Yoann Congal Oct. 19, 2025, 9:06 p.m. UTC | #1
Le sam. 18 oct. 2025 à 01:15, Yoann Congal <yoann.congal@smile.fr> a écrit :

> This series focuses on adding a JSON-schema for the bitbake-setup
> configuration format. I still have some doubt about how strict I should
> make the schema (hence this RFC).
>
> Also I tested by adding a validation step to the bitbake-setup
> selftest but it has non-stdlib dependcies (also a RFC about how to
> handle that).
>

Mathieu tested this on AB (thanks!), as expected, it failed on
"ModuleNotFoundError: No module named 'jsonschema'" [0]

Thinking about it, a less intrusive test could be to reproduce the layers
schema test [1]: building the jsonschema dependency with OE-Core and use it
to validate the schema & default-registry.
But, this approach has one drawback : it can not be used to validate the
configs used inside bitbake-setup selftests (which can't depend on
oe-core). And IMHO, this is where the new config elements will appear.

Finally, given where we are in the release cycle, "less intrusive" is key.
So, I think I will send a patch series with this and go from there.

[0]:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/2576/steps/12/logs/stdio
[1]:
https://git.yoctoproject.org/poky/tree/meta/lib/oeqa/selftest/cases/bblayers.py

>
> Regards,
>
> Yoann Congal (5):
>   schemas: import layers.schema.json from OE-Core
>   schemas: add $schema specification to the layers schema
>   schemas: Add bitbake-setup JSON schema
>   bitbake-setup: Add an option to validate the schema
>   lib/bb/tests/setup.py: validate JSON schema during tests
>
>  bin/bitbake-setup                 |  41 ++++++++++++
>  lib/bb/tests/setup.py             |   2 +-
>  schemas/bitbake-setup.schema.json | 108 ++++++++++++++++++++++++++++++
>  schemas/layers.schema.json        |  77 +++++++++++++++++++++
>  4 files changed, 227 insertions(+), 1 deletion(-)
>  create mode 100644 schemas/bitbake-setup.schema.json
>  create mode 100644 schemas/layers.schema.json
>
>
Alexander Kanavin Oct. 20, 2025, 12:15 p.m. UTC | #2
On Sun, 19 Oct 2025 at 23:06, Yoann Congal via lists.openembedded.org
<yoann.congal=smile.fr@lists.openembedded.org> wrote:
>
> Le sam. 18 oct. 2025 à 01:15, Yoann Congal <yoann.congal@smile.fr> a écrit :
>>
>> This series focuses on adding a JSON-schema for the bitbake-setup
>> configuration format. I still have some doubt about how strict I should
>> make the schema (hence this RFC).
>>
>> Also I tested by adding a validation step to the bitbake-setup
>> selftest but it has non-stdlib dependcies (also a RFC about how to
>> handle that).
>
>
> Mathieu tested this on AB (thanks!), as expected, it failed on "ModuleNotFoundError: No module named 'jsonschema'" [0]
>
> Thinking about it, a less intrusive test could be to reproduce the layers schema test [1]: building the jsonschema dependency with OE-Core and use it to validate the schema & default-registry.
> But, this approach has one drawback : it can not be used to validate the configs used inside bitbake-setup selftests (which can't depend on oe-core). And IMHO, this is where the new config elements will appear.
>
> Finally, given where we are in the release cycle, "less intrusive" is key. So, I think I will send a patch series with this and go from there.
>
> [0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/2576/steps/12/logs/stdio
> [1]: https://git.yoctoproject.org/poky/tree/meta/lib/oeqa/selftest/cases/bblayers.py

Thanks for working on this. I'd suggest you simply extend the
oe-selftest (and the schema file!) already in core, where a rich
testing environment can be much more easily provided. Just validate
the existing standard config files in bitbake repo for a start.

One change to bitbake repo itself is that the config used by
bitbake-selftest could be in a separate file, rather than embedded in
the test itself, and then that could be validated too.

Alex