Skip to content

Commit

Permalink
Merge branch 'master' into move-kbn-analytics-into-bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 3, 2021
2 parents dda6031 + 2fbfca6 commit 50efbc8
Show file tree
Hide file tree
Showing 129 changed files with 1,663 additions and 669 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ kibanaLibrary.load()
kibanaPipeline(timeoutMinutes: 210, checkPrChanges: true, setCommitStatus: true) {
slackNotifications.onFailure(disabled: !params.NOTIFY_ON_FAILURE) {
githubPr.withDefaultPrComments {
ciStats.trackBuild {
ciStats.trackBuild(requireSuccess: githubPr.isPr()) {
catchError {
retryable.enable()
kibanaPipeline.allCiTasks()
Expand Down
2 changes: 2 additions & 0 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ yarn kbn watch-bazel
- @kbn/config-schema
- @kbn/dev-utils
- @kbn/eslint-import-resolver-kibana
- @kbn/eslint-plugin-eslint
- @kbn/expect
- @kbn/legacy-logging
- @kbn/logging
- @kbn/std
- @kbn/tinymath
Expand Down
Binary file modified docs/discover/images/search-session-awhile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/discover/images/search-session.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/discover/images/search-sessions-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions docs/discover/search-sessions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ and when your session is complete, view and manage it in *Stack Management*.
[role="screenshot"]
image::images/search-session.png[Search Session indicator displaying the current state of the search, which you can click to stop or save a running Search Session ]

Search sessions are <<search-session-settings-kb,enabled by default>>. Saving
a search session is only available when
<<set-time-filter,auto refresh>> is off.

Search sessions are <<search-session-settings-kb,enabled by default>>.

[float]
==== Requirements
Expand Down Expand Up @@ -59,6 +56,7 @@ image::images/search-sessions-menu.png[Search Sessions management view with acti

. Use the edit menu in *Search Sessions* to:
* *Inspect* the queries and filters that makeup the session.
* *Edit the name* of a session.
* *Extend* the expiration of a completed session.
* *Delete* a session.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"@kbn/i18n": "link:packages/kbn-i18n",
"@kbn/interpreter": "link:packages/kbn-interpreter",
"@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils",
"@kbn/legacy-logging": "link:packages/kbn-legacy-logging",
"@kbn/legacy-logging": "link:bazel-bin/packages/kbn-legacy-logging/npm_module",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging/npm_module",
"@kbn/monaco": "link:packages/kbn-monaco",
"@kbn/server-http-tools": "link:packages/kbn-server-http-tools",
Expand Down Expand Up @@ -445,7 +445,7 @@
"@kbn/es": "link:packages/kbn-es",
"@kbn/es-archiver": "link:packages/kbn-es-archiver",
"@kbn/eslint-import-resolver-kibana": "link:bazel-bin/packages/kbn-eslint-import-resolver-kibana/npm_module",
"@kbn/eslint-plugin-eslint": "link:packages/kbn-eslint-plugin-eslint",
"@kbn/eslint-plugin-eslint": "link:bazel-bin/packages/kbn-eslint-plugin-eslint/npm_module",
"@kbn/expect": "link:bazel-bin/packages/kbn-expect/npm_module",
"@kbn/optimizer": "link:packages/kbn-optimizer",
"@kbn/plugin-generator": "link:packages/kbn-plugin-generator",
Expand Down
2 changes: 2 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ filegroup(
"//packages/kbn-config-schema:build",
"//packages/kbn-dev-utils:build",
"//packages/kbn-eslint-import-resolver-kibana:build",
"//packages/kbn-eslint-plugin-eslint:build",
"//packages/kbn-expect:build",
"//packages/kbn-legacy-logging:build",
"//packages/kbn-logging:build",
"//packages/kbn-std:build",
"//packages/kbn-tinymath:build",
Expand Down
61 changes: 61 additions & 0 deletions packages/kbn-eslint-plugin-eslint/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-eslint-plugin-eslint"
PKG_REQUIRE_NAME = "@kbn/eslint-plugin-eslint"

SOURCE_FILES = glob(
[
"rules/**/*.js",
"index.js",
"lib.js",
],
exclude = [
"**/*.test.*",
"**/__fixtures__"
],
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md",
]

DEPS = [
"@npm//babel-eslint",
"@npm//dedent",
"@npm//eslint",
"@npm//eslint-module-utils",
"@npm//micromatch",
]

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES + [
":srcs",
],
deps = DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
92 changes: 92 additions & 0 deletions packages/kbn-legacy-logging/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-legacy-logging"
PKG_REQUIRE_NAME = "@kbn/legacy-logging"

SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = ["**/*.test.*"],
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md"
]

SRC_DEPS = [
"//packages/kbn-config-schema",
"@npm//@elastic/numeral",
"@npm//@hapi/hapi",
"@npm//chokidar",
"@npm//lodash",
"@npm//moment-timezone",
"@npm//query-string",
"@npm//rxjs",
"@npm//tslib",
]

TYPES_DEPS = [
"@npm//@types/hapi__hapi",
"@npm//@types/hapi__podium",
"@npm//@types/jest",
"@npm//@types/lodash",
"@npm//@types/moment-timezone",
"@npm//@types/node",
]

DEPS = SRC_DEPS + TYPES_DEPS

ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)

ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = [":tsc"] + DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
7 changes: 1 addition & 6 deletions packages/kbn-legacy-logging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
}
"types": "./target/index.d.ts"
}
12 changes: 4 additions & 8 deletions packages/kbn-legacy-logging/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"incremental": true,
"outDir": "target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-legacy-logging/src",
"types": [
"jest",
"node"
]
"types": ["jest", "node"]
},
"include": [
"src/**/*"
]
"include": ["src/**/*"]
}
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pageLoadAssetSize:
visTypeVega: 153573
visTypeVislib: 242838
visTypeXy: 113478
visualizations: 295025
visualizations: 90000
visualize: 57431
watcher: 43598
runtimeFields: 41752
Expand Down
11 changes: 9 additions & 2 deletions packages/kbn-storybook/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Side Public License, v 1.
*/

import { resolve } from 'path';
import { externals } from '@kbn/ui-shared-deps';
import { stringifyRequest } from 'loader-utils';
import { resolve } from 'path';
import { Configuration, Stats } from 'webpack';
import webpackMerge from 'webpack-merge';
import { externals } from '@kbn/ui-shared-deps';
import { REPO_ROOT } from './lib/constants';

const stats = {
Expand Down Expand Up @@ -80,6 +80,12 @@ export default function ({ config: storybookConfig }: { config: Configuration })
stats,
};

// Disable the progress plugin
const progressPlugin: any = (storybookConfig.plugins || []).find((plugin: any) => {
return 'handler' in plugin && plugin.showActiveModules && plugin.showModules;
});
progressPlugin.handler = () => {};

// This is the hacky part. We find something that looks like the
// HtmlWebpackPlugin and mutate its `options.template` to point at our
// revised template.
Expand All @@ -89,5 +95,6 @@ export default function ({ config: storybookConfig }: { config: Configuration })
if (htmlWebpackPlugin) {
htmlWebpackPlugin.options.template = require.resolve('../lib/templates/index.ejs');
}

return webpackMerge(storybookConfig, config);
}
10 changes: 6 additions & 4 deletions src/dev/chromium_version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ async function getPuppeteerRelease(log: ToolingLog): Promise<PuppeteerRelease> {
'Could not get the Puppeteer version! Check node_modules/puppteer/package.json'
);
}
log.info(`Kibana is using Puppeteer ${version} (${forkCompatibilityMap[version]})`);
return forkCompatibilityMap[version];
const puppeteerRelease = forkCompatibilityMap[version] ?? version;

log.info(`Kibana is using Puppeteer ${version} (${puppeteerRelease})`);
return puppeteerRelease;
}

async function getChromiumRevision(
Expand Down Expand Up @@ -129,8 +131,8 @@ run(
description: chalk`
Display the Chromium git commit that correlates to a given Puppeteer release.
- node x-pack/dev-tools/chromium_version 5.5.0 {dim # gets the Chromium commit for Puppeteer v5.5.0}
- node x-pack/dev-tools/chromium_version {dim # gets the Chromium commit for the Kibana dependency version of Puppeteer}
- node scripts/chromium_version 5.5.0 {dim # gets the Chromium commit for Puppeteer v5.5.0}
- node scripts/chromium_version {dim # gets the Chromium commit for the Kibana dependency version of Puppeteer}
You can use https://omahaproxy.appspot.com/ to look up the Chromium release that first shipped with that commit.
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ const log = new ToolingLog({
});

describe(`enumeratePatterns`, () => {
it(`should resolve x-pack/plugins/reporting/server/browsers/extract/unzip.js to kibana-reporting`, () => {
it(`should resolve x-pack/plugins/reporting/server/browsers/extract/unzip.ts to kibana-reporting`, () => {
const actual = enumeratePatterns(REPO_ROOT)(log)(
new Map([['x-pack/plugins/reporting', ['kibana-reporting']]])
);

expect(
actual[0].includes(
'x-pack/plugins/reporting/server/browsers/extract/unzip.js kibana-reporting'
'x-pack/plugins/reporting/server/browsers/extract/unzip.ts kibana-reporting'
)
).toBe(true);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ x-pack/plugins/reporting/server/browsers/download/download.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/download/ensure_downloaded.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/download/index.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/download/util.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/extract.js kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/extract_error.js kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/index.js kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/unzip.js kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/extract.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/extract_error.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/index.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/unzip.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/index.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/install.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/network_policy.test.ts kibana-reporting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ describe(`Transform fns`, () => {
it(`should remove the jenkins workspace path`, () => {
const obj = {
staticSiteUrl:
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.js',
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.ts',
COVERAGE_INGESTION_KIBANA_ROOT:
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana',
};
expect(coveredFilePath(obj)).toHaveProperty(
'coveredFilePath',
'x-pack/plugins/reporting/server/browsers/extract/unzip.js'
'x-pack/plugins/reporting/server/browsers/extract/unzip.ts'
);
});
});
describe(`in the qa research job`, () => {
it(`should remove the jenkins workspace path`, () => {
const obj = {
staticSiteUrl:
'/var/lib/jenkins/workspace/elastic+kibana+qa-research/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.js',
'/var/lib/jenkins/workspace/elastic+kibana+qa-research/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.ts',
COVERAGE_INGESTION_KIBANA_ROOT:
'/var/lib/jenkins/workspace/elastic+kibana+qa-research/kibana',
};
expect(coveredFilePath(obj)).toHaveProperty(
'coveredFilePath',
'x-pack/plugins/reporting/server/browsers/extract/unzip.js'
'x-pack/plugins/reporting/server/browsers/extract/unzip.ts'
);
});
});
Expand Down Expand Up @@ -82,7 +82,7 @@ describe(`Transform fns`, () => {
describe(`teamAssignment`, () => {
const teamAssignmentsPathMOCK =
'src/dev/code_coverage/ingest_coverage/__tests__/mocks/team_assign_mock.txt';
const coveredFilePath = 'x-pack/plugins/reporting/server/browsers/extract/unzip.js';
const coveredFilePath = 'x-pack/plugins/reporting/server/browsers/extract/unzip.ts';
const obj = { coveredFilePath };
const log = new ToolingLog({
level: 'info',
Expand Down
1 change: 0 additions & 1 deletion src/plugins/visualizations/public/components/_index.scss

This file was deleted.

Loading

0 comments on commit 50efbc8

Please sign in to comment.