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

Moved alerting plugin to new platform #57411

Conversation

YulNaumenko
Copy link
Contributor

@YulNaumenko YulNaumenko commented Feb 12, 2020

Summary

Migrates the Alerting plugin from Legacy on to the Kibana Platform.
Closes #51652

Checklist

For maintainers

@YulNaumenko YulNaumenko requested a review from a team as a code owner February 12, 2020 04:45
@YulNaumenko YulNaumenko self-assigned this Feb 12, 2020
…rate-to-kibana-platform

# Conflicts:
#	.github/CODEOWNERS
#	x-pack/legacy/plugins/alerting/common/alert.ts
#	x-pack/legacy/plugins/alerting/common/types.ts
#	x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.ts
#	x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules.ts
#	x-pack/plugins/alerting/common/types.ts
#	x-pack/plugins/alerting/server/alerts_client.ts
#	x-pack/plugins/alerting/server/task_runner/alert_task_instance.ts
#	x-pack/plugins/alerting/server/types.ts
@YulNaumenko YulNaumenko added release_note:skip Skip the PR/issue when compiling release notes Feature:Alerting v7.7.0 v8.0.0 Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Feb 12, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@gmmorris
Copy link
Contributor

I know this is going to be a little painful to fix now, but I think the moving of the files should be done using git mv rather than just moving them manually.
This way git can preserve the history of the file by marking the move as a rename.
Moving manually makes it look like lots of files were deleted and lots of file were added (with no commit history).

The value of keeping the history is that you can follow a commit back to its original PR and from there to its original Issue and discussion. We should prioritise keeping these if we can.

Sorry Yul 😬

@kibanamachine
Copy link
Contributor

💔 Build Failed


Test Failures

Kibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/home_page·ts.Actions and Triggers app Home page Alerts tab navigates to an alert details page

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:00:00]         └-: Actions and Triggers app
[00:00:00]           └-> "before all" hook
[00:00:00]           └-: Home page
[00:00:00]             └-> "before all" hook
[00:00:00]             └-> "before all" hook
[00:00:00]               │ debg navigating to triggersActions url: http://localhost:6141/app/kibana#/management/kibana/triggersActions
[00:00:00]               │ debg Navigate to: http://localhost:6141/app/kibana#/management/kibana/triggersActions
[00:00:00]               │ debg ... sleep(700) start
[00:00:00]               │ debg browser[INFO] http://localhost:6141/login?next=%2Fapp%2Fkibana%3F_t%3D1581570829840#/management/kibana/triggersActions 350 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:00:00]               │
[00:00:00]               │ debg browser[INFO] http://localhost:6141/bundles/app/login/bootstrap.js 8:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:00]               │ debg ... sleep(700) end
[00:00:00]               │ debg returned from get, calling refresh
[00:00:01]               │ debg browser[INFO] http://localhost:6141/login?next=%2Fapp%2Fkibana%3F_t%3D1581570829840#/management/kibana/triggersActions 350 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:00:01]               │
[00:00:01]               │ debg browser[INFO] http://localhost:6141/bundles/app/login/bootstrap.js 8:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:01]               │ debg currentUrl = http://localhost:6141/login?next=%2Fapp%2Fkibana%3F_t%3D1581570829840#/management/kibana/triggersActions
[00:00:01]               │          appUrl = http://localhost:6141/app/kibana#/management/kibana/triggersActions
[00:00:01]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:00:05]               │ debg browser[INFO] http://localhost:6141/built_assets/dlls/vendors_3.bundle.dll.js 582:139970 "INFO: 2020-02-13T05:13:54Z
[00:00:05]               │        Adding connection to http://localhost:6141/elasticsearch
[00:00:05]               │
[00:00:05]               │      "
[00:00:05]               │ debg Found login page.  Logging in with username = elastic
[00:00:05]               │ debg TestSubjects.setValue(loginUsername, elastic)
[00:00:05]               │ debg TestSubjects.click(loginUsername)
[00:00:05]               │ debg Find.clickByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:00:05]               │ debg Find.findByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:00:05]               │ debg TestSubjects.setValue(loginPassword, changeme)
[00:00:05]               │ debg TestSubjects.click(loginPassword)
[00:00:05]               │ debg Find.clickByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:00:05]               │ debg Find.findByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:00:06]               │ debg TestSubjects.click(loginSubmit)
[00:00:06]               │ debg Find.clickByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:00:06]               │ debg Find.findByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:00:06]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"] nav:not(.ng-hide)') with timeout=20000
[00:00:06]               │ debg browser[INFO] http://localhost:6141/app/kibana?_t=1581570829840#/management/kibana/triggersActions 350 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:00:06]               │
[00:00:06]               │ debg browser[INFO] http://localhost:6141/bundles/app/kibana/bootstrap.js 8:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:09]               │ debg browser[INFO] http://localhost:6141/built_assets/dlls/vendors_3.bundle.dll.js 582:139970 "INFO: 2020-02-13T05:13:58Z
[00:00:09]               │        Adding connection to http://localhost:6141/elasticsearch
[00:00:09]               │
[00:00:09]               │      "
[00:00:11]               │ debg browser[INFO] http://localhost:6141/app/kibana?_t=1581570841148#/management/kibana/triggersActions 350 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:00:11]               │
[00:00:11]               │ debg browser[INFO] http://localhost:6141/bundles/app/kibana/bootstrap.js 8:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:11]               │ debg Finished login process currentUrl = http://localhost:6141/app/kibana#/management/kibana/triggersActions
[00:00:11]               │ debg TestSubjects.find(kibanaChrome)
[00:00:11]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=10000
[00:00:13]               │ debg browser[INFO] http://localhost:6141/built_assets/dlls/vendors_3.bundle.dll.js 582:139970 "INFO: 2020-02-13T05:14:03Z
[00:00:13]               │        Adding connection to http://localhost:6141/elasticsearch
[00:00:13]               │
[00:00:13]               │      "
[00:00:14]               │ debg ... sleep(501) start
[00:00:15]               │ debg ... sleep(501) end
[00:00:15]               │ debg in navigateTo url = http://localhost:6141/app/kibana#/management/kibana/triggersActions/alerts
[00:00:15]               │ debg TestSubjects.exists(statusPageContainer)
[00:00:15]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:00:17]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:00:18]             └-> Loads the app
[00:00:18]               └-> "before each" hook: global before each
[00:00:18]               │ debg Checking for section heading to say Triggers and Actions.
[00:00:18]               │ debg TestSubjects.getVisibleText(appTitle)
[00:00:18]               │ debg TestSubjects.find(appTitle)
[00:00:18]               │ debg Find.findByCssSelector('[data-test-subj="appTitle"]') with timeout=10000
[00:00:18]               └- ✓ pass  (30ms) "Actions and Triggers app Home page Loads the app"
[00:00:18]             └-: Connectors tab
[00:00:18]               └-> "before all" hook
[00:00:20]             └-: Alerts tab
[00:00:20]               └-> "before all" hook
[00:00:20]               └-> renders the alerts tab
[00:00:20]                 └-> "before each" hook: global before each
[00:00:20]                 │ debg TestSubjects.click(alertsTab)
[00:00:20]                 │ debg Find.clickByCssSelector('[data-test-subj="alertsTab"]') with timeout=10000
[00:00:20]                 │ debg Find.findByCssSelector('[data-test-subj="alertsTab"]') with timeout=10000
[00:00:20]                 │ debg isGlobalLoadingIndicatorVisible
[00:00:20]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:00:20]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:00:22]                 │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:00:22]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:00:22]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:00:22]                 │ debg TestSubjects.exists(alertsList)
[00:00:22]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="alertsList"]') with timeout=120000
[00:00:22]                 └- ✓ pass  (2.1s) "Actions and Triggers app Home page Alerts tab renders the alerts tab"
[00:00:22]               └-> navigates to an alert details page
[00:00:22]                 └-> "before each" hook: global before each
[00:00:22]                 │ debg creating action server-log-1581570852539
[00:00:23]                 │ debg created action ee1737e5-50f1-41d8-b090-47131eadf6e3
[00:00:23]                 │ debg creating alert test-alert-1581570852831
[00:00:23]                 │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/Actions and Triggers app Home page Alerts tab navigates to an alert details page.png"
[00:00:23]                 │ info Current URL is: http://localhost:6141/app/kibana#/management/kibana/triggersActions/alerts
[00:00:23]                 │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/Actions and Triggers app Home page Alerts tab navigates to an alert details page.html
[00:00:23]                 └- ✖ fail: "Actions and Triggers app Home page Alerts tab navigates to an alert details page"
[00:00:23]                 │

