mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-12-01 00:27:17 +00:00
Project workflows now resolve from the discovered .fabro directory instead of honoring project.directory. Keep the legacy field parse-only while removing it from resolved settings and API/client shapes.
3.1 KiB
3.1 KiB
Fixed Project Workflow Directory Plan
Summary
Remove the [project].directory feature as an effective setting so project workflows are always discovered, created, listed, and resolved from <repo_root>/.fabro/workflows/*. Configs that still contain [project] directory = ... should continue parsing, but the field is deprecated and ignored. User-level workflows under ~/.fabro/workflows remain unchanged as an additional fallback/list section.
Key Changes
- Remove
directoryfrom the resolved settings/API shape while tolerating old config files:- Keep
ProjectLayer::directoryas a deprecated parse-only field so existingproject.tomlfiles with the field do not fail schema validation. - Delete
ProjectNamespace::directory. - Remove
[project] directory = "."from built-in defaults. - Update project resolver,
fabro-typesfixtures, OpenAPI schema, and generated TypeScript client so resolved[project]settings only carryname,description, andmetadata.
- Keep
- Make project Fabro root fixed:
- Delete
resolve_fabro_root; it only exists to applyproject.directory. - Delete
load_project_configand project-root path normalization code if they have no remaining callers afterresolve_fabro_rootis removed. - At workflow discovery/create/list call sites, use the discovered config path's parent directory as the Fabro root and append
workflows. - Do not add a new project-config validation step for workflow directory discovery; settings validation remains the responsibility of settings-loading paths.
- Delete
- Update docs and hints:
- Remove public references to
project.directoryand replace the oldfabro.root -> project.directoryrename hint with guidance that project workflows now live under.fabro/workflows. - Add/keep explicit docs that project workflows live at
<repo_root>/.fabro/workflows/<name>/.
- Remove public references to
Test Plan
- Config tests:
- Empty settings still resolve project metadata defaults.
[project] directory = "..."still parses but is ignored in resolved settings.- Project workflow root calculation uses the
.fabrodirectory containingproject.toml, regardless of any deprecatedproject.directoryvalue.
- CLI integration tests:
- Replace custom-root workflow create/list tests with fixed-root assertions.
- Confirm
fabro workflow create <name>writes both.fabro/workflows/<name>/workflow.fabroand.fabro/workflows/<name>/workflow.toml. - Confirm named workflow resolution reads
.fabro/workflows/<name>/workflow.toml.
- API/client checks:
cargo build -p fabro-apicd lib/packages/fabro-api-client && bun run generatecargo nextest run -p fabro-config -p fabro-api -p fabro-clicd apps/fabro-web && bun run typecheck
Assumptions
- Backwards compatibility is parse-only: old configs with
[project].directoryshould not fail, but the value has no effect and is not exposed in resolved settings or the API. - This change only fixes the project workflow directory. User workflows remain available unless a separate decision removes them later.
- GitHub retrieval itself is out of scope here; this refactor makes the repo path deterministic for that future work.