Skip to content

Conversation

@JoonLeeNIH
Copy link

Overview

Fixes crashes in original INS-1513 implementation

Change Details (Specifics)

Added handling for Opensearch errors in /search endpoint, as well as corresponding test

Related Ticket(s)

https://tracker.nci.nih.gov/browse/INS-1513

@JoonLeeNIH JoonLeeNIH requested review from Copilot and huuaho February 9, 2026 18:15
Copy link

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

Fixes crashes in the /search endpoint by adding handling for OpenSearch failures and adjusting default sort behavior.

Changes:

  • Add try/catch around OpenSearch search execution and return a structured error.
  • Harden request parsing in the dataset search controller (filters/search_text) and update the default sort field.
  • Add a unit test + fixture for an OpenSearch error response.

Reviewed changes

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

Show a summary per file
File Description
Utils/datasetFields.js Introduces a default dataset sort field constant/export used by the controller.
Controllers/dataset.controllers.js Validates request inputs, changes default sort field, and returns error responses when service reports OpenSearch errors.
Services/dataset.service.js Wraps OpenSearch call with error handling and logs failures.
Services/dataset.service.test.js Adds a test intended to cover OpenSearch error handling in the service.
Services/dataset.service.test.fixtures.js Adds fixture representing an OpenSearch error payload.

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

@JoonLeeNIH JoonLeeNIH deployed to ccdi-manager-nonprod February 9, 2026 19:19 — with GitHub Actions Active
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.

1 participant