Skip to content

Commit

Permalink
Merge branch 'master' into fix/unsavedChangesSpaceSpecific
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Mar 3, 2021
2 parents 83d20db + 294db10 commit b18f190
Show file tree
Hide file tree
Showing 373 changed files with 8,581 additions and 631 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,22 @@ module.exports = {
},
},

/**
* Fleet overrides
*/
{
files: ['x-pack/plugins/fleet/**/*.{js,mjs,ts,tsx}'],
rules: {
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', 'parent'],
'newlines-between': 'always-and-inside-groups',
},
],
},
},

/**
* Security Solution overrides
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ fieldFormats: {
UrlFormat: typeof UrlFormat;
StringFormat: typeof StringFormat;
TruncateFormat: typeof TruncateFormat;
HistogramFormat: typeof HistogramFormat;
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ fieldFormats: {
UrlFormat: typeof UrlFormat;
StringFormat: typeof StringFormat;
TruncateFormat: typeof TruncateFormat;
HistogramFormat: typeof HistogramFormat;
}
```
8 changes: 7 additions & 1 deletion docs/management/managing-fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ include::field-formatters/string-formatter.asciidoc[]
[[field-formatters-numeric]]
=== Numeric field formatters

Numeric fields support the `Url`, `Bytes`, `Duration`, `Number`, `Percentage`, `String`, and `Color` formatters.
Numeric fields support the `Url`, `Bytes`, `Duration`, `Number`, `Percentage`, `Histogram`, `String`, and `Color` formatters.

The `Bytes`, `Number`, and `Percentage` formatters enable you to choose the display formats of numbers in this field using
the <<numeral, Elastic numeral pattern>> syntax that {kib} maintains.

The `Histogram` formatter is only used for the {ref}/histogram.html[histogram field type]. When using the `Histogram` formatter,
you can apply the `Number`, `Bytes`, or `Percentage` format to the aggregated data.

`Number`, and `Percentage` formatters enable you to choose the display formats of numbers in this field using
the <<numeral, Elastic numeral pattern>> syntax that {kib} maintains.

include::field-formatters/url-formatter.asciidoc[]

include::field-formatters/string-formatter.asciidoc[]
Expand Down
4 changes: 2 additions & 2 deletions src/core/server/logging/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ There are two types of layout supported at the moment: `pattern` and `json`.

### Pattern layout
With `pattern` layout it's possible to define a string pattern with special placeholders `%conversion_pattern` (see the table below) that
will be replaced with data from the actual log message. By default the following pattern is used:
will be replaced with data from the actual log message. By default the following pattern is used:
`[%date][%level][%logger] %message`. Also `highlight` option can be enabled for `pattern` layout so that
some parts of the log message are highlighted with different colors that may be quite handy if log messages are forwarded
to the terminal with color support.
Expand Down Expand Up @@ -143,7 +143,7 @@ Example of `%date` output:
Outputs the process ID.

### JSON layout
With `json` layout log messages will be formatted as JSON strings that include timestamp, log level, context name, message
With `json` layout log messages will be formatted as JSON strings in [ECS format](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html) that includes a timestamp, log level, context name, message
text and any other metadata that may be associated with the log message itself.

## Appenders
Expand Down
21 changes: 21 additions & 0 deletions src/dev/build/args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ it('build default and oss dist for current platform, without packages, by defaul
"createDockerCentOS": false,
"createDockerContexts": true,
"createDockerUBI": false,
"createGenericFolders": true,
"createPlatformFolders": true,
"createRpmPackage": false,
"downloadFreshNode": true,
"initialize": true,
"isRelease": false,
"targetAllPlatforms": false,
"versionQualifier": "",
Expand All @@ -57,8 +60,11 @@ it('builds packages if --all-platforms is passed', () => {
"createDockerCentOS": true,
"createDockerContexts": true,
"createDockerUBI": true,
"createGenericFolders": true,
"createPlatformFolders": true,
"createRpmPackage": true,
"downloadFreshNode": true,
"initialize": true,
"isRelease": false,
"targetAllPlatforms": true,
"versionQualifier": "",
Expand All @@ -81,8 +87,11 @@ it('limits packages if --rpm passed with --all-platforms', () => {
"createDockerCentOS": false,
"createDockerContexts": true,
"createDockerUBI": false,
"createGenericFolders": true,
"createPlatformFolders": true,
"createRpmPackage": true,
"downloadFreshNode": true,
"initialize": true,
"isRelease": false,
"targetAllPlatforms": true,
"versionQualifier": "",
Expand All @@ -105,8 +114,11 @@ it('limits packages if --deb passed with --all-platforms', () => {
"createDockerCentOS": false,
"createDockerContexts": true,
"createDockerUBI": false,
"createGenericFolders": true,
"createPlatformFolders": true,
"createRpmPackage": false,
"downloadFreshNode": true,
"initialize": true,
"isRelease": false,
"targetAllPlatforms": true,
"versionQualifier": "",
Expand All @@ -130,8 +142,11 @@ it('limits packages if --docker passed with --all-platforms', () => {
"createDockerCentOS": true,
"createDockerContexts": true,
"createDockerUBI": true,
"createGenericFolders": true,
"createPlatformFolders": true,
"createRpmPackage": false,
"downloadFreshNode": true,
"initialize": true,
"isRelease": false,
"targetAllPlatforms": true,
"versionQualifier": "",
Expand Down Expand Up @@ -162,8 +177,11 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform
"createDockerCentOS": true,
"createDockerContexts": true,
"createDockerUBI": false,
"createGenericFolders": true,
"createPlatformFolders": true,
"createRpmPackage": false,
"downloadFreshNode": true,
"initialize": true,
"isRelease": false,
"targetAllPlatforms": true,
"versionQualifier": "",
Expand All @@ -187,8 +205,11 @@ it('limits packages if --all-platforms passed with --skip-docker-centos', () =>
"createDockerCentOS": false,
"createDockerContexts": true,
"createDockerUBI": true,
"createGenericFolders": true,
"createPlatformFolders": true,
"createRpmPackage": true,
"downloadFreshNode": true,
"initialize": true,
"isRelease": false,
"targetAllPlatforms": true,
"versionQualifier": "",
Expand Down
6 changes: 6 additions & 0 deletions src/dev/build/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export function readCliArgs(argv: string[]) {
'oss',
'no-oss',
'skip-archives',
'skip-initialize',
'skip-generic-folders',
'skip-platform-folders',
'skip-os-packages',
'rpm',
'deb',
Expand Down Expand Up @@ -93,7 +96,10 @@ export function readCliArgs(argv: string[]) {
versionQualifier: flags['version-qualifier'],
buildOssDist: flags.oss !== false,
buildDefaultDist: !flags.oss,
initialize: !Boolean(flags['skip-initialize']),
downloadFreshNode: !Boolean(flags['skip-node-download']),
createGenericFolders: !Boolean(flags['skip-generic-folders']),
createPlatformFolders: !Boolean(flags['skip-platform-folders']),
createArchives: !Boolean(flags['skip-archives']),
createRpmPackage: isOsPackageDesired('rpm'),
createDebPackage: isOsPackageDesired('deb'),
Expand Down
69 changes: 40 additions & 29 deletions src/dev/build/build_distributables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export interface BuildOptions {
buildOssDist: boolean;
buildDefaultDist: boolean;
downloadFreshNode: boolean;
initialize: boolean;
createGenericFolders: boolean;
createPlatformFolders: boolean;
createArchives: boolean;
createRpmPackage: boolean;
createDebPackage: boolean;
Expand All @@ -41,45 +44,53 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions
/**
* verify, reset, and initialize the build environment
*/
await run(Tasks.VerifyEnv);
await run(Tasks.Clean);
await run(options.downloadFreshNode ? Tasks.DownloadNodeBuilds : Tasks.VerifyExistingNodeBuilds);
await run(Tasks.ExtractNodeBuilds);
if (options.initialize) {
await run(Tasks.VerifyEnv);
await run(Tasks.Clean);
await run(
options.downloadFreshNode ? Tasks.DownloadNodeBuilds : Tasks.VerifyExistingNodeBuilds
);
await run(Tasks.ExtractNodeBuilds);
}

