Skip to content

feat: add config-sdk-version.json and SDK version guard [LIN-2149] - #27

Closed
ChetanBhosale wants to merge 3 commits into
mainfrom
chetan/lin-2149-sdk-version-guard
Closed

feat: add config-sdk-version.json and SDK version guard [LIN-2149]#27
ChetanBhosale wants to merge 3 commits into
mainfrom
chetan/lin-2149-sdk-version-guard

Conversation

@ChetanBhosale

Copy link
Copy Markdown
Contributor

What

Adds config-sdk-version.json at 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 LinkrunnerKit.podspec must equal sdk_versions[0].version.

  • A PR that does not touch the SDK version passes untouched. Ordinary fixes, docs and refactors are unaffected.
  • A PR that bumps the version fails until an entry is added at the top of 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_source block inside config-sdk-version.json, so the same script is used across all nine SDK repos.

Data provenance

version and description come from Postgres public."SDKVersion". pushed_date does not — all 206 rows there were bulk-inserted on 2026-07-24 11:47:43, so created_at carries no release-date signal. Dates come from git tags and the CHANGELOG instead, and are verified monotonic against version order.

This repo's 4.1.0 (ICM/TCF) has no row in SDKVersion yet, so its description is summarised from the CHANGELOG. 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

ChetanBhosale and others added 3 commits July 28, 2026 16:21
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
Replaces the shared Python checker with Scripts/check-sdk-version.swift,
run with the Swift toolchain that ships with Xcode:

  swift Scripts/check-sdk-version.swift

Uses Foundation only. CI runs it on macOS, where Swift is preinstalled.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011RipJmrW6btPTyoXRXhfLU
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
@ChetanBhosale

Copy link
Copy Markdown
Contributor Author

Closing for now — parking this work. The branch chetan/lin-2149-sdk-version-guard is preserved and both checks were passing, so this can be reopened as-is if we pick it up again. Tracked in LIN-2149.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant