elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.73k stars 8.14k forks source link

[Reporting] New Platform Migration #53898

Closed tsullivan closed 4 years ago

tsullivan commented 4 years ago

Describe the feature: The Kibana Reporting plugin code needs to be migrated to the New Platform interface.

The Reporting plugin definition in NP will share a contract with other plugins that will allow them to pass a Kibana URL and some options to a function and receive an observable that resolves to a PNG payload of the screenshot. This was already possible in the legacy Reporting code, but the interface to the screenshot observable is cumbersome and undocumented.

Tasks:

Concerns:

elasticmachine commented 4 years ago

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

rudolf commented 4 years ago

Should we detect ES connection health to influence how we poll for pending jobs? #18297

NP will expose status for it's sub-services like elasticsearch in a similar way to what Legacy did (using an observable instead of a event emitter) we're tracking the work here https://github.com/elastic/kibana/issues/41983 I've updated the issue description with this as a blocker.

rudolf commented 4 years ago

Test that spawns a Hapi server needs to be re-written

We've created https://github.com/elastic/kibana/issues/51150 for making it easier to test controllers by mocking their dependencies like what you're doing in these tests.

tsullivan commented 4 years ago

We don't need middleware to do what we're currently doing with middleware. We can just as easily make a route handler wrapper that runs the auth checks needed for the custom Reporting authentication model. Resolved in https://github.com/elastic/kibana/pull/54082#discussion_r369291285

tsullivan commented 4 years ago

We use config.set on the server side in some places to update to a configuration that will work with Reporting. We always log a warning and explain how to update the configuration and silence the warning. Will this be possible in the New Platform?

We'll handle this by refactoring Reporting's usage of config. A createConfig$ function will invoke dynamic changes to the set configuration before it touches the application

tsullivan commented 4 years ago

New Platform license checking service provides an observable. Do all the parts of the Reporting code that depend on license status need to subscribe to that observable? It is unclear how this works in the legacy Reporting code

It looks like a few plugins in are now implementing license checks in the New Platform. I think we'll be able to find a solution based on example.

tsullivan commented 4 years ago

(updated description)

mshustov commented 4 years ago

Could you switch to elasticsearch client & licensing plugin API exposed from start contract when migrating the shim to the Kibana Platform? We are deprecating elasticsearch API exposed from setup contract. We are depreciating async lifecycles as well. It means runValidations should be moved to the setup and transformed into unblocking operations.