Skip to content

Commit

Permalink
Merge branch 'master' into issue-76649-update-saved-object-ui-text
Browse files Browse the repository at this point in the history
  • Loading branch information
jportner committed Sep 8, 2020
2 parents 84cc53a + a38df0a commit 072cd1d
Show file tree
Hide file tree
Showing 264 changed files with 73,133 additions and 4,451 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<b>Signature:</b>

```typescript
export declare type AppenderConfigType = TypeOf<typeof appendersSchema>;
export declare type AppenderConfigType = ConsoleAppenderConfig | FileAppenderConfig | LegacyAppenderConfig;
```
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) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [ES\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-server.es_search_strategy.md)

## ES\_SEARCH\_STRATEGY variable

<b>Signature:</b>

```typescript
ES_SEARCH_STRATEGY = "es"
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export interface ISearchStart<SearchStrategyRequest extends IEsSearchRequest = I
| --- | --- | --- |
| [aggs](./kibana-plugin-plugins-data-server.isearchstart.aggs.md) | <code>AggsStart</code> | |
| [getSearchStrategy](./kibana-plugin-plugins-data-server.isearchstart.getsearchstrategy.md) | <code>(name: string) =&gt; ISearchStrategy&lt;SearchStrategyRequest, SearchStrategyResponse&gt;</code> | Get other registered search strategies. For example, if a new strategy needs to use the already-registered ES search strategy, it can use this function to accomplish that. |
| [search](./kibana-plugin-plugins-data-server.isearchstart.search.md) | <code>(context: RequestHandlerContext, request: IKibanaSearchRequest, options: ISearchOptions) =&gt; Promise&lt;IKibanaSearchResponse&gt;</code> | |
| [search](./kibana-plugin-plugins-data-server.isearchstart.search.md) | <code>(context: RequestHandlerContext, request: IEsSearchRequest, options: ISearchOptions) =&gt; Promise&lt;IEsSearchResponse&gt;</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
search: (context: RequestHandlerContext, request: IKibanaSearchRequest, options: ISearchOptions) => Promise<IKibanaSearchResponse>;
search: (context: RequestHandlerContext, request: IEsSearchRequest, options: ISearchOptions) => Promise<IEsSearchResponse>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
| [AggGroupNames](./kibana-plugin-plugins-data-server.agggroupnames.md) | |
| [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-server.castestokbnfieldtypename.md) | Get the KbnFieldType name for an esType string |
| [config](./kibana-plugin-plugins-data-server.config.md) | |
| [ES\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-server.es_search_strategy.md) | |
| [esFilters](./kibana-plugin-plugins-data-server.esfilters.md) | |
| [esKuery](./kibana-plugin-plugins-data-server.eskuery.md) | |
| [esQuery](./kibana-plugin-plugins-data-server.esquery.md) | |
Expand Down
13 changes: 3 additions & 10 deletions src/core/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
* @packageDocumentation
*/

import { Type } from '@kbn/config-schema';
import {
ElasticsearchServiceSetup,
ILegacyScopedClusterClient,
configSchema as elasticsearchConfigSchema,
ElasticsearchServiceStart,
IScopedClusterClient,
} from './elasticsearch';

import { HttpServiceSetup, HttpServiceStart } from './http';
import { HttpResources } from './http_resources';

Expand All @@ -63,12 +63,7 @@ import { CapabilitiesSetup, CapabilitiesStart } from './capabilities';
import { MetricsServiceStart } from './metrics';
import { StatusServiceSetup } from './status';
import { Auditor, AuditTrailSetup, AuditTrailStart } from './audit_trail';
import {
LoggingServiceSetup,
appendersSchema,
loggerContextConfigSchema,
loggerSchema,
} from './logging';
import { AppenderConfigType, appendersSchema, LoggingServiceSetup } from './logging';

export { AuditableEvent, Auditor, AuditorFactory, AuditTrailSetup } from './audit_trail';
export { bootstrap } from './bootstrap';
Expand Down Expand Up @@ -497,8 +492,6 @@ export const config = {
schema: elasticsearchConfigSchema,
},
logging: {
appenders: appendersSchema,
loggers: loggerSchema,
loggerContext: loggerContextConfigSchema,
appenders: appendersSchema as Type<AppenderConfigType>,
},
};
1 change: 0 additions & 1 deletion src/core/server/legacy/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@

export { ensureValidConfiguration } from './ensure_valid_configuration';
export { LegacyObjectToConfigAdapter } from './legacy_object_to_config_adapter';
export { convertLegacyDeprecationProvider } from './legacy_deprecation_adapters';
106 changes: 0 additions & 106 deletions src/core/server/legacy/config/legacy_deprecation_adapters.test.ts

This file was deleted.

57 changes: 0 additions & 57 deletions src/core/server/legacy/config/legacy_deprecation_adapters.ts

This file was deleted.

44 changes: 2 additions & 42 deletions src/core/server/legacy/legacy_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

jest.mock('../../../legacy/server/kbn_server');
jest.mock('../../../cli/cluster/cluster_manager');
jest.mock('./config/legacy_deprecation_adapters', () => ({
convertLegacyDeprecationProvider: (provider: any) => Promise.resolve(provider),
}));

import {
findLegacyPluginSpecsMock,
logLegacyThirdPartyPluginDeprecationWarningMock,
Expand Down Expand Up @@ -446,46 +444,8 @@ describe('#discoverPlugins()', () => {
expect(findLegacyPluginSpecs).toHaveBeenCalledWith(expect.any(Object), logger, env.packageInfo);
});

it(`register legacy plugin's deprecation providers`, async () => {
findLegacyPluginSpecsMock.mockImplementation(
(settings) =>
Promise.resolve({
pluginSpecs: [
{
getDeprecationsProvider: () => undefined,
},
{
getDeprecationsProvider: () => 'providerA',
},
{
getDeprecationsProvider: () => 'providerB',
},
],
pluginExtendedConfig: settings,
disabledPluginSpecs: [],
uiExports: {},
navLinks: [],
}) as any
);

const legacyService = new LegacyService({
coreId,
env,
logger,
configService: configService as any,
});

await legacyService.discoverPlugins();
expect(configService.addDeprecationProvider).toHaveBeenCalledTimes(2);
expect(configService.addDeprecationProvider).toHaveBeenCalledWith('', 'providerA');
expect(configService.addDeprecationProvider).toHaveBeenCalledWith('', 'providerB');
});

it(`logs deprecations for legacy third party plugins`, async () => {
const pluginSpecs = [
{ getId: () => 'pluginA', getDeprecationsProvider: () => undefined },
{ getId: () => 'pluginB', getDeprecationsProvider: () => undefined },
];
const pluginSpecs = [{ getId: () => 'pluginA' }, { getId: () => 'pluginB' }];
findLegacyPluginSpecsMock.mockImplementation(
(settings) =>
Promise.resolve({
Expand Down
15 changes: 1 addition & 14 deletions src/core/server/legacy/legacy_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ import { combineLatest, ConnectableObservable, EMPTY, Observable, Subscription }
import { first, map, publishReplay, tap } from 'rxjs/operators';

import { CoreService } from '../../types';
import { Config, ConfigDeprecationProvider } from '../config';
import { Config } from '../config';
import { CoreContext } from '../core_context';
import { CspConfigType, config as cspConfig } from '../csp';
import { DevConfig, DevConfigType, config as devConfig } from '../dev';
import { BasePathProxyServer, HttpConfig, HttpConfigType, config as httpConfig } from '../http';
import { Logger } from '../logging';
import { PathConfigType } from '../path';
import { findLegacyPluginSpecs, logLegacyThirdPartyPluginDeprecationWarning } from './plugins';
import { convertLegacyDeprecationProvider } from './config';
import {
ILegacyInternals,
LegacyServiceSetupDeps,
Expand Down Expand Up @@ -145,18 +144,6 @@ export class LegacyService implements CoreService {
navLinks,
};

const deprecationProviders = await pluginSpecs
.map((spec) => spec.getDeprecationsProvider())
.reduce(async (providers, current) => {
if (current) {
return [...(await providers), await convertLegacyDeprecationProvider(current)];
}
return providers;
}, Promise.resolve([] as ConfigDeprecationProvider[]));
deprecationProviders.forEach((provider) =>
this.coreContext.configService.addDeprecationProvider('', provider)
);

this.legacyRawConfig = pluginExtendedConfig;

// check for unknown uiExport types
Expand Down
5 changes: 5 additions & 0 deletions src/core/server/legacy/logging/appenders/legacy_appender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ import { LogRecord } from '../../../logging/log_record';
import { LegacyLoggingServer } from '../legacy_logging_server';
import { LegacyVars } from '../../types';

export interface LegacyAppenderConfig {
kind: 'legacy-appender';
legacyLoggingConfig?: any;
}

/**
* Simple appender that just forwards `LogRecord` to the legacy KbnServer log.
* @internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const createPluginSpec = ({ id, path }: { id: string; path: string }): LegacyPlu
getId: () => id,
getExpectedKibanaVersion: () => 'kibana',
getConfigPrefix: () => 'plugin.config',
getDeprecationsProvider: () => undefined,
getPack: () => ({
getPath: () => path,
}),
Expand Down
Loading

0 comments on commit 072cd1d

Please sign in to comment.