Stack Trace

Error: Expected status code of 200, received 400 Bad Request: { statusCode: 400,
  error: 'Bad Request',
  message:
   '[request body.actions.0.actionTypeId]: expected value of type [string] but got [undefined]' }
    at Alerts.createAlwaysFiringWithActions (test/functional_with_es_ssl/services/alerting/alerts.ts:48:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Kibana Pipeline / kibana-xpack-agent / X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/spaces_only/tests/alerting/create·ts.alerting api integration spaces only Alerting create should handle create alert request appropriately

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:00:00]         └-: alerting api integration spaces only
[00:00:00]           └-> "before all" hook
[00:00:00]           └-> "before all" hook
[00:00:00]             │ debg creating space
[00:00:00]             │ debg created space
[00:00:00]             │ debg creating space
[00:00:01]             │ debg created space
[00:00:37]           └-: Alerting
[00:00:37]             └-> "before all" hook
[00:00:37]             └-: create
[00:00:37]               └-> "before all" hook
[00:00:37]               └-> should handle create alert request appropriately
[00:00:37]                 └-> "before each" hook: global before each
[00:00:38]                 └- ✖ fail: "alerting api integration spaces only Alerting create should handle create alert request appropriately"
[00:00:38]                 │

Stack Trace

{ Error: expected 400 to sort of equal 200
    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/alerting_api_integration/spaces_only/tests/alerting/create.ts:56:38) actual: '400', expected: '200', showDiff: true }

Kibana Pipeline / kibana-xpack-agent / X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/spaces_only/tests/alerting/create·ts.alerting api integration spaces only Alerting create should handle create alert request appropriately

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:00:00]         └-: alerting api integration spaces only
[00:00:00]           └-> "before all" hook
[00:00:00]           └-> "before all" hook
[00:00:00]             │ debg creating space
[00:00:00]             │ debg created space
[00:00:00]             │ debg creating space
[00:00:01]             │ debg created space
[00:00:37]           └-: Alerting
[00:00:37]             └-> "before all" hook
[00:00:37]             └-: create
[00:00:37]               └-> "before all" hook
[00:00:37]               └-> should handle create alert request appropriately
[00:00:37]                 └-> "before each" hook: global before each
[00:00:38]                 └- ✖ fail: "alerting api integration spaces only Alerting create should handle create alert request appropriately"
[00:00:38]                 │

Stack Trace

{ Error: expected 400 to sort of equal 200
    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/alerting_api_integration/spaces_only/tests/alerting/create.ts:56:38) actual: '400', expected: '200', showDiff: true }

History

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

@pmuellr
Copy link
Member

pmuellr commented Feb 13, 2020

I think the moving of the files should be done using git mv rather than just moving them manually

I thought git was pretty smart about this. I guess it's only semi-smart - I see a mixture of delete/add's for files, as well as "File renamed without changes". Sigh.

There's probably a simple way to fix this. Something like:

  • in this branch, make a copy of the new x-pack/plugins/alerting directory somewhere else
  • create a new branch of latest master, to replace this branch
  • in that branch, do a git mv x-pack/legacy/plugins/alerting x-pack/plugins/alerting or whatever
  • now copy over the directory created in the first step
  • doesn't deal with the files not in our plugins directory tho

@YulNaumenko
Copy link
Contributor Author

I know this is going to be a little painful to fix now, but I think the moving of the files should be done using git mv rather than just moving them manually.
This way git can preserve the history of the file by marking the move as a rename.
Moving manually makes it look like lots of files were deleted and lots of file were added (with no commit history).

The value of keeping the history is that you can follow a commit back to its original PR and from there to its original Issue and discussion. We should prioritise keeping these if we can.

Sorry Yul 😬

Didn't know about this, but no problem - I will fix it. Thanks for catching up this issue!

@YulNaumenko YulNaumenko deleted the alerts-plugin-migrate-to-kibana-platform branch February 13, 2020 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate alerting plugin to New Platform
5 participants