Repository navigation
test(nav3): [Part 5] Verify the SerialName mapper under R8 in CI - #6783
0xadam-brown wants to merge 2 commits into
Conversation
PR risk: mediumFor commit The model rated this change low. It was raised to medium because:
This label is a hint for reviewers, not an approval. |
c765b6c to
9f1998f
Compare
13ed74a to
37996b3
Compare
📲 Install BuildsAndroid
|
37996b3 to
cd7e549
Compare
9f1998f to
ba7a24b
Compare
cd7e549 to
a6598e0
Compare
ba7a24b to
87b563d
Compare
Add nav3-built-in-back-stack-mappers-r8-check, an app that maps representative back stack keys with BackStackEntryMapper.SerialName in an R8-minified release build and reports whether each name and unknown entry reason is right, and scripts/test-nav3-built-in-back-stack-mappers-r8.sh, which builds it and runs it on a booted emulator or device. Besides names, the app checks that R8 renamed classes, and, through a logger that records the mapper's messages, that the compatibility probe was conclusive. The Nav3 R8 workflow runs the check on API 23 in R8 full mode against the kotlinx.serialization floor and its latest stable release, and in compat mode against the floor, and runs the module's unit tests against the latest stable release. It only runs when files that can affect the check change.
e61da7e to
9ab6968
Compare
a6598e0 to
7010a59
Compare
…Effect records The check read each /unknown entry's reason from the warning the mapper logs, so it couldn't tell whether the reason reached the payload, and it broke whenever a warning was reworded. It now shows every key to SentryNavEffect as one back stack and reads names and reasons from the Navigation context of a captured event that beforeSend drops. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit be9abcb. Configure here.
| on: | ||
| push: | ||
| branches: | ||
| - main |
There was a problem hiding this comment.
Workflow omits 9.x.x branch
Medium Severity
The new workflow's on.push.branches lists main only. Maintenance-branch pushes to 9.x.x never run this R8 check, and the same main-only filter is the pattern that leaves 9.x.x PRs stuck on required status checks.
Triggered by learned rule: No actions/checkout submodules
Reviewed by Cursor Bugbot for commit be9abcb. Configure here.


PR Stack (Nav3 SerialName Mapper)
This stack replaces the
SerialNamehalf of #6696.SerialNameAndPropertieswill follow in its own stack.📜 Description
Unit tests run unminified, but the SDK ships inside apps that R8 minifies.
SerialNamedepends on R8 keeping what kotlinx.serialization's lookup needs (@Serializableannotations, generatedserializer()methods, companion objects, andINSTANCEfields). Whether it does depends on kotlinx.serialization's consumer rules, which vary by version, and on R8's mode. The only way to check it is to build and run a minified app.This PR adds that app and runs it in CI.
The check app
nav3-built-in-back-stack-mappers-r8-checkmaps representative back stack keys withSerialNamein an R8-minified release build and logsPASSorFAILfor each:@SerialName, sealed types, enums (including constants with bodies), value classes, private types, and a class with a custom serializer./unknownand its reason: aString, an unannotated class and enum, and a generic class, each with the expectedunknown_entry_reason./unknownwithserializer_not_foundis accepted.scripts/test-nav3-built-in-back-stack-mappers-r8.sh buildbuilds three APKs: R8 full mode against the oldest supported kotlinx.serialization (1.7.3) and the latest stable release, and R8 compat mode against the oldest.runinstalls each on a booted emulator or device and reads the results from logcat.CI
The
Nav3 Built-in Back Stack Mappers R8 Checkworkflow:minSdk;It runs only when a change can affect the check: the module, the check app, the build logic, the Gradle version, or the version catalogs. It isn't a required check, so skipped runs don't block PRs.
The oldest and latest versions come from
gradle/dependency-matrix.versions.toml. The check app's README describes what to do when a version bump fails.💡 Motivation and Context
A release build that names screens differently from a debug build is the failure apps are least likely to notice, as nobody reads debug logs there. This check has already caught one bug: in R8 full mode at 1.7.3, R8 removed the
INSTANCEfield of the probe's own object, so the probe was silently inconclusive. Part 3 now keeps it with a scoped rule.addresses: JAVA-787 (link)
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
🤖 Generated with Claude Code