Skip to content

Commit

Permalink
Merge branch 'main' into 198964-apm-migrate-testapm_api_integrationte…
Browse files Browse the repository at this point in the history
…stscustom_dashboards-to-be-deployment-agnostic-api-tests
  • Loading branch information
miloszmarcinkowski authored Nov 7, 2024
2 parents 1c908a5 + 3f236b1 commit b9ca370
Show file tree
Hide file tree
Showing 246 changed files with 15,814 additions and 12,789 deletions.
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
Empty file.
Empty file.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@
"@octokit/rest": "^17.11.2",
"@parcel/watcher": "^2.1.0",
"@playwright/test": "=1.46.0",
"@redocly/cli": "^1.25.9",
"@redocly/cli": "^1.25.10",
"@statoscope/webpack-plugin": "^5.28.2",
"@storybook/addon-a11y": "^6.5.16",
"@storybook/addon-actions": "^6.5.16",
Expand Down Expand Up @@ -1690,6 +1690,7 @@
"cypress-axe": "^1.5.0",
"cypress-file-upload": "^5.0.8",
"cypress-multi-reporters": "^1.6.4",
"cypress-network-idle": "^1.14.2",
"cypress-real-events": "^1.11.0",
"cypress-recurse": "^1.35.2",
"date-fns": "^2.29.3",
Expand Down
14 changes: 11 additions & 3 deletions packages/kbn-esql-ast/src/builder/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/* eslint-disable @typescript-eslint/no-namespace */

import { LeafPrinter } from '../pretty_print';
import {
ESQLAstComment,
ESQLAstCommentMultiLine,
Expand Down Expand Up @@ -125,16 +126,23 @@ export namespace Builder {
};

export const column = (
template: Omit<AstNodeTemplate<ESQLColumn>, 'name' | 'quoted'>,
template: Omit<AstNodeTemplate<ESQLColumn>, 'name' | 'quoted' | 'parts'>,
fromParser?: Partial<AstNodeParserFields>
): ESQLColumn => {
return {
const node: ESQLColumn = {
...template,
...Builder.parserFields(fromParser),
parts: template.args.map((arg) =>
arg.type === 'identifier' ? arg.name : LeafPrinter.param(arg)
),
quoted: false,
name: template.parts.join('.'),
name: '',
type: 'column',
};

node.name = LeafPrinter.column(node);

return node;
};

export const order = (
Expand Down
37 changes: 31 additions & 6 deletions packages/kbn-esql-ast/src/mutate/commands/from/metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ describe('commands.from.metadata', () => {

expect(column).toMatchObject({
type: 'column',
parts: ['a'],
args: [
{
type: 'identifier',
name: 'a',
},
],
// parts: ['a'],
});
});

Expand All @@ -40,19 +46,39 @@ describe('commands.from.metadata', () => {
expect(columns).toMatchObject([
{
type: 'column',
parts: ['a'],
args: [
{
type: 'identifier',
name: 'a',
},
],
},
{
type: 'column',
parts: ['b'],
args: [
{
type: 'identifier',
name: 'b',
},
],
},
{
type: 'column',
parts: ['_id'],
args: [
{
type: 'identifier',
name: '_id',
},
],
},
{
type: 'column',
parts: ['_lang'],
args: [
{
type: 'identifier',
name: '_lang',
},
],
},
]);
});
Expand Down Expand Up @@ -156,7 +182,6 @@ describe('commands.from.metadata', () => {
it('return inserted `column` node, and parent `option` node', () => {
const src1 = 'FROM index METADATA a';
const { root } = parse(src1);

const tuple = commands.from.metadata.insert(root, 'b');

expect(tuple).toMatchObject([
Expand Down
22 changes: 18 additions & 4 deletions packages/kbn-esql-ast/src/mutate/commands/from/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export const find = (
}

const predicate: Predicate<[ESQLColumn, unknown]> = ([field]) =>
cmpArr(field.parts, fieldName as string[]);
cmpArr(
field.args.map((arg) => (arg.type === 'identifier' ? arg.name : '')),
fieldName as string[]
);

return findByPredicate(list(ast), predicate);
};
Expand Down Expand Up @@ -128,7 +131,12 @@ export const remove = (
fieldName = [fieldName];
}

return removeByPredicate(ast, (field) => cmpArr(field.parts, fieldName as string[]));
return removeByPredicate(ast, (field) =>
cmpArr(
field.args.map((arg) => (arg.type === 'identifier' ? arg.name : '')),
fieldName as string[]
)
);
};

/**
Expand Down Expand Up @@ -161,7 +169,8 @@ export const insert = (
}

const parts: string[] = typeof fieldName === 'string' ? [fieldName] : fieldName;
const column = Builder.expression.column({ parts });
const args = parts.map((part) => Builder.identifier({ name: part }));
const column = Builder.expression.column({ args });

if (index === -1) {
option.args.push(column);
Expand Down Expand Up @@ -195,7 +204,12 @@ export const upsert = (
const parts = Array.isArray(fieldName) ? fieldName : [fieldName];
const existing = Walker.find(
option,
(node) => node.type === 'column' && cmpArr(node.parts, parts)
(node) =>
node.type === 'column' &&
cmpArr(
node.args.map((arg) => (arg.type === 'identifier' ? arg.name : '')),
parts
)
);
if (existing) {
return undefined;
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-esql-ast/src/mutate/commands/sort/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ describe('commands.sort', () => {
args: [
{
type: 'column',
parts: ['b', 'a'],
args: [{ name: 'b' }, { name: 'a' }],
},
],
});
expect(node2).toMatchObject({
type: 'column',
parts: ['a', 'b'],
args: [{ name: 'a' }, { name: 'b' }],
});
});

Expand Down
30 changes: 19 additions & 11 deletions packages/kbn-esql-ast/src/mutate/commands/sort/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ export type NewSortExpressionTemplate =
const createSortExpression = (
template: string | string[] | NewSortExpressionTemplate
): SortExpression => {
const parts: string[] =
typeof template === 'string'
? [template]
: Array.isArray(template)
? template
: typeof template.parts === 'string'
? [template.parts]
: template.parts;
const identifiers = parts.map((part) => Builder.identifier({ name: part }));
const column = Builder.expression.column({
parts:
typeof template === 'string'
? [template]
: Array.isArray(template)
? template
: typeof template.parts === 'string'
? [template.parts]
: template.parts,
args: identifiers,
});

if (typeof template === 'string' || Array.isArray(template)) {
Expand Down Expand Up @@ -189,12 +191,18 @@ export const find = (
return findByPredicate(ast, ([node]) => {
let isMatch = false;
if (node.type === 'column') {
isMatch = util.cmpArr(node.parts, arrParts);
isMatch = util.cmpArr(
node.args.map((arg) => (arg.type === 'identifier' ? arg.name : '')),
arrParts
);
} else if (node.type === 'order') {
const columnParts = (node.args[0] as ESQLColumn)?.parts;
const columnParts = (node.args[0] as ESQLColumn)?.args;

if (Array.isArray(columnParts)) {
isMatch = util.cmpArr(columnParts, arrParts);
isMatch = util.cmpArr(
columnParts.map((arg) => (arg.type === 'identifier' ? arg.name : '')),
arrParts
);
}
}

Expand Down
Loading

0 comments on commit b9ca370

Please sign in to comment.