From 30d0eb7284c470b7d9a5ba425d5ff48bb8b90aa0 Mon Sep 17 00:00:00 2001 From: chelsealong Date: Sun, 23 Aug 2026 08:02:47 +0000 Subject: [PATCH] fix(bundler): pass explicit workflow_add options from bundle install workflow_add's dev/from_url parameters are declared as typer.Option defaults, which only bind when Typer invokes the command. Calling workflow_add directly from the bundler leaves dev bound to the truthy OptionInfo default, so every bundle-installed workflow is mistaken for a local path and fails to resolve from the catalog. Fixes #4282 --- src/specify_cli/bundler/services/primitives.py | 2 +- tests/unit/test_bundler_primitives.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/specify_cli/bundler/services/primitives.py b/src/specify_cli/bundler/services/primitives.py index 31b1126a34..e577063a44 100644 --- a/src/specify_cli/bundler/services/primitives.py +++ b/src/specify_cli/bundler/services/primitives.py @@ -337,7 +337,7 @@ def install(self, component: ComponentRef) -> None: with _chdir(self._root): _delegate_command( "install", f"workflow '{component.id}'", - lambda: workflow_add(component.id), + lambda: workflow_add(component.id, dev=False, from_url=None), ) def refresh(self, component: ComponentRef) -> None: diff --git a/tests/unit/test_bundler_primitives.py b/tests/unit/test_bundler_primitives.py index dc39106b50..e6165541dd 100644 --- a/tests/unit/test_bundler_primitives.py +++ b/tests/unit/test_bundler_primitives.py @@ -77,13 +77,17 @@ def test_offline_workflow_allows_bundled(tmp_path: Path, monkeypatch): monkeypatch.setattr( assets, "_locate_bundled_workflow", lambda wid: tmp_path / "wf" ) - calls: list[str] = [] - monkeypatch.setattr(specify_cli, "workflow_add", lambda wid: calls.append(wid)) + calls: list[tuple] = [] + monkeypatch.setattr( + specify_cli, + "workflow_add", + lambda wid, dev=object(), from_url=object(): calls.append((wid, dev, from_url)), + ) manager = primitive_manager("workflows", tmp_path, allow_network=False) manager.install(_component("workflows", "bundled-wf")) - assert calls == ["bundled-wf"] + assert calls == [("bundled-wf", False, None)] def test_assert_pinned_version_matches_passes():