Skip to content

Commit

Permalink
Merge branch '8.15' into backport/8.15/pr-193089
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiqueclarke authored Sep 26, 2024
2 parents 6159f21 + 12cb67d commit df0e4b1
Show file tree
Hide file tree
Showing 18 changed files with 189 additions and 106 deletions.
8 changes: 8 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23091,6 +23091,14 @@ components:
ITSM, ServiveNow SecOps, or Swimlane incident.
type: object
properties:
additional_fields:
description: >
Additional fields for ServiceNow ITSM and ServiveNow SecOps
connectors. The fields must exist in the Elastic ServiceNow
application and must be specified in JSON format.
maxLength: 20
nullable: true
type: string
alertId:
description: The alert identifier for Swimlane connectors.
type: string
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@
"pretty-ms": "6.0.0",
"prop-types": "^15.8.1",
"proxy-from-env": "1.0.0",
"puppeteer": "22.13.1",
"puppeteer": "23.3.1",
"query-string": "^6.13.2",
"rbush": "^3.0.1",
"re-resizable": "^6.9.9",
Expand Down
34 changes: 17 additions & 17 deletions packages/kbn-screenshotting-server/src/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export class ChromiumArchivePaths {
platform: 'darwin',
architecture: 'x64',
archiveFilename: 'chrome-mac.zip',
archiveChecksum: 'fa8004f3c8c5574c089c901e48429d1b01720bf3dd25e05ac56c41d0ab470c10',
binaryChecksum: '56f25cb6881e5c2b1aac0d8e87630517d1af8effdc9319d35f872add048df1ca',
archiveChecksum: '0a3d18efd00b3406f66139a673616b4b2b4b00323776678cb82295996f5a6733',
binaryChecksum: '8bcdaa973ee11110f6b70eaac2418fda3bb64446cf37f964fce331cdc8907a20',
binaryRelativePath: 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
revision: 1300317, // 1300313 is not available for Mac_x64
revision: 1331485, // 1331488 is not available for Mac_x64
location: 'common',
archivePath: 'Mac',
isPreInstalled: false,
Expand All @@ -57,44 +57,44 @@ export class ChromiumArchivePaths {
platform: 'darwin',
architecture: 'arm64',
archiveFilename: 'chrome-mac.zip',
archiveChecksum: 'bea49fd3ccd6aaccd7cdc4df38306f002a2934aaa2c044f3b5a3272b31ec77ca',
binaryChecksum: '4c55d9e47deb1179c377c9785afdcdb5f3d3f351bff62b414d43e32ff195bd55',
archiveChecksum: '426eddf16acb88b9446a91de53cc4364c7d487414248f33e30f68cf488cea0c0',
binaryChecksum: '827931739bfdd2b6790a81d5ade8886c159cd051581d79b84d1ede447293e9cf',
binaryRelativePath: 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
revision: 1300314, // 1300313 is not available for Mac_Arm
revision: 1331488,
location: 'common',
archivePath: 'Mac_Arm',
isPreInstalled: false,
},
{
platform: 'linux',
architecture: 'x64',
archiveFilename: 'chromium-5b5d829-locales-linux_x64.zip',
archiveChecksum: '799e8fd5f47ea70b8a3972d39b2617c9cbebc7fc433a89251dae312a7c77534b',
binaryChecksum: '216b8f7ff9b41e985397342c2df54e4f8e07a01a3b8a929f39b9a10931d26ff5',
archiveFilename: 'chromium-fe621c5-locales-linux_x64.zip',
archiveChecksum: '12ce2e0eac184072dfcbc7a267328e3eb7fbe10a682997f4111c0378f2397341',
binaryChecksum: '670481cfa8db209401106cd23051009d390c03608724d0822a12c8c0a92b4c25',
binaryRelativePath: 'headless_shell-linux_x64/headless_shell',
revision: 1300313,
revision: 1331488,
location: 'custom',
isPreInstalled: true,
},
{
platform: 'linux',
architecture: 'arm64',
archiveFilename: 'chromium-5b5d829-locales-linux_arm64.zip',
archiveChecksum: '961e20c45c61f8e948efdc4128bb17c23217bbcb28537f270ccf5bf0826981e7',
binaryChecksum: 'fc4027fb6b1c96bef9374d5d9f791097fae2ec2ddc4e0134167075bd52d1458f',
archiveFilename: 'chromium-fe621c5-locales-linux_arm64.zip',
archiveChecksum: 'f7333eaff5235046c8775f0c1a0b7395b7ebc2e054ea638710cf511c4b6f9daf',
binaryChecksum: '8a3a3371b3d04f4b0880b137a3611c223e0d8e65a218943cb7be1ec4a91f5e35',
binaryRelativePath: 'headless_shell-linux_arm64/headless_shell',
revision: 1300313,
revision: 1331488,
location: 'custom',
isPreInstalled: true,
},
{
platform: 'win32',
architecture: 'x64',
archiveFilename: 'chrome-win.zip',
archiveChecksum: '27a2ed1473cefc6f48ff5665faa1fbcc69ef5be47ee21777a60e87c8379fdd93',
binaryChecksum: 'd603401a5e6f8bd734b329876e4221a4d24a1999f14df6e32eeb5e6a72520d96',
archiveChecksum: 'fa62be702f55f37e455bab4291c59ceb40e81e1922d30cf9453a4ee176b909bc',
binaryChecksum: '1345e66583bad1a1f16885f381d1173de8bf931487da9ba155e1b58bf23b2c66',
binaryRelativePath: path.join('chrome-win', 'chrome.exe'),
revision: 1300320, // 1300313 is not available for win32
revision: 1331487, // 1331488 is not available for win32
location: 'common',
archivePath: 'Win',
isPreInstalled: true,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/build_chromium/linux/args.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ v8_symbol_level = 0
enable_ink = false
rtc_build_examples = false
angle_build_tests = false
enable_screen_ai_service = false
use_fake_screen_ai = true
enable_vr = false

# Please, consult @elastic/kibana-security before changing/removing this option.
Expand Down
6 changes: 6 additions & 0 deletions x-pack/plugins/actions/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -5461,6 +5461,12 @@
"type": "object",
"description": "Information necessary to create or update a Jira, ServiceNow ITSM, ServiveNow SecOps, or Swimlane incident.",
"properties": {
"additional_fields": {
"type": "string",
"nullable": true,
"maxLength": 20,
"description": "Additional fields for ServiceNow ITSM and ServiveNow SecOps connectors. The fields must exist in the Elastic ServiceNow application and must be specified in JSON format.\n"
},
"alertId": {
"type": "string",
"description": "The alert identifier for Swimlane connectors."
Expand Down
6 changes: 6 additions & 0 deletions x-pack/plugins/actions/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3924,6 +3924,12 @@ components:
type: object
description: Information necessary to create or update a Jira, ServiceNow ITSM, ServiveNow SecOps, or Swimlane incident.
properties:
additional_fields:
type: string
nullable: true
maxLength: 20
description: |
Additional fields for ServiceNow ITSM and ServiveNow SecOps connectors. The fields must exist in the Elastic ServiceNow application and must be specified in JSON format.
alertId:
type: string
description: The alert identifier for Swimlane connectors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ properties:
type: object
description: Information necessary to create or update a Jira, ServiceNow ITSM, ServiveNow SecOps, or Swimlane incident.
properties:
additional_fields:
type: string
nullable: true
maxLength: 20
description: >
Additional fields for ServiceNow ITSM and ServiveNow SecOps connectors.
The fields must exist in the Elastic ServiceNow application and must be specified in JSON format.
alertId:
type: string
description: The alert identifier for Swimlane connectors.
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { BULK_CREATE_MAX_ARTIFACTS_BYTES } from './services/artifacts/artifacts'
const DEFAULT_BUNDLED_PACKAGE_LOCATION = path.join(__dirname, '../target/bundled_packages');
const DEFAULT_GPG_KEY_PATH = path.join(__dirname, '../target/keys/GPG-KEY-elasticsearch');

const REGISTRY_SPEC_MAX_VERSION = '3.2';
const REGISTRY_SPEC_MAX_VERSION = '3.0';

export const config: PluginConfigDescriptor = {
exposeToBrowser: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('createFieldMapping', () => {
`;

expect(Utils.createSync).toHaveBeenCalledWith(
`${dataStreamPath}/base-fields.yml`,
`${dataStreamPath}/fields/base-fields.yml`,
mockedTemplate
);
expect(Utils.createSync).toHaveBeenCalledWith(
Expand All @@ -63,7 +63,7 @@ describe('createFieldMapping', () => {
`;

expect(Utils.createSync).toHaveBeenCalledWith(
`${dataStreamPath}/base-fields.yml`,
`${dataStreamPath}/fields/base-fields.yml`,
mockedTemplate
);
expect(Utils.createSync).toHaveBeenCalledWith(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ export function createFieldMapping(
specificDataStreamDir: string,
docs: object[]
): void {
createBaseFields(specificDataStreamDir, packageName, dataStreamName);
createCustomFields(specificDataStreamDir, docs);
const dataStreamFieldsDir = `${specificDataStreamDir}/fields`;
createBaseFields(dataStreamFieldsDir, packageName, dataStreamName);
createCustomFields(dataStreamFieldsDir, docs);
}

function createBaseFields(
specificDataStreamDir: string,
dataStreamFieldsDir: string,
packageName: string,
dataStreamName: string
): void {
Expand All @@ -30,11 +31,11 @@ function createBaseFields(
dataset: datasetName,
});

createSync(`${specificDataStreamDir}/base-fields.yml`, baseFields);
createSync(`${dataStreamFieldsDir}/base-fields.yml`, baseFields);
}

function createCustomFields(specificDataStreamDir: string, pipelineResults: object[]): void {
function createCustomFields(dataStreamFieldsDir: string, pipelineResults: object[]): void {
const mergedResults = mergeSamples(pipelineResults);
const fieldKeys = generateFields(mergedResults);
createSync(`${specificDataStreamDir}/fields/fields.yml`, fieldKeys);
createSync(`${dataStreamFieldsDir}/fields.yml`, fieldKeys);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import { i18n } from '@kbn/i18n';
import { GetPreviewDataResponse, SLOWithSummaryResponse } from '@kbn/slo-schema';
import moment from 'moment';
import React, { useRef } from 'react';
import { TimeBounds } from '../../../slo_details/types';
import { getBrushTimeBounds } from '../../../../utils/slo/duration';
import { useKibana } from '../../../../utils/kibana_react';
import { openInDiscover } from '../../../../utils/slo/get_discover_link';
import { TimeBounds } from '../../pages/slo_details/types';
import { getBrushTimeBounds } from '../../utils/slo/duration';
import { useKibana } from '../../utils/kibana_react';
import { openInDiscover } from '../../utils/slo/get_discover_link';

export interface Props {
data: GetPreviewDataResponse;
Expand Down Expand Up @@ -85,7 +85,7 @@ export function GoodBadEventsChart({
to: moment(datanum.x).add(intervalInMilliseconds, 'ms').toISOString(),
mode: 'absolute' as const,
};
openInDiscover(discover, slo, isBad, !isBad, timeRange);
openInDiscover({ slo, showBad: isBad, showGood: !isBad, timeRange, discover, uiSettings });
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { SloTabId } from './slo_details';
import { useGetPreviewData } from '../../../hooks/use_get_preview_data';
import { useKibana } from '../../../utils/kibana_react';
import { COMPARATOR_MAPPING } from '../../slo_edit/constants';
import { GoodBadEventsChart } from '../../slos/components/common/good_bad_events_chart';
import { GoodBadEventsChart } from '../../../components/good_bad_events_chart/good_bad_events_chart';
import { getDiscoverLink } from '../../../utils/slo/get_discover_link';

export interface Props {
Expand Down Expand Up @@ -173,10 +173,15 @@ export function EventsChartPanel({ slo, range, selectedTabId, onBrushed }: Props
<EuiFlexItem grow={0}>
<EuiLink
color="text"
href={getDiscoverLink(discover, slo, {
from: 'now-24h',
to: 'now',
mode: 'relative',
href={getDiscoverLink({
slo,
timeRange: {
from: 'now-24h',
to: 'now',
mode: 'relative',
},
discover,
uiSettings,
})}
data-test-subj="sloDetailDiscoverLink"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import moment from 'moment';
import React, { useState } from 'react';
import { useFormContext } from 'react-hook-form';
import { useKibana } from '../../../../utils/kibana_react';
import { GoodBadEventsChart } from '../../../slos/components/common/good_bad_events_chart';
import { GoodBadEventsChart } from '../../../../components/good_bad_events_chart/good_bad_events_chart';
import { useDebouncedGetPreviewData } from '../../hooks/use_preview';
import { useSectionFormValidation } from '../../hooks/use_section_form_validation';
import { CreateSLOForm } from '../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@ import { i18n } from '@kbn/i18n';
import { buildEsQuery } from '@kbn/observability-plugin/public';
import { v4 } from 'uuid';
import { isEmpty } from 'lodash';
import { getEsQueryConfig } from '@kbn/data-plugin/public';
import { IUiSettingsClient } from '@kbn/core/public';

function createDiscoverLocator(
slo: SLOWithSummaryResponse,
function createDiscoverLocator({
slo,
showBad = false,
showGood = false,
timeRange?: TimeRange
) {
timeRange,
uiSettings,
}: {
slo: SLOWithSummaryResponse;
showBad: boolean;
showGood: boolean;
timeRange: TimeRange;
uiSettings?: IUiSettingsClient;
}) {
const indexId = v4();
const filters: Filter[] = [];

Expand All @@ -42,8 +51,17 @@ function createDiscoverLocator(
const totalFilters = kqlWithFiltersSchema.is(slo.indicator.params.total)
? slo.indicator.params.total.filters
: [];
const customGoodFilter = buildEsQuery({ kuery: goodKuery, filters: goodFilters });
const customTotalFilter = buildEsQuery({ kuery: totalKuery, filters: totalFilters });

const customGoodFilter = buildEsQuery({
kuery: goodKuery,
filters: goodFilters,
...(uiSettings && { config: getEsQueryConfig(uiSettings) }),
});
const customTotalFilter = buildEsQuery({
kuery: totalKuery,
filters: totalFilters,
...(uiSettings && { config: getEsQueryConfig(uiSettings) }),
});
const customBadFilter = { bool: { filter: customTotalFilter, must_not: customGoodFilter } };

filters.push({
Expand Down Expand Up @@ -144,22 +162,42 @@ function createDiscoverLocator(
};
}

export function getDiscoverLink(
discover: DiscoverStart,
slo: SLOWithSummaryResponse,
timeRange: TimeRange
) {
const config = createDiscoverLocator(slo, false, false, timeRange);
return discover?.locator?.getRedirectUrl(config);
export function getDiscoverLink({
slo,
timeRange,
discover,
uiSettings,
}: {
slo: SLOWithSummaryResponse;
timeRange: TimeRange;
discover?: DiscoverStart;
uiSettings?: IUiSettingsClient;
}) {
const locatorConfig = createDiscoverLocator({
slo,
showBad: false,
showGood: false,
timeRange,
uiSettings,
});
return discover?.locator?.getRedirectUrl(locatorConfig);
}

export function openInDiscover(
discover: DiscoverStart,
slo: SLOWithSummaryResponse,
export function openInDiscover({
slo,
showBad = false,
showGood = false,
timeRange?: TimeRange
) {
const config = createDiscoverLocator(slo, showBad, showGood, timeRange);
discover?.locator?.navigate(config);
timeRange,
discover,
uiSettings,
}: {
slo: SLOWithSummaryResponse;
showBad: boolean;
showGood: boolean;
timeRange: TimeRange;
discover?: DiscoverStart;
uiSettings?: IUiSettingsClient;
}) {
const locatorConfig = createDiscoverLocator({ slo, showBad, showGood, timeRange, uiSettings });
discover?.locator?.navigate(locatorConfig);
}
Loading

0 comments on commit df0e4b1

Please sign in to comment.