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

Migrate status page app to core #72017

Merged
merged 26 commits into from
Jul 23, 2020

Conversation

pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented Jul 16, 2020

Summary

Fix #67979

Checklist

@pgayvallet
Copy link
Contributor Author

@spalger @mistic so, it seems that #72096 is not the only issue regarding removing the last legacy plugin having client-side code.

Totally removing the legacy status_page plugin causes 'unrelated' CI failures: https://github.com/elastic/kibana/pull/72017/checks?check_run_id=888730185. Adding it back (7bdc3c2) actually turn the PR green again. (This can also be reproduced on master by creating a PR that just removes the legacy status_page plugin)

Looking at one of the failures, bundle compression returns gzip files when no brotli version exists

it('returns gzip files when no brotli version exists', () =>
supertest
.get(`/${buildNum}/bundles/light_theme.style.css`) // legacy optimizer does not create brotli outputs
.set('Accept-Encoding', 'gzip, br')
.expect(200)
.expect('Content-Encoding', 'gzip'));
});

is performing an http call to /${buildNum}/bundles/light_theme.style.css, which is a file generated by the legacy optimizer, and which is no longer present when the last legacy plugin is removed.

Even stranger is that these failures are not present when running the FTR suite on local using the FTR test server, and are only present on the CI, so it must be present only on the production build.

Would one of you mind taking a look? I guess the theme css files generation should now be moved to the KP optimizer instead? Maybe there more than that.

@pgayvallet pgayvallet added release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v8.0.0 Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Jul 20, 2020
@spalger
Copy link
Contributor

spalger commented Jul 20, 2020

Yeah, looked at the linked failures and one of them is a flaky test #71056 and the other just seems like a redundant test covered by the unit tests, and we don't have a good way to functionally test it so I think it's fine to remove the returns gzip files when no brotli version exists test.

@pgayvallet
Copy link
Contributor Author

After a slack discussion with @spalger, the removal of the status_page plugin, as the last legacy plugin having UI code, is tightly coupled with the removal of the legacy optimizer, which is why we decided to keep 7bdc3c2 in the PR to keep things isolated. Once the legacy optimizer is definitely removed, we should just open a new PR to revert the changes of this specific commit.

