Skip to content

Detect new screenshots - #696

Merged
hannesa2 merged 1 commit into
masterfrom
DetectNewScreenshots
Sep 19, 2026
Merged

hannesa2 merged 1 commit into
masterfrom
DetectNewScreenshots

Conversation

@hannesa2

@hannesa2 hannesa2 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

It's a follow up of #695 where CI doesn't detect new screenshots.
The work is done here hannesa2/screenShotScript#2 in screenshotScript

@hannesa2
hannesa2 marked this pull request as draft September 19, 2026 17:50
@hannesa2 hannesa2 added the pipeline CI pipeline label Sep 19, 2026
@hannesa2

hannesa2 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor Author

It finds now 3 screenshot(s) when it's based on #695

setpoint (old) | diff | actual screenshot (new)

commit-context-menu.png (new screenshot)
screenshot

history-view.png (new screenshot)
screenshot

staging-view.png (new screenshot)
screenshot

@hannesa2
hannesa2 requested a review from goneng September 19, 2026 18:15
@hannesa2

hannesa2 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor Author

I renamed the screenshot post here, to be not deleted, when I remove the base #695
That means, I remove now your #695 commits, which includes 3 new screenshots.
The plan is now, to merge this first, then you rebase all your pull requests to detect new screenshots
@goneng

@hannesa2
hannesa2 marked this pull request as ready for review September 19, 2026 18:16
@hannesa2
hannesa2 force-pushed the DetectNewScreenshots branch from 5fa2c2f to 6c52c7a Compare September 19, 2026 18:17

@goneng goneng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch on the error-screenshot loop. find .. | while read ran the body in a subshell, so every COUNTER++ and body=... inside it was thrown away and error screenshots could never reach the PR comment. Moving to done <<< "$errorFiles" fixes that, and it retires the if [[ ${f} == "../view-op-error-*.png" ]] guard that could never match.

A few things I noticed, all small:

  • Basename collisions. newName uses only $baseName, so two new PNGs with the same name in different directories overwrite each other, first via cp and then on the upload host. #695 goes to some trouble to disambiguate repeated attachment names, so it would be a shame to lose it one level up.
  • Scope of the search. git ls-files --others is repo-wide, and the build and result directories in the exclude list are normally gitignored, so --exclude-standard already drops them. What is left uncovered is a stray PNG someone happens to leave in their tree, which would get uploaded and embedded in the comment. Scoping to the screenshot output directory might be tighter than excluding by pattern.
  • echo "request_cmd=$request_cmd". This one is pre-existing rather than yours, but the new block copies it, and since request_cmd is built with double quotes it carries the expanded -u $SCREENSHOT_USER:$SCREENSHOT_PASSWORD. Actions masks it in CI, so it only really shows when running locally. Worth mentioning because it bypasses the DEBUG_INFO guard just above it. Related: echo $$request_cmd was printing the PID, so the old line happened to leak nothing, whereas the corrected one will.
  • Ordering. Does this want #695 in first? The new search looks for untracked PNGs, so whether it finds anything depends on where the extractor writes.

One request: since the change itself lives in hannesa2/screenShotScript, a compare link in the description would help, as the diff here is a single submodule line.

@goneng

goneng commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Withdrawing my fourth point, about ordering. Your comment on #695 answers it, and I had the dependency backwards: this PR is what makes #695's new screenshots visible in the first place, not the other way round.

Now that I follow the mechanism: the comparison stages the base screenshots as a throwaway commit and relies on the case-insensitive runner filesystem to have the PR's extraction overwrite them, so git-diff-image sees modified files. That can only ever surface names which already exist in the baseline, which is why the three renamed ones in #695 fell through in silence. --others is precisely the gap.

So this can go in first, and a re-run of #695 should then actually show those three. The other three points stand.

@hannesa2
hannesa2 force-pushed the DetectNewScreenshots branch from 6c52c7a to 3648f3c Compare September 19, 2026 18:45
@hannesa2

Copy link
Copy Markdown
Contributor Author

I applied your suggestion, I hope it's now more clear

@goneng

goneng commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Much clearer, thank you. All three are addressed, and the run on #695 shows the collision fix working: the uploaded names went from gitx-gitx-pr696-arm64-commit-context-menu.png to gitx-gitx-pr695-arm64-scripts-Screenshots-arm64-commit-context-menu.png, so the path is carried through now. Scoping the pathspec to the screenshot directories reads better than the old exclude list too, and dropping the unconditional echo at both call sites is more than I asked for.

Two tiny things, neither worth holding this up:

  • The redacted debug line is a hand-written copy of request_cmd, so it can drift from the real command. It already has: request_cmd now carries -s, the echoed one does not.
  • ':!*view-op-error*' went away with the old exclude list. That is fine while the search stays scoped to screenshot directories, though if a view-op-error-*.png ever lands inside one it would go up twice, once here and once from the error loop below.

Looks good to me. Happy to rebase my pull requests onto master once this lands, as you suggested.

@hannesa2
hannesa2 force-pushed the DetectNewScreenshots branch from 3648f3c to 686e721 Compare September 19, 2026 19:42
@hannesa2

Copy link
Copy Markdown
Contributor Author

This make sense, I applied the suggestions

@hannesa2
hannesa2 merged commit 722a902 into master Sep 19, 2026
3 checks passed
@hannesa2
hannesa2 deleted the DetectNewScreenshots branch September 19, 2026 19:58
@hannesa2

Copy link
Copy Markdown
Contributor Author

Looks good to me. Happy to rebase my pull requests onto master once this lands, as you suggested.

Go ahead !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipeline CI pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants