Skip to content
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/FieldFormats] expose setFieldFormats and call from ReportingPlugin.start #56563

Merged
merged 7 commits into from
Feb 3, 2020

Conversation

tsullivan
Copy link
Member

Summary

Replaces:
This PR cleans up a problem where a "start" plugin had to be grabbed before ReportingPlugin.setup was called, so it organizes the code better for future "start" plugin migrations.

Replaces #56485

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@tsullivan tsullivan added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:NP Migration v7.7.0 labels Jan 31, 2020
@tsullivan tsullivan requested review from joelgriffith, lukeelmers, alexwizp and a team January 31, 2020 21:54
@tsullivan tsullivan requested a review from a team as a code owner January 31, 2020 21:54
@tsullivan tsullivan added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:AppArch labels Jan 31, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@tsullivan tsullivan self-assigned this Jan 31, 2020
Copy link
Contributor

@lizozom lizozom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't pulled to test, but looks LGTM
Added a couple of minor comments.

const coreSetup = server.newPlatform.setup.core;
const pluginInstance = plugin(server.newPlatform.coreContext as PluginInitializerContext);

await pluginInstance.setup(coreSetup, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have to await the result of setup?
The next stage awaits on the results of getStartServices anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do need a way to make sure that my plugin's start method would not be called before setup.

Soon in the plugin class there will be a private field referenced in setup and start, so I'd have a race condition if start was using the data before it is initialized in setup.

I don't have my mind settled yet on how to co-ordinate dependencies in setup and start, but I plan to have it outlined in an upcoming PR to provide more plugin dependencies to modules that aren't called from routes handlers. :)

@@ -68,35 +61,7 @@ export const reporting = (kibana: any) => {
},

async init(server: Legacy.Server) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this has to be async anymore

@lizozom lizozom mentioned this pull request Feb 2, 2020
7 tasks
@lizozom
Copy link
Contributor

lizozom commented Feb 3, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@tsullivan tsullivan merged commit ebb2989 into elastic:master Feb 3, 2020
@tsullivan tsullivan deleted the alexwizp-reporting branch February 3, 2020 21:33
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 4, 2020
* master: (42 commits)
  Move kuery_autocomplete ⇒ NP (elastic#56607)
  [ML] Functional tests - stabilize job row and analytics result view assertions (elastic#56595)
  [Discover] Inline angular directives only used in this plugin (elastic#56119)
  [Discover] Migrate get_sort.js test from mocha to TypeScript (elastic#56011)
  [SIEM] Enable flow_target_select_connected unit tests (elastic#55618)
  Start consuming np logging config (elastic#56480)
  [SIEM] Add eslint-plugin-react-perf (elastic#55960)
  Mention changed SAML ACS endpoint URL in breaking changes doc. (elastic#56613)
  Add `getServerInfo` API to http setup contract (elastic#56636)
  Updates Monitoring alert Jest snapshots
  Kibana property config migrations (elastic#55937)
  Vislib replacement toggle (elastic#56439)
  [Uptime] Add unit tests for QueryContext time calculation (elastic#56671)
  [SIEM][Detection Engine] Critical blocker, fixes pre-packaged rule miscounts
  Upgrade EUI to v18.3.0 (elastic#56228)
  [Maps] Fix server log (elastic#56679)
  [SIEM] Fixes FTUE when APM node is present (elastic#56574)
  [Reporting/FieldFormats] expose `setFieldFormats` and call from ReportingPlugin.start (elastic#56563)
  Update EMS API urls for production (elastic#56657)
  Ability to delete alerts even when AAD is out of sync (elastic#56543)
  ...
tsullivan added a commit to tsullivan/kibana that referenced this pull request Feb 5, 2020
…tingPlugin.start (elastic#56563)

* [Reporting] New Platform Migration

Part of elastic#53898

* fix CI

* fix typescript

Co-authored-by: Alexey Antonov <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
tsullivan added a commit that referenced this pull request Feb 5, 2020
…tingPlugin.start (#56563) (#56875)

* [Reporting] New Platform Migration

Part of #53898

* fix CI

* fix typescript

Co-authored-by: Alexey Antonov <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Alexey Antonov <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Feature:NP Migration release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants