Skip to content

[DT-3184]Add ability to convert a dac's controlled datasets to external.#2874

Open
otchet-broad wants to merge 11 commits intodevelopfrom
otchet-dt-3184-convert-dac-to-external
Open

[DT-3184]Add ability to convert a dac's controlled datasets to external.#2874
otchet-broad wants to merge 11 commits intodevelopfrom
otchet-dt-3184-convert-dac-to-external

Conversation

@otchet-broad
Copy link
Copy Markdown
Contributor

@otchet-broad otchet-broad commented Apr 24, 2026

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:
image

SWAGGER UI REQUEST:

image

SWAGGER RESPONSE:

image

AFTER:

image image

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.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@otchet-broad otchet-broad marked this pull request as ready for review April 24, 2026 18:11
@otchet-broad otchet-broad requested a review from a team as a code owner April 24, 2026 18:11
@otchet-broad otchet-broad requested review from Copilot, fboulnois and rushtong and removed request for a team April 24, 2026 18:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/externalize endpoint + 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_notes column on data_access_request and 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

Comment thread src/main/resources/assets/schemas/DacDatasetExternalizationResponse.yaml Outdated
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants