Attach Test Plan
POST/projects/:project_id/test-plan
Bring an existing project under a published plan version.
An injection, not a match: the plan's task_type, dimensions and both locks are written
onto the project and the version is pinned, exactly as creating from the plan writes them. The
dimensions replace the project's own, minting a draft per affected dataset the way PATCH
does — an already-golden version keeps the dimension_snapshot frozen at its own promotion,
so the plan's vocabulary applies from the next quality run and promotion onward.
Two things refuse it: a schema_name or task_type the project cannot adopt, since
neither is editable afterwards, and a plan reference that no longer resolves in this
workspace. Both are checked before anything is written, as is the plan's own dimension set
against the columns this project's datasets carry. A project that already pins a plan is a
409 — detach first.
Adopting a task type is permanent. A project holding None takes the plan's, and
nothing afterwards can clear or change it — ProjectPatchRequest carries no task_type
and detach does not restore it, deliberately: every dataset uploaded since is forced to match
the project's value (upload_dataset), so reverting it would orphan them. The consequence
is that such a project can only ever be bound to plans declaring that same task type. A
project that already declares one is unaffected — it adopts nothing.
Because it is permanent, the adoption is checked against what the project already holds: a project with no task type never forced its datasets to agree with it, so one declaring a different type would be stranded by the adoption. That is a 422 naming those datasets. Deprecated and failed ones are ignored, the same ones a dimension edit skips.
Requires workspace_admin/workspace_editor membership of the project's workspace, as
PATCH /projects/{project_id} does: a platform admin who is not a member cannot bind a
contract they would then be unable to edit.
Request
Responses
- 200
- 422
Successful Response
Validation Error