Skip to content

DT-2531: Migrate translate usages from UseRestrictionConverter to OntologyService#2815

Open
rushtong wants to merge 1 commit intodevelopfrom
gr-DT-2531-translate-part-2
Open

DT-2531: Migrate translate usages from UseRestrictionConverter to OntologyService#2815
rushtong wants to merge 1 commit intodevelopfrom
gr-DT-2531-translate-part-2

Conversation

@rushtong
Copy link
Contributor

Addresses

Follow up work for https://broadworkbench.atlassian.net/browse/DT-2531

Summary

This is follow up work to #2811. In that PR, we replicated the translate feature. Unfortunately, I missed one of the usages which was in UseRestrictionConverter which called the same remote endpoint. This PR removes that and replaces all usages with the same method in OntologyService.


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

@sonarqubecloud
Copy link

@rushtong rushtong marked this pull request as ready for review February 18, 2026 22:10
@rushtong rushtong requested a review from a team as a code owner February 18, 2026 22:10
@rushtong rushtong requested review from Copilot, eweitz, kevinmarete and otchet-broad and removed request for a team February 18, 2026 22:10
return dataUse;
}

public String translateDataUse(DataUse dataUse, DataUseTranslationType type) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the meat of the change. All services that called this method now call the newer version in OntologyService

Copy link
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

This PR completes the migration of data use translation functionality by removing the translateDataUse method from UseRestrictionConverter and replacing all its usages with OntologyService.translateDataUse(). This follows up on PR #2811, which replicated the translate feature from the external Ontology service to internal Consent code.

Changes:

  • Removed translateDataUse method from UseRestrictionConverter and simplified its constructor
  • Updated VoteService to use OntologyService instead of UseRestrictionConverter for translation
  • Updated DataAccessReportsParser to use OntologyService for translation while retaining UseRestrictionConverter for parsing
  • Updated all test files to reflect the new dependencies and removed obsolete translation tests

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main/java/org/broadinstitute/consent/http/service/UseRestrictionConverter.java Removed translateDataUse method and related dependencies; simplified constructor to no-arg
src/main/java/org/broadinstitute/consent/http/service/VoteService.java Replaced useRestrictionConverter dependency with ontologyService for data use translation
src/main/java/org/broadinstitute/consent/http/service/DataAccessReportsParser.java Added ontologyService dependency and updated translation call while keeping useRestrictionConverter for parsing
src/main/java/org/broadinstitute/consent/http/ConsentModule.java Updated provider methods to reflect simplified UseRestrictionConverter constructor and added ontologyService to VoteService
src/test/java/org/broadinstitute/consent/http/service/UseRestrictionConverterTest.java Removed translation-related tests and updated all test instantiations to use no-arg constructor
src/test/java/org/broadinstitute/consent/http/service/VoteServiceTest.java Updated mock dependencies to replace useRestrictionConverter with ontologyService
src/test/java/org/broadinstitute/consent/http/service/DataAccessReportsParserTest.java Added ontologyService mock and updated test setup to mock translation method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants

Comments