Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Summary
Replaces the
read_submissionENA submission flow with a newqc_read/qc_read_file/qc_read_submissionflow. Previously, raw read file metadata was submitted directly to ENA. Now, the genome launcher runs QC first and posts the resulting file metadata (CRAM or FASTQ pair) back to Canopy via a new callback endpoint. Canopy creates the submission record from that QC output, and the broker claims and submits it as before.readrecords and the broker API contract are unchanged.🔄 Type of Change
🧩 Key Changes
Schema / migration (
0007_add_qc_read_tables)qc_read,qc_read_file,qc_read_submissiontablesentity_typePostgreSQL enum with'qc_read'read_submissiontable (no data migration required)New QC reads endpoint (
POST /qc-reads)bpa_package_idqc_read,qc_read_file, and adraftqc_read_submissionatomicallyprepared_payloadstored on the submission is in thefiles-list format expected by the broker'sto_run_xml()Broker endpoints updated
ReadSubmissionreferences replaced withQcReadSubmissionthroughoutbroker.pyentity_typestrings updated from"read"to"qc_read"in events and accession registry insertsdraftqc_read_submissionrow is created from the rejected row so the entity is immediately re-claimable;experiment_idis preserved on the new rowUpdate assembly pipeline manifest
Add base_url to reads schema and assembly manifest
base_urlfield toreadtable, which is also included in the assembly manifest.Cleanup
reads.pyendpoint:ReadSubmissioncreation/update logic removed; Read CRUD is unaffectedexperiment_service.pybulk import:ReadSubmissioncreation removed;Readrows are still created as beforeaggregate.py:ReadSubmissionJsonreplaced withQcReadSubmissionJsonread_submissions.pyendpoint: no longer registered in the router (file retained but inactive)broker-testfixto_run_xml()had dead code: it readdata.get("files", [])but then ignored it, building a single<FILE>from flatfile_name/file_format/file_checksumfields instead. Fixed to iterate thefileslist; raisesTransformErrorif the list is missing or empty✅ Checklist
🔍 Review Notes
read_submissiontable is dropped with no data migration.qc_read_submission.experiment_idis a denormalised column (the canonical FK isqc_read_id). It is populated on creation via the QC callback and preserved when a new draft is created after rejection.fastq_r1/fastq_r2is normalised to"fastq"in the brokerprepared_payload(ENA does not distinguish R1/R2 infiletype).read_submissions.pyendpoint file still exists on disk but is no longer wired into the router. It can be deleted in a follow-up cleanup PR once the team confirms nothing external depends on it.test_endpoints_broker_contract.py(sample prerequisites assertion, validation override merge) are unrelated to this PR and were failing onmainbefore this branch.📎 Related Issues / Tickets