This is an automated email from the ASF dual-hosted git repository.

jason810496 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8894f5be87f Reinstall stale provider UI dependencies when compiling 
assets (#75607)
8894f5be87f is described below

commit 8894f5be87f056f69f7d847ab0e3e394669635eb
Author: Andrew Chang <[email protected]>
AuthorDate: Wed Nov 18 10:52:04 2026 +0800

    Reinstall stale provider UI dependencies when compiling assets (#75607)
    
    When a provider UI's node_modules was installed with a different pnpm
    store or layout, pnpm must purge and reinstall it, and it asks for
    confirmation first. compile_provider_assets.py runs pnpm install with
    captured output, so nobody can answer. pnpm 9, which common.ai pins,
    then exits 0 without installing anything if stdin is closed, or waits
    forever if stdin is open. The build then fails on any dependency added
    since the last install, for example react-icons after #74334. pnpm 10,
    which fab and edge3 pin, fails with
    ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY.
    
    #76498 asks developers to delete the store-dir setting that older prek
    hooks wrote to the global pnpm config. Each provider UI installed with
    that setting then hits this on its next build.
    
    The other prek hooks that install UI dependencies on the host already
    skip this confirmation.
---
 scripts/ci/prek/compile_provider_assets.py            | 2 +-
 scripts/tests/ci/prek/test_compile_provider_assets.py | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/ci/prek/compile_provider_assets.py 
b/scripts/ci/prek/compile_provider_assets.py
index 1edd674fe5a..df6d677cdbf 100755
--- a/scripts/ci/prek/compile_provider_assets.py
+++ b/scripts/ci/prek/compile_provider_assets.py
@@ -129,7 +129,7 @@ def compile_assets(provider_name: str):
     for try_num in range(3):
         print(f"### Trying to install {provider_name} dependencies: attempt: 
{try_num + 1} ###")
         result = subprocess.run(
-            ["pnpm", "install", "--frozen-lockfile"],
+            ["pnpm", "install", "--frozen-lockfile", 
"--config.confirmModulesPurge=false"],
             cwd=os.fspath(www_directory),
             text=True,
             check=False,
diff --git a/scripts/tests/ci/prek/test_compile_provider_assets.py 
b/scripts/tests/ci/prek/test_compile_provider_assets.py
index ff2c80d139c..06f7ef5cabf 100644
--- a/scripts/tests/ci/prek/test_compile_provider_assets.py
+++ b/scripts/tests/ci/prek/test_compile_provider_assets.py
@@ -129,4 +129,8 @@ def test_rebuilds_when_sources_change(harness):
     (harness.www_directory / "src" / "main.ts").write_text("export const main 
= 2;\n")
     harness.run_script()
 
-    assert harness.read_pnpm_calls() == [*calls_after_first_build, "install 
--frozen-lockfile", "build"]
+    assert harness.read_pnpm_calls() == [
+        *calls_after_first_build,
+        "install --frozen-lockfile --config.confirmModulesPurge=false",
+        "build",
+    ]

Reply via email to