-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/7.x' into backport/7.x/pr-62819
- Loading branch information
Showing
176 changed files
with
3,389 additions
and
1,953 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...data/public/kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [indexPattern](./kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md) | ||
|
||
## IndexPatternField.indexPattern property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
indexPattern?: IndexPattern; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Elasticsearch Index Templates | ||
|
||
## Generation | ||
|
||
* Index templates are generated from `YAML` files contained in the package. | ||
* There is one index template per dataset. | ||
* For the generation of an index template, all `yml` files contained in the package subdirectory `dataset/DATASET_NAME/fields/` are used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/core/server/legacy/plugins/log_legacy_plugins_warning.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { loggerMock } from '../../logging/logger.mock'; | ||
import { logLegacyThirdPartyPluginDeprecationWarning } from './log_legacy_plugins_warning'; | ||
import { LegacyPluginSpec } from '../types'; | ||
|
||
const createPluginSpec = ({ id, path }: { id: string; path: string }): LegacyPluginSpec => { | ||
return { | ||
getId: () => id, | ||
getExpectedKibanaVersion: () => 'kibana', | ||
getConfigPrefix: () => 'plugin.config', | ||
getDeprecationsProvider: () => undefined, | ||
getPack: () => ({ | ||
getPath: () => path, | ||
}), | ||
}; | ||
}; | ||
|
||
describe('logLegacyThirdPartyPluginDeprecationWarning', () => { | ||
let log: ReturnType<typeof loggerMock.create>; | ||
|
||
beforeEach(() => { | ||
log = loggerMock.create(); | ||
}); | ||
|
||
it('logs warning for third party plugins', () => { | ||
logLegacyThirdPartyPluginDeprecationWarning({ | ||
specs: [createPluginSpec({ id: 'plugin', path: '/some-external-path' })], | ||
log, | ||
}); | ||
expect(log.warn).toHaveBeenCalledTimes(1); | ||
expect(log.warn.mock.calls[0]).toMatchInlineSnapshot(` | ||
Array [ | ||
"Some installed third party plugin(s) [plugin] are using the legacy plugin format and will no longer work in a future Kibana release. Please refer to https://www.elastic.co/guide/en/kibana/master/breaking-changes-8.0.html for a list of breaking changes and https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md for documentation on how to migrate legacy plugins.", | ||
] | ||
`); | ||
}); | ||
|
||
it('lists all the deprecated plugins and only log once', () => { | ||
logLegacyThirdPartyPluginDeprecationWarning({ | ||
specs: [ | ||
createPluginSpec({ id: 'pluginA', path: '/abs/path/to/pluginA' }), | ||
createPluginSpec({ id: 'pluginB', path: '/abs/path/to/pluginB' }), | ||
createPluginSpec({ id: 'pluginC', path: '/abs/path/to/pluginC' }), | ||
], | ||
log, | ||
}); | ||
expect(log.warn).toHaveBeenCalledTimes(1); | ||
expect(log.warn.mock.calls[0]).toMatchInlineSnapshot(` | ||
Array [ | ||
"Some installed third party plugin(s) [pluginA, pluginB, pluginC] are using the legacy plugin format and will no longer work in a future Kibana release. Please refer to https://www.elastic.co/guide/en/kibana/master/breaking-changes-8.0.html for a list of breaking changes and https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md for documentation on how to migrate legacy plugins.", | ||
] | ||
`); | ||
}); | ||
|
||
it('does not log warning for internal legacy plugins', () => { | ||
logLegacyThirdPartyPluginDeprecationWarning({ | ||
specs: [ | ||
createPluginSpec({ | ||
id: 'plugin', | ||
path: '/absolute/path/to/kibana/src/legacy/core_plugins', | ||
}), | ||
createPluginSpec({ | ||
id: 'plugin', | ||
path: '/absolute/path/to/kibana/x-pack', | ||
}), | ||
], | ||
log, | ||
}); | ||
|
||
expect(log.warn).not.toHaveBeenCalled(); | ||
}); | ||
}); |
52 changes: 52 additions & 0 deletions
52
src/core/server/legacy/plugins/log_legacy_plugins_warning.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { Logger } from '../../logging'; | ||
import { LegacyPluginSpec } from '../types'; | ||
|
||
const internalPaths = ['/src/legacy/core_plugins', '/x-pack']; | ||
|
||
const breakingChangesUrl = | ||
'https://www.elastic.co/guide/en/kibana/master/breaking-changes-8.0.html'; | ||
const migrationGuideUrl = 'https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md'; | ||
|
||
export const logLegacyThirdPartyPluginDeprecationWarning = ({ | ||
specs, | ||
log, | ||
}: { | ||
specs: LegacyPluginSpec[]; | ||
log: Logger; | ||
}) => { | ||
const thirdPartySpecs = specs.filter(isThirdPartyPluginSpec); | ||
if (thirdPartySpecs.length > 0) { | ||
const pluginIds = thirdPartySpecs.map(spec => spec.getId()); | ||
log.warn( | ||
`Some installed third party plugin(s) [${pluginIds.join( | ||
', ' | ||
)}] are using the legacy plugin format and will no longer work in a future Kibana release. ` + | ||
`Please refer to ${breakingChangesUrl} for a list of breaking changes ` + | ||
`and ${migrationGuideUrl} for documentation on how to migrate legacy plugins.` | ||
); | ||
} | ||
}; | ||
|
||
const isThirdPartyPluginSpec = (spec: LegacyPluginSpec): boolean => { | ||
const pluginPath = spec.getPack().getPath(); | ||
return !internalPaths.some(internalPath => pluginPath.indexOf(internalPath) > -1); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.