Comment on lines +75 to +76
mount(params: AppMountParameters) {
return renderStatusApp(params, { http, notifications });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We choose to not use async import for the error app, so I think it makes sense to do the same for the status page.

return null;
}
return (
<EuiBasicTable<FormattedStatus>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TIL you can specify generics of react components in tsx.

Comment on lines +65 to +70
async (context, request, response) => {
if (anonymousStatusPage) {
return response.renderAnonymousCoreApp();
} else {
return response.renderCoreApp();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: the legacy status_page was returned with a status of 503 if the server status wasn't green, but

  • we can't reproduce this behavior until the server-side API is moved to KP
  • we don't have a way to return custom http status code using the httpResources API, and even less error codes.

Copy link
Contributor

Choose a reason for hiding this comment

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

we don't have a way to return custom http status code using the httpResources API, and even less error codes.

Should we create an issue to add this functionality and refactor the status page later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created #72831 and added the point to #41983

@@ -17,23 +17,36 @@
* under the License.
*/

import { Plugin, CoreSetup } from 'kibana/public';
import type { OpsMetrics } from '../server/metrics';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm importing from server into types here to avoid moving all the types from core/server/metrics to core/types. As it's an import type statement, I guess this is alright?

Comment on lines 21 to 26
return new kibana.Plugin({
uiExports: {
app: {
title: 'Server Status',
title: 'Old Server Status',
main: 'plugins/status_page/status_page',
hidden: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As explained in the comments, the status_page plugin is the last legacy plugin with UI. removing it totally causes issues with the legacy optimizer no longer generating some files. The legacy plugin will have to be totally removed after we remove the legacy optimizer.

Comment on lines 207 to +208
try {
if (kbnServer.status.isGreen()) {
return await h.renderApp(app);
} else {
return await h.renderStatusPage();
}
return await h.renderApp(app);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This block was mostly broken since we moved the ES service and status check to KP, as we are awaiting for ES to be ready before starting up the plugins. Only situation it would properly work is if the server status would change from green to red after initialization.
As this part (auto 503 handling) is another step of #41983, and as we can't easily render the status page from legacy h helper anyway, I think this change is alright for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

This block was mostly broken since we moved the ES service and status check to KP, as we are awaiting for ES to be ready before starting up the plugins.

we could serve status page with NotReadyServer while waiting for ES service to be ready

path: '/{p*}',
method: '*',
handler: (req, responseToolkit) => {
this.log.debug(`Kibana server is not ready yet ${req.method}:${req.url.href}.`);
// If server is not ready yet, because plugins or core can perform
// long running tasks (build assets, saved objects migrations etc.)
// we should let client know that and ask to retry after 30 seconds.
return responseToolkit
.response('Kibana server is not ready yet')
.code(503)
.header('Retry-After', '30');
},
});
await this.notReadyServer.start();

That's optional suggestion and not a blocker for the current PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, we do want to do that, however this is far from trivial from what I saw:

We are going to have a cyclic dependency issue doing so, as this notReadyServer is within the http service, and we gonna need to use the httpResources, or at least the rendering service to send the correct response. We could expose something like an internal registerNotReadyRoute or something to work-around this issue.

Second point, this will not work until we migrate the server-side status endpoints to core, as atm the endpoints needed by the page are in a legacy plugin, so the routes are not mounted until the end of core's start phase. Even when migrated, we would need to register these routes to the notReadyServer too, for them to be available during the setup phase.

Follow-up of previous point, the notReadyServer is currently a 'raw' HAPI server, so not directly compatible with our route registrations API. We would need to adapt the server to be compatible, or adapt the routes.

I added a point in #41983 and linked it to this discussion.

@pgayvallet pgayvallet marked this pull request as ready for review July 21, 2020 09:30
@pgayvallet pgayvallet requested a review from a team as a code owner July 21, 2020 09:30
@elasticmachine
Copy link
Contributor

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

@pgayvallet pgayvallet added the Feature:Legacy Removal Issues related to removing legacy Kibana label Jul 21, 2020
@apmmachine
Copy link
Contributor

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #72017 updated]

  • Start Time: 2020-07-21T11:35:58.503+0000

  • Duration: 5 min 16 sec

@@ -58,6 +62,7 @@ export class StatusService implements CoreService<InternalStatusServiceSetup> {
return {
core$,
overall$,
isStatusPageAnonymous: () => statusConfig.allowAnonymous,
Copy link
Contributor

@mshustov mshustov Jul 22, 2020

Choose a reason for hiding this comment

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

That's a bummer that we cannot use exposeToBrowser for the platform code. Should I create an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I don't like what I had to do to mimic the same behavior...

await retry.tryForTime(6000, async () => {
const text = await testSubjects.getVisibleText('statusBreakdown');
expect(text.indexOf('plugin:kibana')).to.be.above(-1);
});
});

it('should show the build hash and number', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we add tests for an anonymous user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We would need to add an x-pack suite for that, as the current suite is running on OSS. Should I do so?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would add it. Config is a public API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nm, there is already one:

it('allows user to navigate without authentication', async () => {
await PageObjects.security.forceLogout();
await PageObjects.statusPage.navigateToPage();
await PageObjects.statusPage.expectStatusPage();
});

Copy link
Contributor Author

@pgayvallet pgayvallet Jul 22, 2020

Choose a reason for hiding this comment

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

I can add a similar test when status.allowAnonymous is false, but that would require to create a specific test suite to start the server with the correct option. Either that, or I can just add a unit test for src/core/server/core_app/core_app.ts to ensure the route is declared with correct options depending on the configuration value. wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Either that, or I can just add a unit test for src/core/server/core_app/core_app.ts to ensure the route is declared with correct options depending on the configuration value. wdyt?

👍

Comment on lines +65 to +70
async (context, request, response) => {
if (anonymousStatusPage) {
return response.renderAnonymousCoreApp();
} else {
return response.renderCoreApp();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't have a way to return custom http status code using the httpResources API, and even less error codes.

Should we create an issue to add this functionality and refactor the status page later?


try {
response = await http.get('/api/status', {
credentials: 'same-origin',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it required? It seems to be the default value. https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials

name: i18n.translate('core.statusPage.metricsTiles.columns.heapTotalHeader', {
defaultMessage: 'Heap total',
}),
value: get(data.metrics, 'process.memory.heap.size_limit'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove get as we have proper typings?

get(data.metrics, 'os.load.5m'),
get(data.metrics, 'os.load.15m'),
],
type: 'float',
Copy link
Contributor

Choose a reason for hiding this comment

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

formatNumber doesn't have float branch

src/core/public/core_app/status/lib/format_number.ts Outdated Show resolved Hide resolved
path: '/status',
validate: false,
options: {
authRequired: !anonymousStatusPage,
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the same as 'optional'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it is. Depending on the config value of status.allowAnonymous, the app is, or not, accessible to non-logged users.

return {
isStatusPageAnonymous: server.config().get('status.allowAnonymous'),
};
url: '/old-status',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to land on it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, by manually typing the path in the browser, it unfortunately is. Not sure how to not break the legacy optimizer without exposing the app, and the url is mandatory...

Maybe I should change the path to something a little scarier, like __deprecated__/status?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine to keep it. We are about to remove it soon.

});

if (injectedMetadata.getAnonymousStatusPage()) {
http.anonymousPaths.register('/status');
Copy link
Contributor

Choose a reason for hiding this comment

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

You cannot navigate to the other Kibana pages from other anonymous pages without reloading. It creates a bug when status.allowAnonymous: true and you logged-in user lands on the /status page and navigates to other pages. result: SecurityNavControl is not rendered.
2020-07-22_10-50-55
As a workaround, we could make status page chromeless to enforce page reloading.
Is it possible to land on the /status page from a link in Kibana UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You cannot navigate to the other Kibana pages from other anonymous pages without reloading. It creates a bug when status.allowAnonymous: true and you logged-in user lands on the /status page and navigates to other pages. result: SecurityNavControl is not rendered.

Hum. This indeed is an issue. We really need to have a way to know about anonymous vs logged-in apps from core, to be able to automatically performs that kind of reload when using navigateToApp between anon/logged or logged/anon apps. Do you know if we have an issue for that?

As a workaround, we could make status page chromeless to enforce page reloading.

chromeless apps do not really force page reloading, but I guess hiding the chrome navigation will remove any way for the user to navigate away from the status page using the UI. do you think it would be sufficient?

Is it possible to land on the /status page from a link in Kibana UI?

Not that I'm aware of. The app is hidden and there is no link to it anywhere in chrome.

Copy link
Contributor

Choose a reason for hiding this comment

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

but I guess hiding the chrome navigation will remove any way for the user to navigate away from the status page using the UI.

that was my reasoning as well. I think it's okay since the user navigates to the /status page manually.

Hum. This indeed is an issue. We really need to have a way to know about anonymous vs logged-in apps from core, to be able to automatically performs that kind of reload when using navigateToApp between anon/logged or logged/anon apps. Do you know if we have an issue for that?

I'm not aware of any.

@pgayvallet pgayvallet mentioned this pull request Jul 23, 2020
14 tasks
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / kibana-xpack-agent / X-Pack Accessibility Tests.x-pack/test/accessibility/apps/uptime·ts.uptime settings page

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:01:56]         └-: uptime
[00:01:56]           └-> "before all" hook
[00:01:56]           └-> "before all" hook
[00:01:56]             │ info [uptime/blank] Loading "mappings.json"
[00:01:56]             │ info [uptime/blank] Loading "data.json"
[00:01:56]             │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1595488879159322619] [heartbeat-8-generated-test] creating index, cause [api], templates [], shards [1]/[1]
[00:01:57]             │ info [uptime/blank] Created index "heartbeat-8-generated-test"
[00:01:57]             │ debg [uptime/blank] "heartbeat-8-generated-test" settings undefined
[00:01:57]           └-> overview page
[00:01:57]             └-> "before each" hook: global before each
[00:01:57]             └-> "before each" hook
[00:01:57]               │ debg TestSubjects.exists(uptimeSettingsToOverviewLink)
[00:01:57]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeSettingsToOverviewLink"]') with timeout=0
[00:01:57]               │ debg --- retry.tryForTime error: [data-test-subj="uptimeSettingsToOverviewLink"] is not displayed
[00:01:58]               │ debg TestSubjects.exists(uptimeOverviewPage)
[00:01:58]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverviewPage"]') with timeout=0
[00:01:58]               │ debg --- retry.tryForTime error: [data-test-subj="uptimeOverviewPage"] is not displayed
[00:01:58]               │ debg navigating to uptime url: http://localhost:61121/app/uptime
[00:01:58]               │ debg navigate to: http://localhost:61121/app/uptime
[00:01:59]               │ debg browser[INFO] http://localhost:61121/app/uptime?_t=1595491008803 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:59]               │
[00:01:59]               │ debg browser[INFO] http://localhost:61121/bundles/app/core/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:01:59]               │ debg ... sleep(700) start
[00:01:59]               │ debg ... sleep(700) end
[00:01:59]               │ debg returned from get, calling refresh
[00:02:00]               │ debg browser[INFO] http://localhost:61121/app/uptime?_t=1595491008803 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:02:00]               │
[00:02:00]               │ debg browser[INFO] http://localhost:61121/bundles/app/core/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:00]               │ debg currentUrl = http://localhost:61121/app/uptime
[00:02:00]               │          appUrl = http://localhost:61121/app/uptime
[00:02:00]               │ debg TestSubjects.find(kibanaChrome)
[00:02:00]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:02:02]               │ debg browser[INFO] http://localhost:61121/35062/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 452:106112 "INFO: 2020-07-23T07:56:51Z
[00:02:02]               │        Adding connection to http://localhost:61121/elasticsearch
[00:02:02]               │
[00:02:02]               │      "
[00:02:02]               │ debg ... sleep(501) start
[00:02:02]               │ debg ... sleep(501) end
[00:02:03]               │ debg in navigateTo url = http://localhost:61121/app/uptime
[00:02:03]               │ debg TestSubjects.exists(statusPageContainer)
[00:02:03]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:02:03]               │ERROR browser[SEVERE] http://localhost:61121/35062/bundles/plugin/uptime/uptime.plugin.js 0:18092 "API /api/uptime/monitor/list is not returning expected response, Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.not_before\" for response" Object
[00:02:05]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:02:06]               │ debg isGlobalLoadingIndicatorVisible
[00:02:06]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:02:06]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:02:07]               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:02:08]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:02:08]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:02:08]               │ debg TestSubjects.exists(uptimeOverviewPage)
[00:02:08]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverviewPage"]') with timeout=2000
[00:02:08]             └- ✓ pass  (559ms) "uptime overview page"
[00:02:08]           └-> overview page with expanded monitor detail
[00:02:08]             └-> "before each" hook: global before each
[00:02:08]             └-> "before each" hook
[00:02:08]               │ debg TestSubjects.exists(uptimeSettingsToOverviewLink)
[00:02:08]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeSettingsToOverviewLink"]') with timeout=0
[00:02:08]               │ debg --- retry.tryForTime error: [data-test-subj="uptimeSettingsToOverviewLink"] is not displayed
[00:02:09]               │ debg TestSubjects.exists(uptimeOverviewPage)
[00:02:09]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverviewPage"]') with timeout=0
[00:02:09]             │ debg TestSubjects.click(xpack.uptime.monitorList.a11yTestMonitor.expandMonitorDetail)
[00:02:09]             │ debg Find.clickByCssSelector('[data-test-subj="xpack.uptime.monitorList.a11yTestMonitor.expandMonitorDetail"]') with timeout=10000
[00:02:09]             │ debg Find.findByCssSelector('[data-test-subj="xpack.uptime.monitorList.a11yTestMonitor.expandMonitorDetail"]') with timeout=10000
[00:02:09]             │ debg TestSubjects.click(xpack.uptime.monitorList.actionsPopover.a11yTestMonitor)
[00:02:09]             │ debg Find.clickByCssSelector('[data-test-subj="xpack.uptime.monitorList.actionsPopover.a11yTestMonitor"]') with timeout=10000
[00:02:09]             │ debg Find.findByCssSelector('[data-test-subj="xpack.uptime.monitorList.actionsPopover.a11yTestMonitor"]') with timeout=10000
[00:02:10]             └- ✓ pass  (785ms) "uptime overview page with expanded monitor detail"
[00:02:10]           └-> overview alert popover controls
[00:02:10]             └-> "before each" hook: global before each
[00:02:10]             └-> "before each" hook
[00:02:10]               │ debg TestSubjects.exists(uptimeSettingsToOverviewLink)
[00:02:10]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeSettingsToOverviewLink"]') with timeout=0
[00:02:10]               │ debg --- retry.tryForTime error: [data-test-subj="uptimeSettingsToOverviewLink"] is not displayed
[00:02:10]               │ debg TestSubjects.exists(uptimeOverviewPage)
[00:02:10]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverviewPage"]') with timeout=0
[00:02:10]             │ debg TestSubjects.click(xpack.uptime.alertsPopover.toggleButton)
[00:02:10]             │ debg Find.clickByCssSelector('[data-test-subj="xpack.uptime.alertsPopover.toggleButton"]') with timeout=10000
[00:02:10]             │ debg Find.findByCssSelector('[data-test-subj="xpack.uptime.alertsPopover.toggleButton"]') with timeout=10000
[00:02:11]             │ debg TestSubjects.exists(xpack.uptime.openAlertContextPanel)
[00:02:11]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="xpack.uptime.openAlertContextPanel"]') with timeout=2500
[00:02:11]             │ debg TestSubjects.click(xpack.uptime.openAlertContextPanel)
[00:02:11]             │ debg Find.clickByCssSelector('[data-test-subj="xpack.uptime.openAlertContextPanel"]') with timeout=10000
[00:02:11]             │ debg Find.findByCssSelector('[data-test-subj="xpack.uptime.openAlertContextPanel"]') with timeout=10000
[00:02:11]             │ debg --- retry.tryForTime error: stale element reference: element is not attached to the page document
[00:02:11]             │        (Session info: headless chrome=84.0.4147.89)
[00:02:11]             └- ✓ pass  (937ms) "uptime overview alert popover controls"
[00:02:11]           └-> detail page
[00:02:11]             └-> "before each" hook: global before each
[00:02:11]             └-> "before each" hook
[00:02:11]               │ debg TestSubjects.exists(uptimeSettingsToOverviewLink)
[00:02:11]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeSettingsToOverviewLink"]') with timeout=0
[00:02:11]               │ debg --- retry.tryForTime error: [data-test-subj="uptimeSettingsToOverviewLink"] is not displayed
[00:02:14]               │ debg --- retry.tryForTime error: [data-test-subj="xpack.uptime.openAlertContextPanel"] is not displayed
[00:02:14]               │ debg TestSubjects.exists(uptimeOverviewPage)
[00:02:14]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverviewPage"]') with timeout=0
[00:02:14]             │ debg TestSubjects.exists(uptimeMonitorPage)
[00:02:14]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeMonitorPage"]') with timeout=0
[00:02:14]             │ debg --- retry.tryForTime error: [data-test-subj="uptimeMonitorPage"] is not displayed
[00:02:14]             │ debg TestSubjects.click(monitor-page-link-a11yTestMonitor)
[00:02:14]             │ debg Find.clickByCssSelector('[data-test-subj="monitor-page-link-a11yTestMonitor"]') with timeout=10000
[00:02:14]             │ debg Find.findByCssSelector('[data-test-subj="monitor-page-link-a11yTestMonitor"]') with timeout=10000
[00:02:15]             │ debg TestSubjects.exists(uptimeMonitorPage)
[00:02:15]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeMonitorPage"]') with timeout=30000
[00:02:15]             │ debg TestSubjects.exists(uptimeOverallAvailability)
[00:02:15]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverallAvailability"]') with timeout=120000
[00:02:15]             │ debg TestSubjects.getVisibleText(uptimeOverallAvailability)
[00:02:15]             │ debg TestSubjects.find(uptimeOverallAvailability)
[00:02:15]             │ debg Find.findByCssSelector('[data-test-subj="uptimeOverallAvailability"]') with timeout=10000
[00:02:15]             │ERROR browser[SEVERE] http://localhost:61121/35062/bundles/plugin/uptime/uptime.plugin.js 0:18092 "API /api/uptime/pings is not returning expected response, Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"pings.tls.server.x509.not_before\" for response" Object
[00:02:15]             └- ✓ pass  (1.5s) "uptime detail page"
[00:02:15]           └-> settings page
[00:02:15]             └-> "before each" hook: global before each
[00:02:15]             └-> "before each" hook
[00:02:15]               │ debg TestSubjects.exists(uptimeSettingsToOverviewLink)
[00:02:15]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeSettingsToOverviewLink"]') with timeout=0
[00:02:15]               │ debg --- retry.tryForTime error: [data-test-subj="uptimeSettingsToOverviewLink"] is not displayed
[00:02:16]               │ debg TestSubjects.exists(uptimeOverviewPage)
[00:02:16]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverviewPage"]') with timeout=0
[00:02:16]               │ debg --- retry.tryForTime error: [data-test-subj="uptimeOverviewPage"] is not displayed
[00:02:16]               │ debg navigating to uptime url: http://localhost:61121/app/uptime
[00:02:16]               │ debg navigate to: http://localhost:61121/app/uptime
[00:02:17]               │ debg browser[INFO] http://localhost:61121/app/uptime?_t=1595491026706 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:02:17]               │
[00:02:17]               │ debg browser[INFO] http://localhost:61121/bundles/app/core/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:17]               │ debg ... sleep(700) start
[00:02:17]               │ debg ... sleep(700) end
[00:02:17]               │ debg returned from get, calling refresh
[00:02:19]               │ debg browser[INFO] http://localhost:61121/35062/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 452:106112 "INFO: 2020-07-23T07:57:08Z
[00:02:19]               │        Adding connection to http://localhost:61121/elasticsearch
[00:02:19]               │
[00:02:19]               │      "
[00:02:19]               │ERROR browser[SEVERE] http://localhost:61121/35062/bundles/core/core.entry.js 83:273544 TypeError: Failed to fetch
[00:02:19]               │ debg browser[INFO] http://localhost:61121/app/uptime?_t=1595491026706 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:02:19]               │
[00:02:19]               │ debg browser[INFO] http://localhost:61121/bundles/app/core/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:19]               │ debg currentUrl = http://localhost:61121/app/uptime
[00:02:19]               │          appUrl = http://localhost:61121/app/uptime
[00:02:19]               │ debg TestSubjects.find(kibanaChrome)
[00:02:19]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:02:21]               │ debg browser[INFO] http://localhost:61121/35062/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 452:106112 "INFO: 2020-07-23T07:57:10Z
[00:02:21]               │        Adding connection to http://localhost:61121/elasticsearch
[00:02:21]               │
[00:02:21]               │      "
[00:02:21]               │ debg ... sleep(501) start
[00:02:21]               │ debg ... sleep(501) end
[00:02:21]               │ERROR browser[SEVERE] http://localhost:61121/35062/bundles/plugin/uptime/uptime.plugin.js 0:18092 "API /api/uptime/monitor/list is not returning expected response, Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.issuer.distinguished_name\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.subject.distinguished_name\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.serial_number\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.public_key_algorithm\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.signature_algorithm\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.not_after\",Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.tls.server.x509.not_before\" for response" Object
[00:02:21]               │ debg in navigateTo url = http://localhost:61121/app/uptime
[00:02:21]               │ debg TestSubjects.exists(statusPageContainer)
[00:02:21]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:02:24]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:02:25]               │ debg isGlobalLoadingIndicatorVisible
[00:02:25]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:02:25]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:02:26]               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:02:27]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:02:27]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:02:27]               │ debg TestSubjects.exists(uptimeOverviewPage)
[00:02:27]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverviewPage"]') with timeout=2000
[00:02:27]             │ debg TestSubjects.exists(uptimeSettingsToOverviewLink)
[00:02:27]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeSettingsToOverviewLink"]') with timeout=0
[00:02:27]             │ debg --- retry.tryForTime error: [data-test-subj="uptimeSettingsToOverviewLink"] is not displayed
[00:02:27]             │ debg TestSubjects.exists(uptimeOverviewPage)
[00:02:27]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverviewPage"]') with timeout=0
[00:02:27]             │ debg TestSubjects.click(settings-page-link)
[00:02:27]             │ debg Find.clickByCssSelector('[data-test-subj="settings-page-link"]') with timeout=5000
[00:02:27]             │ debg Find.findByCssSelector('[data-test-subj="settings-page-link"]') with timeout=5000
[00:02:27]             │ debg TestSubjects.exists(uptimeSettingsPage)
[00:02:27]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeSettingsPage"]') with timeout=2000
[00:02:27]             │ debg browser[INFO] http://localhost:61121/app/uptime#/settings 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:02:27]             │
[00:02:27]             │ debg browser[INFO] http://localhost:61121/bundles/app/core/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:30]             │ debg browser[INFO] http://localhost:61121/35062/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 452:106112 "INFO: 2020-07-23T07:57:19Z
[00:02:30]             │        Adding connection to http://localhost:61121/elasticsearch
[00:02:30]             │
[00:02:30]             │      "
[00:02:30]             │ debg --- retry.tryForTime error: [data-test-subj="uptimeSettingsPage"] is not displayed
[00:02:30]             │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/uptime settings page.png"
[00:02:30]             │ info Current URL is: http://localhost:61121/app/uptime#/settings
[00:02:30]             │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/uptime settings page.html
[00:02:30]             └- ✖ fail: uptime settings page
[00:02:30]             │      Error: expected testSubject(uptimeSettingsPage) to exist
[00:02:30]             │       at TestSubjects.existOrFail (/dev/shm/workspace/kibana/test/functional/services/common/test_subjects.ts:62:15)
[00:02:30]             │ 
[00:02:30]             │ 

