Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1a42175

Browse files
authored
fix: Check yarn files during install (#1533)
We observed that in some cases files are missing when yarn reuses themfrom cache. Not sure what's causing it but checking files seems to atleast fix it. This is probably some yarn bug.
1 parentf5ab045 commit1a42175

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

‎bench/app.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def prune_app_directory(self):
423423
remove_unused_node_modules(app_path)
424424

425425

426-
defcoerce_url_to_name_if_possible(git_url:str,cache_key:str)->str:
426+
defcoerce_url_to_name_if_possible(git_url:str,cache_key:str)->str:
427427
app_name=os.path.basename(git_url)
428428
ifcan_get_cached(app_name,cache_key):
429429
returnapp_name
@@ -435,7 +435,7 @@ def can_get_cached(app_name: str, cache_key: str) -> bool:
435435
Used before App is initialized if passed `git_url` is a
436436
file URL as opposed to the app name.
437437
438-
If True then `git_url` can be coerced into the `app_name` and
438+
If True then `git_url` can be coerced into the `app_name` and
439439
checking local remote and fetching can be skipped while keeping
440440
get-app command params the same.
441441
"""
@@ -671,7 +671,7 @@ def get_app(
671671
importbench.cliasbench_cli
672672
frombench.benchimportBench
673673
frombench.utils.appimportcheck_existing_dir
674-
674+
675675
ifurlparse(git_url).scheme=="file"andcache_key:
676676
git_url=coerce_url_to_name_if_possible(git_url,cache_key)
677677

@@ -908,7 +908,9 @@ def install_app(
908908
install_python_dev_dependencies(apps=app,bench_path=bench_path,verbose=verbose)
909909

910910
ifnotusing_cachedandos.path.exists(os.path.join(app_path,"package.json")):
911-
yarn_install="yarn install --verbose"ifverboseelse"yarn install"
911+
yarn_install="yarn install --check-files"
912+
ifverbose:
913+
yarn_install+=" --verbose"
912914
bench.run(yarn_install,cwd=app_path)
913915

914916
bench.apps.sync(app_name=app,required=resolution,branch=tag,app_dir=app_path)

‎bench/utils/bench.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@
1818
# imports - module imports
1919
importbench
2020
frombench.exceptionsimportPatchError,ValidationError
21-
frombench.utilsimport (exec_cmd,get_bench_cache_path,get_bench_name,
22-
get_cmd_output,log,which)
21+
frombench.utilsimport (
22+
exec_cmd,
23+
get_bench_cache_path,
24+
get_bench_name,
25+
get_cmd_output,
26+
log,
27+
which,
28+
)
2329

2430
logger=logging.getLogger(bench.PROJECT_NAME)
2531

@@ -132,7 +138,9 @@ def update_yarn_packages(bench_path=".", apps=None, verbose=None):
132138
app_path=os.path.join(apps_dir,app)
133139
ifos.path.exists(os.path.join(app_path,"package.json")):
134140
click.secho(f"\nInstalling node dependencies for{app}",fg="yellow")
135-
yarn_install="yarn install --verbose"ifverboseelse"yarn install"
141+
yarn_install="yarn install --check-files"
142+
ifverbose:
143+
yarn_install+=" --verbose"
136144
bench.run(yarn_install,cwd=app_path)
137145

138146

@@ -329,7 +337,10 @@ def restart_supervisor_processes(bench_path=".", web_workers=False, _raise=False
329337
forgroupingroups:
330338
failure=bench.run(f"{sudo}supervisorctl restart{group}",_raise=_raise)
331339
iffailure:
332-
log(f"restarting supervisor group `{group}` failed. Use `bench restart` to retry.",level=3)
340+
log(
341+
f"restarting supervisor group `{group}` failed. Use `bench restart` to retry.",
342+
level=3,
343+
)
333344

334345

335346
defrestart_systemd_processes(bench_path=".",web_workers=False,_raise=True):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp