You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3366bdf
Browse filesBrowse the repository at this point in the historyBrowse files
chore(tooling): Add a pre-build gate and open-PR handling to verify-pr
From running the skill on open PRs (#7042, #7030): a "Not verifiable this
way" verdict decided before any build (build-only claims, triggers a
simulator can't produce, native APIs missing from the pinned SDK, low
disk), guidance for feature PRs and open PRs, checks for node_modules,
run tagging and spec codegen, release builds by default, and evidence
for replay recording content and JS-thread blocks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .agents/skills/verify-pr/SKILL.md
+33-5Lines changed: 33 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,9 @@ Android emulator and iOS simulator. Real devices and CI are out of scope for now
23
23
|**Not reproduced**| No symptom without the change, so the fix proves nothing on this setup. |
24
24
|**Failed**| Symptom still present with the change. |
25
25
|**Inconclusive**| An event didn't arrive in time, the build/run broke, or the evidence is indirect. Say which. |
26
+
|**Not verifiable this way**| Decided in step 1, before any build: the claim isn't observable on a simulator/emulator, or the change can't be built yet. Say why and what would verify it instead. |
26
27
27
-
Prefer **Inconclusive** over a guess.
28
+
Prefer **Inconclusive** over a guess, and **Not verifiable this way** over a run that can't separate the two sides.
28
29
29
30
## 1. Plan
30
31
@@ -43,10 +44,33 @@ Write down, before touching anything:
43
44
44
45
If you can't state the evidence that would separate the two runs, stop and ask; the run would prove nothing.
45
46
47
+
### Gate: can this be verified on a device?
48
+
49
+
Answer these before building. Any "no" ends the run with **Not verifiable this way** for that platform; write the report with the reason.
50
+
51
+
-**Is the claim about runtime behavior?** Build fixes, dependency bumps, Metro/bundler config, type-only changes, and performance claims don't produce a difference in Sentry events. A run can only show nothing broke; say so instead of running.
52
+
-**Can the trigger happen on a simulator/emulator?** For example, MetricKit reports, real-device hardware, OS-scheduled background work, and store-only behavior can't.
53
+
-**Do the bundled native SDKs have the APIs the PR calls?** Check the pinned versions (`packages/core/RNSentry.podspec``sentry_cocoa_version`, `packages/core/android/build.gradle``sentryAndroidVersion`) against where the API was released. A PR waiting on a native bump can't be built on that platform yet.
54
+
-**Is there enough disk?**`df -h /System/Volumes/Data` — stop under ~15 GB free. Clean iOS and Android sample builds together take ~13 GB.
55
+
56
+
### Feature PRs
57
+
58
+
A feature has no symptom; verify its **presence**:
59
+
60
+
- "Without" is still the PR's SDK change reversed. Keep the PR's own sample changes (a new option, a new button) on both sides, so only the SDK differs.
61
+
- If the sample calls a new API that doesn't exist without the change, guard the call (`?.method?.()`) on the "without" side only, and say so.
62
+
- An opt-in option can be checked more cheaply with one build and the option off, but that doesn't show the default is unchanged; prefer the reversed build.
63
+
46
64
## 2. Without the change
47
65
48
66
Build the "without" side from the current checkout with only the PR's SDK change reversed. This needs one clean build; the "with" side is then an incremental rebuild.
49
67
68
+
Before the first build:
69
+
70
+
-`node_modules` must match the checkout: `node -p "require('react-native/package.json').version"` in `samples/react-native` equals the pinned version in its `package.json`; otherwise `yarn install`.
71
+
- The run-tagging code (`samples/react-native/src/verifyRun.ts` and the `tagVerifyRun()` call in `App.tsx`) must be in the tree. A PR branched before it landed doesn't have it: copy both from `main`, and list them under sample changes.
72
+
- If the PR's head doesn't contain this skill, copy `flows/steps/` out of the repo before checking the head out, and point `runFlow` at the copy.
73
+
50
74
```bash
51
75
# merged PR — save the merge commit's SDK changes (no tests/changelog), then reverse them
Keep the patch in a file; a shell variable holding the command breaks under zsh ("No valid patches in input").
64
88
65
-
- First check the files the PR touched haven't changed on your checkout since: `git diff <merge-sha> HEAD -- <files>` is empty, or the revert won't be the PR's exact before-state. Note it in the report either way.
89
+
- Merged PRs: first check the files the PR touched haven't changed on your checkout since: `git diff <merge-sha> HEAD -- <files>` is empty, or the revert won't be the PR's exact before-state. Note it in the report either way.
90
+
- Open PRs: you build the head itself. Say which base it's on; if it needs something `main` has (e.g. a native bump), apply the PR's patch onto `main` instead and say so.
91
+
-**Spec changes** (`NativeRNSentry.ts`, `*NativeComponent.ts`): check the generated code matches each side (iOS: grep `samples/react-native/ios/build/generated/ios/ReactCodegen/RNSentrySpec*.h` for the method; reinstall Pods if it's stale). A stale spec makes the "with" run silently skip the new method and look like Failed.
66
92
- When `git apply -R --check` fails, fall back to the parent commit: `git checkout <merge-sha>^` (detached), `yarn install && yarn build`, build there, then return. Slower; record that you did it.
67
93
- The sample bundles `packages/core/dist/`. Before the first sample build, run `yarn build` in `packages/core` if `dist/` is older than the last change to `packages/core/src` (`git log -1 --format=%cd -- packages/core/src`) — even for native-only PRs.
68
94
-**JS changes** (`packages/core/src/`) need that `yarn build` on **both** sides.
@@ -74,13 +100,14 @@ Keep the patch in a file; a shell variable holding the command breaks under zsh
74
100
Setup, build, install, and drive commands are in [references/android.md](references/android.md) and [references/ios.md](references/ios.md). The short version:
75
101
76
102
- Android: full emulator image (e.g. `Pixel_8`), not an ATD image — ATD returns black screenshots. JDK 17, `SENTRY_DISABLE_AUTO_UPLOAD=true`, `yarn build-android-release`.
103
+
- Prefer **release** builds. Debug builds load JS from whatever Metro is on port 8081 (another session's, if one is running), and the all-ABI debug APK may not fit on the emulator.
77
104
- iOS: a booted simulator, Pods installed for the build you make (`yarn pod-install-release-static`), `SENTRY_DISABLE_AUTO_UPLOAD=true`, `yarn build-ios-release`.
78
105
- Maestro needs JDK 17 on both platforms. With an emulator and a simulator both running, pass `--device <id>`.
79
106
- Drive the UI with **Maestro**. Compose the run's scenario from the shared steps in [flows/steps/](flows/steps/) (`launch.yml` with the run tags, `open-errors-screen-button.yml`, `native-crash-and-relaunch.yml`), using [flows/examples/](flows/examples/) as a pattern. Save the flow next to the report, not in the skill.
80
107
- Don't add flows or steps to the skill during a verification run. Promote something to `flows/steps/` only when a second run needs it, in a separate change.
81
108
- Pass the run tags as launch arguments (next step). Relaunch after a crash so the event is sent.
82
109
- Logs and other batched data are sent later: keep the app running ~20 s after the flow before looking them up.
83
-
- Capture a screenshot at the step that shows the scenario ran, and keep the device log (Android: `adb logcat -d`; iOS: `xcrun simctl spawn <udid> log show --last 5m --predicate 'process == "sentryreactnativesample"'`).
110
+
- Capture proof that the scenario ran: a screenshot of its result, or a device-log line when the screen can't show it (a blocked JS thread shows only the tap). Keep the device log from the run's start (Android: `adb logcat -c` before, `adb logcat -d` after; iOS: `xcrun simctl spawn <udid> log show --start "<run start>" --predicate 'process == "sentryreactnativesample"'`), and grep it by the run's own id.
84
111
85
112
## 4. Tag
86
113
@@ -108,13 +135,14 @@ Compare against the expectation from step 1. Unexpected extra differences go in
108
135
109
136
## 6. Report
110
137
111
-
Write the report with [references/report-template.md](references/report-template.md) to a local file (scratchpad, or `samples/react-native/verify-reports/` if the maintainer wants it in the tree). Include the verdict, the claim, the exact scenario, both event links, screenshots, the sample diff if any, timings, and every problem hit. Then show it and ask before posting anywhere.
138
+
Write the report with [references/report-template.md](references/report-template.md) to a local file (scratchpad, or `samples/react-native/verify-reports/` if the maintainer wants it in the tree). Running as a subagent that can't write report files: return the full report text instead, and the parent saves it. Include the verdict, the claim, the exact scenario, both event links, screenshots, the sample diff if any, timings, and every problem hit. Then show it and ask before posting anywhere.
112
139
113
140
Finally:
114
141
115
142
- Restore the SDK sources with `git checkout -- packages/core` (this also restores `replay-stubs.jar`), or return from the detached parent checkout.
116
143
- iOS: restore what `pod install` rewrote: `git checkout -- samples/react-native/ios/sentryreactnativesample.xcodeproj samples/react-native/ios/sentryreactnativesample/PrivacyInfo.xcprivacy`. The ignored `Pods/` then no longer match the tracked project, which is why every iOS run reinstalls Pods first.
117
-
- Shut down any simulator or emulator you booted (`xcrun simctl shutdown <udid>`, `adb emu kill`).
144
+
- Shut down any simulator or emulator you booted (`xcrun simctl shutdown <udid>`, `adb -s <serial> emu kill`), and stop any Metro or helper server you started. Leave devices and servers you didn't start alone.
145
+
- Remove the large build outputs you created if disk is short: `samples/react-native/{ios/DerivedData,ios/build,android/app/build,app.apk,sentryreactnativesample.app}` (all git-ignored).
Copy file name to clipboardExpand all lines: .agents/skills/verify-pr/references/android.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@
10
10
| Source maps upload |`export SENTRY_DISABLE_AUTO_UPLOAD=true` for release builds. The local token can't upload, and verification doesn't need it. |
11
11
| Sentry | The Sentry MCP with read access to `sentry-sdks`. `sentry-cli` can't read events (no `api` command, `org:ci` token). |
12
12
13
-
Start an emulator if none is running: `emulator -avd Pixel_8 -no-snapshot-save &`, then `adb wait-for-device`.
13
+
Start an emulator if none is running: `emulator -avd Pixel_8 -no-snapshot-save &`, then `adb wait-for-device`. If another session's emulator (e.g. an ATD image) is already running, boot `Pixel_8` next to it and pass `-s <serial>` to `adb` and `--device <serial>` to Maestro.
- These scripts **drop extra arguments**: `-P…` flags never reach Gradle. For Gradle properties, call `./gradlew :app:assembleRelease -P…` in `samples/react-native/android` directly.
25
+
- Debug builds load JS from port 8081 on the host (`10.0.2.2:8081`); `adb reverse` doesn't change that on an emulator. If another Metro holds 8081, build with `-PreactNativeDevServerPort=<port>` and `yarn start --port <port>`, or use a release build.
26
+
24
27
-`*-legacy` variants build the Old Architecture. Verify on the architecture the claim is about; when it's both, run both.
25
28
- Build time depends on the Gradle cache: ~5–6 min with a cold cache, 15–40 s with a warm one, including after a native-only change.
26
29
- JS SDK changes: `cd packages/core && yarn build` first, on both sides.
Copy file name to clipboardExpand all lines: .agents/skills/verify-pr/references/evidence.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,9 @@ Choose the signal that differs between the two runs, and write the expectation f
13
13
| Profiles | Profile chunks of each run |`search_profiles` by time window; open from the transaction |
14
14
| Screenshots, view hierarchy, other attachments | The attachment on each run's event, read back from Sentry — not the device's own screenshot |`get_event_attachment` with the event id (lists them), then with the `attachmentId` (returns the image). Save both images with the report |
15
15
| Masking (screenshots, replay) | A **probe** the mask must hide: a view that is neither text nor an image (so default masking leaves it alone) in two contrasting colors (a redaction is one flat color) | as above; describe what each run's image shows |
16
-
| Replays | The replay on the run's event | the event's `replays.attached` field |
16
+
| Replays | The replay on the run's event | the event's `replays.attached` field; `get_replay_details` for the timeline |
17
+
| Replay recording content (touches, frames) | The rrweb events in each segment. The MCP's replay timeline shows only breadcrumbs (e.g. `tap`), not recorded touch positions | Android with `debug: true`: logcat holds each segment's full rrweb JSON (touches are `type 3`, `source 2`). Android Spotlight doesn't forward replay envelopes |
18
+
| A JS-thread block or hang | The hang event; a device-log line the scenario prints after the block | screenshots show only the tap |
17
19
| Option mapping, native init | The **resolved option on device**, logged by the scenario (e.g. `ScopesAdapter.getInstance().getOptions().getLogs().isEnabled()`); the option's effect in Sentry is secondary | logcat, or put the value in the message/tag the run sends. Mind the sample's init path (SKILL.md step 1.3) |
18
20
| Performance (startup, allocation) | Usually not checkable end to end on an emulator | Say so and mark **Inconclusive** rather than measuring noise |
0 commit comments