[DT-3258] Ensure that FSOs are limited to DAAs for this DAO.#2902
Open
otchet-broad wants to merge 1 commit into
Open
[DT-3258] Ensure that FSOs are limited to DAAs for this DAO.#2902otchet-broad wants to merge 1 commit into
otchet-broad wants to merge 1 commit into
Conversation
|
rushtong
approved these changes
May 12, 2026
| Instant.now()); | ||
| fileStorageObjectDAO.insertNewFile( | ||
| randomAlphabetic(10), | ||
| FileCategory.ALTERNATIVE_DATA_SHARING_PLAN.getValue(), |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses DT-3258 by ensuring DaaDAO only attaches FileStorageObjects (FSOs) that represent Data Access Agreements when DAAs are fetched, preventing unrelated file categories from being returned as the DAA “file”.
Changes:
- Updated
DaaDAOSQL queries to scope thefile_storage_objectjoin tocategory = 'dataAccessAgreement'. - Added/extended DAO tests to validate that DAAs only return the correct-category FSO even when other FSOs exist for the same
entity_id.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/main/java/org/broadinstitute/consent/http/db/DaaDAO.java |
Restricts FSO joins to the dataAccessAgreement category when fetching DAAs. |
src/test/java/org/broadinstitute/consent/http/db/DaaDAOTest.java |
Adds coverage to ensure only the DAA-category file is returned when multiple FSOs exist. |
Comment on lines
68
to
72
| dac.description | ||
| FROM data_access_agreement daa | ||
| LEFT JOIN file_storage_object fso ON daa.daa_id::text = fso.entity_id | ||
| LEFT JOIN file_storage_object fso ON daa.daa_id::text = fso.entity_id AND fso.category = 'dataAccessAgreement' | ||
| LEFT JOIN dac_daa dd ON daa.daa_id = dd.daa_id | ||
| LEFT JOIN dac ON dd.dac_id = dac.dac_id AND dac.deleted IS NOT TRUE |
Comment on lines
109
to
113
| dac.description | ||
| FROM data_access_agreement daa | ||
| LEFT JOIN file_storage_object fso ON daa.daa_id::text = fso.entity_id | ||
| LEFT JOIN file_storage_object fso ON daa.daa_id::text = fso.entity_id AND fso.category = 'dataAccessAgreement' | ||
| LEFT JOIN dac_daa dd ON daa.daa_id = dd.daa_id | ||
| LEFT JOIN dac ON dd.dac_id = dac.dac_id AND dac.deleted IS NOT TRUE |
| dac.description | ||
| FROM data_access_agreement daa | ||
| LEFT JOIN file_storage_object fso ON daa.daa_id::text = fso.entity_id | ||
| LEFT JOIN file_storage_object fso ON daa.daa_id::text = fso.entity_id AND fso.category = 'dataAccessAgreement' |
| dac.description | ||
| FROM data_access_agreement daa | ||
| LEFT JOIN file_storage_object fso ON daa.daa_id::text = fso.entity_id | ||
| LEFT JOIN file_storage_object fso ON daa.daa_id::text = fso.entity_id AND fso.category = 'dataAccessAgreement' |
| } | ||
|
|
||
| @Test | ||
| void testFindAllDacOnlyProperFileCategory() { |
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-3258
Summary
Limits retrieval of FSOs to data access agreements when including FSOs.
Have you read CONTRIBUTING.md lately? If not, do that first.