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

Example plugins in X-Pack #63823

Merged
merged 6 commits into from
Apr 17, 2020
Merged

Example plugins in X-Pack #63823

merged 6 commits into from
Apr 17, 2020

Conversation

streamich
Copy link
Contributor

@streamich streamich commented Apr 17, 2020

Summary

This PR adds ability to add example plugins to X-Pack. Create your plugin in /x-pack/examples and stat Kibana with

yarn start --run-examples

Checklist

Delete any items that are not applicable to this PR.

For maintainers


Dev Docs

Kibana developers can now create example plugins in X-Pack—create your plugin in /x-pack/examples folder and stat Kibana with

yarn start --run-examples

@streamich streamich requested review from a team as code owners April 17, 2020 08:02
@streamich streamich added review Team:AppArch Team:Operations Team label for Operations Team Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.8.0 v8.0.0 labels Apr 17, 2020
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@streamich streamich requested a review from stacey-gammon April 17, 2020 08:03
@streamich streamich added the release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. label Apr 17, 2020
Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

LGTM for platform changes

src/core/server/config/env.ts Outdated Show resolved Hide resolved
Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

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

Operations team: LGTM

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / kibana-xpack-agent / X-Pack Endpoint Functional Tests.x-pack/test/functional_endpoint/apps/endpoint/host_list·ts.endpoint host list displays table data

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 6 times on tracked branches: https://github.com/elastic/kibana/issues/63621

[00:00:00]       │
[00:00:00]         └-: endpoint
[00:00:00]           └-> "before all" hook
[00:01:33]           └-: host list
[00:01:33]             └-> "before all" hook
[00:01:33]             └-> "before all" hook
[00:01:33]               │ info [endpoint/metadata/api_feature] Loading "mappings.json"
[00:01:33]               │ info [endpoint/metadata/api_feature] Loading "data.json"
[00:01:33]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1587133662375031234] applying create index request using v1 templates [{"metrics-endpoint":{"order":1,"index_patterns":["metrics-endpoint-*"],"settings":{"index":{"lifecycle":{"name":"metrics-default"},"codec":"best_compression","mapping":{"total_fields":{"limit":"10000"}},"refresh_interval":"5s","number_of_shards":"1","query":{"default_field":["message"]},"number_of_routing_shards":"30"}},"mappings":{"_doc":{"_meta":{"package":"foo"},"dynamic_templates":[{"strings_as_keyword":{"mapping":{"ignore_above":1024,"type":"keyword"},"match_mapping_type":"string"}}],"date_detection":false,"properties":{"agent":{"properties":{"name":{"ignore_above":1024,"type":"keyword"},"id":{"ignore_above":1024,"type":"keyword"},"version":{"ignore_above":1024,"type":"keyword"}}},"endpoint":{"properties":{"policy":{"type":"object"}}},"@timestamp":{"type":"date"},"ecs":{"properties":{"version":{"ignore_above":1024,"type":"keyword"}}},"stream":{"properties":{"namespace":{"type":"constant_keyword"},"type":{"type":"constant_keyword"},"dataset":{"type":"constant_keyword"}}},"elastic":{"properties":{"agent":{"type":"object"}}},"host":{"properties":{"hostname":{"ignore_above":1024,"type":"keyword"},"os":{"properties":{"name":{"ignore_above":1024,"type":"keyword"},"variant":{"ignore_above":1024,"type":"keyword"},"version":{"ignore_above":1024,"type":"keyword"},"full":{"ignore_above":1024,"type":"keyword"}}},"ip":{"type":"ip"},"id":{"ignore_above":1024,"type":"keyword"},"mac":{"ignore_above":1024,"type":"keyword"},"architecture":{"ignore_above":1024,"type":"keyword"}}},"event":{"properties":{"created":{"type":"date"}}}}}},"aliases":{}}}, {"metrics-settings":{"order":1,"index_patterns":["metrics-*-*"],"settings":{"index":{"lifecycle":{"name":"metrics-default"},"codec":"best_compression","refresh_interval":"5s","number_of_routing_shards":"30","number_of_shards":"1","query":{"default_field":["message"]}}},"mappings":{},"aliases":{}}}, {"metrics-mappings":{"order":1,"index_patterns":["metrics-*-*"],"settings":{},"mappings":{"_doc":{"_meta":{},"dynamic_templates":[{"strings_as_keyword":{"mapping":{"ignore_above":1024,"type":"keyword"},"match_mapping_type":"string"}}],"date_detection":false,"properties":{"agent":{"properties":{"hostname":{"ignore_above":1024,"type":"keyword"},"name":{"ignore_above":1024,"type":"keyword"},"id":{"ignore_above":1024,"type":"keyword"},"ephemeral_id":{"ignore_above":1024,"type":"keyword"},"type":{"ignore_above":1024,"type":"keyword"},"version":{"ignore_above":1024,"type":"keyword"}}},"@timestamp":{"type":"date"},"ecs":{"properties":{"version":{"ignore_above":1024,"type":"keyword"}}},"stream":{"properties":{"namespace":{"type":"constant_keyword"},"type":{"type":"constant_keyword"},"dataset":{"type":"constant_keyword"}}},"host":{"properties":{"hostname":{"ignore_above":1024,"type":"keyword"},"os":{"properties":{"build":{"ignore_above":1024,"type":"keyword"},"kernel":{"ignore_above":1024,"type":"keyword"},"codename":{"ignore_above":1024,"type":"keyword"},"name":{"ignore_above":1024,"type":"keyword"},"family":{"ignore_above":1024,"type":"keyword"},"version":{"ignore_above":1024,"type":"keyword"},"platform":{"ignore_above":1024,"type":"keyword"},"full":{"ignore_above":1024,"type":"keyword"}}},"ip":{"type":"ip"},"containerized":{"type":"boolean"},"name":{"ignore_above":1024,"type":"keyword"},"id":{"ignore_above":1024,"type":"keyword"},"type":{"ignore_above":1024,"type":"keyword"},"mac":{"ignore_above":1024,"type":"keyword"},"architecture":{"ignore_above":1024,"type":"keyword"}}}}}},"aliases":{}}}]
[00:01:33]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1587133662375031234] [metrics-endpoint-default-1] creating index, cause [api], templates [metrics-endpoint, metrics-settings, metrics-mappings], shards [1]/[1], mappings [_doc]
[00:01:33]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-16-tests-xl-1587133662375031234] moving index [metrics-endpoint-default-1] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [metrics-default]
[00:01:33]               │ info [endpoint/metadata/api_feature] Created index "metrics-endpoint-default-1"
[00:01:33]               │ debg [endpoint/metadata/api_feature] "metrics-endpoint-default-1" settings {"index":{"mapping":{"total_fields":{"limit":10000}},"refresh_interval":"5s"}}
[00:01:33]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-16-tests-xl-1587133662375031234] moving index [metrics-endpoint-default-1] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] in policy [metrics-default]
[00:01:33]               │ info [endpoint/metadata/api_feature] Indexed 9 docs into "metrics-endpoint-default-1"
[00:01:33]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-16-tests-xl-1587133662375031234] moving index [metrics-endpoint-default-1] from [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-follow-shard-tasks"}] in policy [metrics-default]
[00:01:33]               │ debg navigateToActualUrl http://localhost:6171/app/endpoint/hosts
[00:01:33]               │ debg browser[INFO] http://localhost:6171/app/endpoint/hosts?_t=1587138227959 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:01:33]               │
[00:01:33]               │ debg browser[INFO] http://localhost:6171/bundles/app/core/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:01:33]               │ debg currentUrl = http://localhost:6171/app/endpoint/hosts
[00:01:33]               │          appUrl = http://localhost:6171/app/endpoint/hosts
[00:01:33]               │ debg TestSubjects.find(kibanaChrome)
[00:01:33]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:01:38]               │ debg isGlobalLoadingIndicatorVisible
[00:01:38]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:01:38]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:01:38]               │ debg browser[INFO] http://localhost:6171/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-17T15:43:52Z
[00:01:38]               │        Adding connection to http://localhost:6171/elasticsearch
[00:01:38]               │
[00:01:38]               │      "
[00:01:38]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:01:38]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:01:38]             └-> finds title
[00:01:38]               └-> "before each" hook: global before each
[00:01:38]               │ debg TestSubjects.getVisibleText(hostListTitle)
[00:01:38]               │ debg TestSubjects.find(hostListTitle)
[00:01:38]               │ debg Find.findByCssSelector('[data-test-subj="hostListTitle"]') with timeout=10000
[00:01:38]               └- ✓ pass  (33ms) "endpoint host list finds title"
[00:01:38]             └-> displays table data
[00:01:38]               └-> "before each" hook: global before each
[00:01:38]               │ debg TestSubjects.exists(hostListTable)
[00:01:38]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="hostListTable"]') with timeout=2500
[00:01:38]               │ debg TestSubjects.find(hostListTable)
[00:01:38]               │ debg Find.findByCssSelector('[data-test-subj="hostListTable"]') with timeout=10000
[00:01:38]               │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/endpoint host list displays table data.png"
[00:01:38]               │ info Current URL is: http://localhost:6171/app/endpoint/hosts
[00:01:38]               │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/endpoint host list displays table data.html
[00:01:39]               └- ✖ fail: "endpoint host list displays table data"
[00:01:39]               │

