Skip to content

Speed up provider asset change detection by pruning dependency directories - #72784

Merged
potiuk merged 1 commit into
apache:mainfrom
Andrushika:speed-up-provider-asset-change-detection
Sep 9, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
Andrushika:speed-up-provider-asset-change-detection

Conversation

@Andrushika

Copy link
Copy Markdown
Contributor

Why

Before each breeze start-airflow, compile_provider_assets.py hashes the provider www directory to decide if the plugin UI needs a rebuild. That directory also holds node_modules and .pnpm-store (the pnpm cache lands there because our lint hooks set store-dir to a relative path), so the hash excludes both.

But the exclusion is a regexp over the result of rglob, which means every path under them is still listed and resolve() first, then thrown away. That is about 2s per provider, and common.ai runs on every start.

#72783 fixed the same thing in compile_ui_assets.py.

What

Walk with os.walk and prune the two directories, so nothing under them is listed or resolved. Hash time for common.ai and edge3 goes from about 2s to under 10ms each. The hash order changes, so each provider rebuilds once after this lands.

related: #72783


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5.1)

Generated-by: Claude Code (Fable 5.1) following the guidelines

…ories

The provider asset hash already excluded node_modules and .pnpm-store,
but only after listing and resolving every path under them. That is
about two seconds per provider on each breeze start-airflow for
nothing. Pruning the directories during the walk removes the cost.

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@potiuk
potiuk merged commit 01e0ace into apache:main Sep 9, 2026
70 checks passed
@Andrushika
Andrushika deleted the speed-up-provider-asset-change-detection branch September 9, 2026 11:12
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-3-test PR Link

potiuk pushed a commit that referenced this pull request Sep 9, 2026
…dency directories (#72784) (#72800)

The provider asset hash already excluded node_modules and .pnpm-store,
but only after listing and resolving every path under them. That is
about two seconds per provider on each breeze start-airflow for
nothing. Pruning the directories during the walk removes the cost.
(cherry picked from commit 01e0ace)

Co-authored-by: Andrew Chang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants