[P2] Replacing only the raw reads leaves the ENA assembly linked to the old run
I looked into the revision path and reproduced an edge case here. RUN_REF now comes from raw_reads_table, but has_assembly_data_changed still compares the consensus, flat-file metadata, and mapped fields in seq_metadata. It doesn't see changes to the generated run accession.
For example:
- Version 1 deposits reads as
ERR111 and an assembly referencing ERR111.
- Version 2 replaces the read files but keeps the consensus and assembly metadata unchanged, producing
ERR222.
- Assembly creation retrieves
ERR222 here, then takes the unchanged-assembly shortcut at lines 525–528 and copies the previous assembly result without submitting an updated manifest.
Loculus consequently reports the new run, while the ENA assembly remains linked to ERR111. The raw-read workflow can also request suppression of that old run. Adding reads to an existing assembly without otherwise changing it has the same missing-link-update problem.
I reproduced the shortcut using the actual PR functions with database calls mocked: the new run was present, but the previous assembly was copied and no new manifest was generated. The existing raw-read revision test misses this because get_revisions defaults to modify_assembly=True, so it changes assembly metadata too.
It would be good to compare the previous and current effective run references before reusing an assembly result, and add a test with modify_raw_reads=True, modify_assembly=False. If updating the link needs manual handling, that could be flagged explicitly instead.
This could be turned into a follow-up issue if you'd prefer to handle it separately.
Originally posted by @theosanderson-agent in #6816 (comment)
[P2] Replacing only the raw reads leaves the ENA assembly linked to the old run
I looked into the revision path and reproduced an edge case here.
RUN_REFnow comes fromraw_reads_table, buthas_assembly_data_changedstill compares the consensus, flat-file metadata, and mapped fields inseq_metadata. It doesn't see changes to the generated run accession.For example:
ERR111and an assembly referencingERR111.ERR222.ERR222here, then takes the unchanged-assembly shortcut at lines 525–528 and copies the previous assembly result without submitting an updated manifest.Loculus consequently reports the new run, while the ENA assembly remains linked to
ERR111. The raw-read workflow can also request suppression of that old run. Adding reads to an existing assembly without otherwise changing it has the same missing-link-update problem.I reproduced the shortcut using the actual PR functions with database calls mocked: the new run was present, but the previous assembly was copied and no new manifest was generated. The existing raw-read revision test misses this because
get_revisionsdefaults tomodify_assembly=True, so it changes assembly metadata too.It would be good to compare the previous and current effective run references before reusing an assembly result, and add a test with
modify_raw_reads=True, modify_assembly=False. If updating the link needs manual handling, that could be flagged explicitly instead.This could be turned into a follow-up issue if you'd prefer to handle it separately.
Originally posted by @theosanderson-agent in #6816 (comment)