Skip to content

Commit af493f0

Browse files
committed
Re-enable visual regression checks on pull requests
Reverts #59629, so RNTester visual captures and comparisons run on pull requests again, including from forks. Since retakes (#59408) landed, 1 of 106 `main` reports between 2026-11-07 and 2026-11-12 had a difference, a flake in `button/disabled/default`. Changelog: [Internal]
1 parent b8f0db7 commit af493f0

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

‎.github/workflows/test-all.yml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ jobs:
171171

172172
test_visual_ios_rntester:
173173
needs: test_ios_rntester
174-
# Pause visual regression on pull requests; keep main baselines up to date.
175-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.test_ios_rntester.result == 'success' }}
174+
if: ${{ needs.test_ios_rntester.result == 'success' }}
176175
uses: ./.github/workflows/visual-capture-rntester.yml
177176
with:
178177
platform: ios
@@ -386,8 +385,7 @@ jobs:
386385

387386
test_visual_android_rntester:
388387
needs: build_android
389-
# Pause visual regression on pull requests; keep main baselines up to date.
390-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build_android.result == 'success' }}
388+
if: ${{ needs.build_android.result == 'success' }}
391389
uses: ./.github/workflows/visual-capture-rntester.yml
392390
with:
393391
platform: android

‎.github/workflows/visual-compare-rntester.yml‎

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Trusted half of RNTester visual regression testing. Runs from the default
2-
# branch after Test All completes on main and compares whatever
3-
# visual-capture-rntester.yml captured in that run. The
2+
# branch after Test All completes, including for pull requests from forks, and
3+
# compares whatever visual-capture-rntester.yml captured in that run. The
44
# capture artifacts are treated as inert data: they are validated before any
55
# image is decoded, and nothing in them is executed.
66
#
7-
# Pull request comparisons are temporarily paused; pushes to the default
8-
# branch compare captures and publish the immutable baseline for that commit.
7+
# Pull requests: compare with the baseline for the base commit (or its
8+
# nearest ancestor with one), upload a report, and set check runs.
9+
# Pushes to the default branch: as above, then publish the captures as the
10+
# immutable baseline for that commit.
911
name: Visual Compare RNTester
1012

1113
on:
@@ -31,16 +33,23 @@ env:
3133
jobs:
3234
find_captures:
3335
# Test All can fail for reasons unrelated to rendering, so a failed run is
34-
# still compared. A platform with no capture is reported as such. Only
35-
# main pushes run comparisons while pull request testing is paused.
36-
# Nothing runs until the repository has GCP credentials configured.
36+
# still compared. A platform with no capture is reported as such. Pushes
37+
# to other branches have no baseline to compare with or publish. Pull
38+
# requests into other branches are skipped in compare-run.js, because
39+
# workflow_run doesn't include the base branch of a pull request from a
40+
# fork. Nothing runs until the repository has GCP credentials configured.
3741
if: |
3842
vars.VISUAL_GCP_PROJECT != '' &&
3943
vars.VISUAL_WORKLOAD_IDENTITY_PROVIDER != '' &&
4044
contains(fromJSON('["success", "failure"]'), github.event.workflow_run.conclusion) &&
41-
github.event.workflow_run.event == 'push' &&
42-
github.event.workflow_run.head_branch == github.event.repository.default_branch &&
43-
github.event.workflow_run.head_repository.full_name == github.repository
45+
(
46+
github.event.workflow_run.event == 'pull_request' ||
47+
(
48+
github.event.workflow_run.event == 'push' &&
49+
github.event.workflow_run.head_branch == github.event.repository.default_branch &&
50+
github.event.workflow_run.head_repository.full_name == github.repository
51+
)
52+
)
4453
runs-on: ubuntu-latest
4554
permissions:
4655
actions: read

0 commit comments

Comments
 (0)