[DT-3184]Add ability to convert a dac's controlled datasets to external.#2874
Open
otchet-broad wants to merge 11 commits intodevelopfrom
Open
[DT-3184]Add ability to convert a dac's controlled datasets to external.#2874otchet-broad wants to merge 11 commits intodevelopfrom
otchet-broad wants to merge 11 commits intodevelopfrom
Conversation
…related test class.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an admin-only workflow to externalize datasets managed by a DAC (and clean up related DUOS-managed access artifacts), including audit-style administrative notes on impacted DARs.
Changes:
- Adds
/api/dac/{dacId}/datasets/externalizeendpoint + request/response models and OpenAPI documentation. - Implements transactional DAO operation to (optionally) convert datasets to
external, revoke DAR dataset relations (with appended DAR admin notes), and cancel open data-access elections. - Introduces
admin_dar_notescolumn ondata_access_requestand plumbs it through DAO/mappers/model serialization, with accompanying tests.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/org/broadinstitute/consent/http/service/dao/DacServiceDAO.java | Implements DB-side externalization, DAR note append, DAR relation deletion, election cancellation |
| src/main/java/org/broadinstitute/consent/http/service/DacService.java | Adds service method + ElasticSearch reindexing after mutation |
| src/main/java/org/broadinstitute/consent/http/resources/DacResource.java | Adds admin-only REST endpoint for dataset externalization |
| src/main/java/org/broadinstitute/consent/http/models/DacDatasetExternalizationRequest.java | New request record with default/nullable boolean helpers |
| src/main/java/org/broadinstitute/consent/http/models/DacDatasetExternalizationResponse.java | New response record with execution summary metrics |
| src/main/java/org/broadinstitute/consent/http/models/DataAccessRequest.java | Adds adminDarNotes field + includes it in simplified DAR output; fixes SO closeout date shallowCopy bug |
| src/main/java/org/broadinstitute/consent/http/db/DataAccessRequestDAO.java | Selects admin_dar_notes in relevant queries |
| src/main/java/org/broadinstitute/consent/http/db/mapper/DataAccessRequestMapper.java | Maps admin_dar_notes into model when present |
| src/main/java/org/broadinstitute/consent/http/ConsentModule.java | Wires ElasticSearchService into DacService constructor |
| src/main/resources/changesets/changelog-consent-2026-04-23-dar-admin-notes.xml | Liquibase change adding admin_dar_notes column |
| src/main/resources/changelog-master.xml | Includes new Liquibase changeset |
| src/main/resources/assets/api-docs.yaml | Registers new path and component schemas |
| src/main/resources/assets/paths/dacDatasetExternalizeById.yaml | New OpenAPI path definition |
| src/main/resources/assets/schemas/DacDatasetExternalizationRequest.yaml | New OpenAPI request schema |
| src/main/resources/assets/schemas/DacDatasetExternalizationResponse.yaml | New OpenAPI response schema |
| src/main/resources/assets/schemas/DataAccessRequest.yaml | Documents new adminDarNotes field |
| src/test/java/org/broadinstitute/consent/http/service/dao/DacServiceDAOTest.java | Adds integration-style DAO tests for externalization behavior |
| src/test/java/org/broadinstitute/consent/http/service/DacServiceTest.java | Adds service tests including reindex/no-reindex on dry run |
| src/test/java/org/broadinstitute/consent/http/resources/DacResourceTest.java | Adds resource tests for new endpoint |
| src/test/java/org/broadinstitute/consent/http/models/DataAccessRequestTest.java | Validates simplified DAR includes adminDarNotes |
| src/test/java/org/broadinstitute/consent/http/models/DacDatasetExternalizationRequestTest.java | Unit tests for request helpers/defaults |
| src/test/java/org/broadinstitute/consent/http/db/DataAccessRequestDAOTest.java | Ensures DAO returns adminDarNotes |
rushtong
reviewed
Apr 24, 2026
|
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-3184
Developed with Github Copilot
Summary
For a given DAC, allow an admin to change all of the datasets they oversee from controlled to external. In doing this, the code also updates DARs to remove the datasets and adds an administrative note to memorialize the change and cancels open elections so that DAC members cannot vote on items that have been converted from controlled to external.
BEFORE:

SWAGGER UI REQUEST:
SWAGGER RESPONSE:
AFTER:
Administrative note on example DAR:
On 2026-04-24T13:53:29Z the following datasets were removed administratively from this request because the responsible Data Access Committee no longer manages access using DUOS. DUOS-000XXX
Note: I've redacted the DUOS ID in the administrative note.
Have you read CONTRIBUTING.md lately? If not, do that first.