Skip to content

Commit 041faee

Browse files
authored
fix(bundler): pass explicit workflow_add options from bundle install (#4284)
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
1 parent 1ceb456 commit 041faee

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/specify_cli/bundler/services/primitives.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def install(self, component: ComponentRef) -> None:
337337
with _chdir(self._root):
338338
_delegate_command(
339339
"install", f"workflow '{component.id}'",
340-
lambda: workflow_add(component.id),
340+
lambda: workflow_add(component.id, dev=False, from_url=None),
341341
)
342342

343343
def refresh(self, component: ComponentRef) -> None:

tests/unit/test_bundler_primitives.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,17 @@ def test_offline_workflow_allows_bundled(tmp_path: Path, monkeypatch):
7777
monkeypatch.setattr(
7878
assets, "_locate_bundled_workflow", lambda wid: tmp_path / "wf"
7979
)
80-
calls: list[str] = []
81-
monkeypatch.setattr(specify_cli, "workflow_add", lambda wid: calls.append(wid))
80+
calls: list[tuple] = []
81+
monkeypatch.setattr(
82+
specify_cli,
83+
"workflow_add",
84+
lambda wid, dev=object(), from_url=object(): calls.append((wid, dev, from_url)),
85+
)
8286

8387
manager = primitive_manager("workflows", tmp_path, allow_network=False)
8488
manager.install(_component("workflows", "bundled-wf"))
8589

86-
assert calls == ["bundled-wf"]
90+
assert calls == [("bundled-wf", False, None)]
8791

8892

8993
def test_assert_pinned_version_matches_passes():

0 commit comments

Comments
 (0)