-
Notifications
You must be signed in to change notification settings - Fork 0
INS-1513 #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.3.0
Are you sure you want to change the base?
INS-1513 #46
Conversation
There was a problem hiding this 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.
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