Skip to content

Commit

Permalink
Merge branch 'master' into bazel/test
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Jun 29, 2021
2 parents 5ce2045 + 51767e7 commit 9c468ba
Show file tree
Hide file tree
Showing 525 changed files with 12,741 additions and 6,657 deletions.
1 change: 1 addition & 0 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ yarn kbn watch-bazel
- @kbn/storybook
- @kbn/telemetry-utils
- @kbn/test
- @kbn/test-subj-selector
- @kbn/tinymath
- @kbn/ui-framework
- @kbn/ui-shared-deps
Expand Down
14 changes: 9 additions & 5 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Set to `false` to disable Console. *Default: `true`*
<<ops-cGroupOverrides-cpuAcctPath, `ops.cGroupOverrides.cpuAcctPath`>>.

| `csp.rules:`
| deprecated:[7.14.0,"In 8.0 and later, this setting will no longer be supported."]
| deprecated:[7.14.0,"In 8.0 and later, this setting will no longer be supported."]
A https://w3c.github.io/webappsec-csp/[Content Security Policy] template
that disables certain unnecessary and potentially insecure capabilities in
the browser. It is strongly recommended that you keep the default CSP rules
Expand Down Expand Up @@ -73,8 +73,8 @@ that ship with {kib}.

[NOTE]
============
The `frame-ancestors` directive can also be configured by using
<<server-securityResponseHeaders-disableEmbedding, `server.securityResponseHeaders.disableEmbedding`>>. In that case, that takes precedence and any values in `csp.frame_ancestors`
The `frame-ancestors` directive can also be configured by using
<<server-securityResponseHeaders-disableEmbedding, `server.securityResponseHeaders.disableEmbedding`>>. In that case, that takes precedence and any values in `csp.frame_ancestors`
are ignored.
============

Expand Down Expand Up @@ -777,10 +777,14 @@ out through *Advanced Settings*. *Default: `true`*
| Set this value to true to allow Vega to use any URL to access external data
sources and images. When false, Vega can only get data from {es}. *Default: `false`*

| `xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled`
a|
`xpack.discoverEnhanced.actions.`
`exploreDataInContextMenu.enabled`
| Enables the *Explore underlying data* option that allows you to open *Discover* from a dashboard panel and view the panel data. *Default: `false`*

| `xpack.discoverEnhanced.actions.exploreDataInChart.enabled`
a|
`xpack.discoverEnhanced.actions.`
`exploreDataInChart.enabled`
| Enables you to view the underlying documents in a data series from a dashboard panel. *Default: `false`*

