-
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/Migration] ReportingSetup, LegacySetup #54198
[Reporting/Migration] ReportingSetup, LegacySetup #54198
Conversation
565dd95
to
1c68276
Compare
1c68276
to
89f421d
Compare
89f421d
to
2b8a8b2
Compare
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
* implementation itself restricts against having Legacy dependencies passed | ||
* into `setup`. The factory parameters take the legacy dependencies, and the | ||
* `setup` method gets it from enclosure */ | ||
export function reportingPluginFactory( |
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 made this factory function to accept parameters that can not directly be passed into the ReportingPlugin
constructor and setup method.
I had to come up with this solution, because the guidance from the Migration guide had outdated info:
/* this is not possible if the Plugin class extends the core plugin class:
* the setup method doesn't accept a 3rd parameter */
const demoSetup = new Plugin().setup(coreSetup, pluginsSetup, __LEGACY);
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.
We could make this type more permissive:
interface Plugin<...> {
setup(core: CoreSetup, plugins: TPluginsSetup, ...args: any[]): MaybePromise<TSetup>;
/* ... */
}
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.
(sorry, I'm a little late) I'm not a big fan of 'poluting' the Plugin
interface, as the additional parameters will not be able to actually be injected/used once the plugin is migrated and core
actually instantiate the plugin.
Maybe we could instead introduce a sub-interface for the migration period,
interface ShimedPlugin<
TSetup = void,
TStart = void,
TPluginsSetup extends object = object,
TPluginsStart extends object = object,
TLegacySetupDeps extends object = object
> extends Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart> {
setup(
core: CoreSetup,
plugins: TPluginsSetup,
legacy: TLegacySetupDeps
): TSetup | Promise<TSetup>;
}
@tsullivan The factory is a workaround that will do just fine however. Sorry for the outdated documentation
import { registerReportingUsageCollector } from './usage'; | ||
import { logConfiguration } from '../log_configuration'; | ||
|
||
// For now there is no exposed functionality to other plugins |
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.
In the near future, we will expose functionality to other plugins so they have an API to schedule reports of their data visualizations / CSV exports
https://github.com/elastic/kibana/pull/54198/files#r367683017 is interesting, otherwise LGTM |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* upstream/master: (24 commits) Show error page when accessing unavailable app (elastic#54656) [ML] Improving job wizards with datafeed aggregations (elastic#55180) remove flaly assetion. a license presence tested anyway (elastic#55289) fix commonly used ranges uptime (elastic#54930) [SIEM] Use proper icons on Detections view (elastic#55215) Fix: invalid translation referenced (elastic#54901) [State Management] Remove AppState from edit_index_pattern page (elastic#54104) Implements `getStartServices` on server-side (elastic#55156) Move vis_vega_type/data_model tests to jest (elastic#55186) [SIEM] [Detection Engine] Update status on rule details page (elastic#55201) Fix KQL value suggestions for nested fields (elastic#54820) Enforce camelCase format for a plugin id (elastic#53759) [SIEM] Detection engine cleanup for rule details/creation/edit page (elastic#55069) Remove nested root from index pattern (elastic#54978) [Reporting/Migration] ReportingSetup, LegacySetup (elastic#54198) [SIEM] [Detection Engine] Fixes duplicate rule action (elastic#55252) [SIEM] Detections add alert & signal tab (elastic#55127) Management API - redirect on disabled app path (elastic#55136) [SIEM][Detection Engine] Fixes critical regression on the backend with immutable and tags update local (elastic#55177) ...
* master: (108 commits) [ML] Single Metric Viewer: Fix job check. (elastic#55191) Show error page when accessing unavailable app (elastic#54656) [ML] Improving job wizards with datafeed aggregations (elastic#55180) remove flaly assetion. a license presence tested anyway (elastic#55289) fix commonly used ranges uptime (elastic#54930) [SIEM] Use proper icons on Detections view (elastic#55215) Fix: invalid translation referenced (elastic#54901) [State Management] Remove AppState from edit_index_pattern page (elastic#54104) Implements `getStartServices` on server-side (elastic#55156) Move vis_vega_type/data_model tests to jest (elastic#55186) [SIEM] [Detection Engine] Update status on rule details page (elastic#55201) Fix KQL value suggestions for nested fields (elastic#54820) Enforce camelCase format for a plugin id (elastic#53759) [SIEM] Detection engine cleanup for rule details/creation/edit page (elastic#55069) Remove nested root from index pattern (elastic#54978) [Reporting/Migration] ReportingSetup, LegacySetup (elastic#54198) [SIEM] [Detection Engine] Fixes duplicate rule action (elastic#55252) [SIEM] Detections add alert & signal tab (elastic#55127) Management API - redirect on disabled app path (elastic#55136) [SIEM][Detection Engine] Fixes critical regression on the backend with immutable and tags ...
* ReportingSetup, LegacySetup * fix ts
backport: #55441 |
Summary
This PR provides the plugin definition for the server-side of Reporting in terms of the core types of the Kibana new platform.
This takes migration progress to halfway through the migration guide. When this is merged, we will be ready for the "Switch to new platform services" section: https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md#switch-to-new-platform-services
#53898