Skip to content

Commit

Permalink
Small fix to asset compilation retry (apache#45144)
Browse files Browse the repository at this point in the history
Try num printed is now more human, and capture_output is added - it
was missing in the original apache#45143
  • Loading branch information
potiuk authored Dec 22, 2024
1 parent a8c4871 commit 9e28fcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion scripts/ci/pre_commit/compile_ui_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ def get_directory_hash(directory: Path, skip_path_regexp: str | None = None) ->
env = os.environ.copy()
env["FORCE_COLOR"] = "true"
for try_num in range(3):
print(f"### Trying to install yarn dependencies: attempt: {try_num} ###")
print(f"### Trying to install yarn dependencies: attempt: {try_num + 1} ###")
result = subprocess.run(
["pnpm", "install", "--frozen-lockfile", "--config.confirmModulesPurge=false"],
cwd=os.fspath(ui_directory),
text=True,
check=False,
capture_output=True,
)
if result.returncode == 0:
break
Expand Down
8 changes: 6 additions & 2 deletions scripts/ci/pre_commit/compile_www_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ def get_directory_hash(directory: Path, skip_path_regexp: str | None = None) ->
env = os.environ.copy()
env["FORCE_COLOR"] = "true"
for try_num in range(3):
print(f"### Trying to install yarn dependencies: attempt: {try_num} ###")
print(f"### Trying to install yarn dependencies: attempt: {try_num + 1} ###")
result = subprocess.run(
["yarn", "install", "--frozen-lockfile"], cwd=os.fspath(www_directory), text=True, check=False
["yarn", "install", "--frozen-lockfile"],
cwd=os.fspath(www_directory),
text=True,
check=False,
capture_output=True,
)
if result.returncode == 0:
break
Expand Down

0 comments on commit 9e28fcb

Please sign in to comment.