/**
* run platform-generic build tasks
*/
await run(Tasks.CopySource);
await run(Tasks.CopyBinScripts);
await run(Tasks.ReplaceFavicon);
await run(Tasks.CreateEmptyDirsAndFiles);
await run(Tasks.CreateReadme);
await run(Tasks.BuildBazelPackages);
await run(Tasks.BuildPackages);
await run(Tasks.BuildKibanaPlatformPlugins);
await run(Tasks.TranspileBabel);
await run(Tasks.CreatePackageJson);
await run(Tasks.InstallDependencies);
await run(Tasks.CleanPackages);
await run(Tasks.CreateNoticeFile);
await run(Tasks.UpdateLicenseFile);
await run(Tasks.RemovePackageJsonDeps);
await run(Tasks.CleanTypescript);
await run(Tasks.CleanExtraFilesFromModules);
await run(Tasks.CleanEmptyFolders);
if (options.createGenericFolders) {
await run(Tasks.CopySource);
await run(Tasks.CopyBinScripts);
await run(Tasks.ReplaceFavicon);
await run(Tasks.CreateEmptyDirsAndFiles);
await run(Tasks.CreateReadme);
await run(Tasks.BuildBazelPackages);
await run(Tasks.BuildPackages);
await run(Tasks.BuildKibanaPlatformPlugins);
await run(Tasks.TranspileBabel);
await run(Tasks.CreatePackageJson);
await run(Tasks.InstallDependencies);
await run(Tasks.CleanPackages);
await run(Tasks.CreateNoticeFile);
await run(Tasks.UpdateLicenseFile);
await run(Tasks.RemovePackageJsonDeps);
await run(Tasks.CleanTypescript);
await run(Tasks.CleanExtraFilesFromModules);
await run(Tasks.CleanEmptyFolders);
}

/**
* copy generic build outputs into platform-specific build
* directories and perform platform/architecture-specific steps
*/
await run(Tasks.CreateArchivesSources);
await run(Tasks.PatchNativeModules);
await run(Tasks.InstallChromium);
await run(Tasks.CleanExtraBinScripts);
await run(Tasks.CleanNodeBuilds);
if (options.createPlatformFolders) {
await run(Tasks.CreateArchivesSources);
await run(Tasks.PatchNativeModules);
await run(Tasks.InstallChromium);
await run(Tasks.CleanExtraBinScripts);
await run(Tasks.CleanNodeBuilds);

await run(Tasks.PathLength);
await run(Tasks.UuidVerification);
await run(Tasks.PathLength);
await run(Tasks.UuidVerification);
}

/**
* package platform-specific builds into archives
Expand Down
18 changes: 11 additions & 7 deletions src/dev/build/tasks/os_packages/docker_generator/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ export async function runDockerGenerator(
revision: config.getBuildSha(),
};

type HostArchitectureToDocker = Record<string, string>;
const hostTarget: HostArchitectureToDocker = {
x64: 'x64',
arm64: 'aarch64',
};
const buildArchitectureSupported = hostTarget[process.arch] === flags.architecture;
if (flags.architecture && !buildArchitectureSupported) {
return;
}

// Verify if we have the needed kibana target in order
// to build the kibana docker image.
// Also create the docker build target folder
Expand Down Expand Up @@ -132,13 +142,7 @@ export async function runDockerGenerator(
await chmodAsync(`${resolve(dockerBuildDir, 'build_docker.sh')}`, '755');

// Only build images on native targets
type HostArchitectureToDocker = Record<string, string>;
const hostTarget: HostArchitectureToDocker = {
x64: 'x64',
arm64: 'aarch64',
};
const buildImage = hostTarget[process.arch] === flags.architecture && flags.image;
if (buildImage) {
if (flags.image) {
await exec(log, `./build_docker.sh`, [], {
cwd: dockerBuildDir,
level: 'info',
Expand Down
4 changes: 4 additions & 0 deletions src/dev/build/tasks/os_packages/run_fpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export async function runFpm(
'--rpm-posttrans',
resolve(__dirname, 'package_scripts/post_trans.sh'),

// for RHEL 8+ package verification
'--rpm-digest',
'sha256',

// tell fpm about the config file so that it is called out in the package definition
'--config-files',
`/etc/kibana/kibana.yml`,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dashboard/public/application/dashboard_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export function DashboardApp({
);

dashboardStateManager.registerChangeListener(() => {
setUnsavedChanges(dashboardStateManager?.hasUnsavedPanelState());
setUnsavedChanges(dashboardStateManager.getIsDirty(data.query.timefilter.timefilter));
// we aren't checking dirty state because there are changes the container needs to know about
// that won't make the dashboard "dirty" - like a view mode change.
triggerRefresh$.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,10 @@ export class DashboardStateManager {
// Filter bar comparison is done manually (see cleanFiltersForComparison for the reason) and time picker
// changes are not tracked by the state monitor.
const hasTimeFilterChanged = timeFilter ? this.getFiltersChanged(timeFilter) : false;
return this.getIsEditMode() && (this.isDirty || hasTimeFilterChanged);
return (
this.hasUnsavedPanelState() ||
(this.getIsEditMode() && (this.isDirty || hasTimeFilterChanged))
);
}

public getPanels(): SavedDashboardPanel[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ export function DashboardTopNav({
const topNav = getTopNavConfig(viewMode, dashboardTopNavActions, {
hideWriteControls: dashboardCapabilities.hideWriteControls,
isNewDashboard: !savedDashboard.id,
isDirty: dashboardStateManager.isDirty,
isDirty: dashboardStateManager.getIsDirty(timefilter),
isSaveInProgress,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
StringFormat,
TruncateFormat,
UrlFormat,
HistogramFormat,
} from '../converters';

export const baseFormatters: FieldFormatInstanceType[] = [
Expand All @@ -38,4 +39,5 @@ export const baseFormatters: FieldFormatInstanceType[] = [
StringFormat,
TruncateFormat,
UrlFormat,
HistogramFormat,
];
Loading

0 comments on commit b18f190

Please sign in to comment.