Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-101068
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Jun 2, 2021
2 parents b305da5 + 654e46c commit b02a01e
Show file tree
Hide file tree
Showing 99 changed files with 2,247 additions and 1,760 deletions.
2 changes: 0 additions & 2 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ Review important information about the {kib} 7.x releases.
[[release-notes-7.13.1]]
== {kib} 7.13.1

coming::[7.13.1]

The 7.13.1 release includes the following bug fixes.

[float]
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/getting-started/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ may need to run:
yarn kbn clean
----

NOTE: Running this command is only necessary in rare circumstance where you need to recover
a consistent state when problems arise. If you need to run this command often, complete
this form to provide feedback: https://ela.st/yarn-kbn-clean

If you have failures during `yarn kbn bootstrap` you may have some
corrupted packages in your yarn cache which you can clean with:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ correctiveActions: {
[key: string]: any;
};
};
manualSteps?: string[];
manualSteps: string[];
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface DeprecationsDetails

| Property | Type | Description |
| --- | --- | --- |
| [correctiveActions](./kibana-plugin-core-server.deprecationsdetails.correctiveactions.md) | <code>{</code><br/><code> api?: {</code><br/><code> path: string;</code><br/><code> method: 'POST' &#124; 'PUT';</code><br/><code> body?: {</code><br/><code> [key: string]: any;</code><br/><code> };</code><br/><code> };</code><br/><code> manualSteps?: string[];</code><br/><code> }</code> | |
| [correctiveActions](./kibana-plugin-core-server.deprecationsdetails.correctiveactions.md) | <code>{</code><br/><code> api?: {</code><br/><code> path: string;</code><br/><code> method: 'POST' &#124; 'PUT';</code><br/><code> body?: {</code><br/><code> [key: string]: any;</code><br/><code> };</code><br/><code> };</code><br/><code> manualSteps: string[];</code><br/><code> }</code> | |
| [deprecationType](./kibana-plugin-core-server.deprecationsdetails.deprecationtype.md) | <code>'config' &#124; 'feature'</code> | (optional) Used to identify between different deprecation types. Example use case: in Upgrade Assistant, we may want to allow the user to sort by deprecation type or show each type in a separate tab.<!-- -->Feel free to add new types if necessary. Predefined types are necessary to reduce having similar definitions with different keywords across kibana deprecations. |
| [documentationUrl](./kibana-plugin-core-server.deprecationsdetails.documentationurl.md) | <code>string</code> | |
| [level](./kibana-plugin-core-server.deprecationsdetails.level.md) | <code>'warning' &#124; 'critical' &#124; 'fetch_error'</code> | levels: - warning: will not break deployment upon upgrade - critical: needs to be addressed before upgrade. - fetch\_error: Deprecations service failed to grab the deprecation details for the domain. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,30 @@

```typescript
getAggregationRestrictions(): Record<string, Record<string, {
agg?: string | undefined;
agg?: string | undefined; /**
* Get last saved saved object fields
*/
interval?: number | undefined;
fixed_interval?: string | undefined;
calendar_interval?: string | undefined;
delay?: string | undefined; /**
delay?: string | undefined;
time_zone?: string | undefined; /**
* Reset last saved saved object fields. used after saving
*/
time_zone?: string | undefined;
}>> | undefined;
```
<b>Returns:</b>

`Record<string, Record<string, {
agg?: string | undefined;
agg?: string | undefined; /**
* Get last saved saved object fields
*/
interval?: number | undefined;
fixed_interval?: string | undefined;
calendar_interval?: string | undefined;
delay?: string | undefined; /**
delay?: string | undefined;
time_zone?: string | undefined; /**
* Reset last saved saved object fields. used after saving
*/
time_zone?: string | undefined;
}>> | undefined`

Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,9 @@ Returns index pattern as saved object body for saving
<b>Signature:</b>

```typescript
getAsSavedObjectBody(): {
fieldAttrs: string | undefined;
title: string;
timeFieldName: string | undefined;
intervalName: string | undefined;
sourceFilters: string | undefined;
fields: string | undefined;
fieldFormatMap: string | undefined;
type: string | undefined;
typeMeta: string | undefined;
allowNoIndex: true | undefined;
runtimeFieldMap: string | undefined;
};
getAsSavedObjectBody(): IndexPatternAttributes;
```
<b>Returns:</b>

`{
fieldAttrs: string | undefined;
title: string;
timeFieldName: string | undefined;
intervalName: string | undefined;
sourceFilters: string | undefined;
fields: string | undefined;
fieldFormatMap: string | undefined;
type: string | undefined;
typeMeta: string | undefined;
allowNoIndex: true | undefined;
runtimeFieldMap: string | undefined;
}`
`IndexPatternAttributes`

Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,30 @@

```typescript
getAggregationRestrictions(): Record<string, Record<string, {
agg?: string | undefined;
agg?: string | undefined; /**
* Get last saved saved object fields
*/
interval?: number | undefined;
fixed_interval?: string | undefined;
calendar_interval?: string | undefined;
delay?: string | undefined; /**
delay?: string | undefined;
time_zone?: string | undefined; /**
* Reset last saved saved object fields. used after saving
*/
time_zone?: string | undefined;
}>> | undefined;
```
<b>Returns:</b>

`Record<string, Record<string, {
agg?: string | undefined;
agg?: string | undefined; /**
* Get last saved saved object fields
*/
interval?: number | undefined;
fixed_interval?: string | undefined;
calendar_interval?: string | undefined;
delay?: string | undefined; /**
delay?: string | undefined;
time_zone?: string | undefined; /**
* Reset last saved saved object fields. used after saving
*/
time_zone?: string | undefined;
}>> | undefined`

Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,9 @@ Returns index pattern as saved object body for saving
<b>Signature:</b>

```typescript
getAsSavedObjectBody(): {
fieldAttrs: string | undefined;
title: string;
timeFieldName: string | undefined;
intervalName: string | undefined;
sourceFilters: string | undefined;
fields: string | undefined;
fieldFormatMap: string | undefined;
type: string | undefined;
typeMeta: string | undefined;
allowNoIndex: true | undefined;
runtimeFieldMap: string | undefined;
};
getAsSavedObjectBody(): IndexPatternAttributes;
```
<b>Returns:</b>

`{
fieldAttrs: string | undefined;
title: string;
timeFieldName: string | undefined;
intervalName: string | undefined;
sourceFilters: string | undefined;
fields: string | undefined;
fieldFormatMap: string | undefined;
type: string | undefined;
typeMeta: string | undefined;
allowNoIndex: true | undefined;
runtimeFieldMap: string | undefined;
}`
`IndexPatternAttributes`

38 changes: 32 additions & 6 deletions packages/kbn-config/src/config_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,14 @@ test('logs deprecation warning during validation', async () => {
const configService = new ConfigService(rawConfig, defaultEnv, logger);
mockApplyDeprecations.mockImplementationOnce((config, deprecations, createAddDeprecation) => {
const addDeprecation = createAddDeprecation!('');
addDeprecation({ message: 'some deprecation message' });
addDeprecation({ message: 'another deprecation message' });
addDeprecation({
message: 'some deprecation message',
correctiveActions: { manualSteps: ['do X'] },
});
addDeprecation({
message: 'another deprecation message',
correctiveActions: { manualSteps: ['do Y'] },
});
return { config, changedPaths: mockedChangedPaths };
});

Expand All @@ -444,13 +450,24 @@ test('does not log warnings for silent deprecations during validation', async ()
mockApplyDeprecations
.mockImplementationOnce((config, deprecations, createAddDeprecation) => {
const addDeprecation = createAddDeprecation!('');
addDeprecation({ message: 'some deprecation message', silent: true });
addDeprecation({ message: 'another deprecation message' });
addDeprecation({
message: 'some deprecation message',
correctiveActions: { manualSteps: ['do X'] },
silent: true,
});
addDeprecation({
message: 'another deprecation message',
correctiveActions: { manualSteps: ['do Y'] },
});
return { config, changedPaths: mockedChangedPaths };
})
.mockImplementationOnce((config, deprecations, createAddDeprecation) => {
const addDeprecation = createAddDeprecation!('');
addDeprecation({ message: 'I am silent', silent: true });
addDeprecation({
message: 'I am silent',
silent: true,
correctiveActions: { manualSteps: ['do Z'] },
});
return { config, changedPaths: mockedChangedPaths };
});

Expand Down Expand Up @@ -519,7 +536,11 @@ describe('getHandledDeprecatedConfigs', () => {
mockApplyDeprecations.mockImplementationOnce((config, deprecations, createAddDeprecation) => {
deprecations.forEach((deprecation) => {
const addDeprecation = createAddDeprecation!(deprecation.path);
addDeprecation({ message: `some deprecation message`, documentationUrl: 'some-url' });
addDeprecation({
message: `some deprecation message`,
documentationUrl: 'some-url',
correctiveActions: { manualSteps: ['do X'] },
});
});
return { config, changedPaths: mockedChangedPaths };
});
Expand All @@ -532,6 +553,11 @@ describe('getHandledDeprecatedConfigs', () => {
"base",
Array [
Object {
"correctiveActions": Object {
"manualSteps": Array [
"do X",
],
},
"documentationUrl": "some-url",
"message": "some deprecation message",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-config/src/deprecation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export interface DeprecatedConfigDetails {
silent?: boolean;
/* (optional) link to the documentation for more details on the deprecation. */
documentationUrl?: string;
/* (optional) corrective action needed to fix this deprecation. */
correctiveActions?: {
/* corrective action needed to fix this deprecation. */
correctiveActions: {
/**
* Specify a list of manual steps our users need to follow
* to fix the deprecation before upgrade.
Expand Down
11 changes: 9 additions & 2 deletions src/core/public/deprecations/deprecations_client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ describe('DeprecationsClient', () => {
path: 'some-path',
method: 'POST',
},
manualSteps: ['manual-step'],
},
};

Expand All @@ -104,7 +105,9 @@ describe('DeprecationsClient', () => {
domainId: 'testPluginId-1',
message: 'some-message',
level: 'warning',
correctiveActions: {},
correctiveActions: {
manualSteps: ['manual-step'],
},
};

const isResolvable = deprecationsClient.isDeprecationResolvable(mockDeprecationDetails);
Expand All @@ -120,7 +123,9 @@ describe('DeprecationsClient', () => {
domainId: 'testPluginId-1',
message: 'some-message',
level: 'warning',
correctiveActions: {},
correctiveActions: {
manualSteps: ['manual-step'],
},
};
const result = await deprecationsClient.resolveDeprecation(mockDeprecationDetails);

Expand All @@ -144,6 +149,7 @@ describe('DeprecationsClient', () => {
extra_param: 123,
},
},
manualSteps: ['manual-step'],
},
};
const result = await deprecationsClient.resolveDeprecation(mockDeprecationDetails);
Expand Down Expand Up @@ -176,6 +182,7 @@ describe('DeprecationsClient', () => {
extra_param: 123,
},
},
manualSteps: ['manual-step'],
},
};
http.fetch.mockRejectedValue({ body: { message: mockResponse } });
Expand Down
6 changes: 3 additions & 3 deletions src/core/server/config/deprecation/core_deprecations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('core deprecations', () => {
const { messages } = applyCoreDeprecations();
expect(messages).toMatchInlineSnapshot(`
Array [
"Environment variable CONFIG_PATH is deprecated. It has been replaced with KBN_PATH_CONF pointing to a config folder",
"Environment variable \\"CONFIG_PATH\\" is deprecated. It has been replaced with \\"KBN_PATH_CONF\\" pointing to a config folder",
]
`);
});
Expand Down Expand Up @@ -425,7 +425,7 @@ describe('core deprecations', () => {
});
expect(messages).toMatchInlineSnapshot(`
Array [
"\\"logging.events.log\\" has been deprecated and will be removed in 8.0. Moving forward, log levels can be customized on a per-logger basis using the new logging configuration. ",
"\\"logging.events.log\\" has been deprecated and will be removed in 8.0. Moving forward, log levels can be customized on a per-logger basis using the new logging configuration.",
]
`);
});
Expand All @@ -438,7 +438,7 @@ describe('core deprecations', () => {
});
expect(messages).toMatchInlineSnapshot(`
Array [
"\\"logging.events.error\\" has been deprecated and will be removed in 8.0. Moving forward, you can use \\"logging.root.level: error\\" in your logging configuration. ",
"\\"logging.events.error\\" has been deprecated and will be removed in 8.0. Moving forward, you can use \\"logging.root.level: error\\" in your logging configuration.",
]
`);
});
Expand Down
Loading

0 comments on commit b02a01e

Please sign in to comment.