Skip to content

Commit

Permalink
Merge branch 'main' into discover-flaky-histogram-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal authored Oct 11, 2024
2 parents 6d48b5c + b30c19f commit 39264c8
Show file tree
Hide file tree
Showing 139 changed files with 2,585 additions and 730 deletions.
6 changes: 4 additions & 2 deletions .buildkite/ftr_oblt_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ disabled:
- x-pack/test_serverless/functional/test_suites/observability/cypress/config_headless.ts
- x-pack/test_serverless/functional/test_suites/observability/cypress/config_runner.ts

# serverless config files that run deployment-agnostic tests
# Failing https://github.com/elastic/kibana/issues/195811
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts

defaultQueue: 'n2-4-spot'
enabled:
- x-pack/test_serverless/api_integration/test_suites/observability/config.ts
Expand All @@ -25,5 +29,3 @@ enabled:
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group5.ts
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group6.ts
- x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts
# serverless config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
6 changes: 4 additions & 2 deletions .buildkite/ftr_search_serverless_configs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
disabled:
# Base config files, only necessary to inform config finding script

# serverless config files that run deployment-agnostic tests
# Failing https://github.com/elastic/kibana/issues/195811
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/search.serverless.config.ts

defaultQueue: 'n2-4-spot'
enabled:
- x-pack/test_serverless/api_integration/test_suites/search/config.ts
Expand All @@ -18,5 +22,3 @@ enabled:
- x-pack/test_serverless/functional/test_suites/search/common_configs/config.group4.ts
- x-pack/test_serverless/functional/test_suites/search/common_configs/config.group5.ts
- x-pack/test_serverless/functional/test_suites/search/common_configs/config.group6.ts
# serverless config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/search.serverless.config.ts
6 changes: 4 additions & 2 deletions .buildkite/ftr_security_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ disabled:
- x-pack/test_serverless/functional/config.base.ts
- x-pack/test_serverless/shared/config.base.ts

# serverless config files that run deployment-agnostic tests
# Failing https://github.com/elastic/kibana/issues/195811
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/security.serverless.config.ts

defaultQueue: 'n2-4-spot'
enabled:
- x-pack/test_serverless/api_integration/test_suites/security/config.ts
Expand Down Expand Up @@ -100,5 +104,3 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/edr_workflows/response_actions/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_endpoint/configs/serverless.endpoint.config.ts
- x-pack/test/security_solution_endpoint/configs/serverless.integrations.config.ts
# serverless config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/security.serverless.config.ts
3 changes: 2 additions & 1 deletion .buildkite/pull_requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"^\\.backportrc\\.json$",
"^nav-kibana-dev\\.docnav\\.json$",
"^src/dev/prs/kibana_qa_pr_list\\.json$",
"^\\.buildkite/pull_requests\\.json$"
"^\\.buildkite/pull_requests\\.json$",
"^\\.devcontainer/"
],
"always_require_ci_on_changed": [
"^docs/developer/plugin-list.asciidoc$",
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/cloud/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fi
if is_pr_with_label "ci:cloud-redeploy"; then
echo "--- Shutdown Previous Deployment"
CLOUD_DEPLOYMENT_ID=$(ecctl deployment list --output json | jq -r '.deployments[] | select(.name == "'$CLOUD_DEPLOYMENT_NAME'") | .id')
if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
if [ -z "${CLOUD_DEPLOYMENT_ID}" ] || [ "${CLOUD_DEPLOYMENT_ID}" == "null" ]; then
echo "No deployment to remove"
else
echo "Shutting down previous deployment..."
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/serverless/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ deploy() {

PROJECT_ID=$(jq -r '[.items[] | select(.name == "'$PROJECT_NAME'")] | .[0].id' $PROJECT_EXISTS_LOGS)
if is_pr_with_label "ci:project-redeploy"; then
if [ -z "${PROJECT_ID}" ]; then
if [ -z "${PROJECT_ID}" ] || [ "${PROJECT_ID}" == "null" ]; then
echo "No project to remove"
else
echo "Shutting down previous project..."
Expand Down
2 changes: 2 additions & 0 deletions .github/updatecli/values.d/ironbank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config:
- path: src/dev/build/tasks/os_packages/docker_generator/templates/ironbank
11 changes: 11 additions & 0 deletions .github/updatecli/values.d/scm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
scm:
enabled: true
owner: elastic
repository: kibana
branch: main
commitusingapi: true
# begin updatecli-compose policy values
user: kibanamachine
email: [email protected]
# end updatecli-compose policy values

3 changes: 3 additions & 0 deletions .github/updatecli/values.d/updatecli-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
spec:
files:
- "updatecli-compose.yaml"
38 changes: 38 additions & 0 deletions .github/workflows/updatecli-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: updatecli-compose

on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'

permissions:
contents: read

jobs:
compose:
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
pull-requests: write
steps:
- uses: actions/checkout@v4

- uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: elastic/oblt-actions/updatecli/run@v1
with:
command: --experimental compose diff
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: elastic/oblt-actions/updatecli/run@v1
with:
command: --experimental compose apply
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 changes: 31 additions & 14 deletions docs/maps/connect-to-ems.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:ems: Elastic Maps Service
:ems-docker-repo: docker.elastic.co/elastic-maps-service/elastic-maps-server
:ems-docker-image: {ems-docker-repo}:{version}-amd64
:ems-docker-image: {ems-docker-repo}:{version}
:ems-headers-url: https://deployment-host

[[maps-connect-to-ems]]
Expand Down Expand Up @@ -81,34 +81,53 @@ If you cannot connect to {ems} from the {kib} server or browser clients, and you

{hosted-ems} is a self-managed version of {ems} offered as a Docker image that provides both the EMS basemaps and EMS boundaries. The image is bundled with basemaps up to zoom level 8. After connecting it to your {es} cluster for license validation, you have the option to download and configure a more detailed basemaps database.

You can use +docker pull+ to download the {hosted-ems} image from the Elastic Docker registry.

. Pull the {hosted-ems} Docker image.
+
ifeval::["{release-state}"=="unreleased"]
Version {version} of {hosted-ems} has not yet been released, so no Docker image is currently available for this version.
WARNING: Version {version} of {hosted-ems} has not yet been released.
No Docker image is currently available for this version.
endif::[]

ifeval::["{release-state}"!="unreleased"]

+
["source","bash",subs="attributes"]
----------------------------------
docker pull {ems-docker-image}
----------------------------------

Start {hosted-ems} and expose the default port `8080`:
. Optional: Install
https://docs.sigstore.dev/system_config/installation/[Cosign] for your
environment. Then use Cosign to verify the {es} image's signature.
+
[source,sh,subs="attributes"]
----
wget https://artifacts.elastic.co/cosign.pub
cosign verify --key cosign.pub {ems-docker-image}
----
+
The `cosign` command prints the check results and the signature payload in JSON format:
+
[source,sh,subs="attributes"]
--------------------------------------------
Verification for {ems-docker-image} --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- Existence of the claims in the transparency log was verified offline
- The signatures were verified against the specified public key
--------------------------------------------


. Start {hosted-ems} and expose the default port `8080`:
+
["source","bash",subs="attributes"]
----------------------------------
docker run --rm --init --publish 8080:8080 \
{ems-docker-image}
----------------------------------

+
Once {hosted-ems} is running, follow instructions from the webpage at `localhost:8080` to define a configuration file and optionally download a more detailed basemaps database.

+
[role="screenshot"]
image::images/elastic-maps-server-instructions.png[Set-up instructions]

endif::[]

[float]
[[elastic-maps-server-configuration]]
==== Configuration
Expand Down Expand Up @@ -193,7 +212,6 @@ One way to configure {hosted-ems} is to provide `elastic-maps-server.yml` via bi

["source","yaml",subs="attributes"]
--------------------------------------------
version: '2'
services:
ems-server:
image: {ems-docker-image}
Expand All @@ -212,7 +230,6 @@ These variables can be set with +docker-compose+ like this:

["source","yaml",subs="attributes"]
----------------------------------------------------------
version: '2'
services:
ems-server:
image: {ems-docker-image}
Expand Down
Binary file modified docs/maps/images/elastic-maps-server-instructions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,85 @@ ROW (asdf + asdf)::string, 1.2::string, "1234"::integer, (12321342134 + 23412341
- "aaaaaaaaaaa")::boolean`);
});
});

describe('list literals', () => {
describe('numeric', () => {
test('wraps long list literals one line', () => {
const query =
'ROW [1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890]';
const text = reprint(query).text;

expect('\n' + text).toBe(`
ROW
[1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890,
1234567890, 1234567890, 1234567890]`);
});

test('wraps long list literals to multiple lines one line', () => {
const query = `ROW [1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890,
1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890,
1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890,
1234567890, 1234567890, 1234567890]`;
const text = reprint(query).text;

expect('\n' + text).toBe(`
ROW
[1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890,
1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890,
1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890,
1234567890, 1234567890, 1234567890]`);
});

test('breaks very long values one-per-line', () => {
const query = `ROW fn1(fn2(fn3(fn4(fn5(fn6(fn7(fn8([1234567890, 1234567890, 1234567890, 1234567890, 1234567890]))))))))`;
const text = reprint(query, { wrap: 40 }).text;

expect('\n' + text).toBe(`
ROW
FN1(
FN2(
FN3(
FN4(
FN5(
FN6(
FN7(
FN8(
[
1234567890,
1234567890,
1234567890,
1234567890,
1234567890]))))))))`);
});
});

describe('string', () => {
test('wraps long list literals one line', () => {
const query =
'ROW ["some text", "another text", "one more text literal", "and another one", "and one more", "and one more", "and one more", "and one more", "and one more"]';
const text = reprint(query).text;

expect('\n' + text).toBe(`
ROW
["some text", "another text", "one more text literal", "and another one",
"and one more", "and one more", "and one more", "and one more",
"and one more"]`);
});

test('can break very long strings per line', () => {
const query =
'ROW ["..............................................", "..............................................", ".............................................."]';
const text = reprint(query).text;

expect('\n' + text).toBe(`
ROW
[
"..............................................",
"..............................................",
".............................................."]`);
});
});
});
});

test.todo('Idempotence on multiple times pretty printing');
23 changes: 13 additions & 10 deletions packages/kbn-esql-ast/src/pretty_print/wrapping_pretty_printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import {
CommandVisitorContext,
ExpressionVisitorContext,
FunctionCallExpressionVisitorContext,
ListLiteralExpressionVisitorContext,
Visitor,
} from '../visitor';
import { singleItems } from '../visitor/utils';
import { children, singleItems } from '../visitor/utils';
import { BasicPrettyPrinter, BasicPrettyPrinterOptions } from './basic_pretty_printer';
import { getPrettyPrintStats } from './helpers';
import { LeafPrinter } from './leaf_printer';
Expand Down Expand Up @@ -235,7 +236,11 @@ export class WrappingPrettyPrinter {
}

private printArguments(
ctx: CommandVisitorContext | CommandOptionVisitorContext | FunctionCallExpressionVisitorContext,
ctx:
| CommandVisitorContext
| CommandOptionVisitorContext
| FunctionCallExpressionVisitorContext
| ListLiteralExpressionVisitorContext,
inp: Input
) {
let txt = '';
Expand All @@ -247,7 +252,7 @@ export class WrappingPrettyPrinter {
let remainingCurrentLine = inp.remaining;
let oneArgumentPerLine = false;

for (const child of singleItems(ctx.node.args)) {
for (const child of children(ctx.node)) {
if (getPrettyPrintStats(child).hasLineBreakingDecorations) {
oneArgumentPerLine = true;
break;
Expand Down Expand Up @@ -489,13 +494,11 @@ export class WrappingPrettyPrinter {
})

.on('visitListLiteralExpression', (ctx, inp: Input): Output => {
let elements = '';

for (const out of ctx.visitElements(inp)) {
elements += (elements ? ', ' : '') + out.txt;
}

const formatted = `[${elements}]${inp.suffix ?? ''}`;
const args = this.printArguments(ctx, {
indent: inp.indent,
remaining: inp.remaining - 1,
});
const formatted = `[${args.txt}]${inp.suffix ?? ''}`;
const { txt, indented } = this.decorateWithComments(inp.indent, ctx.node, formatted);

return { txt, indented };
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-esql-ast/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export type ESQLAstField = ESQLFunction | ESQLColumn;
export type ESQLAstItem = ESQLSingleAstItem | ESQLAstItem[];

export type ESQLAstNodeWithArgs = ESQLCommand | ESQLCommandOption | ESQLFunction;
export type ESQLAstNodeWithChildren = ESQLAstNodeWithArgs | ESQLList;

/**
* *Proper* are nodes which are objects with `type` property, once we get rid
Expand Down
Loading

0 comments on commit 39264c8

Please sign in to comment.