| `xpack.license_management.enabled`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
"@kbn/storybook": "link:bazel-bin/packages/kbn-storybook",
"@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools",
"@kbn/test": "link:bazel-bin/packages/kbn-test",
"@kbn/test-subj-selector": "link:packages/kbn-test-subj-selector",
"@kbn/test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector",
"@loaders.gl/polyfills": "^2.3.5",
"@microsoft/api-documenter": "7.7.2",
"@microsoft/api-extractor": "7.7.0",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ filegroup(
"//packages/kbn-storybook:build",
"//packages/kbn-telemetry-tools:build",
"//packages/kbn-test:build",
"//packages/kbn-test-subj-selector:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-ui-framework:build",
"//packages/kbn-ui-shared-deps:build",
Expand Down
48 changes: 48 additions & 0 deletions packages/kbn-test-subj-selector/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-test-subj-selector"
PKG_REQUIRE_NAME = "@kbn/test-subj-selector"

SOURCE_FILES = glob([
"index.d.ts",
"index.js"
])

SRCS = SOURCE_FILES

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

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

DEPS = []

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"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
* Side Public License, v 1.
*/

import Path from 'path';
import Fs from 'fs';
import Util from 'util';
import path from 'path';
import { unlink } from 'fs/promises';
import { REPO_ROOT } from '@kbn/dev-utils';
import { Env } from '@kbn/config';
import { getEnvOptions } from '@kbn/config/target/mocks';
Expand All @@ -18,16 +17,14 @@ import { InternalCoreStart } from '../../../internal_types';
import { Root } from '../../../root';

const kibanaVersion = Env.createDefault(REPO_ROOT, getEnvOptions()).packageInfo.version;
const logFilePath = Path.join(__dirname, 'migration_test_kibana.log');
const logFilePath = path.join(__dirname, 'migration_test_kibana.log');

const asyncUnlink = Util.promisify(Fs.unlink);
async function removeLogFile() {
// ignore errors if it doesn't exist
await asyncUnlink(logFilePath).catch(() => void 0);
await unlink(logFilePath).catch(() => void 0);
}

// FAILING on 7.13: https://github.com/elastic/kibana/issues/96895
describe.skip('migration from 7.7.2-xpack with 100k objects', () => {
describe('migration from 7.7.2-xpack with 100k objects', () => {
let esServer: kbnTestServer.TestElasticsearchUtils;
let root: Root;
let coreStart: InternalCoreStart;
Expand Down Expand Up @@ -64,12 +61,9 @@ describe.skip('migration from 7.7.2-xpack with 100k objects', () => {
},
},
},
loggers: [
{
name: 'root',
appenders: ['file'],
},
],
root: {
appenders: ['default', 'file'],
},
},
},
{
Expand Down Expand Up @@ -106,7 +100,7 @@ describe.skip('migration from 7.7.2-xpack with 100k objects', () => {
await removeLogFile();
await startServers({
oss: false,
dataArchive: Path.join(__dirname, 'archives', '7.7.2_xpack_100k_obj.zip'),
dataArchive: path.join(__dirname, 'archives', '7.7.2_xpack_100k_obj.zip'),
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/dev/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ node scripts/build --help
# build a release version
node scripts/build --release

# reuse already downloaded node executables, turn on debug logging, and only build the default distributable
node scripts/build --skip-node-download --debug --no-oss
# reuse already downloaded node executables, turn on debug logging
node scripts/build --skip-node-download --debug
```

# Fixing out of memory issues
Expand Down
7 changes: 0 additions & 7 deletions src/dev/build/args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ it('build default and oss dist for current platform, without packages, by defaul
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": false,
Expand All @@ -54,7 +53,6 @@ it('builds packages if --all-platforms is passed', () => {
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": true,
"createDockerCentOS": true,
Expand All @@ -81,7 +79,6 @@ it('limits packages if --rpm passed with --all-platforms', () => {
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": false,
Expand All @@ -108,7 +105,6 @@ it('limits packages if --deb passed with --all-platforms', () => {
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": true,
"createDockerCentOS": false,
Expand Down Expand Up @@ -136,7 +132,6 @@ it('limits packages if --docker passed with --all-platforms', () => {
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": true,
Expand Down Expand Up @@ -171,7 +166,6 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": true,
Expand Down Expand Up @@ -199,7 +193,6 @@ it('limits packages if --all-platforms passed with --skip-docker-centos', () =>
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": true,
"createDockerCentOS": false,
Expand Down
3 changes: 0 additions & 3 deletions src/dev/build/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export function readCliArgs(argv: string[]) {
const unknownFlags: string[] = [];
const flags = getopts(argv, {
boolean: [
'oss',
'no-oss',
'skip-archives',
'skip-initialize',
'skip-generic-folders',
Expand Down Expand Up @@ -94,7 +92,6 @@ export function readCliArgs(argv: string[]) {
const buildOptions: BuildOptions = {
isRelease: Boolean(flags.release),
versionQualifier: flags['version-qualifier'],
buildOssDist: flags.oss !== false,
buildDefaultDist: !flags.oss,
initialize: !Boolean(flags['skip-initialize']),
downloadFreshNode: !Boolean(flags['skip-node-download']),
Expand Down
2 changes: 0 additions & 2 deletions src/dev/build/build_distributables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import * as Tasks from './tasks';

export interface BuildOptions {
isRelease: boolean;
buildOssDist: boolean;
buildDefaultDist: boolean;
downloadFreshNode: boolean;
initialize: boolean;
Expand All @@ -38,7 +37,6 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions
config,
log,
buildDefaultDist: options.buildDefaultDist,
buildOssDist: options.buildOssDist,
});

/**
Expand Down
2 changes: 0 additions & 2 deletions src/dev/build/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ if (showHelp) {
build the Kibana distributable
options:
--oss {dim Only produce the OSS distributable of Kibana}
--no-oss {dim Only produce the default distributable of Kibana}
--skip-archives {dim Don't produce tar/zip archives}
--skip-os-packages {dim Don't produce rpm/deb/docker packages}
--all-platforms {dim Produce archives for all platforms, not just this one}
Expand Down
39 changes: 11 additions & 28 deletions src/dev/build/lib/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,40 +43,24 @@ beforeEach(() => {
jest.clearAllMocks();
});

const ossBuild = new Build(config, true);
const defaultBuild = new Build(config, false);

describe('#isOss()', () => {
it('returns true for oss', () => {
expect(ossBuild.isOss()).toBe(true);
});

it('returns false for default build', () => {
expect(defaultBuild.isOss()).toBe(false);
});
});
const defaultBuild = new Build(config);

describe('#getName()', () => {
it('returns kibana for default build', () => {
expect(defaultBuild.getName()).toBe('kibana');
});

it('returns kibana-oss for oss', () => {
expect(ossBuild.getName()).toBe('kibana-oss');
});
});

describe('#getLogTag()', () => {
it('returns string with build name in it', () => {
expect(defaultBuild.getLogTag()).toContain(defaultBuild.getName());
expect(ossBuild.getLogTag()).toContain(ossBuild.getName());
});
});

describe('#resolvePath()', () => {
it('uses passed config to resolve a path relative to the repo', () => {
expect(ossBuild.resolvePath('bar')).toMatchInlineSnapshot(
`<absolute path>/build/kibana-oss/bar`
expect(defaultBuild.resolvePath('bar')).toMatchInlineSnapshot(
`<absolute path>/build/kibana/bar`
);
});

Expand All @@ -89,28 +73,27 @@ describe('#resolvePath()', () => {

describe('#resolvePathForPlatform()', () => {
it('uses config.resolveFromRepo(), config.getBuildVersion(), and platform.getBuildName() to create path', () => {
expect(ossBuild.resolvePathForPlatform(linuxPlatform, 'foo', 'bar')).toMatchInlineSnapshot(
`<absolute path>/build/oss/kibana-8.0.0-linux-x86_64/foo/bar`
expect(defaultBuild.resolvePathForPlatform(linuxPlatform, 'foo', 'bar')).toMatchInlineSnapshot(
`<absolute path>/build/default/kibana-8.0.0-linux-x86_64/foo/bar`
);
});
});

describe('#getPlatformArchivePath()', () => {
it('creates correct path for different platforms', () => {
expect(ossBuild.getPlatformArchivePath(linuxPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-oss-8.0.0-linux-x86_64.tar.gz`
expect(defaultBuild.getPlatformArchivePath(linuxPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-8.0.0-linux-x86_64.tar.gz`
);
expect(ossBuild.getPlatformArchivePath(linuxArmPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-oss-8.0.0-linux-aarch64.tar.gz`
expect(defaultBuild.getPlatformArchivePath(linuxArmPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-8.0.0-linux-aarch64.tar.gz`
);
expect(ossBuild.getPlatformArchivePath(windowsPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-oss-8.0.0-windows-x86_64.zip`
expect(defaultBuild.getPlatformArchivePath(windowsPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-8.0.0-windows-x86_64.zip`
);
});

describe('#getRootDirectory()', () => {
it('creates correct root directory name', () => {
expect(ossBuild.getRootDirectory()).toMatchInlineSnapshot(`"kibana-oss-8.0.0"`);
expect(defaultBuild.getRootDirectory()).toMatchInlineSnapshot(`"kibana-8.0.0"`);
});
});
Expand Down
12 changes: 4 additions & 8 deletions src/dev/build/lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ import { Config } from './config';
import { Platform } from './platform';

export class Build {
private name = this.oss ? 'kibana-oss' : 'kibana';
private logTag = this.oss ? chalk`{magenta [kibana-oss]}` : chalk`{cyan [ kibana ]}`;
private name = 'kibana';
private logTag = chalk`{cyan [ kibana ]}`;

constructor(private config: Config, private oss: boolean) {}

isOss() {
return !!this.oss;
}
constructor(private config: Config) {}

resolvePath(...args: string[]) {
return this.config.resolveFromRepo('build', this.name, ...args);
Expand All @@ -28,7 +24,7 @@ export class Build {
resolvePathForPlatform(platform: Platform, ...args: string[]) {
return this.config.resolveFromRepo(
'build',
this.oss ? 'oss' : 'default',
'default',
`kibana-${this.config.getBuildVersion()}-${platform.getBuildName()}`,
...args
);
Expand Down
Loading

0 comments on commit 9c468ba

Please sign in to comment.