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

[bug] set saved search instance for Discover based on dataset #8689

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Oct 23, 2024

Description

Preventing any errors being thrown because of the index pattern not existing in the case of saved search was created with a dataset.

Also fix issue that prevented saved search instance not being set even though loaded properly.

The original fix that was removed fixed a previous issue but subsequent updates and refactors required an update that was uncaught.

Issues Resolved

n/a

Screenshot

Screenshot 2024-10-23 at 2 22 28 AM

Testing the changes

  • verified saved search is loading for PPL
  • verified reload working for non index pattern
  • verified short url working for non index pattern
  • verified copy url working for non index pattern

Changelog

  • skip

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

Preventing any errors being thrown because of the index pattern
not existing in the case of saved search was created with
a dataset.

Also fix issue that prevented saved search instance not being
set even though loaded properly.

The original fix that was removed fixed a previous issue but
subsequent updates and refactors required an update that was uncaught.

Issue:
n/a

Signed-off-by: Kawika Avilla <[email protected]>
@kavilla kavilla added discover for discover reinvent and removed Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry labels Oct 23, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 60.86%. Comparing base (85e0767) to head (a886620).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ic/application/view_components/utils/use_search.ts 0.00% 9 Missing ⚠️
...ommon/search/search_source/create_search_source.ts 0.00% 1 Missing and 2 partials ⚠️
...lication/utils/state_management/discover_slice.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8689      +/-   ##
==========================================
- Coverage   60.86%   60.86%   -0.01%     
==========================================
  Files        3793     3793              
  Lines       90456    90462       +6     
  Branches    14204    14207       +3     
==========================================
- Hits        55059    55057       -2     
- Misses      31908    31915       +7     
- Partials     3489     3490       +1     
Flag Coverage Δ
Linux_1 29.08% <0.00%> (-0.01%) ⬇️
Linux_2 56.39% <0.00%> (-0.01%) ⬇️
Linux_3 37.68% <0.00%> (-0.01%) ⬇️
Linux_4 29.85% <0.00%> (-0.01%) ⬇️
Windows_1 29.09% <0.00%> (-0.01%) ⬇️
Windows_2 56.35% <0.00%> (-0.01%) ⬇️
Windows_3 37.68% <0.00%> (-0.01%) ⬇️
Windows_4 29.85% <0.00%> (-0.01%) ⬇️

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.

ashwin-pc
ashwin-pc previously approved these changes Oct 23, 2024
Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

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

We should add a test here for the saved search flow, but can come in as a fast follow.

Signed-off-by: Kawika Avilla <[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.

Looks like a test related to saved searches is failing?

http: services.http,
data: services.data,
});
pattern = await data.indexPatterns.get(
Copy link
Collaborator

Choose a reason for hiding this comment

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

just for my knowledge, this just reads from cache and doesn't make a request? If it does make a request, I'm a little confused by the sequence above (call, cache, call) - I'm assuming the cache call is actually what fetches given this usage.

Copy link
Member Author

Choose a reason for hiding this comment

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

good question.

for anything that isn't an index pattern, it will read just from the cache. if nothing returns from the cache, then we will recreate the the dataset and save it as an index pattern when we call cache dataset. then we retrieve the actual index pattern we just created.

if it is an index pattern it will check the cache if it doesn't exist in the cache it will make it a request

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 PR as test failure looks like test needs to be cleaned up, but can happen separately

@ananzh
Copy link
Member

ananzh commented Oct 23, 2024

@ananzh ananzh merged commit e4281e4 into opensearch-project:main Oct 23, 2024
66 of 68 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 23, 2024
* [bug] set saved search instance for Discover based on dataset

Preventing any errors being thrown because of the index pattern
not existing in the case of saved search was created with
a dataset.

Also fix issue that prevented saved search instance not being
set even though loaded properly.

The original fix that was removed fixed a previous issue but
subsequent updates and refactors required an update that was uncaught.

Issue:
n/a

Signed-off-by: Kawika Avilla <[email protected]>

* set saved search order

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit e4281e4)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ananzh pushed a commit that referenced this pull request Oct 23, 2024
…#8692)

* [bug] set saved search instance for Discover based on dataset

Preventing any errors being thrown because of the index pattern
not existing in the case of saved search was created with
a dataset.

Also fix issue that prevented saved search instance not being
set even though loaded properly.

The original fix that was removed fixed a previous issue but
subsequent updates and refactors required an update that was uncaught.

Issue:
n/a



* set saved search order



---------


(cherry picked from commit e4281e4)

Signed-off-by: Kawika Avilla <[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>
Qxisylolo pushed a commit to Qxisylolo/OpenSearch-Dashboards that referenced this pull request Oct 30, 2024
…arch-project#8689)

* [bug] set saved search instance for Discover based on dataset

Preventing any errors being thrown because of the index pattern
not existing in the case of saved search was created with
a dataset.

Also fix issue that prevented saved search instance not being
set even though loaded properly.

The original fix that was removed fixed a previous issue but
subsequent updates and refactors required an update that was uncaught.

Issue:
n/a

Signed-off-by: Kawika Avilla <[email protected]>

* set saved search order

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>
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.

4 participants