Skip to content

ci: validate board config required fields on PR#9678

Open
igorpecovnik wants to merge 1 commit intomainfrom
validate-board-configs
Open

ci: validate board config required fields on PR#9678
igorpecovnik wants to merge 1 commit intomainfrom
validate-board-configs

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

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:

    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). With --github also emits ::error / ::warning workflow commands that annotate the PR diff.

  • .github/workflows/maintenance-validate-board-configs.yml — runs on PRs touching config/boards/** (or the validator / workflow itself). Detects changed files via git diff against the PR base — only validates what the PR actually touched, not all 500+ boards.

Rule table

field severity notes
BOARD_NAME error required
BOARD_VENDOR error required
BOARDFAMILY error required, must match config/sources/families/
KERNEL_TARGET error must contain at least one of legacy / current / edge / vendor / mainline
BOOTCONFIG error required for built boards (except .wip)
BOARD_MAINTAINER warning orphan boards rot
INTRODUCED warning year first shipped
BOOT_FDT_FILE warning skipped on .tvb (TV-box SoCs often auto-detect)

Per-extension behavior

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 entirely (dead boards aren't validated)

Test plan

  • Smoke-tested locally against orangepi5.conf, odroidn2.conf, aml-t95z-plus.tvb (real boards) — no errors, expected warnings only
  • Synthetic broken .conf produces 4 errors + 3 warnings, exit 1
  • Synthetic broken .wip demotes 3 errors to warnings, only BOARD_NAME remains error
  • YAML + Python syntax validate
  • Open this PR; the workflow runs on its own files (validator + workflow path triggers); confirm no findings on the changes themselves, then test by adding a temporary broken file in another PR

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).
@github-actions github-actions bot added size/large PR with 250 lines or more 05 Milestone: Second quarter release Needs review Seeking for review Framework Framework components GitHub Actions GitHub Actions code GitHub GitHub-related changes like labels, templates, ... labels Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Framework Framework components GitHub Actions GitHub Actions code GitHub GitHub-related changes like labels, templates, ... Needs review Seeking for review size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

1 participant