Conversation
fernando79513
left a comment
There was a problem hiding this comment.
This is very very cool.
I've run it in all the yaml files in the base provider, and mostly the linting issues were related to the estimated duration issues:
https://docs.google.com/spreadsheets/d/1G-8OoozIgTTThQCZA-tSOnv5Nyj1aDVDkQH5_vigtQY/edit?gid=0#gid=0
There was a problem hiding this comment.
Pull request overview
This PR introduces a JSON Schema set intended to validate Checkbox “unit” definitions (job/test plan/category/template/exporter/manifest entry/packaging meta-data), plus editor configuration to wire the schema into VS Code, and a small documentation correction for exporter units.
Changes:
- Added a top-level unit schema (
unit.schema.json) and per-unit schemas underunit_json_schema/. - Updated exporter documentation to include
tarandtp-exportas supported values/options. - Added a VS Code YAML schema mapping to apply the unit schema to selected YAML file globs.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| unit_json_schema/unit.schema.json | Entry-point schema that references the per-unit schemas via $ref. |
| unit_json_schema/job.schema.json | Schema for job units (shared fields + siblings). |
| unit_json_schema/test-plan.schema.json | Schema for test plan units including include/mandatory/bootstrapping fields. |
| unit_json_schema/category.schema.json | Schema for category units. |
| unit_json_schema/template.schema.json | Schema for template units (extends job fields). |
| unit_json_schema/exporter.schema.json | Schema for exporter units. |
| unit_json_schema/manifest-entry.schema.json | Schema for manifest entry units. |
| unit_json_schema/packaging-meta-data.schema.json | Schema for packaging meta-data units. |
| docs/reference/units/exporter.rst | Documentation update to reflect tar and tp-export. |
| .vscode/settings.json | VS Code YAML schema association configuration. |
Key issues to address before this is practically usable in-repo (all verified against existing provider .pxu unit files and the docs in docs/reference/units/):
- All schemas use
$idvalues pointing at a non-existentschema_checkbox/path and also use GitHubblob/URLs (HTML), which will break remote resolution and can break relative$refresolution in some tooling. - Several schemas require non-underscored fields (e.g.
name,summary,template-summary) but existing units and docs consistently use translatable underscore forms (e.g._name,_summary,_template-summary)—causing widespread validation failures. - Multiple fields are typed as arrays in the schemas (e.g.
depends,requires,imports,flags,environ), but are commonly expressed as scalar strings in existing.pxuunits (and documented as space/comma-separated lists), which will also fail validation. template.schema.jsonrestrictstemplate-unittoconst: "job", but the template unit documentation explicitly states other values may be used..vscode/settings.jsonmaps the schema tounits/*.yamlglobs, but this repository’s actual unit files are primarilyproviders/**/units/**/*.pxu(so the mapping won’t apply unless.pxuis associated and included).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Minor: more permissive expected duration
|
I run the "lint report" again. Most of the issues seem to be with the jobs, not the linter
There are still some issues that we may want to address
|
|
|
Description
This adds a json schema for yaml Checkbox units. This also adds pre-configuration for VS Code to simplify the life of those using it, which I think is why we committed it to the repo.
Minor: this fixes a missing exporter in the docs I found.
Resolved issues
Fixes: CHECKBOX-1396
Documentation
N/A
Tests
Tested locally with the vs code plugin + the neovim lsp plugin