Skip to content

Fix flaky static checks caused by migration-reference hook race#70170

Merged
jason810496 merged 1 commit into
apache:mainfrom
jason810496:ci/fix-migration-reference-hook-race
Jul 21, 2026
Merged

Fix flaky static checks caused by migration-reference hook race#70170
jason810496 merged 1 commit into
apache:mainfrom
jason810496:ci/fix-migration-reference-hook-race

Conversation

@jason810496

Copy link
Copy Markdown
Member

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.py

The three update-migration-references* hooks live in three prek workspaces that run in parallel, yet each invocation of the shared scripts/ci/prek/migration_reference.py processed all three apps (airflow, fab, edge3) and rewrote every migration file and migrations-ref.rst even 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

  • Each hook's 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.
  • Reproduced before the fix with CI's exact invocation (prek --all-files with the same SKIP list): the fab hook failed with the same revision = not found error while passing in isolation.

Was generative AI tooling used to co-author this PR?

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

jason810496 commented Jul 21, 2026

Copy link
Copy Markdown
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.

@jason810496 jason810496 removed the backport-to-v3-3-test Backport to v3-3-test label Jul 21, 2026
@jason810496
jason810496 merged commit 1627834 into apache:main Jul 21, 2026
155 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants