[v3-2-test] Speed up 'Generate the FastAPI API spec' prek hook (~2min → ~25s) (#64131)#66308
Merged
potiuk merged 1 commit intoapache:v3-2-testfrom May 3, 2026
Conversation
…ache#64131) The OpenAPI spec generation doesn't query the database — it only introspects FastAPI routes. Using postgres backend was adding ~90s of postgres container startup and migration overhead for no reason. Switching to sqlite cuts the hook from ~2 minutes to ~25 seconds. (cherry picked from commit 5d9819f)
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
maincommit5d9819fea5) to v3-2-test.generate-openapi-specprek hook frombackend="postgres"to
backend="sqlite"inscripts/ci/prek/generate_openapi_spec.py.not query the database, so the postgres-container startup + migration
overhead (~90s) is wasted.
#64131 was merged on
mainon 2026-03-24 and backported tov3-1-testthe same day as #64132 — but the cut of
v3-2-testhappened a fewhours earlier, so it landed without the fix. Same shape as the recent
#66209 backport (which fixed the providers OpenAPI spec generator
and the providers import-checker hooks); this is the matching core
hook, the last remaining
backend="postgres"underscripts/ci/prek/.Test plan
Static checksjob is faster on v3-2-testGenerate the FastAPI API specprek hook still produces a cleanspec (no functional change beyond DB backend)
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.7) following the guidelines