Repository navigation
Fix screenshot compare - #658
Conversation
4da9491 to
b30f143
Compare
ea33e94 to
c0ccff2
Compare
|
Really nice work to start from - the step gating is careful in the places that are easy to get wrong Sorry for pushing to your branch instead of leaving notes. What it changes:
I replayed the fixture change over six months of master: the old clone drifts |
|
Nice ! It's very promising. I made some tests #666 and #661
That means, that we need a downloadlink/name separation per pull request.
|
c0ccff2 to
42ec88b
Compare
|
Good catch, and I think it is simpler than a race. The upload has no per-PR Two lines fix it, in the shape the same file already uses for error newName="pr${PR}-${emulatorApi}-${f}"
mv "${f}" "$newName"The It also fixes something my gate introduced: if a PR posts a comment and a One bit of housekeeping: the comment on this PR from 09-16 predates the fix And thanks for running #661 and #666 - those closed the thing I could not |
|
Opened it as hannesa2/screenShotScript#1 so you can Once it is in, GitX needs the submodule pin moved off |
|
Added one diagnostic step ( Two baseline cache entries turned up under the same key So the step prints What to compare: two runs that both missed the cache on the same base - Worth knowing why it has to be measured this way: the UI-path gate means a PR It only prints when a baseline exists, so it stays quiet on PRs like this one. |
9e1e478 to
633e5d3
Compare
|
Unfortunately it doesn't detect anything anymore |
633e5d3 to
ac3e146
Compare
| echo "$changed" | ||
| else | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| echo "No UI-relevant paths changed; skipping the screenshot baseline." |
There was a problem hiding this comment.
I think we need to rebase the test-PRs over the current commit of ScreenshotCompare branch, so the base-commit changes and also includes the latest fixes.
There was a problem hiding this comment.
Yes, exactly what I'm doing right now.
Surprisingly, now it finds changes 🎉 and I found one thing which needs some investigation: there should be only the latest screenshot post, the others should be deleted to not spam the pull request, but there are still the old ones
|
maybe the retention of old screenshots is because they are now specifically created with different names/paths. want me to investigate? |
Yes please ! ❤️ |
|
I added here DEBUG_INFO in screenshot script, now it should be easier to investigate |
|
OK - helpful observations - found 2 related bugs 😃 - on it. |
|
Investigated the comment pile-up. Two separate things, one in the script and The script one is the cause of what you spotted, and it is not the new oldCommentsList=$(echo $oldCommentsJson | jq '...')turns every Fixed in hannesa2/screenShotScript#1 ( The second one is in this workflow, and it arrived with - name: Archive screenshots diffs
- if: ${{ env.variableSet != '' && matrix.abi == 'arm64' && github.event_name == 'pull_request' && steps.stage-baseline.outcome == 'success' }}
+ if: ${{ always() && env.variableSet != '' && matrix.abi == 'arm64' && github.event_name == 'pull_request' && steps.stage-baseline.outcome == 'success' }}Leaving this one for you rather than pushing to your branch again. On whether failing is the right call - I would keep it non-blocking for One good piece of news while I was in the logs. The #661 baseline was built |
|
@hannesa2 , I have not pushed the above |
Cancelling a superseded run throws away the artifacts it would have uploaded, which is the very thing the screenshot experiments in gitx#658, gitx#661 and gitx#681 exist to look at, and it makes each variant wait for the running build before it can start. Raised by hannesa2 on gitx#623. - Read cancel-in-progress from the pull request's labels, so that a pull request labelled keep-runs runs every push to completion - Leave every other pull request cancelling as it does now, and master and tag builds untouched, since their group is keyed per run
5aeee2e to
701f2d1
Compare
The comparison still reported all four screenshots as differing on PRs that change no UI, because neither side of it was held fixed. * Build the baseline from github.event.pull_request.base.sha instead of a pinned release tag, so the diff shows what this PR changed rather than everything merged since the last release. * Strip every ref but the fixture branch from the screenshot repo. The history view counts commits reachable from any ref, and the clone inherited the workspace's refs, so the fixture moved with master and a cached baseline no longer matched it. * Skip the baseline build for PRs that touch no UI path, about half of them, and key the cache on the base commit. * Drop the committed PNGs, which nothing compares against any more, and fail loudly if the two screenshot paths stop colliding, which would otherwise pass the check without comparing anything.
Record what the baseline actually contains, so a rebuild can be told apart from the cached copy it replaced. * Two cache entries appeared under one key at 292110 and 292108 bytes. If the baseline is not byte-stable between builds of the same commit, every cache miss reports differences the pull request did not cause, which is most of what this branch set out to fix. * Hash on both paths, cached and freshly built, and print which one it was, so two runs can be compared from the logs alone.
Compare against the commit the pull request is actually being merged into, so intervening merges to master stop counting as its changes. * github.event.pull_request.base.sha is master as GitHub recorded it when the pull request last changed base, not the base branch's head. On run 35328811182 it read a921dbd while master was a996171, so the baseline was a merge behind and #667 counted as #661's work. * The checkout is refs/pull/N/merge, whose first parent is the commit the merge was computed against. Resolve it with rev-parse HEAD^1 and use that for the gate, the cache key and the baseline checkout. * Print both values, so the next run says whether they agree.
cc0358e to
abc919a
Compare
|
@goneng Thanks a lot, I followed you on both suggestions |
882073a to
3be5f95
Compare
|
Looks really good now, thanks a lot ! |
|
💃🏼 🕺🏼 |



close #628