ci: validate board config required fields on PR#9678
Open
igorpecovnik wants to merge 1 commit intomainfrom
Open
ci: validate board config required fields on PR#9678igorpecovnik wants to merge 1 commit intomainfrom
igorpecovnik wants to merge 1 commit intomainfrom
Conversation
Adds a PR-time validator that checks board configs for missing
required / recommended fields. Helps catch issues before merge
rather than at first build attempt by the unlucky maintainer who
picks up the orphan board.
tools/validate-board-config.py:
- Standalone Python validator, runnable locally:
tools/validate-board-config.py config/boards/orangepi5.conf
- Extracts top-level KEY=VALUE assignments via regex (does NOT
source the bash file; boards have side-effecty function bodies)
- Emits plain text findings; with --github also emits ::error
/ ::warning workflow commands that annotate the PR diff
- Exit 1 if any error, else 0
Rule table:
ERRORS:
BOARD_NAME required, non-empty
BOARD_VENDOR required, non-empty
BOARDFAMILY required, must match config/sources/families/
KERNEL_TARGET must contain at least one of:
legacy / current / edge / vendor / mainline
BOOTCONFIG required (except .wip)
WARNINGS:
BOARD_MAINTAINER recommended; orphan boards rot
INTRODUCED recommended; year first shipped
BOOT_FDT_FILE recommended (skip on .tvb)
Per-extension behavior:
.conf / .csc full rule set
.tvb full rule set, skip BOOT_FDT_FILE warning
.wip only BOARD_NAME is error; rest demoted to warning
.eos skipped (dead boards aren't validated)
.github/workflows/maintenance-validate-board-configs.yml:
- Triggers on pull_request touching config/boards/** (or the
validator/workflow itself)
- Detects changed files via git diff against PR base — only
validates what the PR actually touched, not all 500+ boards
- Runs validator with --github so findings show on the PR diff
- Skips cleanly when no board configs changed (other PRs unaffected)
Smoke-tested against orangepi5.conf, odroidn2.conf, aml-t95z-plus.tvb
(real boards, no errors) and synthetic broken .conf / .wip files
(errors and warnings as expected).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a PR-time validator for
config/boards/*.{conf,csc,tvb,wip,eos}files. Catches missing required / recommended fields before merge instead of at first build attempt by the unlucky maintainer who picks up an orphan board.Two files:
tools/validate-board-config.py— standalone Python validator. Runnable locally:Extracts top-level
KEY=VALUEassignments via regex (does not source the bash file — boards have side-effecty function bodies). With--githubalso emits::error/::warningworkflow commands that annotate the PR diff..github/workflows/maintenance-validate-board-configs.yml— runs on PRs touchingconfig/boards/**(or the validator / workflow itself). Detects changed files viagit diffagainst the PR base — only validates what the PR actually touched, not all 500+ boards.Rule table
BOARD_NAMEBOARD_VENDORBOARDFAMILYconfig/sources/families/KERNEL_TARGETlegacy / current / edge / vendor / mainlineBOOTCONFIG.wip)BOARD_MAINTAINERINTRODUCEDBOOT_FDT_FILE.tvb(TV-box SoCs often auto-detect)Per-extension behavior
.conf/.csc.tvbBOOT_FDT_FILEwarning.wipBOARD_NAMEis error; rest demoted to warning.eosTest plan
orangepi5.conf,odroidn2.conf,aml-t95z-plus.tvb(real boards) — no errors, expected warnings only.confproduces 4 errors + 3 warnings, exit 1.wipdemotes 3 errors to warnings, onlyBOARD_NAMEremains error