Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Modify getRollups API to use getRollup instead of search API #150

Merged
merged 9 commits into from
Jan 5, 2021

Conversation

annie3431
Copy link
Contributor

Issue #, if available: N/A

Description of changes:

  • Add new route getRollups in ismPlugins.ts

  • Change totalRollup to total_rollups in getRollupsResponse interface to match with backend response.

  • Previously getRollups is using search API to fetch multiple rollup jobs. Now changed to use getRollup and passing in parameters: from, size, search, sortField, and sortDirection.

  • ModifygetRollups to fetch metadata of all rollup jobs by directly requesting from ism.explainRollup, and removed previously defined function explainRollup.

  • A few updates on interface definitions to reduce mismatch type errors

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@annie3431
Copy link
Contributor Author

Test Suites: 32 passed, 32 total
Tests: 167 passed, 167 total
Snapshots: 28 passed, 28 total
Time: 159.636 s
Ran all test suites.
✨ Done in 161.72s.

@annie3431 annie3431 added the maintenance improves code quality, but not the product label Jan 4, 2021
ftianli-amzn
ftianli-amzn previously approved these changes Jan 5, 2021
qreshi
qreshi previously approved these changes Jan 5, 2021
});
return response.custom({
statusCode: 200,
body: { ok: true, response: { rollups: rollups, totalRollups: totalRollups, metadata: explainResponse } },
body: { ok: true, response: { rollups: rollups, total_rollups: totalRollups, metadata: explainResponse } },
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for changing this to snake_case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a few changes after adding type definition of GetRollupsResponse in line 293, the interface definition was changed to snake_case, too.
Since other functions does not define the type of received response, had just removed the type definition in line 292 making it const getRollupResponse = await ... and changed snake_case back to camelCase.

@annie3431 annie3431 dismissed stale reviews from qreshi and ftianli-amzn via ea42437 January 5, 2021 22:35
@annie3431 annie3431 merged commit 905a680 into master Jan 5, 2021
@annie3431 annie3431 deleted the getRollups-fix branch January 5, 2021 22:50
@bowenlan-amzn bowenlan-amzn added refactor and removed maintenance improves code quality, but not the product labels Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants