Skip to content

Commit

Permalink
Merge branch '8.x' into backport/8.x/pr-195375
Browse files Browse the repository at this point in the history
  • Loading branch information
gsoldevila authored Nov 7, 2024
2 parents 7441f53 + c3bf0b4 commit 2c91a5e
Show file tree
Hide file tree
Showing 203 changed files with 6,669 additions and 3,698 deletions.
6 changes: 3 additions & 3 deletions .buildkite/ftr_security_serverless_configs.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
disabled:
# Base config files, only necessary to inform config finding script
- x-pack/test_serverless/functional/test_suites/security/cypress/security_config.base.ts
- x-pack/test_serverless/functional/test_suites/security/cypress/cypress.config.ts
- x-pack/test/security_solution_api_integration/config/serverless/config.base.ts
- x-pack/test/security_solution_api_integration/config/serverless/config.base.essentials.ts
- x-pack/test/security_solution_api_integration/config/serverless/config.base.edr_workflows.ts
- x-pack/test/defend_workflows_cypress/serverless_config.base.ts
- x-pack/test/osquery_cypress/serverless_config.base.ts

# Cypress configs, for now these are still run manually
- x-pack/test/defend_workflows_cypress/serverless_config.ts
- x-pack/test/osquery_cypress/serverless_cli_config.ts
- x-pack/test_serverless/functional/test_suites/security/cypress/security_config.ts
- x-pack/test/security_solution_cypress/serverless_config.ts


# Playwright
- x-pack/test/security_solution_playwright/serverless_config.ts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,20 @@ steps:
automatic:
- exit_status: '-1'
limit: 1

- command: .buildkite/scripts/steps/functional/defend_workflows_serverless.sh
label: 'Defend Workflows Cypress Tests on Serverless'
agents:
enableNestedVirtualization: true
localSsds: 1
localSsdInterface: nvme
machineType: n2-standard-4
depends_on:
- build
- quick_checks
timeout_in_minutes: 60
parallelism: 14
retry:
automatic:
- exit_status: '-1'
limit: 1

This file was deleted.

2,022 changes: 2,022 additions & 0 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions docs/api/synthetics/monitors/delete-monitor-api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@ Deletes one or more monitors from the Synthetics app.
You must have `all` privileges for the *Synthetics* feature in the *{observability}* section of the
<<kibana-feature-privileges,{kib} feature privileges>>.

You must have `all` privileges for the *Synthetics* feature in the *{observability}* section of the
<<kibana-feature-privileges,{kib} feature privileges>>.


[[delete-monitor-api-path-params]]
=== {api-path-parms-title}

`config_id`::
(Required, string) The ID of the monitor that you want to delete.


Here is an example of a DELETE request to delete a monitor by ID:

[source,sh]
Expand All @@ -37,7 +33,7 @@ DELETE /api/synthetics/monitors/monitor1-id

==== Bulk Delete Monitors

You can delete multiple monitors by sending a list of config ids to a DELETE request to the `/api/synthetics/monitors` endpoint.
You can delete multiple monitors by sending a list of config ids to a POST request to the `/api/synthetics/monitors/_bulk_delete` endpoint.


[[monitors-delete-request-body]]
Expand All @@ -49,11 +45,11 @@ The request body should contain an array of monitors IDs that you want to delete
(Required, array of strings) An array of monitor IDs to delete.


Here is an example of a DELETE request to delete a list of monitors by ID:
Here is an example of a POST request to delete a list of monitors by ID:

