pierrejeambrun commented on code in PR #45060:
URL: https://github.com/apache/airflow/pull/45060#discussion_r1897416916


##########
scripts/ci/pre_commit/compile_www_assets.py:
##########
@@ -71,4 +72,23 @@ def get_directory_hash(directory: Path, skip_path_regexp: 
str | None = None) ->
     subprocess.check_call(["yarn", "install", "--frozen-lockfile"], 
cwd=os.fspath(www_directory))
     subprocess.check_call(["yarn", "run", "build"], 
cwd=os.fspath(www_directory), env=env)
     new_hash = get_directory_hash(www_directory, 
skip_path_regexp=r".*node_modules.*")
-    WWW_HASH_FILE.write_text(new_hash)
+    www_hash_file.write_text(new_hash)
+
+
+def is_fab_provider_installed() -> bool:
+    return (
+        importlib.util.find_spec("airflow") is not None

Review Comment:
   I don't see `is_fab_provider_installed`  being called ? Where was that 
supposed to be ?



##########
scripts/ci/pre_commit/compile_www_assets.py:
##########
@@ -71,4 +72,23 @@ def get_directory_hash(directory: Path, skip_path_regexp: 
str | None = None) ->
     subprocess.check_call(["yarn", "install", "--frozen-lockfile"], 
cwd=os.fspath(www_directory))
     subprocess.check_call(["yarn", "run", "build"], 
cwd=os.fspath(www_directory), env=env)
     new_hash = get_directory_hash(www_directory, 
skip_path_regexp=r".*node_modules.*")
-    WWW_HASH_FILE.write_text(new_hash)
+    www_hash_file.write_text(new_hash)
+
+
+def is_fab_provider_installed() -> bool:
+    return (
+        importlib.util.find_spec("airflow") is not None

Review Comment:
   Indeed I don't think we have the providers there, core and providers must be 
build separately. I don't think such routes `fab_provider_www_directory = (
           AIRFLOW_SOURCES_PATH / "providers" / "src" / "airflow" / "providers" 
/ "fab" / "www"` exists.
   
   
   Maybe we need one hook for core, one hook for the fab provider. And we need 
to include the provider hook into the `fab` provider build process.
   
   Maybe @potiuk can give us some hints/ideas on what's the best way to achieve 
that. 



##########
scripts/ci/pre_commit/compile_www_assets.py:
##########
@@ -71,4 +72,23 @@ def get_directory_hash(directory: Path, skip_path_regexp: 
str | None = None) ->
     subprocess.check_call(["yarn", "install", "--frozen-lockfile"], 
cwd=os.fspath(www_directory))
     subprocess.check_call(["yarn", "run", "build"], 
cwd=os.fspath(www_directory), env=env)
     new_hash = get_directory_hash(www_directory, 
skip_path_regexp=r".*node_modules.*")
-    WWW_HASH_FILE.write_text(new_hash)
+    www_hash_file.write_text(new_hash)
+
+
+def is_fab_provider_installed() -> bool:
+    return (
+        importlib.util.find_spec("airflow") is not None

Review Comment:
   I think the problem is that we need to adapt the custom asset hatchling 
build stage for that to also work for the plugin.
   
   I'm not an expert there but `CustomBuild.build_standard` looks like this 
should be updated. For now it's only taking care of the `airflow/www` dir.



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