Skip to content

TEST: Dummy board to exercise board validation CI#36

Open
mattytrentini wants to merge 17 commits into
feature/board-validate-actionfrom
test/board-validate-dummy
Open

TEST: Dummy board to exercise board validation CI#36
mattytrentini wants to merge 17 commits into
feature/board-validate-actionfrom
test/board-validate-dummy

Conversation

@mattytrentini

Copy link
Copy Markdown
Owner

Summary

Temporary PR to test the board validation GitHub Action. Adds a dummy board (TEST_VALIDATE_BOARD) with deliberate issues to exercise the checks.

Expected warnings (no errors):

  • Missing pins.csv
  • Empty thumbnail and docs fields
  • Vendor name "Acme Corp" repeated in product name
  • Unknown vendor "Acme Corp"
  • Missing image in micropython-media (should trigger PR comment)

Test plan

  • Workflow triggers on this PR
  • Validation script runs (exit 0, warnings only)
  • PR comment posted about missing micropython-media image

Add tools/validate_board.py and tools/board_schema.json for validating
new board definitions in pull requests.  The script checks file presence,
board.json schema conformance, MCU/vendor validity, URL liveness, and
whether board images exist in the micropython-media repository.
Add a GitHub Actions workflow that validates new board definitions in
pull requests.  Triggered when files under ports/*/boards/ are changed,
it runs validate_board.py and posts a PR comment when board images are
missing from the micropython-media repository.
@github-actions

Copy link
Copy Markdown

Code size report:

Reference:  github/workflows: Add board validation CI check. [5f7fab0]
Comparison: rp2/boards/TEST_VALIDATE_BOARD: Add dummy board for CI testing. [merge of 62468d5]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32:    +0 +0.000% ESP32_GENERIC
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

The pathspec 'ports/*/boards/*/' matches directory entries but not files
within them.  Use 'ports/*/boards/**' to match all files recursively.
@mattytrentini mattytrentini force-pushed the test/board-validate-dummy branch from 62468d5 to e33baf3 Compare March 27, 2026 03:13
The newline-separated file list from git diff was being expanded as
separate shell commands.  Join files with spaces and use a single-line
output to ensure all files are passed as arguments to the script.
@mattytrentini mattytrentini force-pushed the test/board-validate-dummy branch from e33baf3 to 3b4ec8d Compare March 27, 2026 03:20
GitHub Actions annotations are not prominently visible on the PR page.
Write all errors and warnings to a JSON file and post them as a
formatted PR comment with a results table per board, making issues
immediately visible to the PR author.
@mattytrentini mattytrentini force-pushed the test/board-validate-dummy branch from 3b4ec8d to 84a8cb2 Compare March 27, 2026 03:34
@github-actions

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown

Code size report:

Reference:  tools: Drop empty thumbnail check from board validation. [1120f0e]
Comparison: rp2/boards/TEST_VALIDATE_BOARD: Add dummy board for CI testing. [merge of e9738aa]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32:    +0 +0.000% ESP32_GENERIC
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

…ment.

The missing images warning is already included in the per-board results
table, so the separate section was duplicating information.
@mattytrentini mattytrentini force-pushed the test/board-validate-dummy branch from 84a8cb2 to 119a10f Compare March 27, 2026 03:52
Repository owner deleted a comment from github-actions Bot Mar 27, 2026
The micropython-media repository stores images under boards/{BOARD_NAME}/
not board-images/.  Update the URL construction to include the board name
in the path.
…mments.

Use context.payload.pull_request.number instead of context.issue.number
for reliability, and log the comment ID and URL after creation to aid
debugging.
…ze bot.

The code_size workflow finds and overwrites the first github-actions[bot]
comment, clobbering our validation results.  Fix by:
- Writing results to GITHUB_STEP_SUMMARY (always visible, immune to bots)
- Deleting any previous validation comment before creating a fresh one
- Generating the comment body in a separate step for reliability
Inline Python in the workflow YAML caused a YAML parse error.  Move the
markdown formatting into validate_board.py via a new --comment-md flag,
keeping the workflow YAML clean and parseable.
The code_size workflow overwrites github-actions[bot] PR comments,
clobbering our validation results.  Replace the PR comment with a
GitHub Actions step summary, which is reliably visible on the workflow
run page and cannot be overwritten by other workflows.
@mattytrentini mattytrentini force-pushed the test/board-validate-dummy branch from 119a10f to 9cc7244 Compare March 27, 2026 12:31
A green check gives authors no reason to click through to the step
summary.  Make warnings also fail the check (exit code 2) so the
author sees a red check, clicks Details, and finds the formatted
results table explaining what to fix.
@mattytrentini mattytrentini force-pushed the test/board-validate-dummy branch from 9cc7244 to fc73fe1 Compare March 27, 2026 22:36
The micropython-media image check is a reminder, not something that
should block a PR.  Add a notice level that is displayed in the step
summary but does not affect the exit code.  Errors and warnings still
fail the check; notices are informational only.
Many servers block automated HEAD/GET requests, causing false positives.
Demote URL liveness failures to notices so they don't fail the check.
@mattytrentini mattytrentini force-pushed the test/board-validate-dummy branch from fc73fe1 to 13b397b Compare March 28, 2026 13:35
Post each warning and notice as an individual PR review comment on the
relevant file in the diff.  Uses subject_type 'file' for file-level
comments.  Review comments are separate from issue comments, so the
code_size workflow cannot overwrite them.
@mattytrentini mattytrentini force-pushed the test/board-validate-dummy branch from 13b397b to 4a71ee0 Compare March 29, 2026 02:44

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing pins.csv. This file is expected for non-generic boards.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Vendor name 'Acme Corp' appears in product name 'Acme Corp Test Board'. The vendor is displayed separately, so it should not be repeated in the product name.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: thumbnail is empty. Consider removing it or adding an image.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: docs is empty. Consider removing it or adding a docs URL.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Notice: Image(s) not found in micropython-media repository: test_validate_board.jpg. Please submit a corresponding PR to https://github.com/micropython/micropython-media with board images.

The thumbnail field is likely to be removed from board.json.  Remove
the warning for empty thumbnails to avoid noise.  Keep the docs check
as its use will be encouraged going forward.
Temporary test board to exercise the board validation GitHub Action.
This commit should be removed after testing is complete.
@mattytrentini mattytrentini force-pushed the test/board-validate-dummy branch from 4a71ee0 to e9738aa Compare March 31, 2026 05:38

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Missing pins.csv. This file is expected for non-generic boards.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Vendor name 'Acme Corp' appears in product name 'Acme Corp Test Board'. The vendor is displayed separately, so it should not be repeated in the product name.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: docs is empty. Consider adding a docs URL.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Notice: Image(s) not found in micropython-media repository: test_validate_board.jpg. Please submit a corresponding PR to https://github.com/micropython/micropython-media with board images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant