-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Move Timefilter service ⇒ NP #49491
Move Timefilter service ⇒ NP #49491
Conversation
💔 Build Failed
|
db7341a
to
a51d68d
Compare
💔 Build Failed
|
c164407
to
cb4042b
Compare
Pinging @elastic/kibana-app-arch (Team:AppArch) |
💔 Build Failed
|
💔 Build Failed
|
bfb5b76
to
6aea0e3
Compare
💔 Build Failed |
💚 Build Succeeded |
💔 Build Failed |
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.
ML edit to the chart_utils test 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.
These two seem to be blockers:
- Importing Index Patterns in the NP
data
plugin from the LP. - Removing type safety in mocks.
Other comments are for discussion.
@@ -44,7 +43,6 @@ export interface DataPluginStartDependencies { | |||
*/ | |||
export interface DataSetup { | |||
query: QuerySetup; | |||
timefilter: TimefilterSetup; |
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.
Instead of removing timefilter
from the shim, shall we re-export the timefilter from the NP here.
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.
/cc @ppisljar
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.
I prefer the opposite approach and I've been using it in previous PR.
I've been working with other teams and promotes faster adaptation.
And it allows us to maintain less code.
import { TimelionPluginSetupDependencies } from './plugin'; | ||
import { LegacyDependenciesPlugin } from './shim'; | ||
|
||
const setupPlugins: Readonly<TimelionPluginSetupDependencies> = { | ||
visualizations, | ||
data, | ||
data: npSetup.plugins.data, |
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.
If timefilter
was re-exported in the shim, this change would not be necessary. Also, now if Timelion needs some other service besides timefilter
from the data
plugin they would need to import the shim and the NP plugin, merge those locally, also import types of both of those and merge those locally.
export const timeHistory = data.timefilter.history; | ||
export const timefilter = data.timefilter.timefilter; | ||
export const timeHistory = npStart.plugins.data.query.timefilter.history; | ||
export const timefilter = npStart.plugins.data.query.timefilter.timefilter; |
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.
Is the double timefilter
key — .timefilter.timefilter
— temporary, or we are planning to keep that?
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.
ATM it's just backwards compatible.
Though I'm not a big fan as well.
I'm open to making a follow up PR updating the structure.
import { IndexPattern, Field } from '../index_patterns'; | ||
|
||
// TODO: remove this | ||
import { IndexPattern, Field } from '../../../../../legacy/core_plugins/data/public/index_patterns'; |
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 seems like a no-no—importing from the Legacy Platform in the New Platform. My understanding is that we should not be doing this even with TODO
comment, but maybe I'm wrong (/cc @ppisljar @joshdover ).
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.
Talked about this with @ppisljar.
We decided to go with it, because otherwise we're blocked until IndexPatterns
are done. It's a temporary solution that works since it's only a type, and once IndexPatterns are migrated, we'll switch it over.
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.
its only types that we are importing, so this should be ok
…plugin/move-timefilter-to-NP
💚 Build Succeeded |
…plugin/move-timefilter-to-NP
💚 Build Succeeded |
…plugin/move-timefilter-to-NP
retest |
💚 Build Succeeded |
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.
Talked with @ppisljar, he is OK for this PR to import legacy Index Patterns from a New Platform plugin, thus removing request for changes.
Talked with @ppisljar, he is OK for this PR to import legacy Index Patterns from a New Platform plugin, thus removing request for changes.
@streamich thanks, if so is this approved? |
Don't you feel it's kind of redundant? Anyway @ppisljar could you look then? |
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
* Move timefilter to NP * Fixed editor import * added karma mocks * More karma mocks * Change way timefilter is mocked * Fix timefilter passing in timelion * attempted revert of mock types
Summary
Move timefilter ⇒ NP
Dev Docs
Moved the
timefilter
service to New Platform.Usage in old platform:
Usage in new platform:
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers