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

Goodbye, legacy data plugin 👋 #60449

Merged
merged 5 commits into from
Mar 23, 2020
Merged

Conversation

lukeelmers
Copy link
Member

@lukeelmers lukeelmers commented Mar 17, 2020

Well. It's been real. It's been fun. But it hasn't been real fun. 😉

With #59044 recently merging, there is no longer any code left in the legacy data "shim" plugin: src/legacy/core_plugins/data. This PR officially removes the remaining boilerplate, as well as a few references to it that were lingering around the repo.

Moving forward, folks can find everything they need in the new platform plugin: src/plugins/data

Dev docs

The legacy data plugin located in src/legacy/core_plugins/data has been removed. This change only affects legacy platform plugins which are either:

  1. Importing the public/setup or public/legacy "shim" files from the legacy data plugin to access runtime contracts; or
  2. importing static code from inside src/legacy/core_plugins/data; or
  3. explicitly using require: ['data'] in the plugin definition.

For scenario 1 above, you should migrate your plugin to access the services you need from the new platform data plugin. These are accessible in the legacy world by using ui/new_platform:

- import { start as dataStart } from 'src/legacy/core_plugins/data/public/legacy';
+ import { npStart } from 'ui/new_platform';
+ const dataStart = npStart.plugins.data;

For scenario 2, the equivalent static code you've been importing should now be available from src/plugins/data, in the server or public directories:

- import { someStaticUtilOrType } from 'src/legacy/core_plugins/data/public';
+ import { someStaticUtilOrType } from 'src/plugins/data/public';

For scenario 3, you should be able to safely drop the reference to the plugin, and add data to your list of dependencies in kibana.json whenever your plugin migrates to the new Kibana platform:

// index.ts
const myPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) =>
  new Plugin({
    id: 'my_plugin',
-    require: ['kibana', 'elasticsearch', 'visualizations', 'data'],
+    require: ['kibana', 'elasticsearch', 'visualizations'],
    ...,
  })
);

For more information on where to locate new platform data services, please refer to the table of plugins for shared application services in src/core/MIGRATION.md.

@lukeelmers lukeelmers added review chore release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. v8.0.0 Team:AppArch Feature:NP Migration v7.7.0 labels Mar 17, 2020
@lukeelmers lukeelmers requested a review from a team March 17, 2020 21:50
@lukeelmers lukeelmers self-assigned this Mar 17, 2020
@elasticmachine
Copy link
Contributor

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

@lukeelmers lukeelmers requested a review from a team March 17, 2020 21:51
Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

KibanaApp files LGTM, goodbye data plugin, it was a pleasure 😢 . Chrome also want's to say: bye

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.

LGTM!!!

@lizozom
Copy link
Contributor

lizozom commented Mar 23, 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

@lukeelmers lukeelmers merged commit 3401ae4 into elastic:master Mar 23, 2020
@lukeelmers lukeelmers deleted the delete-data branch March 23, 2020 15:17
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Mar 23, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 23, 2020
* master:
  Fix formatter on range aggregation (elastic#58651)
  Goodbye, legacy data plugin 👋 (elastic#60449)
  [Metrics UI] Alerting for metrics explorer and inventory (elastic#58779)
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 23, 2020
* master: (26 commits)
  [Alerting] Fixes flaky test in Alert Instances Details page (elastic#60893)
  cleanup visualizations api (elastic#59958)
  Inline timezoneProvider function, remove ui/vis/lib/timezone  (elastic#60475)
  [SIEM] Adds 'Open one signal' Cypress test (elastic#60484)
  [UA] Upgrade assistant migration meta data can become stale (elastic#60789)
  [Metrics Alerts] Remove metric field from doc count on backend (elastic#60679)
  [Uptime] Skip failing location test temporarily (elastic#60938)
  [ML] Disabling datafeed editing when job is running (elastic#60751)
  Adding `authc.invalidateAPIKeyAsInternalUser` (elastic#60717)
  [SIEM] Add license check to ML Rule form (elastic#60691)
  Adding `authc.grantAPIKeyAsInternalUser`  (elastic#60423)
  Support Histogram Data Type (elastic#59387)
  [Upgrade Assistant] Fix edge case where reindex op can falsely be seen as stale (elastic#60770)
  [SIEM] [Cases] Update case icons (elastic#60812)
  [TSVB] Fix percentiles band mode (elastic#60741)
  Fix formatter on range aggregation (elastic#58651)
  Goodbye, legacy data plugin 👋 (elastic#60449)
  [Metrics UI] Alerting for metrics explorer and inventory (elastic#58779)
  [Remote clustersadopt changes to remote info API (elastic#60795)
  Only run xpack siem cypress in PRs when there are siem changes (elastic#60661)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:NP Migration release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. review v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants