mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Changes Task Manager folder structure to include a "server" folder as required by our linting rules as part of the migration to the Kibana Platform Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
59e4fe8c18
commit
0ae27058b5
68 changed files with 143 additions and 154 deletions
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { taskManagerMock } from '../../task_manager/task_manager.mock';
|
||||
import { taskManagerMock } from '../../task_manager/server/task_manager.mock';
|
||||
import { ActionTypeRegistry } from './action_type_registry';
|
||||
import { ExecutorType } from './types';
|
||||
import { ActionExecutor, ExecutorError, TaskRunnerFactory } from './lib';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import Boom from 'boom';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { TaskManagerSetupContract } from './shim';
|
||||
import { RunContext } from '../../task_manager';
|
||||
import { RunContext } from '../../task_manager/server';
|
||||
import { ExecutorError, TaskRunnerFactory } from './lib';
|
||||
import { ActionType } from './types';
|
||||
import { ActionsConfigurationUtilities } from './actions_config';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ActionTypeRegistry } from './action_type_registry';
|
|||
import { ActionsClient } from './actions_client';
|
||||
import { ExecutorType } from './types';
|
||||
import { ActionExecutor, TaskRunnerFactory } from './lib';
|
||||
import { taskManagerMock } from '../../task_manager/task_manager.mock';
|
||||
import { taskManagerMock } from '../../task_manager/server/task_manager.mock';
|
||||
import { configUtilsMock } from './actions_config.mock';
|
||||
import { getActionsConfigurationUtilities } from './actions_config';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import { ActionExecutor, TaskRunnerFactory } from '../lib';
|
||||
import { ActionTypeRegistry } from '../action_type_registry';
|
||||
import { taskManagerMock } from '../../../task_manager/task_manager.mock';
|
||||
import { taskManagerMock } from '../../../task_manager/server/task_manager.mock';
|
||||
import { registerBuiltInActionTypes } from './index';
|
||||
import { Logger } from '../../../../../../src/core/server';
|
||||
import { loggingServiceMock } from '../../../../../../src/core/server/mocks';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { taskManagerMock } from '../../task_manager/task_manager.mock';
|
||||
import { taskManagerMock } from '../../task_manager/server/task_manager.mock';
|
||||
import { createExecuteFunction } from './create_execute_function';
|
||||
import { savedObjectsClientMock } from '../../../../../src/core/server/mocks';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import sinon from 'sinon';
|
||||
import { ExecutorError } from './executor_error';
|
||||
import { ActionExecutor } from './action_executor';
|
||||
import { ConcreteTaskInstance, TaskStatus } from '../../../task_manager';
|
||||
import { ConcreteTaskInstance, TaskStatus } from '../../../task_manager/server';
|
||||
import { TaskRunnerFactory } from './task_runner_factory';
|
||||
import { actionTypeRegistryMock } from '../action_type_registry.mock';
|
||||
import { actionExecutorMock } from './action_executor.mock';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import { ActionExecutorContract } from './action_executor';
|
||||
import { ExecutorError } from './executor_error';
|
||||
import { RunContext } from '../../../task_manager';
|
||||
import { RunContext } from '../../../task_manager/server';
|
||||
import { PluginStartContract as EncryptedSavedObjectsStartContract } from '../../../../../plugins/encrypted_saved_objects/server';
|
||||
import { ActionTaskParams, GetBasePathFunction, SpaceIdToNamespaceFunction } from '../types';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import Hapi from 'hapi';
|
|||
import { Legacy } from 'kibana';
|
||||
import * as Rx from 'rxjs';
|
||||
import { ActionsConfigType } from './types';
|
||||
import { TaskManager } from '../../task_manager';
|
||||
import { TaskManager } from '../../task_manager/server';
|
||||
import { XPackMainPlugin } from '../../xpack_main/server/xpack_main';
|
||||
import KbnServer from '../../../../../src/legacy/server/kbn_server';
|
||||
import { LegacySpacesPlugin as SpacesPluginStartContract } from '../../spaces';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import { TaskRunnerFactory } from './lib';
|
||||
import { AlertTypeRegistry } from './alert_type_registry';
|
||||
import { taskManagerMock } from '../../task_manager/task_manager.mock';
|
||||
import { taskManagerMock } from '../../task_manager/server/task_manager.mock';
|
||||
|
||||
const taskManager = taskManagerMock.create();
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import Boom from 'boom';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { TaskRunnerFactory } from './lib';
|
||||
import { RunContext } from '../../task_manager';
|
||||
import { RunContext } from '../../task_manager/server';
|
||||
import { TaskManagerSetupContract } from './shim';
|
||||
import { AlertType } from './types';
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ import uuid from 'uuid';
|
|||
import { schema } from '@kbn/config-schema';
|
||||
import { AlertsClient } from './alerts_client';
|
||||
import { savedObjectsClientMock, loggingServiceMock } from '../../../../../src/core/server/mocks';
|
||||
import { taskManagerMock } from '../../task_manager/task_manager.mock';
|
||||
import { taskManagerMock } from '../../task_manager/server/task_manager.mock';
|
||||
import { alertTypeRegistryMock } from './alert_type_registry.mock';
|
||||
import { TaskStatus } from '../../task_manager';
|
||||
import { TaskStatus } from '../../task_manager/server';
|
||||
import { IntervalSchedule } from './types';
|
||||
import { resolvable } from './test_utils';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import { Request } from 'hapi';
|
||||
import { AlertsClientFactory, ConstructorOpts } from './alerts_client_factory';
|
||||
import { alertTypeRegistryMock } from '../alert_type_registry.mock';
|
||||
import { taskManagerMock } from '../../../task_manager/task_manager.mock';
|
||||
import { taskManagerMock } from '../../../task_manager/server/task_manager.mock';
|
||||
import { KibanaRequest } from '../../../../../../src/core/server';
|
||||
import { loggingServiceMock } from '../../../../../../src/core/server/mocks';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import sinon from 'sinon';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { AlertExecutorOptions } from '../types';
|
||||
import { ConcreteTaskInstance, TaskStatus } from '../../../task_manager';
|
||||
import { ConcreteTaskInstance, TaskStatus } from '../../../task_manager/server';
|
||||
import { TaskRunnerContext, TaskRunnerFactory } from './task_runner_factory';
|
||||
import { encryptedSavedObjectsMock } from '../../../../../plugins/encrypted_saved_objects/server/mocks';
|
||||
import {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { Logger } from '../../../../../../src/core/server';
|
||||
import { RunContext } from '../../../task_manager';
|
||||
import { RunContext } from '../../../task_manager/server';
|
||||
import { createExecutionHandler } from './create_execution_handler';
|
||||
import { createAlertInstanceFactory } from './create_alert_instance_factory';
|
||||
import { AlertInstance } from './alert_instance';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import Hapi from 'hapi';
|
||||
import { Legacy } from 'kibana';
|
||||
import { LegacySpacesPlugin as SpacesPluginStartContract } from '../../spaces';
|
||||
import { TaskManager } from '../../task_manager';
|
||||
import { TaskManager } from '../../task_manager/server';
|
||||
import { XPackMainPlugin } from '../../xpack_main/server/xpack_main';
|
||||
import KbnServer from '../../../../../src/legacy/server/kbn_server';
|
||||
import {
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
} from 'elasticsearch';
|
||||
import { ESSearchResponse } from '../../../apm/typings/elasticsearch';
|
||||
import { XPackMainPlugin } from '../../../xpack_main/server/xpack_main';
|
||||
import { RunContext } from '../../../task_manager';
|
||||
import { RunContext } from '../../../task_manager/server';
|
||||
import { getVisualizationCounts } from './visualization_counts';
|
||||
|
||||
// This task is responsible for running daily and aggregating all the Lens click event objects
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { get } from 'lodash';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../../../../task_manager/plugin';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../../../../task_manager/server/plugin';
|
||||
import { PLUGIN_ID, VIS_TELEMETRY_TASK, VIS_USAGE_TYPE } from '../../../../constants';
|
||||
|
||||
async function isTaskManagerReady(taskManager: TaskManagerPluginSetupContract | undefined) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../../../../task_manager/plugin';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../../../../task_manager/server/plugin';
|
||||
import { getUsageCollector } from './get_usage_collector';
|
||||
|
||||
export function registerVisualizationsCollector(
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
*/
|
||||
|
||||
import { CoreSetup, Logger } from 'kibana/server';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../../../task_manager/plugin';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../../../task_manager/server/plugin';
|
||||
import { PLUGIN_ID, VIS_TELEMETRY_TASK } from '../../../constants';
|
||||
import { visualizationsTaskRunner } from './visualizations/task_runner';
|
||||
import KbnServer from '../../../../../../../src/legacy/server/kbn_server';
|
||||
import { LegacyConfig } from '../../plugin';
|
||||
import { TaskInstance } from '../../../../task_manager';
|
||||
import { TaskInstance } from '../../../../task_manager/server';
|
||||
|
||||
export function registerTasks({
|
||||
taskManager,
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
getMockTaskInstance,
|
||||
} from '../../../../test_utils';
|
||||
import { visualizationsTaskRunner } from './task_runner';
|
||||
import { TaskInstance } from '../../../../../task_manager';
|
||||
import { TaskInstance } from '../../../../../task_manager/server';
|
||||
|
||||
describe('visualizationsTaskRunner', () => {
|
||||
let mockTaskInstance: TaskInstance;
|
||||
|
|
|
@ -8,7 +8,7 @@ import _, { countBy, groupBy, mapValues } from 'lodash';
|
|||
import { APICaller, CoreSetup } from 'kibana/server';
|
||||
import { getNextMidnight } from '../../get_next_midnight';
|
||||
import { VisState } from '../../../../../../../../src/legacy/core_plugins/visualizations/public';
|
||||
import { TaskInstance } from '../../../../../task_manager';
|
||||
import { TaskInstance } from '../../../../../task_manager/server';
|
||||
import { ESSearchHit } from '../../../../../apm/typings/elasticsearch';
|
||||
import { LegacyConfig } from '../../../plugin';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { CoreSetup, Logger, Plugin, PluginInitializerContext } from 'kibana/server';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../task_manager/plugin';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../task_manager/server/plugin';
|
||||
import { registerCollectors } from './lib/collectors';
|
||||
import { registerTasks, scheduleTasks } from './lib/tasks';
|
||||
import KbnServer from '../../../../../src/legacy/server/kbn_server';
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import { APICaller, CoreSetup } from 'kibana/server';
|
||||
|
||||
import { TaskInstance } from '../../task_manager';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../task_manager/plugin';
|
||||
import { TaskInstance } from '../../task_manager/server';
|
||||
import { PluginSetupContract as TaskManagerPluginSetupContract } from '../../task_manager/server/plugin';
|
||||
|
||||
export const getMockTaskInstance = (): TaskInstance => ({
|
||||
state: { runs: 0, stats: {} },
|
||||
|
|
|
@ -4,97 +4,4 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { Root } from 'joi';
|
||||
import { Legacy } from 'kibana';
|
||||
import { Plugin, PluginSetupContract } from './plugin';
|
||||
import { SavedObjectsSerializer, SavedObjectsSchema } from '../../../../src/core/server';
|
||||
import mappings from './mappings.json';
|
||||
import { migrations } from './migrations';
|
||||
|
||||
export { PluginSetupContract as TaskManager };
|
||||
export {
|
||||
TaskInstance,
|
||||
ConcreteTaskInstance,
|
||||
TaskRunCreatorFunction,
|
||||
TaskStatus,
|
||||
RunContext,
|
||||
} from './task';
|
||||
|
||||
export function taskManager(kibana: any) {
|
||||
return new kibana.Plugin({
|
||||
id: 'task_manager',
|
||||
require: ['kibana', 'elasticsearch', 'xpack_main'],
|
||||
configPrefix: 'xpack.task_manager',
|
||||
config(Joi: Root) {
|
||||
return Joi.object({
|
||||
enabled: Joi.boolean().default(true),
|
||||
max_attempts: Joi.number()
|
||||
.description(
|
||||
'The maximum number of times a task will be attempted before being abandoned as failed'
|
||||
)
|
||||
.min(1)
|
||||
.default(3),
|
||||
poll_interval: Joi.number()
|
||||
.description('How often, in milliseconds, the task manager will look for more work.')
|
||||
.min(100)
|
||||
.default(3000),
|
||||
request_capacity: Joi.number()
|
||||
.description('How many requests can Task Manager buffer before it rejects new requests.')
|
||||
.min(1)
|
||||
// a nice round contrived number, feel free to change as we learn how it behaves
|
||||
.default(1000),
|
||||
index: Joi.string()
|
||||
.description('The name of the index used to store task information.')
|
||||
.default('.kibana_task_manager')
|
||||
.invalid(['.tasks']),
|
||||
max_workers: Joi.number()
|
||||
.description(
|
||||
'The maximum number of tasks that this Kibana instance will run simultaneously.'
|
||||
)
|
||||
.min(1) // disable the task manager rather than trying to specify it with 0 workers
|
||||
.default(10),
|
||||
}).default();
|
||||
},
|
||||
init(server: Legacy.Server) {
|
||||
const plugin = new Plugin({
|
||||
logger: {
|
||||
get: () => ({
|
||||
info: (message: string) => server.log(['info', 'task_manager'], message),
|
||||
debug: (message: string) => server.log(['debug', 'task_manager'], message),
|
||||
warn: (message: string) => server.log(['warn', 'task_manager'], message),
|
||||
error: (message: string) => server.log(['error', 'task_manager'], message),
|
||||
}),
|
||||
},
|
||||
});
|
||||
const schema = new SavedObjectsSchema(this.kbnServer.uiExports.savedObjectSchemas);
|
||||
const serializer = new SavedObjectsSerializer(schema);
|
||||
const setupContract = plugin.setup(
|
||||
{},
|
||||
{
|
||||
serializer,
|
||||
config: server.config(),
|
||||
elasticsearch: server.plugins.elasticsearch,
|
||||
savedObjects: server.savedObjects,
|
||||
}
|
||||
);
|
||||
this.kbnServer.afterPluginsInit(() => {
|
||||
plugin.start();
|
||||
});
|
||||
server.expose(setupContract);
|
||||
},
|
||||
uiExports: {
|
||||
mappings,
|
||||
migrations,
|
||||
savedObjectSchemas: {
|
||||
task: {
|
||||
hidden: true,
|
||||
isNamespaceAgnostic: true,
|
||||
convertToAliasScript: `ctx._id = ctx._source.type + ':' + ctx._id`,
|
||||
indexPattern(config: any) {
|
||||
return config.get('xpack.task_manager.index');
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
export * from './server/';
|
||||
|
|
100
x-pack/legacy/plugins/task_manager/server/index.ts
Normal file
100
x-pack/legacy/plugins/task_manager/server/index.ts
Normal file
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { Root } from 'joi';
|
||||
import { Legacy } from 'kibana';
|
||||
import { Plugin, PluginSetupContract } from './plugin';
|
||||
import { SavedObjectsSerializer, SavedObjectsSchema } from '../../../../../src/core/server';
|
||||
import mappings from './mappings.json';
|
||||
import { migrations } from './migrations';
|
||||
|
||||
export { PluginSetupContract as TaskManager };
|
||||
export {
|
||||
TaskInstance,
|
||||
ConcreteTaskInstance,
|
||||
TaskRunCreatorFunction,
|
||||
TaskStatus,
|
||||
RunContext,
|
||||
} from './task';
|
||||
|
||||
export function taskManager(kibana: any) {
|
||||
return new kibana.Plugin({
|
||||
id: 'task_manager',
|
||||
require: ['kibana', 'elasticsearch', 'xpack_main'],
|
||||
configPrefix: 'xpack.task_manager',
|
||||
config(Joi: Root) {
|
||||
return Joi.object({
|
||||
enabled: Joi.boolean().default(true),
|
||||
max_attempts: Joi.number()
|
||||
.description(
|
||||
'The maximum number of times a task will be attempted before being abandoned as failed'
|
||||
)
|
||||
.min(1)
|
||||
.default(3),
|
||||
poll_interval: Joi.number()
|
||||
.description('How often, in milliseconds, the task manager will look for more work.')
|
||||
.min(100)
|
||||
.default(3000),
|
||||
request_capacity: Joi.number()
|
||||
.description('How many requests can Task Manager buffer before it rejects new requests.')
|
||||
.min(1)
|
||||
// a nice round contrived number, feel free to change as we learn how it behaves
|
||||
.default(1000),
|
||||
index: Joi.string()
|
||||
.description('The name of the index used to store task information.')
|
||||
.default('.kibana_task_manager')
|
||||
.invalid(['.tasks']),
|
||||
max_workers: Joi.number()
|
||||
.description(
|
||||
'The maximum number of tasks that this Kibana instance will run simultaneously.'
|
||||
)
|
||||
.min(1) // disable the task manager rather than trying to specify it with 0 workers
|
||||
.default(10),
|
||||
}).default();
|
||||
},
|
||||
init(server: Legacy.Server) {
|
||||
const plugin = new Plugin({
|
||||
logger: {
|
||||
get: () => ({
|
||||
info: (message: string) => server.log(['info', 'task_manager'], message),
|
||||
debug: (message: string) => server.log(['debug', 'task_manager'], message),
|
||||
warn: (message: string) => server.log(['warn', 'task_manager'], message),
|
||||
error: (message: string) => server.log(['error', 'task_manager'], message),
|
||||
}),
|
||||
},
|
||||
});
|
||||
const schema = new SavedObjectsSchema(this.kbnServer.uiExports.savedObjectSchemas);
|
||||
const serializer = new SavedObjectsSerializer(schema);
|
||||
const setupContract = plugin.setup(
|
||||
{},
|
||||
{
|
||||
serializer,
|
||||
config: server.config(),
|
||||
elasticsearch: server.plugins.elasticsearch,
|
||||
savedObjects: server.savedObjects,
|
||||
}
|
||||
);
|
||||
this.kbnServer.afterPluginsInit(() => {
|
||||
plugin.start();
|
||||
});
|
||||
server.expose(setupContract);
|
||||
},
|
||||
uiExports: {
|
||||
mappings,
|
||||
migrations,
|
||||
savedObjectSchemas: {
|
||||
task: {
|
||||
hidden: true,
|
||||
isNamespaceAgnostic: true,
|
||||
convertToAliasScript: `ctx._id = ctx._source.type + ':' + ctx._id`,
|
||||
indexPattern(config: any) {
|
||||
return config.get('xpack.task_manager.index');
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
|
@ -3,11 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
// Task manager uses an unconventional directory structure so the linter marks this as a violation, server files should
|
||||
// be moved under task_manager/server/
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { SavedObject } from 'src/core/server';
|
||||
import { SavedObject } from '../../../../../src/core/server';
|
||||
|
||||
export const migrations = {
|
||||
task: {
|
|
@ -20,12 +20,8 @@ import {
|
|||
awaitTaskRunResult,
|
||||
TaskLifecycleEvent,
|
||||
} from './task_manager';
|
||||
// Task manager uses an unconventional directory structure so the linter marks this as a violation, server files should
|
||||
// be moved under task_manager/server/
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { savedObjectsClientMock } from 'src/core/server/mocks';
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { SavedObjectsSerializer, SavedObjectsSchema } from 'src/core/server';
|
||||
import { savedObjectsClientMock } from '../../../../../src/core/server/mocks';
|
||||
import { SavedObjectsSerializer, SavedObjectsSchema } from '../../../../../src/core/server';
|
||||
import { mockLogger } from './test_utils';
|
||||
import { asErr, asOk } from './lib/result_type';
|
||||
import { ConcreteTaskInstance, TaskLifecycleResult, TaskStatus } from './task';
|
|
@ -7,13 +7,10 @@ import { Subject, Observable, Subscription } from 'rxjs';
|
|||
import { filter } from 'rxjs/operators';
|
||||
|
||||
import { performance } from 'perf_hooks';
|
||||
// Task manager uses an unconventional directory structure so the linter marks this as a violation, server files should
|
||||
// be moved under task_manager/server/
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { SavedObjectsClientContract, SavedObjectsSerializer } from 'src/core/server';
|
||||
|
||||
import { pipe } from 'fp-ts/lib/pipeable';
|
||||
import { Option, none, some, map as mapOptional } from 'fp-ts/lib/Option';
|
||||
import { SavedObjectsClientContract, SavedObjectsSerializer } from '../../../../../src/core/server';
|
||||
import { Result, asErr, either, map, mapErr, promiseResult } from './lib/result_type';
|
||||
|
||||
import { Logger } from './types';
|
|
@ -12,10 +12,7 @@ import { TaskEvent, asTaskRunEvent, asTaskMarkRunningEvent } from './task_events
|
|||
import { ConcreteTaskInstance, TaskStatus } from './task';
|
||||
import { TaskManagerRunner } from './task_runner';
|
||||
import { mockLogger } from './test_utils';
|
||||
// Task manager uses an unconventional directory structure so the linter marks this as a violation, server files should
|
||||
// be moved under task_manager/server/
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { SavedObjectsErrorHelpers } from '../../../../src/core/server';
|
||||
import { SavedObjectsErrorHelpers } from '../../../../../src/core/server';
|
||||
|
||||
let fakeTimer: sinon.SinonFakeTimers;
|
||||
|
|
@ -17,14 +17,13 @@ import {
|
|||
TaskLifecycleResult,
|
||||
} from './task';
|
||||
import { FetchOpts, StoreOpts, OwnershipClaimingOpts, TaskStore } from './task_store';
|
||||
// Task manager uses an unconventional directory structure so the linter marks this as a violation, server files should
|
||||
// be moved under task_manager/server/
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { savedObjectsClientMock } from 'src/core/server/mocks';
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { SavedObjectsSerializer, SavedObjectsSchema, SavedObjectAttributes } from 'src/core/server';
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { SavedObjectsErrorHelpers } from '../../../../src/core/server/saved_objects/service/lib/errors';
|
||||
import { savedObjectsClientMock } from '../../../../../src/core/server/mocks';
|
||||
import {
|
||||
SavedObjectsSerializer,
|
||||
SavedObjectsSchema,
|
||||
SavedObjectAttributes,
|
||||
} from '../../../../../src/core/server';
|
||||
import { SavedObjectsErrorHelpers } from '../../../../../src/core/server/saved_objects/service/lib/errors';
|
||||
import { asTaskClaimEvent, TaskEvent } from './task_events';
|
||||
import { asOk, asErr } from './lib/result_type';
|
||||
|
|
@ -16,10 +16,7 @@ import {
|
|||
SavedObjectAttributes,
|
||||
SavedObjectsSerializer,
|
||||
SavedObjectsRawDoc,
|
||||
// Task manager uses an unconventional directory structure so the linter marks this as a violation, server files should
|
||||
// be moved under task_manager/server/
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
} from 'src/core/server';
|
||||
} from '../../../../../src/core/server';
|
||||
|
||||
import { asOk, asErr } from './lib/result_type';
|
||||
|
|
@ -11,7 +11,7 @@ import supertestAsPromised from 'supertest-as-promised';
|
|||
|
||||
const {
|
||||
task: { properties: taskManagerIndexMapping },
|
||||
} = require('../../../../legacy/plugins/task_manager/mappings.json');
|
||||
} = require('../../../../legacy/plugins/task_manager/server/mappings.json');
|
||||
|
||||
export default function({ getService }) {
|
||||
const es = getService('legacyEs');
|
||||
|
|
2
x-pack/test/typings/hapi.d.ts
vendored
2
x-pack/test/typings/hapi.d.ts
vendored
|
@ -9,7 +9,7 @@ import 'hapi';
|
|||
import { XPackMainPlugin } from '../../legacy/plugins/xpack_main/server/xpack_main';
|
||||
import { SecurityPlugin } from '../../legacy/plugins/security';
|
||||
import { ActionsPlugin, ActionsClient } from '../../legacy/plugins/actions';
|
||||
import { TaskManager } from '../../legacy/plugins/task_manager';
|
||||
import { TaskManager } from '../../legacy/plugins/task_manager/server';
|
||||
import { AlertingPlugin, AlertsClient } from '../../legacy/plugins/alerting';
|
||||
|
||||
declare module 'hapi' {
|
||||
|
|
2
x-pack/typings/hapi.d.ts
vendored
2
x-pack/typings/hapi.d.ts
vendored
|
@ -9,7 +9,7 @@ import 'hapi';
|
|||
import { XPackMainPlugin } from '../legacy/plugins/xpack_main/server/xpack_main';
|
||||
import { SecurityPlugin } from '../legacy/plugins/security';
|
||||
import { ActionsPlugin, ActionsClient } from '../legacy/plugins/actions';
|
||||
import { TaskManager } from '../legacy/plugins/task_manager';
|
||||
import { TaskManager } from '../legacy/plugins/task_manager/server';
|
||||
import { AlertingPlugin, AlertsClient } from '../legacy/plugins/alerting';
|
||||
|
||||
declare module 'hapi' {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue