TEST: Dummy board to exercise board validation CI#36
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.
|
Code size report: |
The pathspec 'ports/*/boards/*/' matches directory entries but not files within them. Use 'ports/*/boards/**' to match all files recursively.
62468d5 to
e33baf3
Compare
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.
e33baf3 to
3b4ec8d
Compare
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.
3b4ec8d to
84a8cb2
Compare
|
Code size report: |
…ment. The missing images warning is already included in the per-board results table, so the separate section was duplicating information.
84a8cb2 to
119a10f
Compare
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.
119a10f to
9cc7244
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.
9cc7244 to
fc73fe1
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.
fc73fe1 to
13b397b
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.
13b397b to
4a71ee0
Compare
There was a problem hiding this comment.
There was a problem hiding this comment.
There was a problem hiding this comment.
There was a problem hiding this comment.
There was a problem hiding this comment.
ℹ️ 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.
4a71ee0 to
e9738aa
Compare
There was a problem hiding this comment.
There was a problem hiding this comment.
There was a problem hiding this comment.
There was a problem hiding this comment.
ℹ️ 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.
1120f0e to
4737bba
Compare
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):
pins.csvthumbnailanddocsfieldsTest plan