From 6fe6d05c74bc41239fce6a3718b5c8bff533044a Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 10 Oct 2026 21:12:47 +0000 Subject: [PATCH] fix(release): keep the API schema's version in step with each release v0.7.0 bumped __version__ (which FastAPI puts in the schema's info.version) but not nextjs-frontend/openapi.json, so CI's "OpenAPI schema is up to date" check fails on main and on every PR merged with it. Regenerated the schema with make openapi, and release.py now sets the version in openapi.json too. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01GbW6SC3MU2AmYQ9zFa5dk4 --- .github/scripts/release.py | 6 ++++-- docs/contributing.md | 3 ++- nextjs-frontend/openapi.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/scripts/release.py b/.github/scripts/release.py index f39984a2b..abf13882f 100644 --- a/.github/scripts/release.py +++ b/.github/scripts/release.py @@ -5,8 +5,8 @@ release.py cut auto|patch|minor|major|X.Y.Z [--date YYYY-MM-DD] Writes the new version's CHANGELOG.md section: the "## Unreleased" text, when there is any, then the changes merged since the last release, listed from their Conventional Commit titles (except those that wrote their - own Unreleased entry, unless breaking). Sets the version in pyproject.toml, uv.lock, package.json and - CloudronManifest.json (when present) and prints it. `auto` picks the bump from those titles and any + own Unreleased entry, unless breaking). Sets the version in pyproject.toml, uv.lock, package.json, the API + schema (openapi.json) and CloudronManifest.json (when present) and prints it. `auto` picks the bump from those titles and any BREAKING CHANGE footers: a breaking change is major (minor before 1.0), a feat minor, anything else patch. release.py notes X.Y.Z Prints that version's CHANGELOG.md section without its heading (nothing when there's none). @@ -37,6 +37,8 @@ "CloudronManifest.json": r'(^ "version": ")([^"]+)(")', # what a running Lens says it is (the API, MCP, telemetry, and the update check in docs/updates.md) "fastapi_backend/app/domain/__init__.py": r'(^__version__ = ")([^"]+)(")', + # the API schema's info.version is __version__, and CI checks the committed schema matches the generated one + "nextjs-frontend/openapi.json": r'(^ "version": ")([^"]+)(")', } TYPES = { diff --git a/docs/contributing.md b/docs/contributing.md index a41fd8c83..9c7574856 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -70,7 +70,8 @@ With `auto` it picks the version from the PR titles merged since the last releas override. It writes the new section (the Unreleased text, then the changes grouped into features, fixes, performance, reverts, dependencies and other changes; `docs`, `refactor`, `test`, `build`, `ci`, `chore` and `style` are left out, and so is a PR that wrote its own Unreleased entry, unless it's breaking), sets the version in `fastapi_backend/pyproject.toml`, `uv.lock`, -`nextjs-frontend/package.json` and `CloudronManifest.json`, commits that to `main` as `chore(release): vX.Y.Z`, tags +`nextjs-frontend/package.json`, the API schema `nextjs-frontend/openapi.json`, `app/domain/__init__.py` and +`CloudronManifest.json`, commits that to `main` as `chore(release): vX.Y.Z`, tags it and publishes the GitHub release with that section as its notes. Pushing a `vX.Y.Z` tag yourself publishes it the same way, without the commit. `python3 .github/scripts/release.py cut auto` shows locally what it would write. An exact version must be newer than the current one, and only the newest version is marked Latest. If a run pushed its diff --git a/nextjs-frontend/openapi.json b/nextjs-frontend/openapi.json index 29243ab27..85998ff17 100644 --- a/nextjs-frontend/openapi.json +++ b/nextjs-frontend/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Lens", - "version": "0.6.0" + "version": "0.7.0" }, "paths": { "/api/v1/auth/status": {