Skip to content

TEST: Clean board to demonstrate validation CI#37

Open
mattytrentini wants to merge 16 commits into
feature/board-validate-actionfrom
test/board-validate-clean
Open

TEST: Clean board to demonstrate validation CI#37
mattytrentini wants to merge 16 commits into
feature/board-validate-actionfrom
test/board-validate-clean

Conversation

@mattytrentini

Copy link
Copy Markdown
Owner

Summary

Temporary PR to demonstrate a clean board validation result. All required files are present, all fields are valid.

Expected result: Pass with only one warning (missing media image, which is expected for any new board).

Test plan

  • Workflow triggers and passes
  • PR comment shows clean result with only the expected media image warning

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.
The pathspec 'ports/*/boards/*/' matches directory entries but not files
within them.  Use 'ports/*/boards/**' to match all files recursively.
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.
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.
…ment.

The missing images warning is already included in the per-board results
table, so the separate section was duplicating information.
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.
@github-actions

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown

Code size report:

Reference:  tools: Fix micropython-media image path in board validation. [5edd0bf]
Comparison: rp2/boards/TEST_CLEAN_BOARD: Add clean dummy board for CI testing. [merge of 19a1689]
  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

…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.
@mattytrentini mattytrentini force-pushed the test/board-validate-clean branch from 19a1689 to 7df0358 Compare March 27, 2026 05:38
@github-actions

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown

Code size report:

Reference:  github/workflows: Use explicit PR number and add debug logging for comments. [66c298c]
Comparison: rp2/boards/TEST_CLEAN_BOARD: Add clean dummy board for CI testing. [merge of 7df0358]
  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

…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
@mattytrentini mattytrentini force-pushed the test/board-validate-clean branch from 7df0358 to 182944b Compare March 27, 2026 06:11
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.
@mattytrentini mattytrentini force-pushed the test/board-validate-clean branch from 182944b to c409758 Compare March 27, 2026 06:16
@github-actions

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown

Code size report:

Reference:  tools: Make URL liveness check a notice instead of a warning. [414fad2]
Comparison: rp2/boards/TEST_CLEAN_BOARD: Add clean dummy board for CI testing. [merge of e385335]
  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 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-clean branch from c409758 to de9c072 Compare March 27, 2026 12:30
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-clean branch from de9c072 to 2b9fb07 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-clean branch from 2b9fb07 to e385335 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.
Temporary test board to demonstrate a clean board validation result.
This commit should be removed after testing is complete.
@mattytrentini mattytrentini force-pushed the test/board-validate-clean branch from e385335 to 14fa77e 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.

ℹ️ Notice: URL 'https://www.raspberrypi.com/products/raspberry-pi-pico/' returned HTTP 403.

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: rp2-pico.jpg. Please submit a corresponding PR to https://github.com/micropython/micropython-media with board images.

@mattytrentini mattytrentini force-pushed the feature/board-validate-action branch from 1120f0e to 4737bba Compare April 1, 2026 11:55
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