-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Make time_zone parameter properly volatile #35536
Conversation
Pinging @elastic/kibana-app |
Pinging @elastic/kibana-app-arch |
💚 Build Succeeded |
a178799
to
e4d8eff
Compare
Tested and works for me, timezones switch with the configured one on non-rollup vis, always use the rollup timezone for rollup vis. The |
@flash1293 yeah I think that's actually desired behavior so far and we only want to block saving if the user is in a "touched but not applied" state. But as long as the state is valid we don't prevent them from saving. Actually it would also be the only way right now to use "Save as new visualization" even if you haven't made any changes. |
@timroes That's what I had in mind. There is probably some code which can be thrown away because of this, but definitely a low prio task which could be tackled during EUI-ification. |
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
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 too! Tested Chrome OSX and verified the issue appears to be fixed
This comment has been minimized.
This comment has been minimized.
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 and I tested locally with US/Hawaii
timezone.
💚 Build Succeeded |
* Move all time_zone logic to write method * Add more comments
* Move all time_zone logic to write method * Add more comments
* Move all time_zone logic to write method * Add more comments
* Move all time_zone logic to write method * Add more comments
Summary
Fixes #35494
In #34795 we wanted to make the
time_zone
parameter ofdate_histogram
volatile and no longer save it in the saved object (since that was a severe bug). Unfortunately the serialize method of an aggregation param is called fromAggConfig.toJSON
which was used inVis.getSerializableState
andVis.getCurrentState
to clone those objects, thus thetime_zone
was actually also removed on the way to the query and the timezone the rollup plugin set didn't effect the query.This PR now moves all the logic for the time_zone parameter into its
write
method (which is used purely when writing out the DSL for that parameter). This method will now check thetypeMeta
on the index pattern itself (which is set for roll up indexes). If that has a time_zone it's used. Otherwise the time_zone from the kibana settings is used. You can also still technically set thetime_zone
explicitly, which we currently don't use anywhere (but might be exposed later on in the visualization expression). This means the parameter itself will always beundefined
in places it's passed around in the code, and really only be taken care of once written to DSL.Since the bug has not yet been released I marked this as skip for the release notes.
Testing:
This PR should fix #35494 and now allow to visualize over a rolled-up index pattern while your Kibana is in a different time_zone then the index was rolled up. Also it should not break #34784 again and the
time_zone
should still not be saved in the visualizations saved object.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
[ ] This was checked for breaking API changes and was labeled appropriately[ ] This includes a feature addition or change that requires a release note and was labeled appropriately