Skip to content

DT-2532: Replicate Translate Summary in Consent#2814

Open
rushtong wants to merge 3 commits intodevelopfrom
gr-DT-2532-translate-summary
Open

DT-2532: Replicate Translate Summary in Consent#2814
rushtong wants to merge 3 commits intodevelopfrom
gr-DT-2532-translate-summary

Conversation

@rushtong
Copy link
Contributor

@rushtong rushtong commented Feb 18, 2026

Addresses

https://broadworkbench.atlassian.net/browse/DT-2532

Summary

This PR replicates the Translate Summary endpoint by copying over the translateSummary method to Consent. There were very few tests for this method so there are a large number of new tests in TranslationUtilTest

Testing

This method is used when indexing a dataset to Elastic Search. Use the POST /api/dataset/index/{datasetId} API and this code path will be hit.


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

*/
// Suppress warning for method complexity (S3776). Due for reevaluation after initial migration
@SuppressWarnings({"java:S3776"})
public DataUseSummary translateSummary(DataUse dataUse) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rushtong rushtong marked this pull request as ready for review February 18, 2026 21:07
Copilot AI review requested due to automatic review settings February 18, 2026 21:08
@rushtong rushtong requested a review from a team as a code owner February 18, 2026 21:08
@rushtong rushtong requested review from fboulnois and kevinmarete and removed request for a team February 18, 2026 21:08
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 moves the “Translate Summary” behavior into Consent by implementing a local structured summary generator (TranslationUtil.translateSummary) and wiring OntologyService.translateDataUseSummary to use it, reducing reliance on the external ontology service for this functionality.

Changes:

  • Replace OntologyService.translateDataUseSummary remote HTTP call with an in-process translation via TranslationUtil.translateSummary.
  • Add extensive unit test coverage for structured summary translation in TranslationUtilTest.
  • Update Guice wiring and adjust OntologyServiceTest to reflect the new in-process behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/org/broadinstitute/consent/http/service/OntologyService.java Removes remote call dependency for summary translation and delegates to TranslationUtil.
src/main/java/org/broadinstitute/consent/http/matching/TranslationUtil.java Adds structured translateSummary implementation used by dataset indexing.
src/main/java/org/broadinstitute/consent/http/ConsentModule.java Updates provider wiring for the new OntologyService constructor.
src/test/java/org/broadinstitute/consent/http/service/OntologyServiceTest.java Updates tests to validate summary generation without MockServer-based HTTP translation.
src/test/java/org/broadinstitute/consent/http/matching/TranslationUtilTest.java Adds broad test coverage for the new structured summary translation behavior.

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

Copy link
Contributor

@fboulnois fboulnois left a comment

Choose a reason for hiding this comment

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

👍

@sonarqubecloud
Copy link

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

Comments