Skip to content

Commit

Permalink
Merge branch 'main' into fix-alert-status-readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Nov 6, 2023
2 parents 36ff150 + 002e685 commit 4b0f44e
Show file tree
Hide file tree
Showing 89 changed files with 1,189 additions and 666 deletions.
2 changes: 2 additions & 0 deletions .buildkite/scripts/build_kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ is_pr_with_label "ci:build-docker-cross-compile" && BUILD_ARGS+=("--docker-cross
is_pr_with_label "ci:build-os-packages" || BUILD_ARGS+=("--skip-os-packages")
is_pr_with_label "ci:build-canvas-shareable-runtime" || BUILD_ARGS+=("--skip-canvas-shareable-runtime")
is_pr_with_label "ci:build-docker-contexts" || BUILD_ARGS+=("--skip-docker-contexts")
is_pr_with_label "ci:build-cdn-assets" || BUILD_ARGS+=("--skip-cdn-assets")

echo "> node scripts/build" "${BUILD_ARGS[@]}"
node scripts/build "${BUILD_ARGS[@]}"
Expand All @@ -24,6 +25,7 @@ if is_pr_with_label "ci:build-cloud-image"; then
--skip-initialize \
--skip-generic-folders \
--skip-platform-folders \
--skip-cdn-assets \
--skip-archives \
--docker-images \
--docker-tag-qualifier="$GIT_COMMIT" \
Expand Down
3 changes: 2 additions & 1 deletion .buildkite/scripts/steps/artifacts/docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ node scripts/build \
--skip-docker-ubuntu \
--skip-docker-ubi \
--skip-docker-cloud \
--skip-docker-contexts
--skip-docker-contexts \
--skip-cdn-assets

echo "--- Tag images"
docker rmi "$KIBANA_IMAGE"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/package_testing/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

.buildkite/scripts/bootstrap.sh

node scripts/build --all-platforms --debug --skip-docker-cloud --skip-docker-serverless --skip-docker-ubi --skip-docker-contexts
node scripts/build --all-platforms --debug --skip-docker-cloud --skip-docker-serverless --skip-docker-ubi --skip-docker-contexts --skip-cdn-assets

DOCKER_FILE="kibana-$KIBANA_PKG_VERSION-SNAPSHOT-docker-image.tar.gz"

Expand Down
19 changes: 19 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@ Review important information about the {kib} 8.x releases.
For information about the {kib} 8.11.0 release, review the following information.


[float]
[[known-issues-8.11.0]]
=== Known issues

// tag::known-issue-169170[]
[discrete]
.Gatekeeper error on macOS
[%collapsible]
====
*Details* +
Due to a version upgrade of the server binary used by {kib} and an upstream notarization issue, a Gatekeeper error may display for "node"
when starting {kib} in macOS environments.
*Workaround* +
More information can be found at <<install-darwin64>>.
====
// end::known-issue-169170[]

[float]
[[breaking-changes-8.11.0]]
=== Breaking changes
Expand Down
5 changes: 4 additions & 1 deletion docs/user/alerting/rule-types/es-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ FROM kibana_sample_data_logs
+
--
When::: Specify how to calculate the value that is compared to the threshold. The value is calculated by aggregating a numeric field within the time window. The aggregation options are: `count`, `average`, `sum`, `min`, and `max`. When using `count` the document count is used and an aggregation field is not necessary.
Over or Grouped Over::: Specify whether the aggregation is applied over all documents or split into groups using a grouping field. If grouping is used, an alert will be created for each group when it meets the condition. To limit the number of alerts on high cardinality fields, you must specify the number of groups to check against the threshold. Only the top groups are checked.
Over or Grouped Over::: Specify whether the aggregation is applied over all documents or split into groups using up to four grouping fields.
If you choose to use grouping, it's a {ref}/search-aggregations-bucket-terms-aggregation.html[terms] or {ref}/search-aggregations-bucket-multi-terms-aggregation.html[multi terms aggregation]; an alert will be created for each unique set of values when it meets the condition.
To limit the number of alerts on high cardinality fields, you must specify the number of groups to check against the threshold.
Only the top groups are checked.
Threshold::: Defines a threshold value and a comparison operator (`is above`,
`is above or equals`, `is below`, `is below or equals`, or `is between`). The value
calculated by the aggregation is compared to this threshold.
Expand Down
2 changes: 1 addition & 1 deletion docs/user/whats-new.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ image::images/custom-field.gif[An example of creating a custom case field in {ki
[discrete]
==== Supporting multi levels of term aggregations in {es} rule type

The existing {es} alerting rule (KQL-based) is now supported by multiple selection when grouping by alert fields, which allows you to define multiple layers of term aggregations.
The existing {es} alerting rule is now supported by multiple selection when grouping by alert fields, which allows you to define multiple layers of term aggregations.

[role="screenshot"]
image::images/term-aggs.png[An example of creating multiple layers of term aggregations]
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,6 @@
"cypress-axe": "^1.5.0",
"cypress-file-upload": "^5.0.8",
"cypress-multi-reporters": "^1.6.3",
"cypress-react-selector": "^3.0.0",
"cypress-real-events": "^1.10.3",
"cypress-recurse": "^1.35.2",
"date-fns": "^2.29.3",
Expand Down
7 changes: 7 additions & 0 deletions src/dev/build/args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ it('build default and oss dist for current platform, without packages, by defaul
"buildOptions": Object {
"buildCanvasShareableRuntime": true,
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": false,
"createDockerCloud": false,
"createDockerContexts": true,
Expand Down Expand Up @@ -67,6 +68,7 @@ it('builds packages if --all-platforms is passed', () => {
"buildOptions": Object {
"buildCanvasShareableRuntime": true,
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": true,
"createDockerCloud": true,
"createDockerContexts": true,
Expand Down Expand Up @@ -105,6 +107,7 @@ it('limits packages if --rpm passed with --all-platforms', () => {
"buildOptions": Object {
"buildCanvasShareableRuntime": true,
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": false,
"createDockerCloud": false,
"createDockerContexts": true,
Expand Down Expand Up @@ -143,6 +146,7 @@ it('limits packages if --deb passed with --all-platforms', () => {
"buildOptions": Object {
"buildCanvasShareableRuntime": true,
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": true,
"createDockerCloud": false,
"createDockerContexts": true,
Expand Down Expand Up @@ -182,6 +186,7 @@ it('limits packages if --docker passed with --all-platforms', () => {
"buildOptions": Object {
"buildCanvasShareableRuntime": true,
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": false,
"createDockerCloud": true,
"createDockerContexts": true,
Expand Down Expand Up @@ -228,6 +233,7 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform
"buildOptions": Object {
"buildCanvasShareableRuntime": true,
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": false,
"createDockerCloud": true,
"createDockerContexts": true,
Expand Down Expand Up @@ -267,6 +273,7 @@ it('limits packages if --all-platforms passed with --skip-docker-ubuntu', () =>
"buildOptions": Object {
"buildCanvasShareableRuntime": true,
"createArchives": true,
"createCdnAssets": true,
"createDebPackage": true,
"createDockerCloud": true,
"createDockerContexts": true,
Expand Down
2 changes: 2 additions & 0 deletions src/dev/build/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function readCliArgs(argv: string[]) {
const flags = getopts(argv, {
boolean: [
'skip-archives',
'skip-cdn-assets',
'skip-initialize',
'skip-generic-folders',
'skip-platform-folders',
Expand Down Expand Up @@ -132,6 +133,7 @@ export function readCliArgs(argv: string[]) {
createGenericFolders: !Boolean(flags['skip-generic-folders']),
createPlatformFolders: !Boolean(flags['skip-platform-folders']),
createArchives: !Boolean(flags['skip-archives']),
createCdnAssets: !Boolean(flags['skip-cdn-assets']),
createRpmPackage: isOsPackageDesired('rpm'),
createDebPackage: isOsPackageDesired('deb'),
createDockerUbuntu:
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 @@ -26,6 +26,7 @@ export interface BuildOptions {
createGenericFolders: boolean;
createPlatformFolders: boolean;
createArchives: boolean;
createCdnAssets: boolean;
createRpmPackage: boolean;
createDebPackage: boolean;
createDockerUBI: boolean;
Expand Down Expand Up @@ -113,6 +114,10 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions
await run(Tasks.AssertPathLength);
await run(Tasks.AssertNoUUID);
}
// control w/ --skip-cdn-assets
if (options.createCdnAssets) {
await run(Tasks.CreateCdnAssets);
}

/**
* package platform-specific builds into archives
Expand Down
102 changes: 102 additions & 0 deletions src/dev/build/tasks/create_cdn_assets_task.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* 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 { readFileSync } from 'fs';
import { access } from 'fs/promises';

import { resolve, dirname } from 'path';
import { asyncForEach } from '@kbn/std';
import { Jsonc } from '@kbn/repo-packages';

import del from 'del';
import globby from 'globby';

import { mkdirp, compressTar, Task, copyAll } from '../lib';

export const CreateCdnAssets: Task = {
description: 'Creating CDN assets',

async run(config, log, build) {
const buildSource = build.resolvePath();
const buildNum = config.getBuildNumber();
const buildVersion = config.getBuildVersion();
const assets = config.resolveFromRepo('build', 'cdn-assets');
const bundles = resolve(assets, String(buildNum), 'bundles');

await del(assets);
await mkdirp(assets);

// Plugins

const plugins = globby.sync([`${buildSource}/node_modules/@kbn/**/*/kibana.jsonc`]);
await asyncForEach(plugins, async (path) => {
const manifest = Jsonc.parse(readFileSync(path, 'utf8')) as any;
if (manifest?.plugin?.id) {
const pluginRoot = resolve(dirname(path));

try {
// packages/core/plugins/core-plugins-server-internal/src/plugins_service.ts
const assetsSource = resolve(pluginRoot, 'assets');
const assetsDest = resolve('plugins', manifest.plugin.id, 'assets');
await access(assetsSource);
await mkdirp(assetsDest);
await copyAll(assetsSource, assetsDest);
} catch (e) {
// assets are optional
if (!(e.code === 'ENOENT' && e.syscall === 'access')) throw e;
}

try {
// packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.ts
const bundlesSource = resolve(pluginRoot, 'target', 'public');
const bundlesDest = resolve(bundles, 'plugin', manifest.plugin.id, '1.0.0');
await access(bundlesSource);
await mkdirp(bundlesDest);
await copyAll(bundlesSource, bundlesDest);
} catch (e) {
// bundles are optional
if (!(e.code === 'ENOENT' && e.syscall === 'access')) throw e;
}
}
});

// packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.ts
await copyAll(
resolve(buildSource, 'node_modules/@kbn/ui-shared-deps-npm/shared_built_assets'),
resolve(bundles, 'kbn-ui-shared-deps-npm')
);
await copyAll(
resolve(buildSource, 'node_modules/@kbn/ui-shared-deps-src/shared_built_assets'),
resolve(bundles, 'kbn-ui-shared-deps-src')
);
await copyAll(
resolve(buildSource, 'node_modules/@kbn/core/target/public'),
resolve(bundles, 'core')
);
await copyAll(resolve(buildSource, 'node_modules/@kbn/monaco'), resolve(bundles, 'kbn-monaco'));

// packages/core/apps/core-apps-server-internal/src/core_app.ts
await copyAll(
resolve(buildSource, 'node_modules/@kbn/core-apps-server-internal/assets'),
resolve(assets, 'ui')
);

await compressTar({
source: assets,
destination: config.resolveFromTarget(`kibana-${buildVersion}-cdn-assets.tar.gz`),
archiverOptions: {
gzip: true,
gzipOptions: {
level: 9,
},
},
createRootDirectory: true,
rootDirectoryName: `kibana-${buildVersion}-cdn-assets`,
});
},
};
1 change: 1 addition & 0 deletions src/dev/build/tasks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export * from './clean_tasks';
export * from './copy_legacy_source_task';
export * from './create_archives_sources_task';
export * from './create_archives_task';
export * from './create_cdn_assets_task';
export * from './create_empty_dirs_and_files_task';
export * from './create_readme_task';
export * from './download_cloud_dependencies';
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
} from './url/search_sessions_integration';
import { DashboardAPI, DashboardRenderer } from '..';
import { type DashboardEmbedSettings } from './types';
import { DASHBOARD_APP_LOCATOR } from './locator/locator';
import { pluginServices } from '../services/plugin_services';
import { AwaitingDashboardAPI } from '../dashboard_container';
import { DashboardRedirect } from '../dashboard_container/types';
Expand Down Expand Up @@ -82,6 +83,7 @@ export function DashboardApp({
settings: { uiSettings },
data: { search },
customBranding,
share: { url },
} = pluginServices.getServices();
const showPlainSpinner = useObservable(customBranding.hasCustomBranding$, false);
const { scopedHistory: getScopedHistory } = useDashboardMountContext();
Expand Down Expand Up @@ -188,6 +190,8 @@ export function DashboardApp({
return () => stopWatchingAppStateInUrl();
}, [dashboardAPI, kbnUrlStateStorage, savedDashboardId]);

const locator = useMemo(() => url?.locators.get(DASHBOARD_APP_LOCATOR), [url]);

return (
<>
{showNoDataPage && (
Expand All @@ -206,6 +210,7 @@ export function DashboardApp({
{getLegacyConflictWarning?.()}

<DashboardRenderer
locator={locator}
ref={setDashboardAPI}
dashboardRedirect={redirectTo}
savedObjectId={savedDashboardId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ import { isQuery, isTimeRange } from '@kbn/data-plugin/common';
import { Filter, isFilterPinned, Query, TimeRange } from '@kbn/es-query';
import { EmbeddableInput, IEmbeddable } from '@kbn/embeddable-plugin/public';
import { DashboardDrilldownOptions } from '@kbn/presentation-util-plugin/public';

import { DashboardAppLocatorParams } from './locator';
import { DashboardLocatorParams } from '../../dashboard_container';

interface EmbeddableQueryInput extends EmbeddableInput {
query?: Query;
filters?: Filter[];
timeRange?: TimeRange;
}

export const getEmbeddableParams = (
export const getDashboardLocatorParamsFromEmbeddable = (
source: IEmbeddable<EmbeddableQueryInput>,
options: DashboardDrilldownOptions
): Partial<DashboardAppLocatorParams> => {
const params: DashboardAppLocatorParams = {};
): Partial<DashboardLocatorParams> => {
const params: DashboardLocatorParams = {};

const input = source.getInput();
if (isQuery(input.query) && options.useCurrentFilters) {
Expand Down
Loading

0 comments on commit 4b0f44e

Please sign in to comment.