Stack Trace

Error: expected testSubject(uptimeSettingsPage) to exist
    at TestSubjects.existOrFail (/dev/shm/workspace/kibana/test/functional/services/common/test_subjects.ts:62:15)

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
statusPage - -2 2

page load bundle size

id value diff baseline
core 1.1MB +17.0KB 1.1MB
statusPage - -3.6KB 3.6KB
total - +13.4KB -

History

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

@pgayvallet pgayvallet merged commit 2178a14 into elastic:master Jul 23, 2020
pgayvallet added a commit to pgayvallet/kibana that referenced this pull request Jul 23, 2020
* move http.anonymousPaths.register('/status'); logic into core, remove status_page plugin

* move status_page to core & migrate lib

* migrate the status_app components to TS/KP APIs

* update rendering snapshots

* use import type syntax

* moves `/status` server-side route to core

* fix route registration

* update generated file

* change statusPage i18n prefix

* (temporary) try to restore legacy plugin to check behavior

* add some FTR tests

* do not import whole lodash

* update snapshots

* review comments

* improve / clean component unit tests

* change url for legacy status app

* set status app as chromeless

* fix FTR test due to chromeless app

* fix typings

* add unit test for CoreApp /status registration
# Conflicts:
#	x-pack/plugins/translations/translations/ja-JP.json
#	x-pack/plugins/translations/translations/zh-CN.json
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jul 23, 2020
* master: (35 commits)
  Migrated karma tests to jest (elastic#72649)
  Migrate status page app to core (elastic#72017)
  Failing test: Jest Tests.src/plugins/vis_type_vega/public (elastic#71834)
  Fix Firefox TSVB flaky test with switch index patterns (elastic#72882)
  [ML] Fixing link to index management from file data visualizer (elastic#72863)
  test: 💍 add test for sub-expression variables (elastic#71644)
  fix bug (elastic#72809)
  [keystore] use get_keystore in server cli (elastic#72954)
  Show step number instead of incomplete step. (elastic#72866)
  Fix bug where user can't add an exception when "close alert" is checked (elastic#72919)
  [Monitoring] Fix issues displaying alerts (elastic#72891)
  [Ingest Manager] Add more Fleet concurrency tests elastic#71744 (elastic#72338)
  [Security Solution][Exceptions] - Update UI exceptions builder nested logic (elastic#72490)
  disable renovate masterIssue
  [ML] API integration tests for UPDATE data frame analytics endpoint (elastic#72710)
  [Uptime] Fix accessibility issue in Uptime app nav links (elastic#72926)
  [Maps] fix removing global filter from layer can cause app to start thrashing (elastic#72763)
  [Maps] fix blended layer aggregation error when using composite aggregation (elastic#72759)
  fix unexpected arguments to unload command
  Limits the upload size of lists to 9 meg size (elastic#72898)
  ...
pgayvallet added a commit that referenced this pull request Jul 23, 2020
* Migrate status page app to core (#72017)

* move http.anonymousPaths.register('/status'); logic into core, remove status_page plugin

* move status_page to core & migrate lib

* migrate the status_app components to TS/KP APIs

* update rendering snapshots

* use import type syntax

* moves `/status` server-side route to core

* fix route registration

* update generated file

* change statusPage i18n prefix

* (temporary) try to restore legacy plugin to check behavior

* add some FTR tests

* do not import whole lodash

* update snapshots

* review comments

* improve / clean component unit tests

* change url for legacy status app

* set status app as chromeless

* fix FTR test due to chromeless app

* fix typings

* add unit test for CoreApp /status registration
# Conflicts:
#	x-pack/plugins/translations/translations/ja-JP.json
#	x-pack/plugins/translations/translations/zh-CN.json

* fix i18n merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Legacy Removal Issues related to removing legacy Kibana release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate Status Page UI
6 participants