fix(openapi): prevent make dev from rewriting api.yaml version on event#8334
fix(openapi): prevent make dev from rewriting api.yaml version on event#8334axsseldz wants to merge 4 commits intomarimo-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@axsseldz can you investigate when this version bumps? |
the version in i also added both checks, there is now a CI check that fails if --> right here i went back to 0.19.10 (outdated version) and ran the checks, and then went back again to 0.19.11, with pre-commit i suggest running
|
|
@axsseldz great investigation! Keep it it! |
manzt
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Zooming out, it seems like the core issue is that when we bump the version in pyproject.toml and tag a release, we never regenerate api.yaml. So api.yaml is always one version behind each release.
This check catches the drift after the fact but doesn't prevent it. After every release, the first PR will either fail this check (and need a side change to fix it) or need a dedicated "bump api.yaml" commit, and even then, api.yaml will still have been behind for the release itself.
The question is whether info.version in api.yaml is meaningful or necessary. If so, we should regenerate the spec as part of the version bump and assert that only the version number changes. If not, the simplest fix is to stop embedding __version__ in the generated output.
|
Chatting with the team I think it's preferred if we just omit version from codegen. It doesn't do anything other than contribute to confusion/drift. Would you be up for making that change? |
Yes, no problem!, i'll send the changes asap 👍 |
|
hey @manzt i updated the PR based on your feedback, i removed info.version from OpenAPI codegen in commands.py and regenerated api.yaml, so the schema no longer tracks package release version, i also removed the temporary sync guard I had added, since there’s no version field left to sync. |
manzt
left a comment
There was a problem hiding this comment.
Looks great. Thanks for the contribution!

📝 Summary
make devrunsfe-codegen, which regeneratespackages/openapi/api.yaml.During generation,
info.versionis set from marimo’s runtime/package version (pyproject.toml), so ifapi.yamlis stale it gets rewrittenCloses #8333.
🔍 Root Cause
make devdepends onfe-codegen.fe-codegenrunsmarimo development openapi > packages/openapi/api.yaml.info.versionis emitted from__version__(package metadata frompyproject.toml).api.yamlversion is behind, local dev triggers a diff.🔍 Description of Changes
scripts/check_openapi_version_sync.pyto verify:pyproject.toml [project].versionpackages/openapi/api.yaml info.version.pre-commit-config.yaml:openapi-version-sync.github/workflows/test_openapi_version_sync.yaml:📋 Checklist
[updated after latest changes]
CC: @mscolnick @nojaf