Skip to content

Feature/workflow versions and aliases#201

Open
accumb3ns wants to merge 8 commits intomainfrom
feature/workflow-versions-and-aliases
Open

Feature/workflow versions and aliases#201
accumb3ns wants to merge 8 commits intomainfrom
feature/workflow-versions-and-aliases

Conversation

@accumb3ns
Copy link
Copy Markdown
Contributor

@accumb3ns accumb3ns commented Apr 1, 2026

This PR accomplishes the discussed changes to our workflow models:

  1. Adds workflow versions, rather than storing version on the workflow itself; this means the workflow (eg WES Alignment) stays constant, but versions are updated.

  2. Adds workflow version aliases - allows us to point to specific versions with aliases like "develop", "production" etc. like an AWS lambda function. Note - this was originally an enum, but following feedback was converted into a free string field in eeb5384.

  3. Following feedback that it was annoying to have to make 2 calls and filter client side to get the external id of a specific workflow, we accept optional querystring parameters for GET /{workflow}/deployments endpoint like GET /123-456/deployments?alias=production&engine=Arvados to reduce to a single call with server-side filtering.

  4. Following feedback that the term registration wasn't very descriptive - workflow Registration is renamed Deployment throughout to reflect that it represents a specific deployment of the workflow to a platform.

Additional:

  1. Bugfix - previously, we weren't validating client-submitted workflow UUIDs, resulting in 500 errors for eg a random string. These are now validated and 400-type errors are returned for erroneous or missing values.
  2. PIPELINES.md and WORKFLOWS.md are merged into a single document, since they're all part of the same overall set of models.

vasques1 added 8 commits March 23, 2026 15:04
…egistration/Run FKs

- Add VersionAlias enum (production, development)
- Add WorkflowVersion table (version, definition_uri per workflow)
- Add WorkflowVersionAlias table (named pointer to a version)
- Re-point WorkflowRegistration FK from workflow.id to workflowversion.id
- Re-point WorkflowRun FK from workflow.id to workflowversion.id
- Remove version and definition_uri from Workflow table
- Remove version from WorkflowSummary in pipeline models
- Add new request/response schemas for versions and aliases
- Update alembic/env.py imports
- Autogenerated Alembic migration with data migration and full downgrade
…/run endpoints

- Add create_workflow_version, get_workflow_versions, get_workflow_version_by_id
- Add set_workflow_version_alias, get_workflow_version_aliases, delete_workflow_version_alias
- Update create_workflow to no longer accept version/definition_uri
- Update registration CRUD to use workflow_version_id with version validation
- Update run CRUD to use workflow_version_id with version validation
- Update workflow_to_public and workflow_run_to_public serialization
- Add 3 version endpoints (POST/GET list/GET by id)
- Add 3 alias endpoints (PUT/GET/DELETE)
- Update registration endpoints to nest under versions
- Update pipeline_to_public to build WorkflowSummary without version
- Rewrite test_workflows.py for new Workflow shape (no version/definition_uri)
- Add test_workflow_versions.py (8 tests for version CRUD)
- Add test_workflow_aliases.py (10 tests for alias CRUD)
- Rewrite test_workflow_registrations.py (create version first, nested URLs)
- Rewrite test_workflow_runs.py (create version first, body uses workflow_version_id)
- Update test_pipeline_entity.py helper (remove definition_uri from Workflow)
- Update test_qcmetrics.py helpers (WorkflowVersion creation for run tests)
…paration

- Rewrite WORKFLOWS.md with new entities, ER diagram, and endpoint docs
- Update PIPELINES.md design decisions for version-agnostic pipeline design
- Update ER_DIAGRAM.md entities, relationships, constraints, and provenance section
…S.md

- Combine ER diagrams, design decisions, database models, and API endpoints
- Single unified reference for workflows, versions, aliases, registrations, runs, and pipelines
- Fix stale version field in pipeline WorkflowSummary response examples
- Remove superseded standalone files
- Rename WorkflowRegistration class/table/schemas to WorkflowDeployment
- Rename all service functions: create/get/delete_workflow_deployment()
- Rename all route URLs: /registrations -> /deployments, registration_id -> deployment_id
- Update alembic/env.py import
- Add Alembic migration: rename table + FK constraints (data-preserving)
- Replace test_workflow_registrations.py with test_workflow_deployments.py
- Update docs/ER_DIAGRAM.md and docs/WORKFLOWS_AND_PIPELINES.md
- 416 tests pass
- Remove VersionAlias(str, enum.Enum) class and 'import enum' from models
- Change alias field to str on WorkflowVersionAlias, WorkflowAliasSummary, WorkflowVersionAliasPublic
- Update all service/route type hints from VersionAlias to str
- Replace alias.value with alias in error messages
- Change migration alias column from sa.Enum to AutoString
- Replace test_set_alias_invalid_value (422) with test_set_alias_custom_value (accepts any string)
- Update docs: enum→string in mermaid diagrams, field tables, and design rationale
- 416 tests pass
Bare UUID() constructor calls in workflow services raised unhandled
ValueError when given non-UUID strings (e.g. 'not-a-uuid'), causing
FastAPI to return a 500 Internal Server Error.

Added _parse_uuid() helper that wraps UUID() in try/except and raises
HTTPException(400) with a descriptive message. Replaced all 7 bare
UUID() calls across get_workflow_by_id, get_workflow_version_by_id,
create_workflow_deployment, get_workflow_deployments,
delete_workflow_deployment, and get_workflow_run_by_id.

Added tests for invalid UUID (400) and nonexistent UUID (404) on
GET /workflows/{workflow_id}.
@accumb3ns accumb3ns requested review from golharam and maggiecbms April 1, 2026 14:56
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