Repository navigation
feat: track removed registered symbols in api compliance check - #32
Merged
grdsdev merged 1 commit intoJun 18, 2026
Merged
Conversation
grdsdev
added a commit
that referenced
this pull request
Jun 18, 2026
…ix (#31) * feat: CI check 1 — block PRs adding public API not in capability matrix Implements SDK-992. Adds a reusable GitHub Actions workflow that parses the TypeScript public API of an SDK, diffs it against the base branch, and fails with an actionable error if any new public symbol is not registered in sdk-compliance.yaml. Key pieces: - `src/ts-parser.ts`: syntactic TS AST walker (no type-resolution, works without node_modules installed in the SDK repo) - `src/parse-ts.ts`: CLI — takes SDK root path, emits ParseResult JSON - `src/api-check.ts`: diff logic — `checkNewSymbols(base, pr, compliance)` - `src/check-api-symbols.ts`: CLI — compares two ParseResult files against sdk-compliance.yaml, exits 1 with a clear error on uncovered symbols - `.github/workflows/check-api-compliance.yml`: reusable workflow for SDK repos; checks out PR + base branches, runs both parsers, runs the check - `src/compliance.ts`: adds `symbols?: string[]` to ComplianceEntry and RawValue; validates the field; adds `buildSymbolIndex` helper - `src/types.ts`: adds `symbols?: string[]` to ComplianceEntry SDK repos opt in by calling the reusable workflow on pull_request and annotating sdk-compliance.yaml entries with the SDK symbol names: auth.sign_up: status: implemented symbols: - GoTrueClient.signUp 58 tests pass, typecheck clean. * feat: add Swift public API parser and wire up supabase-swift - src/swift-parser.ts: line-by-line Swift AST scanner with brace-depth context tracking. Handles public/open/nonisolated class/struct/actor/ enum/protocol, extensions (including dotted names like AuthClient.Configuration), public func/var/let/typealias/init. Skips Tests/ and TestHelpers/ directories. - src/parse-swift.ts: CLI wrapper (same contract as parse-ts.ts) - package.json: adds parse-swift script - check-api-compliance.yml: reads sdk: field from compliance file and dispatches to parse-ts or parse-swift accordingly 26 new Swift parser tests; full suite 84/84. * feat: track removed registered symbols in api compliance check (#32) * feat: add parse-ignore module — load sdk-parse-ignore via ignore package * test: fix negation test to use valid gitignore semantics * test: restore negation test to brief intent (Tests/* pattern) * refactor: ts-parser uses loadIgnore, removes hardcoded SKIP_DIRS * refactor: swift-parser uses loadIgnore, removes hardcoded SKIP_DIRS/TEST_DIRS * test: fix vacuous directory-exclusion test in swift-parser * chore: remove unused mkdirSync import in ts-parser test * fix: checkout sdk spec at workflow_sha so scripts match the running workflow * fix(ci): resolve sdk spec ref from workflow_ref instead of workflow_sha github.workflow_sha returns a SHA that is not directly fetchable via git (likely an internal merge-evaluation commit). Extract the branch ref from github.workflow_ref (e.g. refs/heads/main) instead — this is always a real ref that actions/checkout can resolve. * fix(ci): use sdk-ref input for capability spec checkout github.workflow_ref in a reusable workflow context gives the calling repo's event ref (e.g. refs/pull/N/merge), not the workflow file's own ref in supabase/sdk. Add an explicit sdk-ref input (default: main) so callers can pin the scripts version during pre-merge testing. * fix(ci): silence npm lifecycle banner in parse steps npm run writes "> package@version script" to stdout, which pollutes the JSON output redirected to pr-symbols.json / base-symbols.json. Add --silent to suppress it. * refactor(ci): accept language input, drop detect step and conditional parse steps Instead of detecting the language from sdk-compliance.yaml at runtime, require callers to declare it as a required input. This removes the detect step and collapses 4 conditional parse steps into 2 unconditional ones using parse-${{ inputs.language }}. * refactor(ci): map language input to parse command, fail on unknown language Direct interpolation of inputs.language into the script name breaks for javascript (command is parse-ts). Add a resolve step with a case statement that maps language → command and emits a descriptive error for unsupported values.
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.
Summary
CheckResultwithremovedRegisteredSymbols: Array<{ symbol, featureId }>— symbols present in the base branch that are gone in the PR and are registered insdk-compliance.yamlformatRemovedMessageto produce an actionable error with the feature ID for each stale entrycheck-api-symbols) to hard-fail when registered symbols are removed, printing both failure types in a single runcheckNewSymbols, 2 forformatRemovedMessage)Behaviour
When a PR removes a public symbol that is registered in the compliance file, CI now fails with:
Both "new uncovered" and "removed stale" errors are reported in the same CI run so the developer can fix everything at once.