Skip to content

fix(bundler): pass explicit workflow_add options from bundle install - #4284

Open
chelsealong wants to merge 1 commit into
github:mainfrom
chelsealong:fix/4282-workflow-add-typer-default
Open

fix(bundler): pass explicit workflow_add options from bundle install#4284
chelsealong wants to merge 1 commit into
github:mainfrom
chelsealong:fix/4282-workflow-add-typer-default

Conversation

@chelsealong

Copy link
Copy Markdown
Contributor

Description

Fixes #4282

specify bundle install failed to install any workflow from a catalog. The
root cause is in _WorkflowKindManager.install (src/specify_cli/bundler/services/primitives.py):
it calls the Typer command workflow_add directly as a plain Python function,
workflow_add(component.id). Typer only binds dev/from_url to their
declared defaults (False / None) when it invokes the command itself —
calling the function directly leaves dev bound to the raw (truthy)
typer.OptionInfo object. That makes the local-path branch trigger, so the
workflow's catalog ID is treated as a filesystem path and installation fails
with:

Error: --dev source must be a workflow YAML file, supported archive, or
directory containing workflow.yml: lifecycle-greenfield-bootstrap

This passes dev=False, from_url=None explicitly at the call site, matching
the fix suggested in the issue.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync --extra test && uv run pytest -q — 7308 passed, 10 skipped
  • uvx ruff@0.15.0 check src tests — all checks passed
  • Added a regression assertion to tests/unit/test_bundler_primitives.py::test_offline_workflow_allows_bundled that captures the dev/from_url values workflow_add is actually called with

Verified the added assertion fails without the fix:

$ git checkout HEAD~1 -- src/specify_cli/bundler/services/primitives.py
$ uv run pytest tests/unit/test_bundler_primitives.py -k test_offline_workflow_allows_bundled -v
...
FAILED tests/unit/test_bundler_primitives.py::test_offline_workflow_allows_bundled
AssertionError: assert [('bundled-wf', <object object at 0x...>, <object object at 0x...>)] == [('bundled-wf', False, None)]
$ git checkout HEAD -- src/specify_cli/bundler/services/primitives.py
$ uv run pytest tests/unit/test_bundler_primitives.py -v
...
20 passed in 0.21s

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

Implemented autonomously by Claude Code (Sonnet 5) under automated direction. The regression test was written and confirmed to fail before the fix, then the full test suite and lint were run locally as shown above.

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 github#4282
@chelsealong
chelsealong requested a review from mnriem as a code owner August 23, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: bundle install cannot install workflows from a catalog (Typer option default leaks into direct call)

1 participant