Skip to content

Commit

Permalink
Merge branch 'main' into fix-suppression-max-signals
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallmain authored Nov 29, 2022
2 parents 240980e + 9417165 commit a37652e
Show file tree
Hide file tree
Showing 34 changed files with 258 additions and 2,567 deletions.
1 change: 0 additions & 1 deletion .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ enabled:
- x-pack/test/functional_embedded/config.ts
- x-pack/test/functional_enterprise_search/without_host_configured.config.ts
- x-pack/test/functional_execution_context/config.ts
- x-pack/test/functional_synthetics/config.js
- x-pack/test/functional_with_es_ssl/config.ts
- x-pack/test/functional/apps/advanced_settings/config.ts
- x-pack/test/functional/apps/aiops/config.ts
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
responseActions: `${SECURITY_SOLUTION_DOCS}response-actions.html`,
configureEndpointIntegrationPolicy: `${SECURITY_SOLUTION_DOCS}configure-endpoint-integration-policy.html`,
exceptions: {
value_lists: `${SECURITY_SOLUTION_DOCS}detections-ui-exceptions.html#manage-value-lists`,
value_lists: `${SECURITY_SOLUTION_DOCS}detections-ui-exceptions.html`,
},
privileges: `${SECURITY_SOLUTION_DOCS}endpoint-management-req.html`,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ async function mountComponent(
return component;
}

