Commit Graph
3 Commits
Author SHA1 Message Date
Hanif Koh c7981ba94c Harden the Sliced G-code Comparison Against Broken Artifacts and Comments
A corrupt or encrypted zip member, or a bad file name, is now an
artifact error, so a broken artifact gets the "made no comparison" note
instead of stopping the comment, and the report step writes a report
whatever fails. The fence also drops format, C1 and line separator
characters. The comment is posted before the old one is deleted,
comments without a user are skipped, a body GitHub returns with other
line ends counts as unchanged, and a download redirect must be https.
The commenter's concurrency group is on the job, so the skipped wakes of
other labels cannot take the place of a pending real one.

New tests cover the bounded read of a member, a run on another branch,
other bot comments, comments past the first page, the newest run of a
commit, and the token never reaching the storage host.
2026-11-28 22:08:48 +08:00
Hanif Koh 49252d14b7 Post the Sliced G-code Comparison on Pull Requests With the check-gcode Label
check_gcode_comment.yml runs when a pull request's Build all run or a
check-gcode label run completes, finds the open pull requests from that
branch, and posts the report of the newest finished build on each one
that has the label. check_gcode_label.yml only wakes it when the label
is added after the build finished; it needs no token and runs nothing.
Neither uses pull_request_target, which GitHub blocks by default in
public repositories.

Runs are kept only when their head repository and branch are the pull
request's, and the artifact must name the pull request, so another fork
at the same commit cannot have its report posted. A run waiting for
approval counts as not finished. The comment is kept when unchanged,
edited in place when only the commit or the baseline moved, and
replaced otherwise. The report appears only inside a fence nothing in
it can close, errors print their type and HTTP status only, and the
step cannot leave a red check.
2026-11-28 22:08:48 +08:00
Hanif Koh 9dafcc7314 Compare a Pull Request's Sliced G-code With Its Base Branch in the Slice Check
On a pull request, the Slice check now finds the newest build of the
base branch at or before the pull request's base commit that saved
fingerprints, compares them with its own, and writes report.txt into
the gcode-fingerprints artifact and the report into the job summary.
Every build also writes made_with.txt, the fingerprint script's hash and
the runner, so a report warns when the two sides were made differently.

scripts/ci_check_gcode.py reads the baseline's artifact in memory: the
download and each file in it are capped, and a file compressed with
anything but stored or deflate is refused, since a capped read does not
bound bzip2 or LZMA. An error writes its type only, never the text of
the files, and the step cannot fail the job.
2026-11-28 22:08:48 +08:00