ci(visual): stop churn PRs from non-deterministic tray screenshots#39
Merged
Conversation
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
The Visual Tray workflow opens a PR (e.g. #38) on nearly every push to
main, even when nothing visually changed. The screenshots are not byte-stable: the PNGs carry no metadata, but the decoded pixels differ run to run. Two distinct sources:Then the
update-platformsjob didrm -f *.png; cp *.pngunconditionally andcreate-pull-requestopened a PR on any byte change — so AA jitter alone produced a churn PR.Changes
compare -metric AE -fuzz 2%and only overwrite when more than 100 pixels differ. Cosmetic AA jitter (0 px) is ignored; real tray/window changes still land. Dimension changes and new platforms fall through to an update. (Adds an ImageMagick install step to the job.)VISUAL_POST_READY_DELAY_MS=6000), so the frameless fixture window is at its pinned(400,200)position rather than caught mid-move.Verification
Ran the exact gated-sync shell against the real PR #38 artifacts with the actual
comparebinary:shellcheckclean on the embedded script; workflow YAML validated.Notes
rmwould have wiped a good screenshot whenever a platform job produced no PNG (transient failure). Trade-off: a platform removed from the matrix leaves an orphaned (unreferenced) screenshot to clean up manually.mainruns. If windows-2025 still churns, the deeper fix is to re-readgetBounds()immediately before capture intests/visual/run.ts.