Stack Trace

{ Error: expected [ [ 'Hostname',
    'Policy',
    'Policy Status',
    'Alerts',
    'Operating System',
    'IP Address',
    'Sensor Version',
    'Last Active' ],
  [ 'No items found' ] ] to sort of equal [ [ 'Hostname',
    'Policy',
    'Policy Status',
    'Alerts',
    'Operating System',
    'IP Address',
    'Sensor Version',
    'Last Active' ],
  [ 'cadmann-4.example.com',
    'Policy Name',
    'Policy Status',
    '0',
    'windows 10.0',
    '10.192.213.130, 10.70.28.129',
    'version',
    'xxxx' ],
  [ 'thurlow-9.example.com',
    'Policy Name',
    'Policy Status',
    '0',
    'windows 10.0',
    '10.46.229.234',
    'version',
    'xxxx' ],
  [ 'rezzani-7.example.com',
    'Policy Name',
    'Policy Status',
    '0',
    'windows 10.0',
    '10.101.149.26, 2606:a000:ffc0:39:11ef:37b9:3371:578c',
    'version',
    'xxxx' ] ]
    at Assertion.assert (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:244:8)
    at Context.it (test/functional_endpoint/apps/endpoint/host_list.ts:73:28)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  actual:
   '[\n  [\n    "Hostname"\n    "Policy"\n    "Policy Status"\n    "Alerts"\n    "Operating System"\n    "IP Address"\n    "Sensor Version"\n    "Last Active"\n  ]\n  [\n    "No items found"\n  ]\n]',
  expected:
   '[\n  [\n    "Hostname"\n    "Policy"\n    "Policy Status"\n    "Alerts"\n    "Operating System"\n    "IP Address"\n    "Sensor Version"\n    "Last Active"\n  ]\n  [\n    "cadmann-4.example.com"\n    "Policy Name"\n    "Policy Status"\n    "0"\n    "windows 10.0"\n    "10.192.213.130, 10.70.28.129"\n    "version"\n    "xxxx"\n  ]\n  [\n    "thurlow-9.example.com"\n    "Policy Name"\n    "Policy Status"\n    "0"\n    "windows 10.0"\n    "10.46.229.234"\n    "version"\n    "xxxx"\n  ]\n  [\n    "rezzani-7.example.com"\n    "Policy Name"\n    "Policy Status"\n    "0"\n    "windows 10.0"\n    "10.101.149.26, 2606:a000:ffc0:39:11ef:37b9:3371:578c"\n    "version"\n    "xxxx"\n  ]\n]',
  showDiff: true }

