Skip to content

Commit

Permalink
Merge branch 'main' into session_expire_from_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamraj-git authored Dec 22, 2024
2 parents 84cde69 + a8c4871 commit 86dd8de
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dev/breeze/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ PLEASE DO NOT MODIFY THE HASH BELOW! IT IS AUTOMATICALLY UPDATED BY PRE-COMMIT.

---------------------------------------------------------------------------------------------------------

Package config hash: d9c2c903940272a1640ebf7e9db4e4df4a153bbc6c491932978ae805a5b4031b33ae621321f48c8e157a3ad5dd16203fa45eb4819fdef04fcec2cb0a7e36dfab
Package config hash: 6624da65e725e16cee3203afa884da62b719903470063a9d859bb4fae71346c9c4ee58d182b7f2a53f53eb10a72d62b4ae38d4e3d8a03cc293ae97aa62ec180e

---------------------------------------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion dev/breeze/doc/images/output_setup.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ea2ff499fd3c25ef89abaab313d5d04a
ba00ab3fb2ed5a777684878c28b3ce65
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9c3f87d890317e2fbd0ecc37be22ba4f
74516122bcea4a5445279431d73c7cd0
2 changes: 1 addition & 1 deletion dev/breeze/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ requires-python = "~=3.9"

dependencies = [
"black>=23.11.0",
"click>=8.1.7",
"click>=8.1.8",
"filelock>=3.13.0",
#
# We pin flit in order to make sure reproducibility of provider packages is maintained
Expand Down
19 changes: 15 additions & 4 deletions scripts/ci/pre_commit/compile_ui_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
AIRFLOW_SOURCES_PATH = Path(__file__).parents[3].resolve()
UI_HASH_FILE = AIRFLOW_SOURCES_PATH / ".build" / "ui" / "hash.txt"

INTERNAL_SERVER_ERROR = "500 Internal Server Error"


def get_directory_hash(directory: Path, skip_path_regexp: str | None = None) -> str:
files = sorted(directory.rglob("*"))
Expand Down Expand Up @@ -68,10 +70,19 @@ 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),
)
for try_num in range(3):
print(f"### Trying to install yarn dependencies: attempt: {try_num} ###")
result = subprocess.run(
["pnpm", "install", "--frozen-lockfile", "--config.confirmModulesPurge=false"],
cwd=os.fspath(ui_directory),
text=True,
check=False,
)
if result.returncode == 0:
break
if try_num == 2 or INTERNAL_SERVER_ERROR not in result.stderr + result.stdout:
print(result.stdout + "\n" + result.stderr)
sys.exit(result.returncode)
subprocess.check_call(["pnpm", "run", "build"], cwd=os.fspath(ui_directory), env=env)
new_hash = get_directory_hash(ui_directory, skip_path_regexp=r".*node_modules.*")
UI_HASH_FILE.write_text(new_hash)
13 changes: 12 additions & 1 deletion scripts/ci/pre_commit/compile_www_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def get_directory_hash(directory: Path, skip_path_regexp: str | None = None) ->
f"To run this script, run the ./{__file__} command"
)

INTERNAL_SERVER_ERROR = "500 Internal Server Error"

if __name__ == "__main__":
www_directory = AIRFLOW_SOURCES_PATH / "airflow" / "www"
node_modules_directory = www_directory / "node_modules"
Expand All @@ -68,7 +70,16 @@ 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))
for try_num in range(3):
print(f"### Trying to install yarn dependencies: attempt: {try_num} ###")
result = subprocess.run(
["yarn", "install", "--frozen-lockfile"], cwd=os.fspath(www_directory), text=True, check=False
)
if result.returncode == 0:
break
if try_num == 2 or INTERNAL_SERVER_ERROR not in result.stderr + result.stdout:
print(result.stdout + "\n" + result.stderr)
sys.exit(result.returncode)
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)

0 comments on commit 86dd8de

Please sign in to comment.