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

[Manual Backport 2.x] [MQL] support enhancing language selector (#6613) #6760

Conversation

abbyhu2000
Copy link
Member

Manual backport of #6613

Enable with `data.enhancements.enabled: true`

Allows for enhancing the data plugin UI service and search service.

* Address issue with time range being invalid if previous state successfully queried and set it with a time range format that is invalid for the new query language
  * For example, DQL with quick time range (4 weeks to now), get results. Switch to PPL, even though PPL has a default time range enhancement. The props date range saved in the app state takes priority and sets the time range to quick range causing an error. I can still modify the time range and get a successful query but it will first fail until the user updates it to a non quick time range.
* Add tests
* Disable for plugins that do not support the functionality
  * By default index patterns are created with a unique ID. However, it can be enabled to create an index pattern with a custom ID that matches the name of the index pattern (which in turn maps to indices).
  * For seamless integration, the temp data frame would need to check if the index pattern that maps to the data frame name. And get it's id.
  * This means that dashboards with visualizations that were created with an index pattern unique ID still require the existing index pattern to exist in memory.

closes opensearch-project#6639
closes opensearch-project#6311

partially resolves:
opensearch-project#5504

* add error data frame

Signed-off-by: Paul Sebastian <paulstn@amazon.com>

move language to left, some styling and disable per app name

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Signed-off-by: Paul Sebastian <paulstn@amazon.com>
Co-authored-by: Paul Sebastian <paulstn@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 26.66667% with 308 lines in your changes are missing coverage. Please review.

Project coverage is 67.50%. Comparing base (c67e336) to head (9505db5).

Files Patch % Lines
src/plugins/data/common/data_frames/utils.ts 9.33% 136 Missing ⚠️
src/plugins/data/public/ui/settings/settings.ts 0.00% 24 Missing ⚠️
...public/ui/query_string_input/query_bar_top_row.tsx 16.00% 17 Missing and 4 partials ⚠️
.../data/common/search/search_source/search_source.ts 15.78% 14 Missing and 2 partials ⚠️
...public/ui/query_string_input/language_switcher.tsx 56.66% 8 Missing and 5 partials ⚠️
src/plugins/data/public/search/search_service.ts 20.00% 12 Missing ⚠️
src/plugins/data/server/search/search_service.ts 7.69% 12 Missing ⚠️
src/plugins/data/public/ui/ui_service.ts 0.00% 11 Missing ⚠️
...on/index_patterns/index_patterns/index_patterns.ts 38.46% 6 Missing and 2 partials ⚠️
...on/search/search_source/fetch/get_search_params.ts 33.33% 6 Missing and 2 partials ⚠️
... and 16 more
Additional details and impacted files
@@            Coverage Diff             @@
##              2.x    #6760      +/-   ##
==========================================
- Coverage   67.76%   67.50%   -0.27%     
==========================================
  Files        3414     3425      +11     
  Lines       66950    67330     +380     
  Branches    10877    10976      +99     
==========================================
+ Hits        45370    45448      +78     
- Misses      18939    19216     +277     
- Partials     2641     2666      +25     
Flag Coverage Δ
Linux_1 33.06% <12.73%> (-0.12%) ⬇️
Linux_2 55.16% <8.36%> (-0.45%) ⬇️
Linux_3 45.03% <26.87%> (-0.26%) ⬇️
Linux_4 34.87% <11.74%> (-0.16%) ⬇️
Windows_1 33.08% <12.73%> (-0.12%) ⬇️
Windows_2 55.13% <8.36%> (-0.45%) ⬇️
Windows_3 45.04% <26.87%> (-0.27%) ⬇️
Windows_4 34.87% <11.74%> (-0.16%) ⬇️

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.

@kavilla kavilla added the Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry label May 9, 2024
Copy link
Member

@kavilla kavilla left a comment

Choose a reason for hiding this comment

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

ty

@ashwin-pc ashwin-pc merged commit 31694db into opensearch-project:2.x May 10, 2024
66 of 86 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.14 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.14 2.14
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.14
# Create a new branch
git switch --create backport/backport-6760-to-2.14
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 31694dbdabffec4a711678841f8080a06c4f879e
# Push it to GitHub
git push --set-upstream origin backport/backport-6760-to-2.14
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.14

Then, create a pull request where the base branch is 2.14 and the compare/head branch is backport/backport-6760-to-2.14.

abbyhu2000 added a commit to abbyhu2000/OpenSearch-Dashboards that referenced this pull request May 10, 2024
…pensearch-project#6760)

Enable with `data.enhancements.enabled: true`

Allows for enhancing the data plugin UI service and search service.

* Address issue with time range being invalid if previous state successfully queried and set it with a time range format that is invalid for the new query language
  * For example, DQL with quick time range (4 weeks to now), get results. Switch to PPL, even though PPL has a default time range enhancement. The props date range saved in the app state takes priority and sets the time range to quick range causing an error. I can still modify the time range and get a successful query but it will first fail until the user updates it to a non quick time range.
* Add tests
* Disable for plugins that do not support the functionality
  * By default index patterns are created with a unique ID. However, it can be enabled to create an index pattern with a custom ID that matches the name of the index pattern (which in turn maps to indices).
  * For seamless integration, the temp data frame would need to check if the index pattern that maps to the data frame name. And get it's id.
  * This means that dashboards with visualizations that were created with an index pattern unique ID still require the existing index pattern to exist in memory.

closes opensearch-project#6639
closes opensearch-project#6311

partially resolves:
opensearch-project#5504

* add error data frame

move language to left, some styling and disable per app name

---------

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Signed-off-by: Paul Sebastian <paulstn@amazon.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Paul Sebastian <paulstn@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
@BionIT
Copy link
Collaborator

BionIT commented Jun 5, 2024

@abbyhu2000 the backport to 2.14 is failed, could you take a look?

@ananzh ananzh added v2.15.0 enhancement New feature or request and removed backport 2.14 labels Jun 12, 2024
@AMoo-Miki
Copy link
Collaborator

decided against it going to 2.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request multiple query language Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry v2.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants