Skip to content

feat(workflows): pick repositories and assets on a workflow step - #53

Merged
artempartos merged 2 commits into
developfrom
feat/workflow-repository-selection
Aug 7, 2026
Merged

artempartos merged 2 commits into
developfrom
feat/workflow-repository-selection

Conversation

@artempartos

@artempartos artempartos commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Why

mount_repositories said a step wanted code but never said which code. The list came from the run, or from a project-wide fallback that only fired when the run carried a board task — so a workflow started on a schedule had no way to get a repository at all, and there was no way to pick repositories per workflow.

Found while debugging a live session whose /workspace/repo was empty. The clone never failed — it never ran. inject_repositories returns early on a blank list, and the workflow_step session resolved from_run: [], from_project_fallback: [].

Repositories become a chosen resource

Chosen the way tools, skills and MCP servers already are:

  • step.repository_ids — new jsonb column, alongside the other step id columns
  • workflow.config["base_repository_ids"] — alongside the other base_*_ids

Editable in the builder UI and over the personal MCP server (meta_create_step, meta_update_step, update_workflow, get_workflow, get_workflow_step). A trigger-started run resolves them exactly like a manual one.

explicit = run.repository_ids + workflow.base_repository_ids + step.repository_ids
resolved = explicit.presence || (inherit_all ? project_repository_ids : [])

Two deliberate differences from tools/skills:

  • An explicit pick wins outright rather than being another summand. Adding the project's other repositories on top of a deliberate choice would widen it — pick one repository, get all four. inherit_all_project_resources stays a fallback for workflows that chose nothing.
  • board_triggered? is gone from repository resolution. It described where a run came from, not what a step needs. Scheduled workflows now resolve repositories like everything else.

The migration backfills before it drops

Over half the steps in production (85/158) keep mount_repositories off, and that is a real "no code here" decision — report builders, planners, intake steps. Since resolution unions the levels, a workflow-level list would reach every step and silently undo each of those opt-outs.

So repositories are written per step, and only to the steps that resolve to one today: mount_repositories = true in a workflow with inherit_all_project_resources. Steps with the flag off keep the column's empty default.

Second commit: assets were missing from the same panel

step.asset_ids has been a real column all along — permitted by the API, unioned by the resolver, accepted by meta_create_step. The session panel just never rendered a control, so the only way to fill it was the MCP server. The "Data flow" section made it easy to miss: it shows input/output asset specs, which are documentation, not a selection.

Adds the picker beside the other resources, plus a controller test for both id lists the builder PATCHes. Neither had API-level coverage, and a missing permit entry fails silently — the request still succeeds and the selection never persists.

Notes for the reviewer

  • Deploy ordering. This drops a column the currently-running code reads (StepResource, the resolver). During a rolling deploy old pods will 500 on step serialization. Either take a short window, or say the word and I'll split drop_column into a follow-up migration so code-then-schema ships in two releases.
  • WorkflowDuplicator starts a cross-project copy with an empty repository selection — repositories are project-scoped with nothing to remap onto, and carrying the ids would point the copy at another project's code.
  • The base-resources Repositories picker stays enabled while "inherit all" is on, unlike the other four; disabling it would remove the only way to narrow a workflow to one repository.

Testing

make check_all green on current develop: 4012 backend tests, eslint, tsc, vitest, rubocop, brakeman, system tests. Backend coverage 90.76%.

New coverage for each level in isolation, the union, explicit-beats-fallback, and the case this fixes — a run with no board task still reaching the project fallback.

🤖 Generated with Claude Code

artempartos and others added 2 commits August 8, 2026 00:11
`mount_repositories` said a step wanted code but never said which code. The
list came from the run, or from a project-wide fallback that only fired when
the run carried a board task — so a workflow started on a schedule had no way
to get a repository at all, and picking one per workflow was impossible.

Repositories are now chosen the way tools, skills and MCP servers already are:
`step.repository_ids` alongside the other step id columns, and
`workflow.config["base_repository_ids"]` alongside the other `base_*_ids`.
Both are editable in the builder UI and over the personal MCP server, and a
trigger-started run resolves them exactly like a manual one — what a step needs
does not depend on what started it.

Resolution differs from tools in one way, deliberately: an explicit pick at any
level is the whole answer rather than another summand. Adding the project's
other repositories on top of a deliberate choice would widen it, so
`inherit_all_project_resources` stays a fallback for workflows that chose
nothing.

The migration backfills before it drops. Over half the steps in production keep
the flag off, and that is a real "no code here" decision for report builders and
planners; since resolution unions the levels, a workflow-level list would reach
every step and undo each of those opt-outs. Repositories are therefore written
per step, and only to the steps that resolve to one today.

Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
`step.asset_ids` has been a real column all along — the API permits it, the
resolver unions it into the step's input assets, and meta_create_step accepts
it. The session panel simply never rendered a control, so the only way to fill
it was the MCP server. The panel's "Data flow" section made this easy to miss:
it shows input/output asset *specs*, which are documentation, not a selection.

Adds the picker next to the other resources, and a controller test covering
both id lists the builder PATCHes. Neither list had API-level coverage, and a
missing entry in the permit list fails silently — the request still succeeds
and the selection just never persists.

Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos artempartos changed the title feat(workflows): select repositories instead of toggling a mount flag feat(workflows): pick repositories and assets on a workflow step Aug 7, 2026
@artempartos
artempartos merged commit ebda2f5 into develop Aug 7, 2026
7 checks passed
alex-astafyev pushed a commit to alex-astafyev/flow that referenced this pull request Aug 19, 2026
* origin/develop:
  feat(personal-mcp): add connector catalog and registry-read tools (AixleHQ#55)
  fix(workflows): offer company assets in the workflow asset pickers (AixleHQ#56)
  feat(mcp): add sub-step update, delete and reorder tools (AixleHQ#54)
  feat(workflows): pick repositories and assets on a workflow step (AixleHQ#53)
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.

1 participant