describe('Discover component', () => {
// FLAKY: https://github.com/elastic/kibana/issues/145894
describe.skip('Discover component', () => {
test('selected data view without time field displays no chart toggle', async () => {
const container = document.createElement('div');
await mountComponent(dataViewMock, undefined, { attachTo: container });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const DEFAULT_VALUES = {
},
},
hasIndexIngestionPipeline: true,
hasPlatinumLicense: true,
ingestionMethod: 'crawler',
};

Expand All @@ -47,6 +48,14 @@ describe('add inference pipeline button', () => {
const tooltip = wrapper.find(EuiToolTip);
expect(tooltip.prop('content')).toContain('permission');
});
it('renders permission tooltip with no platinum license', () => {
setMockValues({ ...DEFAULT_VALUES, hasPlatinumLicense: false });
const wrapper = mount(<AddMLInferencePipelineButton onClick={onClick} />);
expect(wrapper.find(EuiButton)).toHaveLength(1);
expect(wrapper.find(EuiToolTip)).toHaveLength(1);
const tooltip = wrapper.find(EuiToolTip);
expect(tooltip.prop('content')).toContain('permission');
});
it('renders copy & customize tooltip with index pipeline', () => {
setMockValues({ ...DEFAULT_VALUES, hasIndexIngestionPipeline: false });
const wrapper = mount(<AddMLInferencePipelineButton onClick={onClick} />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { EuiButton, EuiToolTip } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { KibanaLogic } from '../../../../../shared/kibana/kibana_logic';
import { LicensingLogic } from '../../../../../shared/licensing';
import { IndexViewLogic } from '../../index_view_logic';
import { PipelinesLogic } from '../pipelines_logic';

Expand All @@ -25,8 +26,10 @@ export const AddMLInferencePipelineButton: React.FC<AddMLInferencePipelineButton
const { capabilities } = useValues(KibanaLogic);
const { ingestionMethod } = useValues(IndexViewLogic);
const { canUseMlInferencePipeline, hasIndexIngestionPipeline } = useValues(PipelinesLogic);
const { hasPlatinumLicense } = useValues(LicensingLogic);
const hasMLPermissions = capabilities?.ml?.canAccessML ?? false;
if (!hasMLPermissions) {

if (!hasMLPermissions || !hasPlatinumLicense) {
return (
<EuiToolTip
content={i18n.translate(
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/fleet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ As part of the bundled package update process, we'll likely also need to update
- `x-pack/test/fleet_api_integration/config.ts`
- `x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts`
- `x-pack/test/functional/config.base.js`
- `x-pack/test/functional_synthetics/config.js`

To update this registry image, pull the digest SHA from the package storage Jenkins pipeline at https://beats-ci.elastic.co/blue/organizations/jenkins/Ingest-manager%2Fpackage-storage/activity and update the files above. The digest value should appear in the "publish Docker image" step as part of the `docker push` command in the logs.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ jest.mock('../../hooks/response_actions/use_get_file_info', () => {

const mockUseGetEndpointsList = useGetEndpointsList as jest.Mock;

describe('Response actions history', () => {
// FLAKY https://github.com/elastic/kibana/issues/145635
describe.skip('Response actions history', () => {
const useUserPrivilegesMock = _useUserPrivileges as jest.Mock<
ReturnType<typeof _useUserPrivileges>
>;
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/synthetics/e2e/journeys/synthetics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export * from './getting_started.journey';
export * from './add_monitor.journey';
export * from './monitor_selector.journey';
export * from './management_list.journey';
export * from './overview_sorting.journey';
// TODO: Fix this test
export * from './overview_scrolling.journey';
export * from './overview_search.journey';
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { journey, step, expect, before, after } from '@elastic/synthetics';
import {
addTestMonitor,
cleanTestMonitors,
enableMonitorManagedViaApi,
} from './services/add_monitor';
import { syntheticsAppPageProvider } from '../../page_objects/synthetics_app';

journey(`MonitorManagementList`, async ({ page, params }) => {
const syntheticsApp = syntheticsAppPageProvider({ page, kibanaUrl: params.kibanaUrl });
const testMonitor1 = 'Test monitor 1';
const testMonitor2 = 'Test monitor 2';
const testMonitor3 = 'Test monitor 3';

page.setDefaultTimeout(60 * 1000);

before(async () => {
await enableMonitorManagedViaApi(params.kibanaUrl);
await cleanTestMonitors(params);

await addTestMonitor(params.kibanaUrl, testMonitor1);
await addTestMonitor(params.kibanaUrl, testMonitor2);
await addTestMonitor(params.kibanaUrl, testMonitor3);
});

after(async () => {
await cleanTestMonitors(params);
});

step('Go to monitor-management', async () => {
await syntheticsApp.navigateToMonitorManagement();
});

step('login to Kibana', async () => {
await syntheticsApp.loginToKibana();
const invalid = await page.locator(`text=Username or password is incorrect. Please try again.`);
expect(await invalid.isVisible()).toBeFalsy();
});

step('shows the count', async () => {
await page.locator('text=Monitors');
await page.click('text=1-3');
});

step(
'Click text=Showing 1-3 of 3 MonitorsSortingThis table contains 3 rows out of 3 rows; Page 1',
async () => {
await page.click(
'text=Showing 1-3 of 3 MonitorsSortingThis table contains 3 rows out of 3 rows; Page 1'
);
await page.click('[aria-label="expands filter group for Type filter"]');
}
);

step(
'Click [aria-label="Use up and down arrows to move focus over options. Enter to select. Escape to collapse options."] >> text=browser',
async () => {
await page.click(
'[aria-label="Use up and down arrows to move focus over options. Enter to select. Escape to collapse options."] >> text=browser'
);
await page.click('[aria-label="Apply the selected filters for Type"]');
expect(page.url()).toBe(
'http://localhost:5620/app/synthetics/monitors?monitorType=%5B%22browser%22%5D'
);
await page.click('[placeholder="Search by name, url, host, tag, project or location"]');
await Promise.all([
page.waitForNavigation({
url: 'http://localhost:5620/app/synthetics/monitors?monitorType=%5B%22browser%22%5D&query=3',
}),
page.fill('[placeholder="Search by name, url, host, tag, project or location"]', '3'),
]);
await page.click('text=1-1');
await page.click(
'text=Showing 1-1 of 1 MonitorSortingThis table contains 1 rows out of 1 rows; Page 1 '
);
}
);

step('when no results appears', async () => {
await page.click('[placeholder="Search by name, url, host, tag, project or location"]');
await page.fill('[placeholder="Search by name, url, host, tag, project or location"]', '5553');

await page.click('text=0-0');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const useRetrieveStepImage = ({
} else {
return new Promise<ImageResponse>((resolve) => resolve(null));
}
}, [skippedStep, hasIntersected, imgPath, retryFetchOnRevisit]);
}, [skippedStep, hasIntersected, imgPath, retryFetchOnRevisit, hasImage]);

return imgState[imgPath] ?? { data: null, loading: false };
};
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const MonitorList = ({
};

const recordRangeLabel = labels.getRecordRangeLabel({
rangeStart: pageSize * pageIndex + 1,
rangeStart: total === 0 ? 0 : pageSize * pageIndex + 1,
rangeEnd: pageSize * pageIndex + pageSize,
total,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ export const ManageMonitorsBtn = () => {

const history = useHistory();

const handleOnClick = () => {
setIsOpen(false);
history.push(MONITOR_MANAGEMENT_ROUTE + '/all');
};

return (
<EuiTourStep
content={
Expand All @@ -33,7 +28,13 @@ export const ManageMonitorsBtn = () => {
<p>{PUBLIC_BETA_DESCRIPTION}</p>
</EuiText>
<EuiSpacer />
<EuiButton color="primary" fill onClick={handleOnClick}>
<EuiButton
color="primary"
fill
href={history.createHref({
pathname: MONITOR_MANAGEMENT_ROUTE,
})}
>
{MONITOR_MANAGEMENT_LABEL}
</EuiButton>
</>
Expand All @@ -56,7 +57,9 @@ export const ManageMonitorsBtn = () => {
aria-label={NAVIGATE_LABEL}
color="text"
data-test-subj="syntheticsManagementPageLink"
onClick={handleOnClick}
href={history.createHref({
pathname: MONITOR_MANAGEMENT_ROUTE,
})}
>
<FormattedMessage
id="xpack.synthetics.page_header.manageMonitors"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import { EuiConfirmModal, EuiIcon, EuiLink } from '@elastic/eui';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

export const DeprecateNoticeModal = ({ onCancel }: { onCancel: () => void }) => {
const { application } = useKibana().services;

return (
<EuiConfirmModal
title={
<>
{HEADER_TEXT} <EuiIcon type="cheer" />
</>
}
onCancel={onCancel}
onConfirm={() => {
application?.navigateToApp('uptime', { path: '/manage-monitors' });
}}
confirmButtonText={GO_MONITOR_MANAGEMENT_TEXT}
cancelButtonText={GO_BACK_TEXT}
>
<p>
<FormattedMessage
id="xpack.synthetics.deprecateNoticeModal.description"
defaultMessage="The Elastic Synthetics integration is deprecated. Instead, you can now monitor endpoints,
pages, and user journeys directly from Uptime much more efficiently:"
/>
</p>
<p>
<li>
<FormattedMessage
id="xpack.synthetics.deprecateNoticeModal.addPrivateLocations"
defaultMessage="Add private locations against your fleet policies"
/>
</li>
<li>
<FormattedMessage
id="xpack.synthetics.deprecateNoticeModal.manageMonitors"
defaultMessage="Manage lightweight and browser monitors from a single place"
/>
</li>
<li>
<FormattedMessage
id="xpack.synthetics.deprecateNoticeModal.elasticManagedLocations"
defaultMessage="Run monitors in multiple locations managed by Elastic, or from your own private locations"
/>
</li>
<li>
<FormattedMessage
id="xpack.synthetics.deprecateNoticeModal.automateMonitors"
defaultMessage="Automate the creation of your monitors using project monitors"
/>
</li>
</p>
<p>
<FormattedMessage
id="xpack.synthetics.deprecateNoticeModal.forMoreInformation"
defaultMessage="For more information, {docsLink}"
values={{
docsLink: (
<EuiLink
target="_blank"
href="https://www.elastic.co/guide/en/observability/current/monitor-uptime-synthetics.html"
>
{READ_DOCS_TEXT}
</EuiLink>
),
}}
/>
</p>
</EuiConfirmModal>
);
};

const HEADER_TEXT = i18n.translate('xpack.synthetics.deprecateNoticeModal.headerText', {
defaultMessage: 'Synthetic Monitoring is now available out of the box in Uptime',
});

const GO_BACK_TEXT = i18n.translate('xpack.synthetics.deprecateNoticeModal.goBack', {
defaultMessage: 'Go back',
});

const READ_DOCS_TEXT = i18n.translate('xpack.synthetics.deprecateNoticeModal.readDocs', {
defaultMessage: 'read docs.',
});

const GO_MONITOR_MANAGEMENT_TEXT = i18n.translate(
'xpack.synthetics.deprecateNoticeModal.goToMonitorManagement',
{
defaultMessage: 'Go to Monitor Management',
}
);
Loading

0 comments on commit a37652e

Please sign in to comment.