Repository navigation
ci: add a PR proof check for changes users can see - #596
Merged
Merged
Conversation
Add a pull request template with a UI proof section and two checkboxes. CONTRIBUTING.md gets a UI proof subsection, and the branch name lines now match the type/slug names the repo uses (feat, fix, docs, chore, test).
A pull request that touches UI paths (Settings, Preferences, StatusBar, Notice, Palette, Presentation, Arrivals, About Swift files, strings, storyboards, xibs, asset catalogs) must show an image, a PNG under docs/verification/, or tick "changes nothing users see". The rule lives in scripts/pr-proof-check.sh with an offline test. The workflow uses pull_request, a read-only token and an explicit Linux image.
A trailing flag with no value looped forever under bash 3.2 because shift 2 fails on one argument. Add a test for it and record the verification run.
Only [bot] and app/ logins count as bots, changed paths are printed escaped so a file name cannot start a workflow command, and the tests now cover spaced UI paths, array-passed arguments, xib files, upper-case PNG proof, CRLF bodies and human logins that start with a bot name. The run record leaves the tree because the repo ignores non-PNG files under docs/verification.
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.
What and why
Adds a
PR proofcheck. A pull request intodevelopthat changes what users see (Settings, the arrow, a notice, strings, storyboards, assets) now fails the check unless the description ticks "This PR changes nothing users see", carries an image or video, or the diff adds a PNG, JPG, GIF, WebP, MP4 or MOV underdocs/verification/. Bots and PRs against other branches pass. The rule lives inscripts/pr-proof-check.sh, the workflow in.github/workflows/pr-proof.yml, and the PR template and CONTRIBUTING.md now explain it.The workflow uses
pull_request(neverpull_request_target), a read-only token, no secrets, a pinnedactions/checkout(the SHA is the commit behind tagv7.0.1, the same pin asci.yml) and the explicitubuntu-24.04image. The PR body is read withghand never placed on a command line.Fixed while reviewing the branch: a flag with no value (for example a trailing
--body) looped forever under bash 3.2, so it now exits 2. Only[bot]andapp/logins count as bots, so a human login such asdependabot-fanis checked. Changed paths are printed withprintf %qbehind a bullet, so a fork file name cannot start a workflow command line in the job log.How it was tested
bash scripts/test-pr-proof-check.shunder macOS/bin/bash3.2.57, with no network, no app and no Xcode build. Each case runs the script on a throwaway body and file list. The run record is kept locally atdocs/verification/pr-proof-check.md(the repo ignores everything but PNG files in that folder).bash scripts/pr-proof-check.sh --body empty.md --files ui.txtPR proof: FAILED. This PR changes files that look like UI, and shows no proof.bash scripts/pr-proof-check.sh --body image.md --files ui.txtPR proof: the description has an image or video. Pass.bash scripts/pr-proof-check.sh --body tick.md --files ui.txtPR proof: the box 'changes nothing users see' is ticked. Pass.bash scripts/pr-proof-check.sh --body empty.md --files nonui.txtPR proof: no changed path looks like UI. Pass.bash scripts/pr-proof-check.sh --body empty.md --files ui.txt --botPR proof: bot author. Nothing to check.bash scripts/pr-proof-check.sh --body empty.md --files ui.txt --base release/v1.13PR proof: base is release/v1.13, not develop. Nothing to check.bash scripts/test-pr-proof-check.shpassed checks: 40 failed checks: 0,ALL GREENexit 1of the script changed toexit 0passed checks: 20 failed checks: 11passed checks: 30 failed checks: 1path="${path%% *}")passed checks: 38 failed checks: 2,FAILED: [a UI path with a space is read whole] [a UI path with a space is named escaped]*"[bot]"pattern deletedpassed checks: 39 failed checks: 1,FAILED: [bot login passes]passed checks: 40 failed checks: 0,ALL GREENgh, then the scriptPR proof: the description has an image or video. Pass.(13 files, basedevelop)The check's own run on this PR is listed in the checks below.
UI proof
This PR touches no Swift, strings, storyboards or assets. It adds a CI workflow, two shell scripts, the PR template and CONTRIBUTING text.
Tick exactly one: