chore: register the remaining public API in the capability matrix - #1673
chore: register the remaining public API in the capability matrix#1673spydon wants to merge 3 commits into
Conversation
Brings capability-matrix coverage of the Dart public API from 49% to 100%. The 881 unregistered symbols split three ways: - 500 are attributed to the capability they support, and 26 are entry points the matrix was missing outright (GoTrueClient.updateUser, SupabaseClient.from, RealtimeChannel.onPostgresChanges, StorageFileApi.createSignedUrl, ...). - 355 go in the top-level supporting_symbols list: shared domain models, the exception hierarchies, the client handles that gate whole areas, and surface the canonical registry has no id for. - 26 are not public API at all and leave the scan instead of entering the matrix. #1671's script only matched class-like declarations, so top-level functions and variables were missed: the realtime transformers, the conditional-import platform shims, and the passkey option mappers are now @internal. ChannelFilter joins them; it is hidden from realtime_client's public library, so it could not serve as evidence for postgres changes, and RealtimeChannel.onPostgresChanges replaces it there. Two paths cannot carry the annotation and are excluded by .sdk-parse-ignore instead: each package's own example app, which the extractor treats as a package because it has a pubspec.yaml, and version.dart, which the release tooling rewrites wholesale. Also declares storage.errors.error_codes, which StorageException.error already implements.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR completes the backfill of the capability matrix (sdk-compliance.yaml) so that the Dart SDK’s extracted public API symbols are fully accounted for, and it tightens a small amount of accidentally-exported surface by marking helper declarations @internal and narrowing exports.
Changes:
- Expanded
sdk-compliance.yamlto register the remaining public API symbols (including missing entry points and supporting types) and added a newstorage.errors.error_codesfeature. - Marked various top-level helpers / shims as
@internalso they no longer count as SDK public API symbols. - Narrowed
realtime_clientexports oftransformers.dartfromhide ...toshow PostgresColumn, PostgresTypeto prevent future accidental leakage.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk-compliance.yaml | Registers remaining public API symbols into capability matrix features/supporting symbols. |
| packages/supabase_flutter/lib/src/passkey/passkey_options_mapper.dart | Marks passkey options mapping helpers @internal. |
| packages/supabase_flutter/lib/src/local_storage_web.dart | Marks web local storage helpers @internal. |
| packages/supabase_flutter/lib/src/local_storage_stub.dart | Marks stub local storage helpers @internal. |
| packages/supabase_flutter/lib/src/hot_restart_cleanup_web.dart | Marks hot-restart cleanup hooks @internal for web. |
| packages/supabase_flutter/lib/src/hot_restart_cleanup_stub.dart | Marks hot-restart cleanup hooks @internal for stub. |
| packages/realtime_client/lib/src/websocket/websocket_web.dart | Marks createWebSocketClient @internal for web implementation. |
| packages/realtime_client/lib/src/websocket/websocket_stub.dart | Marks createWebSocketClient @internal for stub implementation. |
| packages/realtime_client/lib/src/websocket/websocket_io.dart | Marks createWebSocketClient @internal for IO implementation. |
| packages/realtime_client/lib/src/types.dart | Marks ChannelFilter @internal (no longer treated as SDK public API evidence). |
| packages/realtime_client/lib/src/transformers.dart | Marks transformer helpers @internal (keeps only intended public types). |
| packages/realtime_client/lib/src/retry_timer.dart | Marks maxShift @internal. |
| packages/realtime_client/lib/realtime_client.dart | Narrows exports of transformers to only PostgresColumn and PostgresType. |
| packages/postgrest/lib/src/constants.dart | Marks defaultHeaders @internal. |
| packages/gotrue/lib/src/broadcast_web.dart | Marks getBroadcastChannel @internal for web implementation. |
| packages/gotrue/lib/src/broadcast_stub.dart | Marks getBroadcastChannel @internal for stub implementation. |
| .sdk-parse-ignore | Excludes per-package examples and rewritten version.dart from API extraction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Stacked on #1671. Closes the backfill that #1670 and #1671 flagged: capability-matrix coverage of the Dart public API goes from 49% to 100%.
How the 881 unregistered symbols were placed
26 are entry points the matrix was missing outright. These go in
symbols, so the drift check now verifies them:auth.session.update_userGoTrueClient.updateUserauth.session.get_session/get_userGoTrueClient.currentSession/currentUserauth.sign_in.sign_in_with_oauthGoTrueClient.getOAuthSignInUrl,GoTrueClientSignInProvider.signInWithOAuthauth.sign_in.sign_in_with_ssoGoTrueClientSignInProvider.signInWithSSOauth.identities.link_identityGoTrueClientSignInProvider.linkIdentityauth.passkey.*GoTruePasskeyApi.start/verifyRegistration,start/verifyAuthenticationdatabase.query.from_table/rpc/schema_selectionSupabaseClient.from/rpc/schemadatabase.using_modifiers.explainPostgrestTransformBuilder.explainrealtime.subscriptions.postgres_changesRealtimeChannel.onPostgresChanges,onSystemEventsrealtime.client.*SupabaseClient.channel,getChannels,removeChannel,removeAllChannels,RealtimeClient.disconnectstorage.file_buckets.create_signed_urlStorageFileApi.createSignedUrlclient.*GoTrueClient.getSessionFromUrl,recoverSession,setInitialSessionSeveral of these features previously listed only an option or enum as their evidence.
storage.file_buckets.create_signed_urlclaimedDownloadBehavior;database.using_modifiers.explainclaimedExplainFormat;auth.session.update_userclaimedUserAttributes.currentPassword. The method that actually implements the capability was unregistered in each case.500 go in a feature's
supporting_symbols, where the type maps onto one capability: the MFA response types to their operations,Jwt*/JWK*/DecodedJwttoget_claims,FileObjectV2tofile_info,SignedUrl*tocreate_signed_urls, the presence payloads tosubscribe_presence, and so on.355 go in the top-level
supporting_symbolslist. Four kinds:Session,User,AuthResponse,Bucket,OAuthClient,Factor. Accepted or returned by many features at once, so no single feature id is a truthful home.AuthException,PostgrestException,FunctionException,RealtimeSubscribeExceptionand subclasses. Thrown rather than passed, so reachable from no signature.SupabaseClient,GoTrueClient,RealtimeClient,GoTrueAdminApiand the accessors returning them gate whole areas; their operations are attributed individually.26 symbols left the scan instead of entering the matrix
#1671's script only matched class-like declarations, so top-level functions and variables slipped through. Now
@internal:realtime_client/src/transformers.dart:convertCell,convertColumn,convertChangeData,toArray,toBoolean,toDouble,toInt,toJson,toTimestampString,noop,httpEndpointURL,getEnrichedPayload,getPayloadRecordsaccessToken,hasAccessToken,persistSession,removePersistedSession,disposePreviousClient,markClientToDispose,supabaseFlutterClientToDispose,getBroadcastChannel,createWebSocketClientpasskeyRegisterRequestFromOptions,passkeyAuthenticateRequestFromOptions,maxShift,defaultHeadersChannelFilterjoins them, and this one is worth a second look: it is hidden fromrealtime_client's public library, soChannelFilter.selectcould never have been drift-verified evidence forrealtime.subscriptions.postgres_changes.RealtimeChannel.onPostgresChangesreplaces it.Two paths cannot carry the annotation, so
.sdk-parse-ignoreexcludes them:packages/*/example/— each package ships its own example app, and the extractor treats it as a package of its own because it has apubspec.yaml.MyApp,MyWidgetandmainwere counted as SDK public API.examples/was already excluded for exactly this reason.packages/*/lib/src/version.dart— the release tooling rewrites it wholesale (echo "const version = '$version';" > ...), so an annotation would not survive a release.One behaviour-visible change
realtime_client.dartchanges fromexport 'src/transformers.dart' hide getEnrichedPayload, getPayloadRecordstoshow PostgresColumn, PostgresType. The 13 payload-conversion helpers above were public only by accident of that hide list, and the analyzer requires it:@internalon an exported member isinvalid_export_of_internal_element. Theshowform also stops the next helper added to that file from leaking.This removes public API. It is not API anyone should be calling (
toInt,noop,convertCell), and v3 is already removing dead public surface, but it is the one item here that is not purely additive.Also declared:
storage.errors.error_codesThe validator reported it undeclared, and
StorageException.erroralready carries the machine-readable service code the capability describes. Declared as implemented, which also givesStorageExceptiona real home instead of the shared bucket.Gaps this surfaced
Public API with no canonical capability id, currently parked in the top-level list. Each is a candidate for a new id in
supabase/sdk:Supabase.initialize,Supabase.instance,Supabase.client,isInitialized, anddisposeon every client.client.*has no lifecycle group at all.GoTruePasskeyApi.list,delete,update. The matrix hasauth.passkey_admin.list_passkeysanddelete_passkeyfor the admin API, but nothing for a user managing their own.SupabaseQueryBuilder.streamandSupabaseStreamBuilder. The stream filters and modifiers are registered underdatabase.using_filters.*andusing_modifiers.*, butstream()itself is not a capability.StorageClientOptions.retryAttemptsandStorageRetryController.database.configuration.auto_retryexists; there is no storage equivalent.realtime.subscriptions.postgres_changes_multiple_filtersis the one remaining undeclared feature, and Dart implements it (onPostgresChanges(filters: [...])). Declaring it needsRealtimeChannel.onPostgresChangesregistered against two features, so it is left out here rather than adding a duplicate registration.Two more judgement calls worth flagging:
RealtimeClientexposes transport internals —sendBuffer,stateChangeCallbacks,pendingHeartbeatRef,makeRef,ref,push,heartbeatTimer,reconnectTimer, andRealtimeChannel.canPush/trigger. Registered here because they are genuinely exported, but they read like@internalcandidates for a future breaking change.yet_another_json_isolatecontributes 13 symbols with no Supabase capability behind them. Registered in the top-level list; it could instead be excluded from the scan the waysupabase_commonis.Test plan
dart analyze packages/: No issues found. This is the real gate forinvalid_internal_annotation,invalid_use_of_internal_memberandinvalid_export_of_internal_element.OK — compliance file is valid.check-drift:✅ No capability matrix drift detected.check-api-symbolsagainst chore: mark non-public declarations @internal #1671 as base:✅ All new public API symbols are covered in the capability matrix.Nothing registered was removed, and nothing new is uncovered.StorageFileApi.moveformoveandmove_cross_bucket). This change adds none.dart format packages/: 0 changed.gotrue471,realtime_client205,postgrest196,supabase134,storage_client210,supabase_flutter65,functions_client48.postgrestneeds-j 1; run in parallel its test files race on the shared database reset helper, which varies the failure count run to run on unmodified code.