Repository navigation
[DT-4378][risk=low] Add admin endpoints to resync study asset records - #3226
Open
kevinmarete wants to merge 4 commits into
Open
kevinmarete wants to merge 4 commits into
kevinmarete wants to merge 4 commits into
Conversation
POST /api/dataset/study/{studyId}/assets/sync runs syncStudy for one study;
POST /api/dataset/study/assets/sync?since= runs it for every study, or those
changed since an instant, one transaction each, streaming per-study results.
Each reindexes only the study's datasets already in the search index.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
…s 500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
kevinmarete
marked this pull request as ready for review
October 30, 2026 22:11
kevinmarete
requested review from
fboulnois,
otchet-broad and
rushtong
and removed request for
a team
October 30, 2026 22:11
rushtong
approved these changes
Oct 31, 2026
rushtong
left a comment
Contributor
There was a problem hiding this comment.
Looks good, only low findings 👍🏽
- Low: The bulk resync runs on one request thread. A run over all studies can take longer than the ingress timeout. The summary then goes only to the server log.
- Low: If a study is deleted during the run, the summary counts it as failed with a 404.
- Low: The since filter finds only the edits that change study.update_date.
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.



Addresses
https://broadworkbench.atlassian.net/browse/DT-4378
Security risk: low — two new admin-only endpoints that rerun an existing, reviewed sync; no change to who can read or write studies.
Summary
StudyAssetRecordSync.syncStudy(#3213) had no caller. This adds the trigger the plan's Rollback steps need, and DT-4331 will use the bulk call to convert existing studies instead of a SQL changeset.POST /api/dataset/study/{studyId}/assets/sync: runssyncStudyfor one study in its own transaction, then reindexes the study's datasets.syncStudy's 404 (no study) and 400 (a biospecimen in row-id form with nosampleId) pass through.POST /api/dataset/study/assets/sync?since=<ISO-8601 instant>: every study, or each study withcreate_dateorupdate_dateat or aftersince(new studies have a nullupdate_date). One transaction per study in id order. Streams one result per line asapplication/x-ndjson, then a summary line; a failing study is reported and the run continues, and the run also continues if the caller disconnects.Differences from the design in the ticket comment:
StudyAssetResource. That class ownsapi/dataset/study/{studyId}/assets, and Jersey picks the root class with the longer literal prefix and does not fall back, so the route onStudyResourceanswered 404.indexed_date IS NOT NULL), notindexStudy, which indexes every dataset of the study and would re-add one an admin removed. The result reportsindexasUPDATED,NOT_INDEXEDorFAILED; a bulk request that answers 200 with"errors": truecounts asFAILED.Testing
StudyResourceTest,StudyAssetResourceTest,DatasetServiceTest,StudyDAOTest,StudyAssetRecordSyncTest: admin-only on both calls, error pass-through, a malformedsince, the loop continuing past a failed study and a dropped client, reindex outcomes, thesincequery (inclusive, new and edited studies), and a sync that rolls back when a later asset type fails.mvn validatepasses the OpenAPI spec.Have you read CONTRIBUTING.md lately? If not, do that first.
🤖 Generated with Claude Code