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

Added framework to get default query string using dataset and language combination #8896

Merged

Conversation

amsiglan
Copy link
Collaborator

Description

This PR adds framework to get the default query for a dataset and language combination from the dataset. If not provided we fallback to the defaults from the language service for each language.

Testing the changes

Tested using local setup

Changelog

  • feat: Added framework to get default query string using dataset and language combination

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

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.

needs tests

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.86%. Comparing base (a8d383b) to head (c832b28).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8896   +/-   ##
=======================================
  Coverage   60.86%   60.86%           
=======================================
  Files        3802     3802           
  Lines       91052    91052           
  Branches    14370    14368    -2     
=======================================
+ Hits        55421    55423    +2     
+ Misses      32093    32091    -2     
  Partials     3538     3538           
Flag Coverage Δ
Linux_1 29.01% <0.00%> (ø)
Linux_2 56.39% <ø> (ø)
Linux_3 37.88% <100.00%> (?)
Linux_4 29.00% <0.00%> (ø)
Windows_1 29.02% <0.00%> (ø)
Windows_2 56.34% <ø> (ø)
Windows_3 37.88% <100.00%> (+<0.01%) ⬆️
Windows_4 29.00% <0.00%> (ø)

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.


🚨 Try these New Features:

@kavilla kavilla added discover for discover reinvent discover-next labels Nov 19, 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.

this still doesn't make a lot of sense to me with the current existing framework. why would we stop here at the query string level? if the dataset type config being able to override the query syntax provided by the language service then why shouldn't the dataset type config being able to override the editor, fields? it seems like we are overriding the sample queries already so pretty much the language service serves no real purpose if we just keep overriding by the dataset service

Copy link
Collaborator

@virajsanghvi virajsanghvi left a comment

Choose a reason for hiding this comment

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

are there no unit tests for query_string_manager.ts?

Signed-off-by: Amardeepsingh Siglani <[email protected]>
@amsiglan amsiglan force-pushed the get-default-query-from-dataset branch from 60cb836 to 786547f Compare November 20, 2024 00:13
@amsiglan
Copy link
Collaborator Author

needs tests

Working on tests

Signed-off-by: Amardeepsingh Siglani <[email protected]>
Copy link
Collaborator

@virajsanghvi virajsanghvi left a comment

Choose a reason for hiding this comment

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

approving assuming it passes ci

@amsiglan amsiglan merged commit d3f539c into opensearch-project:main Nov 20, 2024
69 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x 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.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-8896-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d3f539c6495f233bf5dc207e727ca05a58c07494
# Push it to GitHub
git push --set-upstream origin backport/backport-8896-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-8896-to-2.x.

amsiglan added a commit to amsiglan/OpenSearch-Dashboards that referenced this pull request Nov 20, 2024
…e combination (opensearch-project#8896)

* added framework to get default query using dataset

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* Changeset file for PR opensearch-project#8896 created/updated

* deduped code

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* added UTs; minor refactor

Signed-off-by: Amardeepsingh Siglani <[email protected]>

---------

Signed-off-by: Amardeepsingh Siglani <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
@amsiglan amsiglan mentioned this pull request Nov 20, 2024
7 tasks
raintygao pushed a commit to raintygao/OpenSearch-Dashboards that referenced this pull request Nov 20, 2024
…e combination (opensearch-project#8896)

* added framework to get default query using dataset

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* Changeset file for PR opensearch-project#8896 created/updated

* deduped code

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* added UTs; minor refactor

Signed-off-by: Amardeepsingh Siglani <[email protected]>

---------

Signed-off-by: Amardeepsingh Siglani <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
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.

3 participants