mbox series

[v3,00/10] bitbake-setup JSON Schema: Fix linting errors

Message ID 20260615-fix-bitbake-schema-v3-0-8dbb07d8765c@windriver.com
Headers show
Series bitbake-setup JSON Schema: Fix linting errors | expand

Message

Rob Woolley June 15, 2026, 5:37 p.m. UTC
UPDATES v3:
* bitbake-setup.schema.json
  * Updated example to bitbake+openembedded-core with qemux86-64+nodistro
* layers.schema.json
  * Fixed typo in description
  * Fixed up the title and description
  * Put the version element at the end
  * Used the short form

UPDATES v2:
  The following updates were made to v2 of this series:
   * Include an additional patch fixing an existing typo
   * Update the examples property to wrap it in an array and
     add a required configuration element

This series fixes some linting errors in the JSON Schema.  Problems
were found using the https://github.com/sourcemeta/jsonschema tool.

Here are the steps used to install and use the tool to lint the schemas:

```
  python3 -m venv venv
  source venv/bin/activate
  pip install sourcemeta-jsonschema
```

```
jsonschema lint setup-schema/bitbake-setup.schema.json
jsonschema lint setup-schema/layers.schema.json
```

NOTE: The examples are annotations and are meant for humans reading the schema.
They do not typically get checked automatically by the JSON Schema validation
tools.  Use jq to extract the JSON object into its own file to check it
separately.

```
cd setup-schema

jq .examples[] bitbake-setup.schema.json  > bitbake-setup.schema-examples.json
jsonschema validate bitbake-setup.schema.json bitbake-setup.schema-examples.json

jq .examples[] layers.schema.json  > layers.schema-examples.conf.json
jsonschema validate layers.schema.json layers.schema-examples.conf.json
cd ..

bitbake/bin/bitbake-setup init bitbake/setup-schema/bitbake-setup.schema-examples.conf.json

```

```
jsonschema validate setup-schema/bitbake-setup.schema.json default-registry/configurations/oe-nodistro-master.conf.json
jsonschema validate setup-schema/bitbake-setup.schema.json default-registry/configurations/oe-nodistro-whinlatter.conf.json
jsonschema validate setup-schema/bitbake-setup.schema.json default-registry/configurations/poky-master.conf.json
jsonschema validate setup-schema/bitbake-setup.schema.json default-registry/configurations/poky-whinlatter.conf.json
```

There are 2 outstanding types of linting errors related to the use of hyphen
in the property names and the enum currently having only one value:

  Set `properties` to identifier names that can be easily mapped to programming
  languages (matching [A-Za-z_][A-Za-z0-9_]*) (simple_properties_identifiers).

  An `enum` of a single value can be expressed as `const` (enum_to_const)

The former would require a larger discussion and potentially increasing the
version number. Updating the enum to include a new version would also resolve
the latter error.

I do not believe that the changes in this series merit increasing the version
of the schema.

Resolving these outstanding errors is not necessary for validating the
Bitbake Configuration files.

UPDATE v2: Additional testing was performed with oe-selftest.  This uses
    python3-jsonschema which is a different implementation and caught
    additional linting errors.

UPDATE v3: Tested with bitbake-selftest, oe-selftest, and bitbake quilt-native

```
    git clone https://git.openembedded.org/bitbake

    ./bitbake/bin/bitbake-setup init --non-interactive poky-master poky machine/qemux86-64 distro/poky

    . /ala-lpggp31/rwoolley/oe-selftest-testing/bitbake-builds/poky-master/build/init-build-env

    echo 'SANITY_TESTED_DISTROS = ""' >> conf/local.conf

    oe-selftest -r bblayers.BitbakeLayers
```

Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
Rob Woolley (10):
      bitbake-setup.schema.json: Add title for schema
      bitbake-setup.schema.json: Add examples property
      bitbake-setup.schema.json: Use anyOf for non-disjoint subschemas
      bitbake-setup.schema.json: Remove trailing period
      layers.schema.json: Add missing schema
      layers.schema.json: Add title for subschema
      layers.schema.json: Add examples property
      layers.schema.json: Remove trailing period
      layers.schema.json: Fix typo in property name
      bitbake-setup.schema.json: Use anyOf for non-disjoint subschemas

 setup-schema/bitbake-setup.schema.json | 40 +++++++++++++++++++++++++++++++---
 setup-schema/layers.schema.json        | 29 ++++++++++++++++++++----
 2 files changed, 62 insertions(+), 7 deletions(-)
---
base-commit: 020a5ba24c7df53eacf834deb87216053ccd38db
change-id: 20260615-fix-bitbake-schema-0ae8bd18a24c

Best regards,
--  
Rob Woolley <rob.woolley@windriver.com>