Fix flaky static checks caused by migration-reference hook race#70170
Merged
jason810496 merged 1 commit intoJul 21, 2026
Merged
Conversation
The update-migration-references, -fab, and -edge3 hooks live in three different prek workspaces that run in parallel, yet each invocation processed all three apps and rewrote every migration file and migrations-ref.rst even when nothing changed. Concurrent containers racing on the same files intermittently failed CI static checks with 'revision = not found' when a reader caught a file mid-write. Scope each hook to its own app and write files only when the content actually changed, so no two hooks touch the same files.
jason810496
requested review from
amoghrajesh,
ashb,
bugraoz93,
dheerajturaga,
gopidesupavan,
jscheffl,
potiuk and
vincbeck
as code owners
July 21, 2026 07:23
Member
Author
|
This should fix the flaky CI issue pointed out in #70155 (comment) by @shahar1. No need to backport, the docs live on main. |
shahar1
approved these changes
Jul 21, 2026
potiuk
approved these changes
Jul 21, 2026
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.
Why
The "CI image checks / Static checks" job fails intermittently with
RuntimeError: revision = not found in .../fab/migrations/versions/0000_1_4_0_create_ab_tables_if_missing.pyThe three
update-migration-references*hooks live in three prek workspaces that run in parallel, yet each invocation of the sharedscripts/ci/prek/migration_reference.pyprocessed all three apps (airflow,fab,edge3) and rewrote every migration file andmigrations-ref.rsteven when nothing changed — so concurrent containers race on the same files, and a reader catching a file mid-write sees truncated content and fails.What
files:filter already scopes it to its own app's migration files/docs, so the all-apps loop was pure overlap: scope each hook invocation to its own app and the hooks no longer share any files — the race is structurally gone.prek --all-fileswith the sameSKIPlist): the fab hook failed with the samerevision = not founderror while passing in isolation.Was generative AI tooling used to co-author this PR?