potiuk commented on code in PR #43329:
URL: https://github.com/apache/airflow/pull/43329#discussion_r1861372455


##########
scripts/ci/pre_commit/compile_ui_assets.py:
##########
@@ -68,10 +69,14 @@ def get_directory_hash(directory: Path, skip_path_regexp: 
str | None = None) ->
         shutil.rmtree(dist_directory, ignore_errors=True)
     env = os.environ.copy()
     env["FORCE_COLOR"] = "true"
-    subprocess.check_call(
-        ["pnpm", "install", "--frozen-lockfile", 
"--config.confirmModulesPurge=false"],
-        cwd=os.fspath(ui_directory),
-    )
+    if os.getenv("AIRFLOW_PRE_CACHED_PNPM_PACKAGES", "false") == "true":
+        # Copy pnpm-cache to node_modules from pnpm-cache
+        shutil.copytree(pnpm_node_modules_cache_directory, 
node_modules_directory, dirs_exist_ok=True)
+    else:

Review Comment:
   One small tthing here. I think we should ALWAYS run the install step below. 
This covers case where the .lock file changed in the meantime and we just need 
to update it based on pre-cached node_modules



##########
scripts/ci/pre_commit/compile_www_assets.py:
##########
@@ -68,7 +69,11 @@ def get_directory_hash(directory: Path, skip_path_regexp: 
str | None = None) ->
         shutil.rmtree(dist_directory, ignore_errors=True)
     env = os.environ.copy()
     env["FORCE_COLOR"] = "true"
-    subprocess.check_call(["yarn", "install", "--frozen-lockfile"], 
cwd=os.fspath(www_directory))
+    if os.getenv("AIRFLOW_PRE_CACHED_YARN_PACKAGES", "false") == "true":

Review Comment:
   Same here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to