Repository navigation
ci(nav3): [Part 6] Keep the SerialName mapper's compatibility coverage current - #6784
Closed
0xadam-brown wants to merge 6 commits into
Closed
0xadam-brown wants to merge 6 commits into
0xadam-brown wants to merge 6 commits into
Conversation
This was referenced Nov 25, 2026
Contributor
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. |
0xadam-brown
force-pushed
the
feat/nav3-serial-name-stack-5
branch
from
November 25, 2026 15:34
c765b6c to
9f1998f
Compare
0xadam-brown
force-pushed
the
feat/nav3-serial-name-stack-6
branch
from
November 25, 2026 15:34
b1503d4 to
731e102
Compare
📲 Install BuildsAndroid
|
An entry recorded as /unknown didn't say why, so outside debug logs a mapper that threw, returned a blank name, or chose not to name an entry all looked the same, as did the built-in mapper's failures, many of which only happen in minified release builds. Record the reason next to the entry as unknown_entry_reason in the back stack context and the nav transaction's data, and as to_unknown_entry_reason and from_unknown_entry_reason on breadcrumbs. The values are mapping_failed, blank_name, and unmapped for any mapper, and not_serializable, generic_type, serializer_not_found, serializer_lookup_threw, or kotlinx_serialization_version for SerialName. A mapper that throws now records mapping_failed as its unknown entry reason instead of as its arguments' drop reason, so one cause has one name. SerialName returns null, which is public API, so it reports its reason through an internal per-thread side channel that the converter reads around each mapping call. A custom mapper that forwards SerialName's null forwards its reason too. Each type's reason is cached with its failure. Generic @serializable types are now detected before the serializer lookup, which can't find their serializers either, so that they record generic_type and log a warning that says so.
The routes are @serializable with the Nav2 sample's route names as their serial names. The single-stack sample names them with BackStackEntryMapper.SerialName and adds each route's own arguments, and the multi-root samples use SerialName directly. The performance scenario can run SerialName itself, to measure its name lookups, as well as the custom mapper.
Add nav3-backstack-entry-mapper-r8-check, an app that maps representative back stack keys with BackStackEntryMapper.SerialName in an R8-minified release build and reports whether each name is right, and scripts/test-nav3-backstack-entry-mapper-r8.sh, which builds it against the kotlinx.serialization floor in R8 full and compat mode, and optionally other versions, 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.
Run the R8 check and the module's unit tests in CI against the kotlinx.serialization floor, the latest stable release, and any newer release candidate. The versions live in gradle/dependency-matrix.versions.toml: Dependabot bumps the stable one, and a weekly job in update-deps.yml bumps the release candidate. Release candidate failures only fail PRs that change it. The workflow runs on every PR and push to main, and scripts/nav3-r8-check-relevant.sh decides whether the changes can affect the check. The R8 check's README describes what to do when a bump fails.
0xadam-brown
force-pushed
the
feat/nav3-serial-name-stack-5
branch
from
November 25, 2026 16:31
9f1998f to
ba7a24b
Compare
0xadam-brown
force-pushed
the
feat/nav3-serial-name-stack-6
branch
from
November 25, 2026 16:31
731e102 to
88da4c7
Compare
0xadam-brown
force-pushed
the
feat/nav3-serial-name-stack-5
branch
2 times, most recently
from
November 27, 2026 15:27
e61da7e to
9ab6968
Compare
Member
Author
|
Closing: the CI workflow now ships with the R8 check in #6783. The Dependabot, update-deps, and release-candidate pieces this PR added are gone, so there's nothing left to review separately. |
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.
PR Stack (Nav3 SerialName Mapper)
This stack replaces the
SerialNamehalf of #6696.SerialNameAndPropertieswill follow in its own stack.📜 Description
Runs Part 5's R8 check, and the module's unit tests, in CI against newer kotlinx.serialization versions as well as the floor.
Version matrix.
gradle/dependency-matrix.versions.toml(thematrixLibscatalog from Part 2) gains two roles next to the floor:kotlinxSerialization-stable, the latest stable release, which Dependabot bumps.kotlinxSerialization-preview, the latest release candidate, which a new weekly job inupdate-deps.ymlbumps. It's tested only while it's newer than stable.The file's header explains the roles, and the rules that keep Dependabot from bumping the floor.
scripts/dependency-matrix.shreads and writes the keys.Workflow.
integration-tests-nav3-r8.ymlbuilds the R8 check's APKs (floor in full and compat mode, plus stable and any newer RC in full mode) and runs them on an emulator. It runs on API 37 for PRs, and on API 23 (Nav3'sminSdk) too on pushes tomain. A separate job runs all of the module's unit tests against the newer versions (scripts/test-nav3-kotlinx-versions.sh). The Build workflow already runs them at the floor.Relevance. The workflow runs on every PR and push to
main, without path filters. Its first job asksscripts/nav3-r8-check-relevant.shwhether the changes can affect the check, and skips the rest if not. That covers the module, the R8 app, build logic, and the versions of Kotlin, AGP, Compose, lifecycle, savedstate, Nav3, and kotlinx.serialization. This keeps unrelated dependency bumps from starting an emulator.Release candidates are advisory. RC failures are warnings, except on PRs that change the preview version, such as the weekly updater's.
Runbook. The R8 check's README says what to do when a bump fails, e.g., when a release needs a newer Kotlin compiler than the repo uses.
The workflow only needs
contents: read, and doesn't cancel in-progress runs onmain.💡 Motivation and Context
Apps choose their own kotlinx.serialization version, which is often newer than the 1.7.3 we compile against. A new release can change serializer lookup, descriptors, or its R8 rules in ways that break naming only in minified builds. Testing stable releases catches that for apps that already use them. Testing release candidates gives us warning before they become stable.
addresses: JAVA-787 (link)
💚 How did you test it?
scripts/test-nav3-kotlinx-versions.sh(unit tests at 1.13.0) and the full R8 script (1.7.3 full and compat, 1.13.0 full) locally on an emulator. All pass.dependency-matrix.shandnav3-r8-check-relevant.shoutput locally. This PR's own workflow run is the first CI run.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
DependencyMatrixPlugin, which other matrices (e.g., AGP) use.