History

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

@streamich streamich merged commit b5762eb into elastic:master Apr 17, 2020
streamich added a commit that referenced this pull request Apr 18, 2020
* feat: 🎸 add example plugin ability to X-Pack

* style: 💄 spread array items from one array

* chore: 🤖 add x-pack/examples tsconfigs to global list

* fix: 🐛 don't import non-existing plugin

* fix: 🐛 fix TypeScript error

* test: 💍 update Jest snapshot
jloleysens added a commit to jloleysens/kibana that referenced this pull request Apr 20, 2020
…bana into ingest-node-pipelines/privileges

* 'feature/ingest-node-pipelines' of github.com:elastic/kibana: (126 commits)
  [SEARCH] Cleanup fetch soon (elastic#63320)
  skip flaky suite (elastic#58692)
  [Uptime] Refresh index and also show more info to user regardi… (elastic#62606)
  [Drilldowns] Fix back button by removing panels from url in dashboard in view mode (elastic#62415)
  [platform] serve plugins from /bundles/plugin:${id}
  [Alerting] Documentation for how to pre-configure connectors. (elastic#63807)
  skip flaky suite (elastic#63621)
  Revert "skip flaky suite (elastic#63747)"
  skip flaky suite (elastic#63747)
  [SIEM][Detections Engine] - Update rule.lists to be rule.exceptions_list (elastic#63717)
  [SIEM] Flaky test fix: Bump find_statuses timeout (elastic#63900)
  [Uptime] Add cert API request and runtime type checking (elastic#63062)
  [Lens] Allow table to scroll horizontally (elastic#63805)
  [Metrics UI] Allow users to create alerts from the central Alerts UI (elastic#63803)
  Migrate legacy maps licensing (x-pack/tilemap) to NP (elastic#63539)
  [Alerting] "Create alert" and alert list design improvements (elastic#63515)
  [Lens] Fix existence for dotted paths in _source (elastic#63752)
  Example plugins in X-Pack (elastic#63823)
  [ML] Migrate Mocha unit tests to Jest: migrate job utils and query utils tests (elastic#63775)
  Endpoint: middleware receive immutable versions of state and actions (elastic#63802)
  ...
jloleysens added a commit to jloleysens/kibana that referenced this pull request Apr 20, 2020
…bana into pipeline-editor-part-mvp-2

* 'feature/ingest-node-pipelines' of github.com:elastic/kibana: (127 commits)
  [Ingest pipelines] Polish details panel and empty list (elastic#63926)
  [SEARCH] Cleanup fetch soon (elastic#63320)
  skip flaky suite (elastic#58692)
  [Uptime] Refresh index and also show more info to user regardi… (elastic#62606)
  [Drilldowns] Fix back button by removing panels from url in dashboard in view mode (elastic#62415)
  [platform] serve plugins from /bundles/plugin:${id}
  [Alerting] Documentation for how to pre-configure connectors. (elastic#63807)
  skip flaky suite (elastic#63621)
  Revert "skip flaky suite (elastic#63747)"
  skip flaky suite (elastic#63747)
  [SIEM][Detections Engine] - Update rule.lists to be rule.exceptions_list (elastic#63717)
  [SIEM] Flaky test fix: Bump find_statuses timeout (elastic#63900)
  [Uptime] Add cert API request and runtime type checking (elastic#63062)
  [Lens] Allow table to scroll horizontally (elastic#63805)
  [Metrics UI] Allow users to create alerts from the central Alerts UI (elastic#63803)
  Migrate legacy maps licensing (x-pack/tilemap) to NP (elastic#63539)
  [Alerting] "Create alert" and alert list design improvements (elastic#63515)
  [Lens] Fix existence for dotted paths in _source (elastic#63752)
  Example plugins in X-Pack (elastic#63823)
  [ML] Migrate Mocha unit tests to Jest: migrate job utils and query utils tests (elastic#63775)
  ...
@streamich streamich mentioned this pull request Apr 23, 2020
47 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. review Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Operations Team label for Operations Team v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants