Skip to content

Commit

Permalink
Merge branch '7.x' into ua/hide_migrated_indices_from_flyout
Browse files Browse the repository at this point in the history
  • Loading branch information
sabarasaba authored Oct 19, 2021
2 parents 5604ee1 + 6e64940 commit 9b24ee3
Show file tree
Hide file tree
Showing 311 changed files with 5,131 additions and 2,535 deletions.
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/collapsible_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ export function CollapsibleNav({
iconType="plusInCircleFilled"
>
{i18n.translate('core.ui.primaryNav.addData', {
defaultMessage: 'Add data',
defaultMessage: 'Add integrations',
})}
</EuiButton>
</EuiCollapsibleNavGroup>
Expand Down
93 changes: 58 additions & 35 deletions src/core/server/config/deprecation/core_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const kibanaPathConf: ConfigDeprecation = (settings, fromPath, addDeprecation) =
if (process.env?.KIBANA_PATH_CONF) {
addDeprecation({
configPath: 'env.KIBANA_PATH_CONF',
level: 'critical',
message: `Environment variable "KIBANA_PATH_CONF" is deprecated. It has been replaced with "KBN_PATH_CONF" pointing to a config folder`,
correctiveActions: {
manualSteps: [
Expand All @@ -27,6 +28,7 @@ const configPathDeprecation: ConfigDeprecation = (settings, fromPath, addDepreca
if (process.env?.CONFIG_PATH) {
addDeprecation({
configPath: 'env.CONFIG_PATH',
level: 'critical',
message: `Environment variable "CONFIG_PATH" is deprecated. It has been replaced with "KBN_PATH_CONF" pointing to a config folder`,
correctiveActions: {
manualSteps: ['Use "KBN_PATH_CONF" instead of "CONFIG_PATH" to point to a config folder.'],
Expand All @@ -39,6 +41,7 @@ const dataPathDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati
if (process.env?.DATA_PATH) {
addDeprecation({
configPath: 'env.DATA_PATH',
level: 'critical',
message: `Environment variable "DATA_PATH" will be removed. It has been replaced with kibana.yml setting "path.data"`,
correctiveActions: {
manualSteps: [
Expand All @@ -53,13 +56,13 @@ const rewriteBasePathDeprecation: ConfigDeprecation = (settings, fromPath, addDe
if (settings.server?.basePath && !settings.server?.rewriteBasePath) {
addDeprecation({
configPath: 'server.basePath',
level: 'warning',
title: 'Setting "server.rewriteBasePath" should be set when using "server.basePath"',
message:
'You should set server.basePath along with server.rewriteBasePath. Starting in 7.0, Kibana ' +
'will expect that all requests start with server.basePath rather than expecting you to rewrite ' +
'the requests in your reverse proxy. Set server.rewriteBasePath to false to preserve the ' +
'current behavior and silence this warning.',
level: 'warning',
correctiveActions: {
manualSteps: [
`Set 'server.rewriteBasePath' in the config file, CLI flag, or environment variable (in Docker only).`,
Expand All @@ -75,6 +78,7 @@ const rewriteCorsSettings: ConfigDeprecation = (settings, fromPath, addDeprecati
if (typeof corsSettings === 'boolean') {
addDeprecation({
configPath: 'server.cors',
level: 'warning',
title: 'Setting "server.cors" is deprecated',
message: '"server.cors" is deprecated and has been replaced by "server.cors.enabled"',
correctiveActions: {
Expand Down Expand Up @@ -113,6 +117,7 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati
if (sourceList.find((source) => source.includes(NONCE_STRING))) {
addDeprecation({
configPath: 'csp.rules',
level: 'critical',
message: `csp.rules no longer supports the {nonce} syntax. Replacing with 'self' in ${policy}`,
correctiveActions: {
manualSteps: [`Replace {nonce} syntax with 'self' in ${policy}`],
Expand All @@ -132,6 +137,7 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati
) {
addDeprecation({
configPath: 'csp.rules',
level: 'critical',
message: `csp.rules must contain the 'self' source. Automatically adding to ${policy}.`,
correctiveActions: {
manualSteps: [`Add 'self' source to ${policy}.`],
Expand All @@ -156,6 +162,7 @@ const mapManifestServiceUrlDeprecation: ConfigDeprecation = (
if (settings.map?.manifestServiceUrl) {
addDeprecation({
configPath: 'map.manifestServiceUrl',
level: 'critical',
message:
'You should no longer use the map.manifestServiceUrl setting in kibana.yml to configure the location ' +
'of the Elastic Maps Service settings. These settings have moved to the "map.emsTileApiUrl" and ' +
Expand All @@ -175,6 +182,7 @@ const serverHostZeroDeprecation: ConfigDeprecation = (settings, fromPath, addDep
if (settings.server?.host === '0') {
addDeprecation({
configPath: 'server.host',
level: 'critical',
message:
'Support for setting server.host to "0" in kibana.yml is deprecated and will be removed in Kibana version 8.0.0. ' +
'Instead use "0.0.0.0" to bind to all interfaces.',
Expand Down Expand Up @@ -206,6 +214,7 @@ const opsLoggingEventDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.ops) {
addDeprecation({
configPath: 'logging.events.ops',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsOps.deprecationTitle', {
defaultMessage: `Setting "logging.events.ops" is deprecated`,
Expand Down Expand Up @@ -237,6 +246,7 @@ const requestLoggingEventDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.request) {
addDeprecation({
configPath: 'logging.events.request',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsRequest.deprecationTitle', {
defaultMessage: `Setting "logging.events.request" is deprecated`,
Expand Down Expand Up @@ -268,6 +278,7 @@ const responseLoggingEventDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.response) {
addDeprecation({
configPath: 'logging.events.response',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsResponse.deprecationTitle', {
defaultMessage: `Setting "logging.events.response" is deprecated`,
Expand Down Expand Up @@ -299,6 +310,7 @@ const timezoneLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.timezone) {
addDeprecation({
configPath: 'logging.timezone',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingtimezone`,
title: i18n.translate('core.deprecations.loggingTimezone.deprecationTitle', {
defaultMessage: `Setting "logging.timezone" is deprecated`,
Expand Down Expand Up @@ -330,6 +342,7 @@ const destLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.dest) {
addDeprecation({
configPath: 'logging.dest',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingdest`,
title: i18n.translate('core.deprecations.loggingDest.deprecationTitle', {
defaultMessage: `Setting "logging.dest" is deprecated`,
Expand Down Expand Up @@ -361,6 +374,7 @@ const quietLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.quiet) {
addDeprecation({
configPath: 'logging.quiet',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingquiet`,
title: i18n.translate('core.deprecations.loggingQuiet.deprecationTitle', {
defaultMessage: `Setting "logging.quiet" is deprecated`,
Expand Down Expand Up @@ -391,6 +405,7 @@ const silentLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.silent) {
addDeprecation({
configPath: 'logging.silent',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingsilent`,
title: i18n.translate('core.deprecations.loggingSilent.deprecationTitle', {
defaultMessage: `Setting "logging.silent" is deprecated`,
Expand Down Expand Up @@ -421,6 +436,7 @@ const verboseLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.verbose) {
addDeprecation({
configPath: 'logging.verbose',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingverbose`,
title: i18n.translate('core.deprecations.loggingVerbose.deprecationTitle', {
defaultMessage: `Setting "logging.verbose" is deprecated`,
Expand Down Expand Up @@ -455,6 +471,7 @@ const jsonLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.json && settings.env !== 'development') {
addDeprecation({
configPath: 'logging.json',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx`,
title: i18n.translate('core.deprecations.loggingJson.deprecationTitle', {
defaultMessage: `Setting "logging.json" is deprecated`,
Expand Down Expand Up @@ -487,6 +504,7 @@ const logRotateDeprecation: ConfigDeprecation = (
if (settings.logging?.rotate) {
addDeprecation({
configPath: 'logging.rotate',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#rolling-file-appender`,
title: i18n.translate('core.deprecations.loggingRotate.deprecationTitle', {
defaultMessage: `Setting "logging.rotate" is deprecated`,
Expand Down Expand Up @@ -518,6 +536,7 @@ const logEventsLogDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.log) {
addDeprecation({
configPath: 'logging.events.log',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsLog.deprecationTitle', {
defaultMessage: `Setting "logging.events.log" is deprecated`,
Expand Down Expand Up @@ -548,6 +567,7 @@ const logEventsErrorDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.error) {
addDeprecation({
configPath: 'logging.events.error',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsError.deprecationTitle', {
defaultMessage: `Setting "logging.events.error" is deprecated`,
Expand Down Expand Up @@ -578,6 +598,7 @@ const logFilterDeprecation: ConfigDeprecation = (
if (settings.logging?.filter) {
addDeprecation({
configPath: 'logging.filter',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingfilter`,
title: i18n.translate('core.deprecations.loggingFilter.deprecationTitle', {
defaultMessage: `Setting "logging.filter" is deprecated`,
Expand All @@ -596,40 +617,42 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({
unusedFromRoot,
renameFromRoot,
}) => [
unusedFromRoot('savedObjects.indexCheckTimeout'),
unusedFromRoot('server.xsrf.token'),
unusedFromRoot('maps.manifestServiceUrl'),
unusedFromRoot('optimize.lazy'),
unusedFromRoot('optimize.lazyPort'),
unusedFromRoot('optimize.lazyHost'),
unusedFromRoot('optimize.lazyPrebuild'),
unusedFromRoot('optimize.lazyProxyTimeout'),
unusedFromRoot('optimize.enabled'),
unusedFromRoot('optimize.bundleFilter'),
unusedFromRoot('optimize.bundleDir'),
unusedFromRoot('optimize.viewCaching'),
unusedFromRoot('optimize.watch'),
unusedFromRoot('optimize.watchPort'),
unusedFromRoot('optimize.watchHost'),
unusedFromRoot('optimize.watchPrebuild'),
unusedFromRoot('optimize.watchProxyTimeout'),
unusedFromRoot('optimize.useBundleCache'),
unusedFromRoot('optimize.sourceMaps'),
unusedFromRoot('optimize.workers'),
unusedFromRoot('optimize.profile'),
unusedFromRoot('optimize.validateSyntaxOfNodeModules'),
renameFromRoot('xpack.xpack_main.telemetry.config', 'telemetry.config'),
renameFromRoot('xpack.xpack_main.telemetry.url', 'telemetry.url'),
renameFromRoot('xpack.xpack_main.telemetry.enabled', 'telemetry.enabled'),
renameFromRoot('xpack.telemetry.enabled', 'telemetry.enabled'),
renameFromRoot('xpack.telemetry.config', 'telemetry.config'),
renameFromRoot('xpack.telemetry.banner', 'telemetry.banner'),
renameFromRoot('xpack.telemetry.url', 'telemetry.url'),
renameFromRoot('cpu.cgroup.path.override', 'ops.cGroupOverrides.cpuPath'),
renameFromRoot('cpuacct.cgroup.path.override', 'ops.cGroupOverrides.cpuAcctPath'),
renameFromRoot('server.xsrf.whitelist', 'server.xsrf.allowlist'),
unusedFromRoot('elasticsearch.preserveHost'),
unusedFromRoot('elasticsearch.startupTimeout'),
unusedFromRoot('savedObjects.indexCheckTimeout', { level: 'critical' }),
unusedFromRoot('server.xsrf.token', { level: 'critical' }),
unusedFromRoot('maps.manifestServiceUrl', { level: 'critical' }),
unusedFromRoot('optimize.lazy', { level: 'critical' }),
unusedFromRoot('optimize.lazyPort', { level: 'critical' }),
unusedFromRoot('optimize.lazyHost', { level: 'critical' }),
unusedFromRoot('optimize.lazyPrebuild', { level: 'critical' }),
unusedFromRoot('optimize.lazyProxyTimeout', { level: 'critical' }),
unusedFromRoot('optimize.enabled', { level: 'critical' }),
unusedFromRoot('optimize.bundleFilter', { level: 'critical' }),
unusedFromRoot('optimize.bundleDir', { level: 'critical' }),
unusedFromRoot('optimize.viewCaching', { level: 'critical' }),
unusedFromRoot('optimize.watch', { level: 'critical' }),
unusedFromRoot('optimize.watchPort', { level: 'critical' }),
unusedFromRoot('optimize.watchHost', { level: 'critical' }),
unusedFromRoot('optimize.watchPrebuild', { level: 'critical' }),
unusedFromRoot('optimize.watchProxyTimeout', { level: 'critical' }),
unusedFromRoot('optimize.useBundleCache', { level: 'critical' }),
unusedFromRoot('optimize.sourceMaps', { level: 'critical' }),
unusedFromRoot('optimize.workers', { level: 'critical' }),
unusedFromRoot('optimize.profile', { level: 'critical' }),
unusedFromRoot('optimize.validateSyntaxOfNodeModules', { level: 'critical' }),
renameFromRoot('xpack.xpack_main.telemetry.config', 'telemetry.config', { level: 'critical' }),
renameFromRoot('xpack.xpack_main.telemetry.url', 'telemetry.url', { level: 'critical' }),
renameFromRoot('xpack.xpack_main.telemetry.enabled', 'telemetry.enabled', { level: 'critical' }),
renameFromRoot('xpack.telemetry.enabled', 'telemetry.enabled', { level: 'critical' }),
renameFromRoot('xpack.telemetry.config', 'telemetry.config', { level: 'critical' }),
renameFromRoot('xpack.telemetry.banner', 'telemetry.banner', { level: 'critical' }),
renameFromRoot('xpack.telemetry.url', 'telemetry.url', { level: 'critical' }),
renameFromRoot('cpu.cgroup.path.override', 'ops.cGroupOverrides.cpuPath', { level: 'critical' }),
renameFromRoot('cpuacct.cgroup.path.override', 'ops.cGroupOverrides.cpuAcctPath', {
level: 'critical',
}),
renameFromRoot('server.xsrf.whitelist', 'server.xsrf.allowlist', { level: 'critical' }),
unusedFromRoot('elasticsearch.preserveHost', { level: 'critical' }),
unusedFromRoot('elasticsearch.startupTimeout', { level: 'critical' }),
rewriteCorsSettings,
configPathDeprecation,
kibanaPathConf,
Expand Down
1 change: 1 addition & 0 deletions src/core/server/kibana_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const deprecations: ConfigDeprecationProvider = () => [
if (kibana?.index) {
addDeprecation({
configPath: 'kibana.index',
level: 'critical',
title: i18n.translate('core.kibana.index.deprecationTitle', {
defaultMessage: `Setting "kibana.index" is deprecated`,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ describe('AggTypeMetricSinglePercentileProvider class', () => {
).toEqual(123);
});

it('should not throw error for empty buckets', () => {
const agg = aggConfigs.getResponseAggs()[0];
expect(agg.getValue({})).toEqual(NaN);
});

it('produces the expected expression ast', () => {
const agg = aggConfigs.getResponseAggs()[0];
expect(agg.toExpressionAst()).toMatchInlineSnapshot(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const getSinglePercentileMetricAgg = () => {
if (Number.isInteger(agg.params.percentile)) {
valueKey += '.0';
}
return bucket[agg.id].values[valueKey];
const { values } = bucket[agg.id] ?? {};

return values ? values[valueKey] : NaN;
},
});
};
49 changes: 49 additions & 0 deletions src/plugins/data/common/search/tabify/tabify_docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ function create(id: string) {
});
}

const meta = {
_index: 'index-name',
_id: '1',
};

describe('tabify_docs', () => {
describe('flattenHit', () => {
let indexPattern: DataView;
Expand Down Expand Up @@ -70,6 +75,50 @@ describe('tabify_docs', () => {
expect(Object.keys(response)).toEqual(expectedOrder);
expect(Object.entries(response).map(([key]) => key)).toEqual(expectedOrder);
});

it('does merge values from ignored_field_values and fields correctly', () => {
const flatten = flattenHit(
{
...meta,
fields: { 'extension.keyword': ['foo'], extension: ['foo', 'ignored'] },
ignored_field_values: {
'extension.keyword': ['ignored'],
fully_ignored: ['some', 'value'],
},
},
indexPattern,
{ includeIgnoredValues: true }
);
expect(flatten).toHaveProperty(['extension.keyword'], ['foo', 'ignored']);
expect(flatten).toHaveProperty('extension', ['foo', 'ignored']);
expect(flatten).toHaveProperty('fully_ignored', ['some', 'value']);
});

it('does not merge values from ignored_field_values into _source', () => {
const flatten = flattenHit(
{
...meta,
_source: { 'extension.keyword': ['foo', 'ignored'] },
ignored_field_values: { 'extension.keyword': ['ignored'] },
},
indexPattern,
{ includeIgnoredValues: true, source: true }
);
expect(flatten).toHaveProperty(['extension.keyword'], ['foo', 'ignored']);
});

it('does merge ignored_field_values when no _source was present, even when parameter was on', () => {
const flatten = flattenHit(
{
...meta,
fields: { 'extension.keyword': ['foo'] },
ignored_field_values: { 'extension.keyword': ['ignored'] },
},
indexPattern,
{ includeIgnoredValues: true, source: true }
);
expect(flatten).toHaveProperty(['extension.keyword'], ['foo', 'ignored']);
});
});

describe('tabifyDocs', () => {
Expand Down
Loading

0 comments on commit 9b24ee3

Please sign in to comment.