Skip to content

Update assembly data types#12

Merged
emilylm merged 6 commits into
mainfrom
update-assembly-data-types
Mar 3, 2026
Merged

Update assembly data types#12
emilylm merged 6 commits into
mainfrom
update-assembly-data-types

Conversation

@emilylm

@emilylm emilylm commented Mar 3, 2026

Copy link
Copy Markdown
Collaborator

📌 Summary

This PR introduces an assembly intent/reservation flow so manifest generation can reserve a version without prematurely creating an assembly record, and hardens error handling for invalid experiment/platform combinations.

The goal is to avoid long-running pipeline race conditions (duplicate provisional versions) while preserving strict assembly schema requirements for final assembly creation.


🔄 Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Refactor (code change that neither fixes a bug nor adds a feature)
  • 📚 Documentation update
  • ⚙️ CI / build / tooling change

🧩 Key Changes

  • Added assembly_run reservation model/table (+ migration) to persist manifest intent state and reserve version numbers safely before final assembly creation.
  • Added POST /api/v1/assemblies/intent/{tax_id} to reserve version + return manifest; updated GET /api/v1/assemblies/manifest/{tax_id} to require sample_id and return the latest (or requested) reserved manifest.
  • Added support for tol_id on assembly creation/schema/model and included tolid + version in generated manifest output.
  • Added placeholder endpoint/function for optimal sample selection by tax ID (/api/v1/assemblies/optimal-sample/{tax_id}). Logic is TBD - on hold whilst requirements are being fleshed out.
  • Standardized error handling in assembly intent path: ValueError from data-type detection is now mapped to AppError with unified error envelope (instead of 500).
  • Updated unit tests across assemblies/manifest/intent and helper/service paths;

✅ Checklist

  • Tests are passing locally / in CI
  • New tests have been added for new or changed functionality
  • Self-review completed
  • Documentation updated (if needed)
  • No sensitive data or secrets included

🔍 Review Notes

  • Review the new assembly_run lifecycle and version reservation logic (assembly max version + assembly_run max version).
  • Confirm API contract changes for manifest endpoints:
    • GET /assemblies/manifest/{tax_id} now requires sample_id
    • POST /assemblies/intent/{tax_id} is the reservation entrypoint
  • Migration uses CREATE TABLE IF NOT EXISTS / DROP TABLE IF EXISTS; please confirm this is acceptable for your migration policy.

📎 Related Issues / Tickets

@emilylm
emilylm merged commit 66c17bc into main Mar 3, 2026
1 of 2 checks passed
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