feat: add config-sdk-version.json and SDK version guard [LIN-2149] - #3
Closed
ChetanBhosale wants to merge 4 commits into
Closed
feat: add config-sdk-version.json and SDK version guard [LIN-2149]#3ChetanBhosale wants to merge 4 commits into
ChetanBhosale wants to merge 4 commits into
Conversation
Record the full published version history (version, pushed_date, description) in config-sdk-version.json at the repo root, newest first, and enforce that the version declared in the package manifest is always its top entry. A PR that does not touch the SDK version is unaffected; one that bumps the version fails until a matching entry is added. Enforced by scripts/check-sdk-version.py, run in CI via the SDK version check workflow and locally via a pre-commit hook. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RipJmrW6btPTyoXRXhfLU
…IN-2149] Replaces the shared Python checker with a Node implementation and exposes it as an npm script, so the check runs on the toolchain the package already requires to build and publish. npm run check:version Also wired into prepublishOnly, so an unrecorded version cannot be published even if CI is bypassed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RipJmrW6btPTyoXRXhfLU
Two stray NUL bytes inside a string literal made git treat scripts/check-sdk-version.js as a binary blob, so diffs and review comments did not work on it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RipJmrW6btPTyoXRXhfLU
Comment on lines
+19
to
+31
| name: SDK version check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| # No `npm ci`: the checker uses Node built-ins only, so `npm run` can | ||
| # invoke it without installing dependencies. | ||
| - name: Verify the SDK version is recorded in config-sdk-version.json | ||
| run: npm run check:version |
Adds a Build workflow that compiles the SDK with its own toolchain, kept separate from the SDK version check so a version mistake and a build break are reported independently. Every command was run locally before being wired up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RipJmrW6btPTyoXRXhfLU
Comment on lines
+15
to
+28
| name: Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build |
Contributor
Author
|
Closing for now — parking this work. The branch |
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.
What
Adds
config-sdk-version.jsonat the repo root — the full published version history as{version, pushed_date, description}, newest first — and a check that stops the SDK version being bumped without a matching entry.The rule
The version in
package.jsonmust equalsdk_versions[0].version.config-sdk-version.json.How
scripts/check-sdk-version.py— stdlib-only, no dependencies. Also rejects duplicate versions, out-of-order arrays and malformed JSON..github/workflows/sdk-version-check.yml— runs it on every PR.The checker is driven by the
version_sourceblock insideconfig-sdk-version.json, so the same script is used across all nine SDK repos.Data provenance
versionanddescriptioncome from Postgrespublic."SDKVersion".pushed_datedoes not — all 206 rows there were bulk-inserted on 2026-07-24 11:47:43, socreated_atcarries no release-date signal. Dates come from the package registry publish date instead, falling back to CHANGELOG, git tag, then the commit that bumped the manifest. All entries are dated and verified monotonic against version order.WEB has no rows in `SDKVersion`, so versions and dates come from npm and every `description` is `null` rather than invented. The check warns about this but does not fail. Backfill tracked in LIN-2150.
Note
Adding "SDK version check" as a required status check in branch protection is what actually blocks a merge — CI alone only reports.
Linear: LIN-2149
🤖 Generated with Claude Code
https://claude.ai/code/session_011RipJmrW6btPTyoXRXhfLU