Skip to content

ci(ecad): ship interactive HTML viewer and visible before/after previews - #1296

Merged
jrsteensen merged 13 commits into
masterfrom
ci/ecad-visual-review-html-previews
Oct 23, 2026
Merged

jrsteensen merged 13 commits into
masterfrom
ci/ecad-visual-review-html-previews

Conversation

@jrsteensen

@jrsteensen jrsteensen commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fix ECAD review artifacts that have PNG/SVG output but no HTML viewer, and make visual changes visible without hunting through ZIP files.

  • Keep sksat/kicadiff@v0.2.0 for structural Markdown and raw renders, but disable its full-size image summary.
  • Invoke the normal kicadiff HTML mode separately. Write and verify index.html inside the same artifact directory as before/, after/, diff/ and PCB layer/schematic-page assets.
  • Create compact before/after PCB and schematic JPEG previews. GitHub sanitizes base64 data: image URIs, so summaries now reference GitHub-renderable public HTTPS JPEG URLs.
  • Add VIEW_ME_FIRST.txt inside each ZIP and a direct ZIP artifact download URL beside the summary images.
  • Publish only validated JPEGs from an isolated workflow_run using trusted master code and contents: write, to a dedicated ecad-review-previews branch. On completion the original Actions summary's linked images become visible. The same mechanism covers forks without granting write to untrusted analysis. Viewer validation remains advisory.
  • Clarify the PR comment download instructions. No changes to hardware, contributor branches, or existing mechanical drawing overlay CI.

Validation

  • Regression target: Convert Backlight Shield from MEGA to GIGA #1292, the GIGA backlight-controller hardware PR.
  • Integration test fixture: draft PR #1297, built from current master + these CI changes + the exact changed KiCad source blobs from contributor Convert Backlight Shield from MEGA to GIGA #1292 (not manufacturing outputs).
  • CI run #39881441508 successfully produced a working HTML artifact; however the GitHub Actions summary displayed broken images because the previous renderer used blocked data: URI images. This PR now fixes those links and adds a post-run publisher.
  • Pending end-to-end verification: GitHub workflow_run executes only workflows on master, so the updated trusted publishing stage must first be merged before it can actually populate preview URLs. The PR remains draft until review; do not claim the images are fixed in a live summary just from CI success.
  • This PR itself is the clean, mergeable implementation; the separate GIGA integration branch is not for merging.

Hosting

GitHub Actions artifacts are ZIP downloads, not hosted HTML. GitHub Pages is currently disabled on this repository. This PR makes the ZIP a complete portable interactive viewer and provides in-run previews; hosting index.html at a direct website URL will need a separate Pages authorization/configuration decision.

Advisory/nonblocking; independent of PDF Overlay Compare.

Preview hosting / security notes

  • Images are public JPEG thumbnails stored at runs/<run-id>/<project>/ in the ecad-review-previews branch. The sandboxed PR build stays contents: read; only the separate trusted workflow obtains write privileges, validates the current PR/head SHA, and uploads whitelisted size-bounded JPEG bytes, not HTML/SVG/code.
  • No GitHub Pages dependency. Old run summaries point to immutable run-ID-based URLs. The preview branch may require a separate routine to prune older runs.
  • Existing PR-comment posting has previously failed with HTTP 403; the trusted workflow now explicitly requests pull-requests: write as well as issues: write. Whether that resolves the GitHub-side restriction needs live verification after merge.

Current validation

The clean PR's CI run #39982208233 passed 11 unit tests, including HTTPS-only summary URLs, safe JPEG ZIP extraction, Git blob/tree publishing, stale PR handling, and simulated fork-comment behavior. The trusted workflow_run image publishing stage cannot run from a draft PR: actual hosted-image presentation must be verified after merging this workflow to the default branch.

@jrsteensen jrsteensen self-assigned this Oct 23, 2026
@jrsteensen jrsteensen added the Type: Maintenance DevOps, code reafactor without change, cleanup, etc. label Oct 23, 2026
@jrsteensen
jrsteensen marked this pull request as ready for review October 23, 2026 16:27
@jrsteensen
jrsteensen merged commit a6fb1be into master Oct 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Maintenance DevOps, code reafactor without change, cleanup, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant