-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Reporting/Discover/Search Sessions] Only use relative time filter when generating share data #112588
[Reporting/Discover/Search Sessions] Only use relative time filter when generating share data #112588
Conversation
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
Pinging @elastic/kibana-app-services (Team:AppServices) |
Input regarding tests to add/update would be much appreciated! |
src/plugins/discover/public/application/apps/main/utils/update_search_source.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. This is the right way to solve this. Much appreciation for jumping on this so quickly!
@elasticmachine merge upstream |
…-for-search-sessions
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked that restoring relative session works.
There is an existing functional test that should have caught this bug:
kibana/x-pack/test/search_sessions_integration/tests/apps/discover/async_search.ts
Lines 104 to 122 in 0af821a
it('relative timerange works', async () => { | |
await PageObjects.common.navigateToApp('discover'); | |
await PageObjects.header.waitUntilLoadingHasFinished(); | |
await searchSessions.save(); | |
await searchSessions.expectState('backgroundCompleted'); | |
const searchSessionId = await getSearchSessionId(); | |
expect(await PageObjects.discover.hasNoResults()).to.be(true); | |
log.info('searchSessionId', searchSessionId); | |
// load URL to restore a saved session | |
await PageObjects.searchSessionsManagement.goTo(); | |
const searchSessionList = await PageObjects.searchSessionsManagement.getList(); | |
// navigate to Discover | |
await searchSessionList[0].view(); | |
await PageObjects.header.waitUntilLoadingHasFinished(); | |
await searchSessions.expectState('restored'); | |
expect(await PageObjects.discover.hasNoResults()).to.be(true); | |
}); | |
}); |
I will check separately why it didn't catch it and will try to fix
Improve discover search session relative time range test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, code owners review, didn't test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
We can remove this TODO
: 606d1b8#diff-0154cfbb823111800ea5acf098c44670bcf6035935df851983db9f2c55bfe16cR93 but I'll take care of that later.
…en generating share data (elastic#112588) * only use relative time filter when generating share data * Added comment on absolute time filter. Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> * improve discover search session relative time range test * update discover tests and types for passing in data plugin to getSharingData function * updated reporting to pass in data plugin to getSharingData, also updates jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
…en generating share data (elastic#112588) * only use relative time filter when generating share data * Added comment on absolute time filter. Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> * improve discover search session relative time range test * update discover tests and types for passing in data plugin to getSharingData function * updated reporting to pass in data plugin to getSharingData, also updates jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
💔 Backport failed
Successful backport PRs will be merged automatically after passing CI. To backport manually run: |
…en generating share data (elastic#112588) * only use relative time filter when generating share data * Added comment on absolute time filter. Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> * improve discover search session relative time range test * update discover tests and types for passing in data plugin to getSharingData function * updated reporting to pass in data plugin to getSharingData, also updates jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
…en generating share data (elastic#112588) * only use relative time filter when generating share data * Added comment on absolute time filter. Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> * improve discover search session relative time range test * update discover tests and types for passing in data plugin to getSharingData function * updated reporting to pass in data plugin to getSharingData, also updates jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
…en generating share data (#112588) (#112735) * only use relative time filter when generating share data * Added comment on absolute time filter. Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> * improve discover search session relative time range test * update discover tests and types for passing in data plugin to getSharingData function * updated reporting to pass in data plugin to getSharingData, also updates jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co> Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
…en generating share data (#112588) (#112736) * only use relative time filter when generating share data * Added comment on absolute time filter. Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> * improve discover search session relative time range test * update discover tests and types for passing in data plugin to getSharingData function * updated reporting to pass in data plugin to getSharingData, also updates jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co> Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
…lter when generating share data (#112588) (#112737) * [Reporting/Discover/Search Sessions] Only use relative time filter when generating share data (#112588) * only use relative time filter when generating share data * Added comment on absolute time filter. Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> * improve discover search session relative time range test * update discover tests and types for passing in data plugin to getSharingData function * updated reporting to pass in data plugin to getSharingData, also updates jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co> * fixes * fix ts Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
…lter when generating share data (#112588) (#112740) * [Reporting/Discover/Search Sessions] Only use relative time filter when generating share data (#112588) * only use relative time filter when generating share data * Added comment on absolute time filter. Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> * improve discover search session relative time range test * update discover tests and types for passing in data plugin to getSharingData function * updated reporting to pass in data plugin to getSharingData, also updates jest tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co> * fix bad merge * fixes * fix Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Closes #112562
After merging #110459 we introduced a regression into restoring search sessions with relative time on discover. This contribution scopes creating a relative time filter to reporting only. This way we preserve the fix for the Copy URL and scheduled reports and address the regression.
Release note
We fixed a bug where restoring search sessions in discover would not preserve absolute times thus invalidate search session caches.
Checklist
CC @tsullivan @Dosant @lukasolson @ppisljar