Skip to content
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

Refactor async calls and minor bug fixes #274

Merged
merged 9 commits into from
Feb 28, 2024

Conversation

ps48
Copy link
Member

@ps48 ps48 commented Feb 27, 2024

Description

  • Refactored async calls to support cancel query
  • Merged implementation of async calls for sidebar, acceleration flyout and s3 queries.
  • Minor Fixed for below:
    • UI takes sometime before going in the running
    • Show toast errors with details button to show errors when SQL backend returns error for async queries
    • Async polling running without being able to cancel
    • Sidebar issue of loading spinner when datasource changed
    • Lint fixes of legacy files

Issues Resolved

#224
#217
#203
#202

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.47%. Comparing base (9188921) to head (8fb7a7f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #274      +/-   ##
==========================================
+ Coverage   59.88%   61.47%   +1.58%     
==========================================
  Files          33       33              
  Lines        1623     1599      -24     
  Branches      288      284       -4     
==========================================
+ Hits          972      983      +11     
+ Misses        548      518      -30     
+ Partials      103       98       -5     
Flag Coverage Δ
dashboards-query-workbench 61.47% <ø> (+1.58%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ps48 added 2 commits February 27, 2024 16:03
Signed-off-by: Shenoy Pratik <[email protected]>
Signed-off-by: Shenoy Pratik <[email protected]>
Copy link
Collaborator

@sumukhswamy sumukhswamy left a comment

Choose a reason for hiding this comment

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

LGTM


case AsyncQueryStatus.Failed:
case AsyncQueryStatus.Cancelled:
isQueryFulfilled = true;
Copy link
Collaborator

@sumukhswamy sumukhswamy Feb 28, 2024

Choose a reason for hiding this comment

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

Had a question about this isQueryFulfilled this is set as true here so that the loading stops?

Copy link
Member Author

Choose a reason for hiding this comment

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

isQueryFulfilled is an internal flag that keeps a check for cancelQuery. If query is fulfilled either with success or failed status then we will not run cancel query.

@ps48 ps48 merged commit 0e30a8d into opensearch-project:main Feb 28, 2024
11 of 13 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 28, 2024
* refactor async calls, minor bug fixes

Signed-off-by: Shenoy Pratik <[email protected]>

* type.ts lint updates and snapshot updates

Signed-off-by: Shenoy Pratik <[email protected]>

* adding lint error fixes

Signed-off-by: Shenoy Pratik <[email protected]>

* fix named export for QueryResults

Signed-off-by: Shenoy Pratik <[email protected]>

* remove default from named export

Signed-off-by: Shenoy Pratik <[email protected]>

* fix flaky unit test and fix lint issues in QueryResults.test.tsx

Signed-off-by: Shenoy Pratik <[email protected]>

* fix flaky tests and lint errors

Signed-off-by: Shenoy Pratik <[email protected]>

* error modal updates

Signed-off-by: Shenoy Pratik <[email protected]>

* update main.tsx snapshot

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Shenoy Pratik <[email protected]>
(cherry picked from commit 0e30a8d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ps48 pushed a commit that referenced this pull request Feb 28, 2024
* refactor async calls, minor bug fixes



* type.ts lint updates and snapshot updates



* adding lint error fixes



* fix named export for QueryResults



* remove default from named export



* fix flaky unit test and fix lint issues in QueryResults.test.tsx



* fix flaky tests and lint errors



* error modal updates



* update main.tsx snapshot



---------


(cherry picked from commit 0e30a8d)

Signed-off-by: Shenoy Pratik <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@ps48 ps48 mentioned this pull request Feb 28, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants