Skip to content

Commit

Permalink
Merge branch 'main' into bug-kpi-viz-wildcard
Browse files Browse the repository at this point in the history
  • Loading branch information
christineweng committed May 14, 2024
2 parents 6e3c042 + 71bd961 commit fecc249
Show file tree
Hide file tree
Showing 171 changed files with 3,583 additions and 2,090 deletions.
10 changes: 10 additions & 0 deletions .buildkite/pipelines/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ steps:
- exit_status: '*'
limit: 1

- command: KIBANA_DOCKER_CONTEXT=chainguard .buildkite/scripts/steps/artifacts/docker_context.sh
label: 'Docker Context Verification'
agents:
queue: n2-2
timeout_in_minutes: 30
retry:
automatic:
- exit_status: '*'
limit: 1

- command: KIBANA_DOCKER_CONTEXT=ironbank .buildkite/scripts/steps/artifacts/docker_context.sh
label: 'Docker Context Verification'
agents:
Expand Down
1 change: 1 addition & 0 deletions .buildkite/scripts/build_kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ if is_pr_with_label "ci:build-cloud-image"; then
--skip-docker-ubi \
--skip-docker-fips \
--skip-docker-ubuntu \
--skip-docker-chainguard \
--skip-docker-serverless \
--skip-docker-contexts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ node scripts/build \
--docker-namespace="kibana-ci" \
--docker-tag="$KIBANA_IMAGE_TAG" \
--skip-docker-ubuntu \
--skip-docker-chainguard \
--skip-docker-ubi \
--skip-docker-cloud \
--skip-docker-contexts \
Expand Down
3 changes: 3 additions & 0 deletions .buildkite/scripts/steps/artifacts/docker_context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ case $KIBANA_DOCKER_CONTEXT in
default)
DOCKER_CONTEXT_FILE="kibana-$FULL_VERSION-docker-build-context.tar.gz"
;;
chainguard)
DOCKER_CONTEXT_FILE="kibana-chainguard-$FULL_VERSION-docker-build-context.tar.gz"
;;
cloud)
DOCKER_CONTEXT_FILE="kibana-cloud-$FULL_VERSION-docker-build-context.tar.gz"
;;
Expand Down
1 change: 1 addition & 0 deletions .buildkite/scripts/steps/artifacts/docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ node scripts/build \
--docker-namespace="kibana-ci" \
--docker-tag="$KIBANA_IMAGE_TAG" \
--skip-docker-ubuntu \
--skip-docker-chainguard \
--skip-docker-ubi \
--skip-docker-fips \
--skip-docker-cloud \
Expand Down
1 change: 1 addition & 0 deletions .buildkite/scripts/steps/cloud/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ else
--skip-docker-ubi \
--skip-docker-fips \
--skip-docker-ubuntu \
--skip-docker-chainguard \
--skip-docker-serverless \
--skip-docker-contexts
fi
Expand Down
1 change: 1 addition & 0 deletions .buildkite/scripts/steps/fips/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ node scripts/build \
--docker-push \
--skip-docker-ubi \
--skip-docker-ubuntu \
--skip-docker-chainguard \
--skip-docker-cloud \
--skip-docker-serverless \
--skip-docker-contexts
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12.2
20.13.1
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12.2
20.13.1
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.12.2-darwin_amd64": ("node-v20.12.2-darwin-x64.tar.gz", "node-v20.12.2-darwin-x64", "cd5e9a80a38ccffc036a87b232a5402339c7bf8fa9a494ae0731a1a671687718"),
"20.12.2-darwin_arm64": ("node-v20.12.2-darwin-arm64.tar.gz", "node-v20.12.2-darwin-arm64", "98eb624b52efec2530079e1d11296ec0ac20771b94b087d21649250339cf5332"),
"20.12.2-linux_arm64": ("node-v20.12.2-linux-arm64.tar.xz", "node-v20.12.2-linux-arm64", "26f6dfac78a119e088458c1e6f2beb6c546a170d916060a23c92075718f92966"),
"20.12.2-linux_amd64": ("node-v20.12.2-linux-x64.tar.xz", "node-v20.12.2-linux-x64", "37756bc241b099e7435e20ba088dd9c13f39c6dc4235661c807cdd7b361371ef"),
"20.12.2-windows_amd64": ("node-v20.12.2-win-x64.zip", "node-v20.12.2-win-x64", "66dda1717cae30a13be6bb17ad96ee54b69f2c23c85acd9c3299b095fa26b452"),
"20.13.1-darwin_amd64": ("node-v20.13.1-darwin-x64.tar.gz", "node-v20.13.1-darwin-x64", "80bde95dc976b84db5ca566738c07305087ae578f5f3b05191e0e6ff54aaeaf2"),
"20.13.1-darwin_arm64": ("node-v20.13.1-darwin-arm64.tar.gz", "node-v20.13.1-darwin-arm64", "c30fe595f59dcd2c5158da6bf8bc251ffc85ca37304afa89db150fb3c62c4507"),
"20.13.1-linux_arm64": ("node-v20.13.1-linux-arm64.tar.xz", "node-v20.13.1-linux-arm64", "5a41797a5815f42e0e9e4d2185d07d5d395386dc681a5a914563586c735ae31f"),
"20.13.1-linux_amd64": ("node-v20.13.1-linux-x64.tar.xz", "node-v20.13.1-linux-x64", "eb449c4db6c5769c4219fdbfa1c7cbc8b367b9f8c7be1eb534dc8f6a3c80a97f"),
"20.13.1-windows_amd64": ("node-v20.13.1-win-x64.zip", "node-v20.13.1-win-x64", "555a55c0c7441cb90e441115c81f610fca712dd5b192034d5eaafd7c29924425"),
},
node_version = "20.12.2",
node_version = "20.13.1",
node_urls = [
"https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v{version}/{filename}",
],
Expand Down
3 changes: 1 addition & 2 deletions dev_docs/key_concepts/embeddables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ date: 2024-05-09
tags: ['kibana', 'dev', 'contributor', 'api docs']
---

Embeddable documentation and examples are bundled with Kibana and accessable by running `yarn start --run-examples`.
Navigate to `http://localhost:5601/app/embeddablesApp`.
Embeddable documentation available at [/src/plugins/embeddable/README.md](https://github.com/elastic/kibana/blob/main/src/plugins/embeddable/README.md)
4 changes: 2 additions & 2 deletions docs/developer/advanced/upgrading-nodejs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ These files must be updated when upgrading Node.js:
- {kib-repo}blob/{branch}/WORKSPACE.bazel[`WORKSPACE.bazel`] - The version is specified in the `node_version` property.
Besides this property, the list of files under `node_repositories` must be updated along with their respective SHA256 hashes.
These can be found in the `SHASUMS256.txt` file inside the public `kibana-custom-node-artifacts` GCP bucket.
Example for Node.js v20.12.2: https://storage.googleapis.com/kibana-custom-node-artifacts/node-glibc-217/dist/v20.12.2/SHASUMS256.txt[kibana-custom-node-artifacts/node-glibc-217/dist/v20.12.2/SHASUMS256.txt]
Example for Node.js v20.13.1: https://storage.googleapis.com/kibana-custom-node-artifacts/node-glibc-217/dist/v20.13.1/SHASUMS256.txt[kibana-custom-node-artifacts/node-glibc-217/dist/v20.13.1/SHASUMS256.txt]

See PR {kib-repo}pull/128123[#128123] for an example of how the Node.js version has been upgraded previously.

Expand All @@ -43,7 +43,7 @@ The only difference between the offical Node.js build and our custom build, is t
==== How to start a new build

To generate a new custom Node.js build, https://buildkite.com/elastic/kibana-custom-node-dot-js-builds#new[start a new build] on our dedicated Buildkite pipeline (requires Elastic employee permissions).
Give it a clear name (e.g. `Node 20.12.2`) and remember so set the custom `OVERRIDE_TARGET_VERSION` environment variable to the desired Node.js version - e.g. `OVERRIDE_TARGET_VERSION=20.12.2`.
Give it a clear name (e.g. `Node 20.13.1`) and remember so set the custom `OVERRIDE_TARGET_VERSION` environment variable to the desired Node.js version - e.g. `OVERRIDE_TARGET_VERSION=20.13.1`.
You find the "Environment Variables" field by expanding "Options >" in the "New Build" dialog.

=== Backporting
Expand Down
3 changes: 1 addition & 2 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
|{kib-repo}blob/{branch}/src/plugins/embeddable/README.md[embeddable]
|Embeddable documentation and examples are bundled with Kibana and accessable by running yarn start --run-examples.
Navigate to http://localhost:5601/app/embeddablesApp.
|Embeddables are React components that manage their own state, can be serialized and deserialized, and return an API that can be used to interact with them imperatively.
|{kib-repo}blob/{branch}/src/plugins/es_ui_shared/README.md[esUiShared]
Expand Down
1 change: 1 addition & 0 deletions docs/playground/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Does not currently support streaming.
a|
* GPT-3 turbo
* GPT-4 turbo
* GPT-4 omni
a|

| *Azure OpenAI*
Expand Down
19 changes: 11 additions & 8 deletions examples/embeddable_examples/public/app/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
*/

import React from 'react';

import { EuiText } from '@elastic/eui';
import { css } from '@emotion/react';
import { EuiMarkdownFormat } from '@elastic/eui';
// @ts-ignore
import overviewMarkdown from '!!raw-loader!@kbn/embeddable-plugin/README.md';

export const Overview = () => {
return (
<EuiText>
<p>
Embeddables are React components that manage their own state, can be serialized and
deserialized, and return an API that can be used to interact with them imperatively.
</p>
</EuiText>
<EuiMarkdownFormat
css={css`
width: 75%;
`}
>
{overviewMarkdown}
</EuiMarkdownFormat>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export const RegisterEmbeddable = () => {
<h2>Register a new embeddable type</h2>
<p>
This plugin registers several embeddable types with{' '}
<strong>registerReactEmbeddableFactory</strong> during plugin start. The code example
below shows Search embeddable registration. Notice how the embeddable factory is imported
asynchronously to limit initial page load size.
<strong>registerReactEmbeddableFactory</strong>. The code example below shows Search
embeddable registration. The embeddable factory is imported asynchronously to limit
initial page load size.
</p>
</EuiText>
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ export function SearchEmbeddableRenderer(props: Props) {
}, [props.timeRange, parentApi.timeRange$]);

return (
<div className="mapEmbeddableContainer">
<ReactEmbeddableRenderer<SearchSerializedState, SearchApi>
type={SEARCH_EMBEDDABLE_ID}
state={initialState}
parentApi={parentApi}
hidePanelChrome={true}
/>
</div>
<ReactEmbeddableRenderer<SearchSerializedState, SearchApi>
type={SEARCH_EMBEDDABLE_ID}
state={initialState}
parentApi={parentApi}
hidePanelChrome={true}
/>
);
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"url": "https://github.com/elastic/kibana.git"
},
"engines": {
"node": "20.12.2",
"node": "20.13.1",
"yarn": "^1.22.19"
},
"resolutions": {
Expand Down Expand Up @@ -1097,7 +1097,7 @@
"pretty-ms": "6.0.0",
"prop-types": "^15.8.1",
"proxy-from-env": "1.0.0",
"puppeteer": "22.3.0",
"puppeteer": "22.8.1",
"query-string": "^6.13.2",
"rbush": "^3.0.1",
"re-resizable": "^6.9.9",
Expand Down
1 change: 1 addition & 0 deletions packages/presentation/presentation_publishing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export {
export {
apiPublishesPanelDescription,
apiPublishesWritablePanelDescription,
getPanelDescription,
type PublishesPanelDescription,
type PublishesWritablePanelDescription,
} from './interfaces/titles/publishes_panel_description';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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 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 or the Server
* Side Public License, v 1.
*/

import { BehaviorSubject } from 'rxjs';
import { getPanelDescription } from './publishes_panel_description';

describe('getPanelDescription', () => {
test('should return default description when description is undefined', () => {
const api = {
panelDescription: new BehaviorSubject<string | undefined>(undefined),
defaultPanelDescription: new BehaviorSubject<string | undefined>('default description'),
};
expect(getPanelDescription(api)).toBe('default description');
});

test('should return empty description when description is empty string', () => {
const api = {
panelDescription: new BehaviorSubject<string | undefined>(''),
defaultPanelDescription: new BehaviorSubject<string | undefined>('default description'),
};
expect(getPanelDescription(api)).toBe('');
});

test('should return description when description is provided', () => {
const api = {
panelDescription: new BehaviorSubject<string | undefined>('custom description'),
defaultPanelDescription: new BehaviorSubject<string | undefined>('default description'),
};
expect(getPanelDescription(api)).toBe('custom description');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export interface PublishesPanelDescription {
defaultPanelDescription?: PublishingSubject<string | undefined>;
}

export function getPanelDescription(api: Partial<PublishesPanelDescription>): string | undefined {
return api.panelDescription?.value ?? api.defaultPanelDescription?.value;
}

export type PublishesWritablePanelDescription = PublishesPanelDescription & {
setPanelDescription: (newTitle: string | undefined) => void;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ describe('getPanelTitle', () => {
expect(getPanelTitle(api)).toBe('default title');
});

test('should return default title when title is empty string', () => {
test('should return empty title when title is empty string', () => {
const api = {
panelTitle: new BehaviorSubject<string | undefined>(''),
defaultPanelTitle: new BehaviorSubject<string | undefined>('default title'),
};
expect(getPanelTitle(api)).toBe('default title');
expect(getPanelTitle(api)).toBe('');
});

test('should return title when title is provided', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface PublishesPanelTitle {
}

export function getPanelTitle(api: Partial<PublishesPanelTitle>): string | undefined {
return api.panelTitle?.value || api.defaultPanelTitle?.value;
return api.panelTitle?.value ?? api.defaultPanelTitle?.value;
}

export type PublishesWritablePanelTitle = PublishesPanelTitle & {
Expand Down
8 changes: 8 additions & 0 deletions src/dev/build/args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ it('build default and oss dist for current platform, without packages, by defaul
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": false,
"createDockerChainguard": false,
"createDockerCloud": false,
"createDockerContexts": true,
"createDockerFIPS": false,
Expand Down Expand Up @@ -71,6 +72,7 @@ it('builds packages if --all-platforms is passed', () => {
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": true,
"createDockerChainguard": true,
"createDockerCloud": true,
"createDockerContexts": true,
"createDockerFIPS": true,
Expand Down Expand Up @@ -111,6 +113,7 @@ it('limits packages if --rpm passed with --all-platforms', () => {
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": false,
"createDockerChainguard": false,
"createDockerCloud": false,
"createDockerContexts": true,
"createDockerFIPS": false,
Expand Down Expand Up @@ -151,6 +154,7 @@ it('limits packages if --deb passed with --all-platforms', () => {
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": true,
"createDockerChainguard": false,
"createDockerCloud": false,
"createDockerContexts": true,
"createDockerFIPS": false,
Expand Down Expand Up @@ -192,6 +196,7 @@ it('limits packages if --docker passed with --all-platforms', () => {
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": false,
"createDockerChainguard": true,
"createDockerCloud": true,
"createDockerContexts": true,
"createDockerFIPS": true,
Expand Down Expand Up @@ -240,6 +245,7 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": false,
"createDockerChainguard": true,
"createDockerCloud": true,
"createDockerContexts": true,
"createDockerFIPS": true,
Expand Down Expand Up @@ -281,6 +287,7 @@ it('limits packages if --all-platforms passed with --skip-docker-ubuntu', () =>
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": true,
"createDockerChainguard": true,
"createDockerCloud": true,
"createDockerContexts": true,
"createDockerFIPS": true,
Expand Down Expand Up @@ -322,6 +329,7 @@ it('limits packages if --all-platforms passed with --skip-docker-fips', () => {
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": true,
"createDockerChainguard": true,
"createDockerCloud": true,
"createDockerContexts": true,
"createDockerFIPS": false,
Expand Down
3 changes: 3 additions & 0 deletions src/dev/build/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function readCliArgs(argv: string[]) {
'skip-docker-contexts',
'skip-docker-ubi',
'skip-docker-ubuntu',
'skip-docker-chainguard',
'skip-docker-cloud',
'skip-docker-serverless',
'skip-docker-fips',
Expand Down Expand Up @@ -139,6 +140,8 @@ export function readCliArgs(argv: string[]) {
createDebPackage: isOsPackageDesired('deb'),
createDockerUbuntu:
isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-ubuntu']),
createDockerChainguard:
isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-chainguard']),
createDockerCloud: isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-cloud']),
createDockerServerless:
isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-serverless']),
Expand Down
5 changes: 5 additions & 0 deletions src/dev/build/build_distributables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface BuildOptions {
createDebPackage: boolean;
createDockerUBI: boolean;
createDockerUbuntu: boolean;
createDockerChainguard: boolean;
createDockerCloud: boolean;
createDockerServerless: boolean;
createDockerContexts: boolean;
Expand Down Expand Up @@ -150,6 +151,10 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions
await run(Tasks.CreateDockerUbuntu);
}

if (options.createDockerChainguard) {
// control w/ --docker-images or --skip-docker-chainguard or --skip-os-packages
await run(Tasks.CreateDockerChainguard);
}
if (options.createDockerCloud) {
// control w/ --docker-images and --skip-docker-cloud
if (options.downloadCloudDependencies) {
Expand Down

0 comments on commit fecc249

Please sign in to comment.