[source,sh]
--------------------------------------------------
DELETE /api/synthetics/monitors
POST /api/synthetics/monitors/_bulk_delete
{
"ids": [
"monitor1-id",
Expand Down
44 changes: 24 additions & 20 deletions docs/api/synthetics/params/delete-param.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Deletes one or more parameters from the Synthetics app.

=== {api-request-title}

`DELETE <kibana host>:<port>/api/synthetics/params`
`DELETE <kibana host>:<port>/api/synthetics/params/<param_id>`

`DELETE <kibana host>:<port>/s/<space_id>/api/synthetics/params`
`DELETE <kibana host>:<port>/s/<space_id>/api/synthetics/params/<param_id>`

=== {api-prereq-title}

Expand All @@ -20,26 +20,19 @@ You must have `all` privileges for the *Synthetics* feature in the *{observabili
You must have `all` privileges for the *Synthetics* feature in the *{observability}* section of the
<<kibana-feature-privileges,{kib} feature privileges>>.

[[parameters-delete-request-body]]
==== Request Body
[[parameters-delete-path-param]]
==== Path Parameters

The request body should contain an array of parameter IDs that you want to delete.

`ids`::
(Required, array of strings) An array of parameter IDs to delete.
`param_id`::
(Required, string) An id of parameter to delete.


Here is an example of a DELETE request to delete a list of parameters by ID:
Here is an example of a DELETE request to delete a parameter by its ID:

[source,sh]
--------------------------------------------------
DELETE /api/synthetics/params
{
"ids": [
"param1-id",
"param2-id"
]
}
DELETE /api/synthetics/params/param_id1
--------------------------------------------------

[[parameters-delete-response-example]]
Expand All @@ -58,10 +51,21 @@ Here's an example response for deleting multiple parameters:
{
"id": "param1-id",
"deleted": true
},
{
"id": "param2-id",
"deleted": true
}
]
--------------------------------------------------
--------------------------------------------------

==== Bulk delete parameters
To delete multiple parameters, you can send a POST request to `/api/synthetics/params/_bulk_delete` with an array of parameter IDs to delete via body.

Here is an example of a POST request to delete multiple parameters:

[source,sh]
--------------------------------------------------
POST /api/synthetics/params/_bulk_delete
{
"ids": ["param1-id", "param2-id"]
}
--------------------------------------------------


4 changes: 2 additions & 2 deletions docs/management/connectors/action-types/jira.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The Jira connector uses the https://developer.atlassian.com/cloud/jira/platform/
[[jira-compatibility]]
=== Compatibility

Jira on-premise deployments (Server and Data Center) are not supported.
Jira Cloud and Jira Data Center are supported. Jira on-premise deployments are not supported.

[float]
[[define-jira-ui]]
Expand All @@ -37,7 +37,7 @@ Name:: The name of the connector.
URL:: Jira instance URL.
Project key:: Jira project key.
Email:: The account email for HTTP Basic authentication.
API token:: Jira API authentication token for HTTP Basic authentication.
API token:: Jira API authentication token for HTTP Basic authentication. For Jira Data Center, this value should be the password associated with the email owner.

[float]
[[jira-action-configuration]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function useAlertsHistory({
http,
instanceId,
}: Props): UseAlertsHistory {
const enabled = !!featureIds.length;
const { isInitialLoading, isLoading, isError, isSuccess, isRefetching, data } = useQuery({
queryKey: ['useAlertsHistory'],
queryFn: async ({ signal }) => {
Expand All @@ -71,10 +72,11 @@ export function useAlertsHistory({
});
},
refetchOnWindowFocus: false,
enabled,
});
return {
data: isInitialLoading ? EMPTY_ALERTS_HISTORY : data ?? EMPTY_ALERTS_HISTORY,
isLoading: isInitialLoading || isLoading || isRefetching,
isLoading: enabled && (isInitialLoading || isLoading || isRefetching),
isSuccess,
isError,
};
Expand Down
8 changes: 8 additions & 0 deletions x-pack/plugins/actions/server/lib/axios_utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,4 +577,12 @@ describe('throwIfResponseIsNotValid', () => {
})
).not.toThrow();
});

test('it does NOT throw if HTTP status code is 204 even if the content type is not supported', () => {
expect(() =>
throwIfResponseIsNotValid({
res: { ...res, status: 204, headers: { ['content-type']: 'text/html' } },
})
).not.toThrow();
});
});
10 changes: 10 additions & 0 deletions x-pack/plugins/actions/server/lib/axios_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ export const throwIfResponseIsNotValid = ({
const requiredContentType = 'application/json';
const contentType = res.headers['content-type'] ?? 'undefined';
const data = res.data;
const statusCode = res.status;

/**
* Some external services may return a 204
* status code but with unsupported content type like text/html.
* To avoid throwing on valid requests we return.
*/
if (statusCode === 204) {
return;
}

/**
* Check that the content-type of the response is application/json.
Expand Down
5 changes: 5 additions & 0 deletions x-pack/plugins/alerting/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ export function setupSavedObjects(
// Encrypted attributes
encryptedSavedObjects.registerType({
type: RULE_SAVED_OBJECT_TYPE,
/**
* We disable enforcing random SO IDs for the rule SO
* to allow users creating rules with a predefined ID.
*/
enforceRandomId: false,
attributesToEncrypt: new Set(RuleAttributesToEncrypt),
attributesToIncludeInAAD: new Set(RuleAttributesIncludedInAAD),
});
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/ml/public/application/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// Components
@import 'components/annotations/annotation_description_list/index'; // SASSTODO: This file overwrites EUI directly
@import 'components/anomalies_table/index'; // SASSTODO: This file overwrites EUI directly
@import 'components/color_range_legend/index';
@import 'components/entity_cell/index';
@import 'components/influencers_list/index';
@import 'components/job_selector/index';
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,36 @@

