Skip to content

test(nav3): [Part 5] Verify the SerialName mapper under R8 in CI - #6783

Open
0xadam-brown wants to merge 2 commits into
feat/nav3-serial-name-stack-4from
feat/nav3-serial-name-stack-5
Open

0xadam-brown wants to merge 2 commits into
feat/nav3-serial-name-stack-4from
feat/nav3-serial-name-stack-5

Conversation

@0xadam-brown

@0xadam-brown 0xadam-brown commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Nav3 SerialName Mapper)

This stack replaces the SerialName half of #6696. SerialNameAndProperties will follow in its own stack.


📜 Description

Unit tests run unminified, but the SDK ships inside apps that R8 minifies. SerialName depends on R8 keeping what kotlinx.serialization's lookup needs (@Serializable annotations, generated serializer() methods, companion objects, and INSTANCE fields). 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-check maps representative back stack keys with SerialName in an R8-minified release build and logs PASS or FAIL for each:

  • Names: objects, data classes with and without @SerialName, sealed types, enums (including constants with bodies), value classes, private types, and a class with a custom serializer.
  • /unknown and its reason: a String, an unannotated class and enum, and a generic class, each with the expected unknown_entry_reason.
  • Named companion objects: must be named from kotlinx.serialization 1.10.0 on, which ships the rules they need. Before that, /unknown with serializer_not_found is accepted.
  • R8 ran: a representative class was renamed.
  • The compatibility probe was conclusive: an inconclusive probe leaves names right, but can no longer detect an incompatible kotlinx.serialization version.

scripts/test-nav3-built-in-back-stack-mappers-r8.sh build builds 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. run installs each on a booted emulator or device and reads the results from logcat.

CI

The Nav3 Built-in Back Stack Mappers R8 Check workflow:

  • builds the APKs and runs them on an API 23 emulator, Nav3's minSdk;
  • runs the module's unit tests against the latest stable kotlinx.serialization, as apps may ship a newer version than the SDK compiles against (the Build workflow already runs them against the oldest).

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 INSTANCE field 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?

  • The workflow passes on this PR: all three APKs on the API 23 emulator, and the unit tests against kotlinx.serialization 1.13.0

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

  • The check reads each reason from the mapper's warning text, so rewording a warning fails it. A later change could assert on recorded breadcrumbs instead.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit be9abcb.

The model rated this change low. It was raised to medium because:

  • R6: build or release configuration changed: .github/workflows/integration-tests-nav3-r8.yml, scripts/test-nav3-built-in-back-stack-mappers-r8.sh, sentry-android-integration-tests/nav3-built-in-back-stack-mappers-r8-check/build.gradle.kts, sentry-android-integration-tests/nav3-built-in-back-stack-mappers-r8-check/proguard-rules.pro, sentry-android-integration-tests/settings.gradle.kts
  • R7: the model was not confident enough that the change is low

This label is a hint for reviewers, not an approval.

@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-5 branch from c765b6c to 9f1998f Compare November 25, 2026 15:34
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-4 branch from 13ed74a to 37996b3 Compare November 25, 2026 15:34
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 25, 2026
@sentry

sentry Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.65.1 (1) release

⚙️ sentry-android Build Distribution Settings

@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-4 branch from 37996b3 to cd7e549 Compare November 25, 2026 16:31
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-5 branch from 9f1998f to ba7a24b Compare November 25, 2026 16:31
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 25, 2026
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-4 branch from cd7e549 to a6598e0 Compare November 27, 2026 15:16
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-5 branch from ba7a24b to 87b563d Compare November 27, 2026 15:16
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 27, 2026
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.
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-5 branch from e61da7e to 9ab6968 Compare November 27, 2026 15:27
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-4 branch from a6598e0 to 7010a59 Compare November 27, 2026 15:27
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 27, 2026
@0xadam-brown 0xadam-brown changed the title test(nav3): [Part 5] Verify the SerialName mapper under R8 test(nav3): [Part 5] Verify the SerialName mapper under R8 in CI Nov 27, 2026
…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>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 27, 2026
@0xadam-brown
0xadam-brown marked this pull request as ready for review November 27, 2026 17:23
@0xadam-brown
0xadam-brown requested review from a team and adinauer as code owners November 27, 2026 17:23
@0xadam-brown
0xadam-brown requested review from romtsn and runningcode and removed request for a team November 27, 2026 17:23
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 27, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Triggered by learned rule: No actions/checkout submodules

Reviewed by Cursor Bugbot for commit be9abcb. Configure here.

This branch has not been deployed

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

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant