feat(backend, website): rename get-data-to-edit endpoint and surface version comment via it#6412
Draft
theosanderson-agent wants to merge 1 commit into
Draft
Conversation
…for-entry and support revocations
Rename the `/get-data-to-edit/{accession}/{version}` endpoint to
`/get-original-data-for-entry/{accession}/{version}` to reflect its
broader role: it now also serves the per-entry data needed to render
revocations on the review page, not just the data needed to populate the
edit form.
Behaviour changes:
- The endpoint no longer throws `422 Unprocessable Entity` for revocation
versions. Revocations have no processed data (they never run through
preprocessing), so `SequenceEntryVersionToEdit.processedData` is now
nullable and returns `null` for them. `isRevocation` is added to the
response so the website can branch on it without re-checking the list.
- The website's review card uses the same endpoint for revocations and
pulls `versionComment` out of `originalData.metadata`, rendering it as
a `Version comment` `KeyValueComponent` next to the `Revocation entry`
marker. No extra field is added to the `/get-sequences` list response.
Other updates:
- Rename Kotlin function `getSequenceEntryVersionToEdit` -> `getOriginalDataForEntry`,
description constant `GET_DATA_TO_EDIT_SEQUENCE_VERSION_DESCRIPTION`
-> `GET_ORIGINAL_DATA_FOR_ENTRY_DESCRIPTION`, test class
`GetDataToEditEndpointTest` -> `GetOriginalDataForEntryEndpointTest`,
and the corresponding test helpers in `SubmissionControllerClient` and
`SubmissionConvenienceClient`.
- Add a backend test asserting that a revocation entry returns its
`versionComment` in `originalData.metadata` and `null` processedData.
- The CLI's `get_sequence_details` and the integration auth-rejection
test point at the new path.
- The website's zod schema for `sequenceEntryToEdit` makes
`processedData` nullable and adds `isRevocation`. `SequencesDialog`,
`FilesDialog`, and `EditableSequences` defend against null
`processedData`, and the review card no longer renders the metadata
list, sequences viewer, or files viewer when `processedData` is
absent.
- Add a website spec verifying the version comment renders on the
review card for a revocation entry.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8 tasks
Contributor
|
This PR may be related to: #4522 ("For revocation entries there is no way to review the version comment I added before approving the entry") — the PR directly addresses this by surfacing |
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
Alternative to #6395 implementing @theosanderson's suggestion: rename
/get-data-to-edit/{accession}/{version}to/get-original-data-for-entry/{accession}/{version}, make it not error for revocations, and use it to display the revocationversionCommenton the review card instead of adding a new field to the list response.Backend
getSequenceEntryVersionToEdit->getOriginalDataForEntry,GET_DATA_TO_EDIT_SEQUENCE_VERSION_DESCRIPTION->GET_ORIGINAL_DATA_FOR_ENTRY_DESCRIPTION).\"is a revocation\"422 short-circuit. Revocations have no processed data (they don't run through preprocessing), soSequenceEntryVersionToEdit.processedDatais now nullable and the response isnullfor them.isRevocation: Booleanto the response so the website can branch on it directly.GetDataToEditEndpointTest->GetOriginalDataForEntryEndpointTestand flip the revocation test from "throws 422" to "returns the original data withversionCommentinoriginalData.metadataandnullprocessedData".Website
backendApi.ts(getDataToEdit->getOriginalDataForEntry), updateBackendClient, the edit page, and the vitest mock.useGetMetadataAndAnnotationsno longer disables the query for revocations - it usesuseGetOriginalDataForEntryfor them too.ReviewCard, readdata.originalData.metadata.versionComment(aRecord<string, string>on the wire) and render it viaKeyValueComponentnext to the existingRevocation entrymarker.sequenceEntryToEditzod schema gainsisRevocation: booleanandprocessedData: ... | null. The metadata list, sequences dialog, files dialog, andEditableSequencesdefend against nullprocessedData(or skip rendering, since you can't edit / view sequences for a revocation).Other consumers
get_sequence_detailsand the backend-auth integration test point at the new path - no other production callers exist.SequenceEntryStatus//get-sequences, in contrast to feat(website): display version comment on review cards for revocations #6395.Test plan
CI=1 npm run test(60 files, 653 tests passing) andnpm run check-typesclean../gradlew test --tests GetOriginalDataForEntryEndpointTestandSubmitProcessedDataEndpointTestgreen locally../gradlew ktlintFormatclean.versionCommentshows the new "Version comment" row and revocations without a comment behave as before.🤖 Generated with Claude Code
🚀 Preview: Add
previewlabel to enable