import type { FC } from 'react';
import React, { useEffect, useRef } from 'react';
import { css } from '@emotion/react';
import d3 from 'd3';

import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';

import { euiThemeVars } from '@kbn/ui-theme';

const COLOR_RANGE_RESOLUTION = 10;

// Overrides for d3/svg default styles
const cssOverride = css({
// Override default font size and color for axis
text: {
fontSize: `calc(${euiThemeVars.euiFontSizeXS} - 2px)`,
fill: euiThemeVars.euiColorDarkShade,
},
// Override default styles for axis lines
'.axis': {
path: {
fill: 'none',
stroke: 'none',
},
line: {
fill: 'none',
stroke: euiThemeVars.euiColorMediumShade,
shapeRendering: 'crispEdges',
},
},
});

interface ColorRangeLegendProps {
colorRange: (d: number) => string;
justifyTicks?: boolean;
Expand Down Expand Up @@ -65,7 +89,6 @@ export const ColorRangeLegend: FC<ColorRangeLegendProps> = ({

const wrapper = d3
.select(d3Container.current)
.classed('mlColorRangeLegend', true)
.attr('width', wrapperWidth)
.attr('height', wrapperHeight)
.append('g')
Expand Down Expand Up @@ -144,7 +167,7 @@ export const ColorRangeLegend: FC<ColorRangeLegendProps> = ({
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<svg ref={d3Container} />
<svg ref={d3Container} css={cssOverride} />
</EuiFlexItem>
</EuiFlexGroup>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@ export const dataStreamStatRt = rt.intersection([

export type DataStreamStat = rt.TypeOf<typeof dataStreamStatRt>;

export const dataStreamDocsStatRt = rt.type({
dataset: rt.string,
count: rt.number,
});

export type DataStreamDocsStat = rt.TypeOf<typeof dataStreamDocsStatRt>;

export const getDataStreamTotalDocsResponseRt = rt.type({
totalDocs: rt.array(dataStreamDocsStatRt),
});

export type DataStreamTotalDocsResponse = rt.TypeOf<typeof getDataStreamTotalDocsResponseRt>;

export const getDataStreamDegradedDocsResponseRt = rt.type({
degradedDocs: rt.array(dataStreamDocsStatRt),
});

export type DataStreamDegradedDocsResponse = rt.TypeOf<typeof getDataStreamDegradedDocsResponseRt>;

export const integrationDashboardRT = rt.type({
id: rt.string,
title: rt.string,
Expand Down Expand Up @@ -84,15 +103,6 @@ export const getIntegrationsResponseRt = rt.exact(

export type IntegrationResponse = rt.TypeOf<typeof getIntegrationsResponseRt>;

export const degradedDocsRt = rt.type({
dataset: rt.string,
count: rt.number,
docsCount: rt.number,
percentage: rt.number,
});

export type DegradedDocs = rt.TypeOf<typeof degradedDocsRt>;

export const degradedFieldRt = rt.type({
name: rt.string,
count: rt.number,
Expand Down Expand Up @@ -188,12 +198,6 @@ export const getDataStreamsStatsResponseRt = rt.exact(
})
);

export const getDataStreamsDegradedDocsStatsResponseRt = rt.exact(
rt.type({
degradedDocs: rt.array(degradedDocsRt),
})
);

export const getDataStreamsSettingsResponseRt = rt.exact(dataStreamSettingsRt);

export const getDataStreamsDetailsResponseRt = rt.exact(dataStreamDetailsRt);
Expand Down
Loading

0 comments on commit 2c91a5e

Please sign in to comment.