From 9f34037d4bda3204b6582f667cbc7e790221fb40 Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Thu, 4 Jun 2026 19:28:57 -0400 Subject: [PATCH 1/4] perf(cli): add --prefer-offline to npm install during update (#39267) --- hermes_cli/main.py | 4 ++-- tests/hermes_cli/test_cmd_update.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 6697435786bff..6dd8d7cd1016d 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -4885,7 +4885,7 @@ def _relay(result: "subprocess.CompletedProcess") -> None: r1 = _run_npm_install_deterministic( npm, npm_cwd, - extra_args=(*npm_workspace_args, "--silent"), + extra_args=(*npm_workspace_args, "--silent", "--prefer-offline"), env=build_env, ) if r1.returncode != 0: @@ -8094,7 +8094,7 @@ def _update_node_dependencies() -> None: # Desktop deps are installed on demand by the desktop launcher # (see _desktop_build_needed). print("→ Updating Node.js dependencies...") - extra_args = ["--no-fund", "--no-audit", "--progress=false"] + extra_args = ["--no-fund", "--no-audit", "--prefer-offline", "--progress=false"] nixos_env = with_hermes_node_path(_nixos_build_env()) diff --git a/tests/hermes_cli/test_cmd_update.py b/tests/hermes_cli/test_cmd_update.py index 56671aa7ecc53..376b917ef0a61 100644 --- a/tests/hermes_cli/test_cmd_update.py +++ b/tests/hermes_cli/test_cmd_update.py @@ -279,7 +279,7 @@ def test_update_refreshes_repo_and_tui_node_dependencies( # cmd_update runs npm commands in these locations: # 1. repo root — root-only install (--workspaces=false) # 2. repo root — workspace install (--workspace ui-tui --workspace web) - # 3. web/ — npm ci --silent (if lockfile not at root) + # 3. web/ — npm ci --silent --prefer-offline (if lockfile not at root) # via _build_web_ui (subprocess.run) # 4. web/ — npm run build (_run_with_idle_timeout) # @@ -297,6 +297,7 @@ def test_update_refreshes_repo_and_tui_node_dependencies( "ci", "--no-fund", "--no-audit", + "--prefer-offline", "--progress=false", "--workspaces=false", ] @@ -305,6 +306,7 @@ def test_update_refreshes_repo_and_tui_node_dependencies( "ci", "--no-fund", "--no-audit", + "--prefer-offline", "--progress=false", "--workspace", "ui-tui", @@ -319,7 +321,7 @@ def test_update_refreshes_repo_and_tui_node_dependencies( # The web/ install runs from the workspace root when the root # lockfile exists (npm workspaces hoist node_modules upward). assert npm_calls[2:] == [ - (["/usr/bin/npm", "ci", "--workspace", "web", "--silent"], PROJECT_ROOT), + (["/usr/bin/npm", "ci", "--workspace", "web", "--silent", "--prefer-offline"], PROJECT_ROOT), ] # The web UI build itself went through the streaming helper. From b25562b5e296c3840339010601375da8b58d5223 Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Fri, 12 Jun 2026 07:37:23 -0400 Subject: [PATCH 2/4] test(cli): update npm prefer-offline expectations (#39267) --- tests/hermes_cli/test_cmd_update.py | 5 ++++- tests/hermes_cli/test_web_ui_build.py | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/hermes_cli/test_cmd_update.py b/tests/hermes_cli/test_cmd_update.py index 376b917ef0a61..a5c856b9109fb 100644 --- a/tests/hermes_cli/test_cmd_update.py +++ b/tests/hermes_cli/test_cmd_update.py @@ -246,7 +246,10 @@ def test_update_on_fork_checks_upstream_when_origin_up_to_date( ), patch.object(hm, "_sync_with_upstream_if_needed") as sync_mock: cmd_update(mock_args) - sync_mock.assert_called_once_with(["git"], PROJECT_ROOT) + sync_mock.assert_called_once_with( + ["git", "-c", "windows.appendAtomically=false"], + PROJECT_ROOT, + ) captured = capsys.readouterr() assert "Already up to date!" in captured.out diff --git a/tests/hermes_cli/test_web_ui_build.py b/tests/hermes_cli/test_web_ui_build.py index 8f94458a6acea..d7b4527f3cf00 100644 --- a/tests/hermes_cli/test_web_ui_build.py +++ b/tests/hermes_cli/test_web_ui_build.py @@ -249,6 +249,7 @@ def test_termux_web_install_is_workspace_scoped(self, tmp_path, monkeypatch): "web", "--include-workspace-root=false", "--silent", + "--prefer-offline", ] assert kwargs["cwd"] == tmp_path @@ -269,7 +270,14 @@ def test_desktop_web_install_uses_existing_workspace_root( assert result is True args, kwargs = mock_run.call_args - assert args[0] == ["/usr/bin/npm", "ci", "--workspace", "web", "--silent"] + assert args[0] == [ + "/usr/bin/npm", + "ci", + "--workspace", + "web", + "--silent", + "--prefer-offline", + ] assert kwargs["cwd"] == tmp_path From e51fcf9955d99743c9b463eb42cc9848a95db6b9 Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Fri, 12 Jun 2026 08:33:13 -0400 Subject: [PATCH 3/4] test(cli): align update expectations with current mainline behavior --- tests/hermes_cli/test_cmd_update.py | 8 ++++---- tests/hermes_cli/test_web_ui_build.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/hermes_cli/test_cmd_update.py b/tests/hermes_cli/test_cmd_update.py index a5c856b9109fb..7e82890326452 100644 --- a/tests/hermes_cli/test_cmd_update.py +++ b/tests/hermes_cli/test_cmd_update.py @@ -246,10 +246,10 @@ def test_update_on_fork_checks_upstream_when_origin_up_to_date( ), patch.object(hm, "_sync_with_upstream_if_needed") as sync_mock: cmd_update(mock_args) - sync_mock.assert_called_once_with( - ["git", "-c", "windows.appendAtomically=false"], - PROJECT_ROOT, - ) + expected_git_cmd = ["git"] + if hm.sys.platform == "win32": + expected_git_cmd = ["git", "-c", "windows.appendAtomically=false"] + sync_mock.assert_called_once_with(expected_git_cmd, PROJECT_ROOT) captured = capsys.readouterr() assert "Already up to date!" in captured.out diff --git a/tests/hermes_cli/test_web_ui_build.py b/tests/hermes_cli/test_web_ui_build.py index d7b4527f3cf00..dbcc34751a9cd 100644 --- a/tests/hermes_cli/test_web_ui_build.py +++ b/tests/hermes_cli/test_web_ui_build.py @@ -201,7 +201,7 @@ def test_web_install_omits_workspace_when_web_has_own_lockfile( assert result is True args, kwargs = mock_run.call_args assert "--workspace" not in args[0] - assert args[0] == ["/usr/bin/npm", "ci", "--silent"] + assert args[0] == ["/usr/bin/npm", "ci", "--silent", "--prefer-offline"] assert kwargs["cwd"] == web_dir def test_web_build_uses_idle_timeout_helper(self, tmp_path): From 005d62e4a8b39feda379f3cfb19a262ec91858be Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Tue, 7 Jul 2026 02:03:45 -0400 Subject: [PATCH 4/4] Refresh CI on current merge base