Repository navigation
build: enable explicit API mode for api, ui and telemetry - #1023
Merged
Merged
Conversation
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (155)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Oct 2, 2026
swolfand
force-pushed
the
mike/explicit-api-abi-check
branch
from
October 5, 2026 23:39
ebe39df to
72ba253
Compare
swolfand
force-pushed
the
mike/explicit-api-mode
branch
from
October 5, 2026 23:47
ede7c64 to
9d533b9
Compare
swolfand
force-pushed
the
mike/explicit-api-abi-check
branch
from
October 6, 2026 18:02
72ba253 to
f19d2d9
Compare
swolfand
force-pushed
the
mike/explicit-api-mode
branch
2 times, most recently
from
October 6, 2026 19:23
3300963 to
47ea4f3
Compare
swolfand
force-pushed
the
mike/explicit-api-abi-check
branch
2 times, most recently
from
October 7, 2026 00:15
1f26572 to
dc92d84
Compare
Turn on explicitApi() in the three published modules so every public declaration states its visibility and type. This adds `public` or an explicit type where the compiler asked and changes no ABI: apiCheck passes against the checked-in dumps unchanged. AutoMap's KSP output declares public functions without a modifier, so a doLast on the ksp tasks adds `public` to bare top-level `fun`s until AutoMap emits it itself.
swolfand
force-pushed
the
mike/explicit-api-mode
branch
from
October 7, 2026 00:30
47ea4f3 to
66d2a61
Compare
This was referenced Oct 8, 2026
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.
Why
Finding #6 of the architecture review: there is no
explicitApi(), and some types are public by accident. With explicit API mode on, a declaration can't become public just because someone left off a modifier. Visibility has to be a deliberate choice, and the ABI check from the previous PR catches any change to it.This is PR 2 of 3, and it stacks on #1022:
explicitApi()in api, ui and telemetryScope
kotlin { explicitApi() }in:source:api,:source:uiand:source:telemetry.Mechanical edits only, all driven by compiler errors:
publicadded to the ~860 declarations that were public by default.const vals,OAuthProviderconstants,ClerkLogfunctions (Int),ClerkButtonDefaultsfactories,PasswordKeyboardOptions, the two custom-navigatorCompositionLocals, and a few extension functions. Each type is the one the compiler had already inferred.AutoMap workaround (
source/api/build.gradle.kts):*.toMap()extensions) has no visibility modifier on public declarations, and explicit API mode rejects that.doLaston the KSP tasks rewrites a bare top-levelfuntopublic fun.fun(the only shape AutoMap generates today). Anything else AutoMap might emit later (public classes, properties, indented or annotated functions) fails explicit API mode instead of being silently rewritten. The build-file comment only states the AutoMap limitation, not how the regex works.publicitself. It needs a small upstream change.config/detekt/detekt-baseline.xml: one existingLongParameterListentry forClerkTypographyBuilderupdated. Its ID contains the constructor signature, which now includespublic. This is the same finding as before, not a new suppression.Rebased onto the updated build: check the public ABI against checked-in dumps #1022 (now on
mainat 1385b1f).User.ktconflicted with fix(user): apply the fetched client in User.reload and return the fresh user #1029: I tookmain'sUser.reloadbody and only addedpublic. Earlier:Clerk.kt,Auth.kt,BiometricCredentials.kt,RestoreCredentials.kt,SignIn.kt,SignInExtensions.ktandSignUp.ktconflicted with theClerk.authfacade stack; I keptmain's bodies and re-added the modifiers the compiler asked for, including onmain's new declarations (transferToSignIn/transferToSignUp,EnterpriseSsoBuilder.redirectUrl,SignInIdentifierBuilder.identifier, thesendEmailLink(redirectUri)and hidden-deprecated overloads,Clerk.setDeviceToken).Blast Radius
apiCheckpasses against the dumps from PR 1 without regenerating them, which shows that the effective visibility and signatures are identical.publicmodifier, or re-run the compile and add the modifiers it asks for.Testing
./gradlew apiCheck: passes, with the dumps unchanged from PR 1 (re-verified after the rebase)../gradlew spotlessApply detekt :source:api:testDebugUnitTest :source:ui:testDebugUnitTest apiCheckand:source:telemetry:testAndroidHostTest: pass after the rebase../gradlew :source:api:testDebugUnitTest :source:ui:testDebugUnitTest :source:telemetry:testAndroidHostTest: pass../gradlew :source:{api,ui,telemetry}:spotlessApply :source:{api,ui,telemetry}:detekt: pass.🤖 Generated with Claude Code
Rebuilt on main after #1022
Main moved a long way (typed
Strategy, unknown-enum fallback,OAuthResult.Outcome, the telemetry library change, #1021's formatting), and rebasing the original commit conflicted in 25 files. So the branch is now one commit rebuilt from current main: the same build config (explicitApi()in api, ui and telemetry, now a plain Android library; the AutoMap kspdoLast), withpublicand explicit types added exactly where the compiler asked.apiCheckpasses against main's dumps with no change, so the ABI is untouched.verifyPublishedArtifacts, all three modules' unit tests, and the samples, workbench and e2e compile.Summary by CodeRabbit