feat(ingest, backend): improve ingest curation warning - add diff#6633
Conversation
649aca5 to
712cd29
Compare
|
Claude finished @anna-parker's task in 1m 56s —— View job Code Review
Good feature overall — adding the metadata diff to the curation warning makes the Slack notification much more actionable. The backend filter implementation is clean and well-tested. A couple of issues worth addressing before merge: One functional bug: Code style: Two Slack message length: The full metadata diff is inlined directly into the notification string. For sequences with many metadata fields, this could easily exceed Slack's ~3000 char limit, causing the notification to be silently dropped. Worth truncating or summarising. See inline comment on Other observations:
|
Co-authored-by: Cornelius Roemer <cornelius.roemer@gmail.com>
## Summary This introduces a single strict parser for Loculus accession-version strings and uses it in both backend locations that previously parsed `accession.version` values independently. `AccessionVersion.fromString()` now validates that the input contains exactly one separator, that both accession and version are present, and that the version is numeric. Accessions containing dots are rejected as invalid input. Parsing failures surface as `UnprocessableEntityException` with a message that distinguishes malformed structure from a non-numeric version. The submission metadata filter and sequence-set validation now delegate to this centralized parser. This removes duplicated parsing logic and ensures both endpoints apply the same validation rules. Invalid accession-version filters consequently return HTTP 422 rather than HTTP 400. ## Validation - `./gradlew ktlintFormat --console=plain` - `./gradlew test --console=plain -x checkDocker --tests org.loculus.backend.api.SubmissionTypesTest` - Kotlin main and test compilation completed successfully as part of the focused test run. The endpoint test suites could not run in this environment: Docker is unavailable, while `USE_NONDOCKER_INFRA=true` requires the missing `runuser` binary. 🚀 Preview: Add `preview` label to enable
resolves #3084
Adds the option to filter by AccessionVersion on the
get-unprocessed-metadataendpoint. Have ingest call this endpoint to get all previous metadata (includes sequence hashes, so it will indirectly tell us if a sequence has been changed) when we get into the case where ingest would like to revise a curated sequence.Ingest will then add a diff of the curated metadata and the metadata it would like to revise to the notification so that curators can decide better to to handle the situation.
PR Checklist
🚀 Preview: https://curation-warning-add-diff.loculus.org