TEST: Clean board to demonstrate validation CI#37
Open
mattytrentini wants to merge 16 commits into
Open
Conversation
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.
|
Code size report: |
…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.
19a1689 to
7df0358
Compare
|
Code size report: |
…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
7df0358 to
182944b
Compare
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.
182944b to
c409758
Compare
|
Code size report: |
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.
c409758 to
de9c072
Compare
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.
de9c072 to
2b9fb07
Compare
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.
2b9fb07 to
e385335
Compare
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.
e385335 to
14fa77e
Compare
There was a problem hiding this comment.
ℹ️ Notice: URL 'https://www.raspberrypi.com/products/raspberry-pi-pico/' returned HTTP 403.
There was a problem hiding this comment.
ℹ️ 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.
1120f0e to
4737bba
Compare
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
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