Skip to content

Conversation

ruchidh
Copy link
Collaborator

@ruchidh ruchidh commented Oct 15, 2025

Description

Summary

This PR implements a comprehensive cancel button feature for query execution across OpenSearch Dashboards, allowing users to cancel running
queries in both the standard QueryEditor and custom QueryExecutionButton scenarios.
The implementation provides a unified cancel button
experience that works consistently across different data source types (OpenSearch and S3).

What Changed

Core Features

  • Cancel Button Visibility: Added showCancelButton, onQueryCancel, and isQueryRunning props to enable cancel functionality
  • Timeout-based UI: Cancel button appears after 100ms delay to avoid flickering for quick queries
  • Cross-component Integration: Works seamlessly with both QueryEditor and custom submit buttons
  • Data Source Compatibility: Functions correctly for both OpenSearch and S3 data source types

Screenshot

Screen.Recording.2025-10-15.at.3.52.17.PM.mov
Screenshot 2025-10-15 at 3 52 36 PM

Changelog

  • feat: Add cancel query feature to discover

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Removed note about backend query cancellation handling.

Signed-off-by: Ruchi Sharma <[email protected]>
Added check for inProgressQueryId before modifying request body.

Signed-off-by: Ruchi Sharma <[email protected]>
Removed comments explaining the abortAllActiveQueries function.

Signed-off-by: Ruchi Sharma <[email protected]>
Copy link
Contributor

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

2 similar comments
Copy link
Contributor

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

Copy link
Contributor

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

Removed the abort signal handling tests from the ppl_search_interceptor test suite.

Signed-off-by: Ruchi Sharma <[email protected]>
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 90.69767% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.55%. Comparing base (0141879) to head (94503ac).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
.../query_execution_button/query_execution_button.tsx 88.88% 2 Missing and 1 partial ⚠️
...nagement/slices/query_editor/query_editor_slice.ts 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (0141879) and HEAD (94503ac). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (0141879) HEAD (94503ac)
Linux_4 1 0
Windows_3 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10727      +/-   ##
==========================================
- Coverage   60.34%   50.55%   -9.79%     
==========================================
  Files        4462     3971     -491     
  Lines      119488   106911   -12577     
  Branches    19746    17152    -2594     
==========================================
- Hits        72102    54049   -18053     
- Misses      42383    49541    +7158     
+ Partials     5003     3321    -1682     
Flag Coverage Δ
Linux_1 26.58% <ø> (-0.01%) ⬇️
Linux_2 38.82% <ø> (-0.01%) ⬇️
Linux_4 ?
Windows_1 26.59% <ø> (-0.01%) ⬇️
Windows_2 38.79% <ø> (-0.01%) ⬇️
Windows_3 ?
Windows_4 33.24% <90.69%> (+0.23%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ruchidh and others added 10 commits October 15, 2025 11:37
Remove commented-out contextProvider configuration

Signed-off-by: Ruchi Sharma <[email protected]>
Refactor tests for QueryEditorTopRow to improve structure and readability. Update mocks and assertions for better clarity and maintainability.

Signed-off-by: Ruchi Sharma <[email protected]>
Increase delay for showing the cancel button from 100ms to 500ms.

Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
@sejli
Copy link
Member

sejli commented Oct 16, 2025

There are some tests that are failing due to the changes, some related to snapshots. Could you fix the tests and run the linter? Typically, we have a precommit validation that runs that should run the linter on changed files.

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