Skip to content

Commit

Permalink
Merge branch '8.x' into backport/8.x/pr-207654
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko authored Jan 23, 2025
2 parents 5dce11d + e177f15 commit 2363666
Show file tree
Hide file tree
Showing 83 changed files with 1,794 additions and 990 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ spec:
pipeline_file: ".buildkite/pipelines/pointer_compression.yml"
provider_settings:
trigger_mode: none
schedules:
Daily run:
branch: main
cronline: "@daily"
teams:
kibana-operations:
access_level: MANAGE_BUILD_AND_READ
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.15.1
20.18.2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.15.1
20.18.2
12 changes: 6 additions & 6 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install
# Setup the Node.js toolchain for the architectures we want to support
node_repositories(
node_repositories = {
"20.15.1-darwin_amd64": ("node-v20.15.1-darwin-x64.tar.gz", "node-v20.15.1-darwin-x64", "f5379772ffae1404cfd1fcc8cf0c6c5971306b8fb2090d348019047306de39dc"),
"20.15.1-darwin_arm64": ("node-v20.15.1-darwin-arm64.tar.gz", "node-v20.15.1-darwin-arm64", "4743bc042f90ba5d9edf09403207290a9cdd2f6061bdccf7caaa0bbfd49f343e"),
"20.15.1-linux_arm64": ("node-v20.15.1-linux-arm64.tar.xz", "node-v20.15.1-linux-arm64", "c049d670df0c27ae2fd53446df79b6227ab23aff930e38daf0ab3da41c396db5"),
"20.15.1-linux_amd64": ("node-v20.15.1-linux-x64.tar.xz", "node-v20.15.1-linux-x64", "a854c291c7b775bedab54251e1e273cfee1adf1dba25435bc52305ef41f143ab"),
"20.15.1-windows_amd64": ("node-v20.15.1-win-x64.zip", "node-v20.15.1-win-x64", "ba6c3711e2c3d0638c5f7cea3c234553808a73c52a5962a6cdb47b5210b70b04"),
"20.18.2-darwin_amd64": ("node-v20.18.2-darwin-x64.tar.gz", "node-v20.18.2-darwin-x64", "00a16bb0a82a2ad5d00d66b466ae1afa678482283747c27e9bce96668f334744"),
"20.18.2-darwin_arm64": ("node-v20.18.2-darwin-arm64.tar.gz", "node-v20.18.2-darwin-arm64", "fa76d5b5340f14070ebaa88ef8faa28c1e9271502725e830cb52f0cf5b6493de"),
"20.18.2-linux_arm64": ("node-v20.18.2-linux-arm64.tar.xz", "node-v20.18.2-linux-arm64", "1b4b1745ef7b6d342ddf998352438cfc61dbfcdf0895c9db7e9f1d8a427815d2"),
"20.18.2-linux_amd64": ("node-v20.18.2-linux-x64.tar.xz", "node-v20.18.2-linux-x64", "1a6e1fbd768437e130eac1a54c5535736d6992df700c09a6ce58f22040d6a34c"),
"20.18.2-windows_amd64": ("node-v20.18.2-win-x64.zip", "node-v20.18.2-win-x64", "ed790b94570518a7dce67b62485e16bc4bffecee4ec3b6df35ed220ae91117a5"),
},
node_version = "20.15.1",
node_version = "20.18.2",
node_urls = [
"https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v{version}/{filename}",
],
Expand Down
36 changes: 36 additions & 0 deletions docs/upgrade-notes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,42 @@ For Elastic Security release information, refer to {security-guide}/release-note
[float]
==== Kibana APIs

[discrete]
[[breaking-207091]]
.Removed legacy security rules bulk endpoints (9.0.0)
[%collapsible]
====
*Details* +
--
* `POST /api/detection_engine/rules/_bulk_create` has been replaced by `POST /api/detection_engine/rules/_import`
* `PUT /api/detection_engine/rules/_bulk_update` has been replaced by `POST /api/detection_engine/rules/_bulk_action`
* `PATCH /api/detection_engine/rules/_bulk_update has been replaced by `POST /api/detection_engine/rules/_bulk_action`
* `DELETE /api/detection_engine/rules/_bulk_delete` has been replaced by `POST /api/detection_engine/rules/_bulk_action`
* `POST api/detection_engine/rules/_bulk_delete` has been replaced by `POST /api/detection_engine/rules/_bulk_action`
--
These changes were introduced in {kibana-pull}197422[#197422].
*Impact* +
Deprecated endpoints will fail with a 404 status code starting from version 9.0.0
*Action* +
--
Update your implementations to use the new endpoints:
* **For bulk creation of rules:**
- Use `POST /api/detection_engine/rules/_import` (link:{api-kibana}/operation/operation-importrules[API documentation]) to create multiple rules along with their associated entities (for example, exceptions and action connectors).
- Alternatively, create rules individually using `POST /api/detection_engine/rules` (link:{api-kibana}/operation/operation-createrule[API documentation]).
* **For bulk updates of rules:**
- Use `POST /api/detection_engine/rules/_bulk_action` (link:{api-kibana}/operation/operation-performrulesbulkaction[API documentation]) to update fields in multiple rules simultaneously.
- Alternatively, update rules individually using `PUT /api/detection_engine/rules` (link:{api-kibana}/operation/operation-updaterule[API documentation]).
* **For bulk deletion of rules:**
- Use `POST /api/detection_engine/rules/_bulk_action` (link:{api-kibana}/operation/operation-performrulesbulkaction[API documentation]) to delete multiple rules by IDs or query.
- Alternatively, delete rules individually using `DELETE /api/detection_engine/rules` (link:{api-kibana}/operation/operation-deleterule[API documentation]).
--
====

[discrete]
[[breaking-199598]]
.Remove deprecated endpoint management endpoints (9.0.0)
Expand Down
24 changes: 12 additions & 12 deletions oas_docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion oas_docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependencies": {
"bump-cli": "^2.8.4",
"@redocly/cli": "^1.27.1"
"@redocly/cli": "^1.27.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"url": "https://github.com/elastic/kibana.git"
},
"engines": {
"node": "20.15.1",
"node": "20.18.2",
"yarn": "^1.22.19"
},
"resolutions": {
Expand Down Expand Up @@ -1528,7 +1528,7 @@
"@octokit/rest": "^17.11.2",
"@parcel/watcher": "^2.1.0",
"@playwright/test": "1.49.0",
"@redocly/cli": "^1.27.1",
"@redocly/cli": "^1.27.2",
"@statoscope/webpack-plugin": "^5.28.2",
"@storybook/addon-a11y": "^6.5.16",
"@storybook/addon-actions": "^6.5.16",
Expand Down Expand Up @@ -1656,7 +1656,7 @@
"@types/resolve": "^1.20.1",
"@types/scheduler": "^0.23.0",
"@types/seedrandom": ">=2.0.0 <4.0.0",
"@types/selenium-webdriver": "^4.1.27",
"@types/selenium-webdriver": "^4.1.28",
"@types/semver": "^7.5.8",
"@types/set-value": "^2.0.0",
"@types/sinon": "^7.0.13",
Expand Down Expand Up @@ -1703,7 +1703,7 @@
"buildkite-test-collector": "^1.7.0",
"callsites": "^3.1.0",
"chance": "1.0.18",
"chromedriver": "^131.0.1",
"chromedriver": "^132.0.0",
"clean-webpack-plugin": "^3.0.0",
"cli-progress": "^3.12.0",
"cli-table3": "^0.6.1",
Expand Down
14 changes: 0 additions & 14 deletions src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,6 @@ it('runs expected fs operations', async () => {
"strip": 1,
},
],
Array [
<absolute path>/.node_binaries/<node version>/<node variant>/linux-x64/download/node-v<node version>-linux-x64.tar.gz,
<absolute path>/.node_binaries/<node version>/<node variant>/linux-x64/extract,
Object {
"strip": 1,
},
],
Array [
<absolute path>/.node_binaries/<node version>/<node variant>/linux-arm64/download/node-v<node version>-linux-arm64.tar.gz,
<absolute path>/.node_binaries/<node version>/<node variant>/linux-arm64/extract,
Object {
"strip": 1,
},
],
Array [
<absolute path>/.node_binaries/<node version>/<node variant>/linux-arm64/download/node-v<node version>-linux-arm64.tar.gz,
<absolute path>/.node_binaries/<node version>/<node variant>/linux-arm64/extract,
Expand Down
3 changes: 2 additions & 1 deletion src/dev/build/tasks/nodejs/node_download_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export function getNodeDownloadInfo(config: Config, platform: Platform) {
} else {
variants = ['glibc-217'];
}
if (platform.isServerless()) variants.push('pointer-compression');
// disabled, see https://github.com/nodejs/node/issues/54531
// if (platform.isServerless()) variants.push('pointer-compression');
}

return variants.map((variant) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
aiAssistant: `${SECURITY_SOLUTION_DOCS}security-assistant.html`,
signalsMigrationApi: `${SECURITY_SOLUTION_DOCS}signals-migration-api.html`,
legacyEndpointManagementApiDeprecations: `${KIBANA_DOCS}breaking-changes-summary.html#breaking-199598`,
legacyBulkApiDeprecations: `${KIBANA_DOCS}breaking-changes-summary.html#breaking-207091`,
},
query: {
eql: `${ELASTICSEARCH_DOCS}eql.html`,
Expand Down
1 change: 1 addition & 0 deletions src/platform/packages/shared/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ export interface DocLinks {
readonly detectionEngineOverview: string;
readonly signalsMigrationApi: string;
readonly legacyEndpointManagementApiDeprecations: string;
readonly legacyBulkApiDeprecations: string;
};
readonly query: {
readonly eql: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
export * from './use_rule_form_dispatch';
export * from './use_rule_form_state';
export * from './use_rule_form_steps';
export * from './use_rule_form_screen_context';
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { useContext } from 'react';
import { RuleFormScreenContext } from '../rule_form_screen_context';

export const useRuleFormScreenContext = () => {
return useContext(RuleFormScreenContext);
};
Original file line number Diff line number Diff line change
Expand Up @@ -149,27 +149,15 @@ const useCommonRuleFormSteps = ({
? {
title: RULE_FORM_PAGE_RULE_ACTIONS_TITLE,
status: actionsStatus,
children: (
<>
<RuleActions />
<EuiSpacer />
<EuiHorizontalRule margin="none" />
</>
),
children: <RuleActions />,
}
: null,
[RuleFormStepId.DETAILS]: {
title: shortTitles
? RULE_FORM_PAGE_RULE_DETAILS_TITLE_SHORT
: RULE_FORM_PAGE_RULE_DETAILS_TITLE,
status: ruleDetailsStatus,
children: (
<>
<RuleDetails />
<EuiSpacer />
<EuiHorizontalRule margin="none" />
</>
),
children: <RuleDetails />,
},
}),
[ruleDefinitionStatus, canReadConnectors, actionsStatus, ruleDetailsStatus, shortTitles]
Expand Down Expand Up @@ -210,7 +198,7 @@ export const useRuleFormSteps: () => RuleFormVerticalSteps = () => {

const mappedSteps = useMemo(() => {
return stepOrder
.map((stepId) => {
.map((stepId, index) => {
const step = steps[stepId];
return step
? {
Expand All @@ -227,6 +215,12 @@ export const useRuleFormSteps: () => RuleFormVerticalSteps = () => {
stepId={stepId}
>
{step.children}
{index > 0 && (
<>
<EuiSpacer />
<EuiHorizontalRule margin="none" />
</>
)}
</ReportOnBlur>
),
}
Expand All @@ -246,8 +240,10 @@ interface RuleFormHorizontalSteps {
hasNextStep: boolean;
hasPreviousStep: boolean;
}
export const useRuleFormHorizontalSteps: () => RuleFormHorizontalSteps = () => {
const [currentStep, setCurrentStep] = useState<RuleFormStepId>(STEP_ORDER[0]);
export const useRuleFormHorizontalSteps: (
initialStep?: RuleFormStepId
) => RuleFormHorizontalSteps = (initialStep = STEP_ORDER[0]) => {
const [currentStep, setCurrentStep] = useState<RuleFormStepId>(initialStep);
const [touchedSteps, setTouchedSteps] = useState<Record<RuleFormStepId, boolean>>(
STEP_ORDER.reduce(
(result, stepId) => ({ ...result, [stepId]: false }),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export * from './request_code_block';
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { omit, pick } from 'lodash';
import React, { useMemo } from 'react';
import { EuiCodeBlock } from '@elastic/eui';
import {
CreateRuleBody,
UPDATE_FIELDS_WITH_ACTIONS,
UpdateRuleBody,
transformCreateRuleBody,
transformUpdateRuleBody,
} from '../common/apis';
import { BASE_ALERTING_API_PATH } from '../constants';
import { useRuleFormState } from '../hooks';
import { SHOW_REQUEST_MODAL_ERROR } from '../translations';
import { RuleFormData } from '../types';

const stringifyBodyRequest = ({
formData,
isEdit,
}: {
formData: RuleFormData;
isEdit: boolean;
}): string => {
try {
const request = isEdit
? transformUpdateRuleBody(pick(formData, UPDATE_FIELDS_WITH_ACTIONS) as UpdateRuleBody)
: transformCreateRuleBody(omit(formData, 'id') as CreateRuleBody);
return JSON.stringify(request, null, 2);
} catch {
return SHOW_REQUEST_MODAL_ERROR;
}
};

interface RequestCodeBlockProps {
isEdit: boolean;
'data-test-subj'?: string;
}
export const RequestCodeBlock = (props: RequestCodeBlockProps) => {
const { isEdit, 'data-test-subj': dataTestSubj } = props;
const { formData, id, multiConsumerSelection } = useRuleFormState();

const formattedRequest = useMemo(() => {
return stringifyBodyRequest({
formData: {
...formData,
...(multiConsumerSelection ? { consumer: multiConsumerSelection } : {}),
},
isEdit,
});
}, [formData, isEdit, multiConsumerSelection]);

return (
<EuiCodeBlock language="json" isCopyable data-test-subj={dataTestSubj}>
{`${isEdit ? 'PUT' : 'POST'} kbn:${BASE_ALERTING_API_PATH}/rule${
isEdit ? `/${id}` : ''
}\n${formattedRequest}`}
</EuiCodeBlock>
);
};
Loading

0 comments on commit 2363666

Please sign in to comment.