Skip to content

Commit

Permalink
Merge branch 'no_more_index_pattern_objects' of github.com:mattkime/k…
Browse files Browse the repository at this point in the history
…ibana into no_more_index_pattern_objects
  • Loading branch information
mattkime committed May 30, 2022
2 parents 5696ae4 + 52135ab commit 027e432
Show file tree
Hide file tree
Showing 192 changed files with 1,807 additions and 1,581 deletions.
2 changes: 2 additions & 0 deletions .buildkite/pull_requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"skip_ci_labels": ["skip-ci", "jenkins-ci"],
"skip_target_branches": ["6.8", "7.11", "7.12"],
"skip_ci_on_only_changed": [
"^dev_docs/",
"^docs/",
"^rfcs/",
"^.ci/.+\\.yml$",
Expand All @@ -26,6 +27,7 @@
"^.ci/Jenkinsfile_[^/]+$",
"^\\.github/",
"\\.md$",
"\\.mdx$",
"^\\.backportrc\\.json$",
"^nav-kibana-dev\\.docnav\\.json$",
"^src/dev/prs/kibana_qa_pr_list\\.json$",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Set of helpers used to create `KibanaResponse` to form HTTP response on an incom

```typescript
kibanaResponseFactory: {
custom: <T extends string | Record<string, any> | Error | Buffer | Stream | {
custom: <T extends string | Record<string, any> | Error | Buffer | {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
} | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
} | Stream | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
badRequest: (options?: ErrorHttpResponseOptions) => KibanaResponse<string | Error | {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
Expand All @@ -34,10 +34,10 @@ kibanaResponseFactory: {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
}>;
customError: (options: CustomHttpResponseOptions<ResponseError | Buffer | Stream>) => KibanaResponse<string | Error | Buffer | Stream | {
customError: (options: CustomHttpResponseOptions<ResponseError | Buffer | Stream>) => KibanaResponse<string | Error | Buffer | {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
}>;
} | Stream>;
redirected: (options: RedirectResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
ok: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
accepted: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
"deep-freeze-strict": "^1.1.1",
"deepmerge": "^4.2.2",
"del": "^5.1.0",
"elastic-apm-node": "^3.33.0",
"elastic-apm-node": "^3.34.0",
"email-addresses": "^5.0.0",
"execa": "^4.0.2",
"exit-hook": "^2.2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
apiKeysLearnMore: `${KIBANA_DOCS}api-keys.html`,
onPremRegistry: `${FLEET_DOCS}air-gapped.html`,
secureLogstash: `${FLEET_DOCS}secure-logstash-connections.html`,
agentPolicy: `${FLEET_DOCS}agent-policy.html`,
},
ecs: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/ecs/current/index.html`,
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ export interface DocLinks {
apiKeysLearnMore: string;
onPremRegistry: string;
secureLogstash: string;
agentPolicy: string;
}>;
readonly ecs: {
readonly guide: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { useCallback, useEffect, useRef, useReducer } from 'react';
import { useCallback, useEffect, useRef, useReducer, Reducer } from 'react';
import { Observable, Subscription } from 'rxjs';

import { useIsMounted } from '../use_is_mounted';
Expand All @@ -23,18 +23,16 @@ export type Action<T> =
| { type: 'setError'; error: unknown }
| { type: 'load' };

const createReducer =
<T>() =>
(state: State<T>, action: Action<T>) => {
switch (action.type) {
case 'setResult':
return { ...state, result: action.result, loading: false };
case 'setError':
return { ...state, error: action.error, loading: false };
case 'load':
return { loading: true, result: undefined, error: undefined };
}
};
function reducer<T>(state: State<T>, action: Action<T>) {
switch (action.type) {
case 'setResult':
return { ...state, result: action.result, loading: false };
case 'setError':
return { ...state, error: action.error, loading: false };
case 'load':
return { loading: true, result: undefined, error: undefined };
}
}

/**
*
Expand All @@ -47,8 +45,7 @@ export const useObservable = <Args extends unknown[], Result>(
): Task<Args, Result> => {
const isMounted = useIsMounted();
const subRef = useRef<Subscription | undefined>();
const reducer = createReducer<Result>();
const [state, dispatch] = useReducer(reducer, {
const [state, dispatch] = useReducer<Reducer<State<Result>, Action<Result>>>(reducer, {
loading: false,
error: undefined,
result: undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/capabilities/capabilities_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/

import { Logger } from '@kbn/logging';
import { Capabilities, CapabilitiesProvider, CapabilitiesSwitcher } from './types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { InternalHttpServicePreboot, InternalHttpServiceSetup, KibanaRequest } from '../http';
import { mergeCapabilities } from './merge_capabilities';
import { getCapabilitiesResolver, CapabilitiesResolver } from './resolve_capabilities';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/core_app/core_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { stringify } from 'querystring';
import { Env } from '@kbn/config';
import { schema } from '@kbn/config-schema';
import { fromRoot } from '@kbn/utils';
import { Logger } from '@kbn/logging';

import { IRouter, IBasePath, IKibanaResponse, KibanaResponseFactory, KibanaRequest } from '../http';
import { HttpResources, HttpResourcesServiceToolkit } from '../http_resources';
import { InternalCorePreboot, InternalCoreSetup } from '../internal_types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { registerBundleRoutes } from './bundle_routes';
import { UiPlugins } from '../plugins';

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/core_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Side Public License, v 1.
*/

import { LoggerFactory } from '@kbn/logging';
import { IConfigService, Env } from './config';
import { LoggerFactory } from './logging';

/** @internal */
export type CoreId = symbol;
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/deprecations/deprecations_factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import type { GetDeprecationsContext } from './types';
import { DeprecationsFactory, DeprecationsFactoryConfig } from './deprecations_factory';
import { loggerMock } from '../logging/logger.mock';
import { loggerMock } from '@kbn/logging-mocks';
import { DeprecationsDetails } from './types';

describe('DeprecationsFactory', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/deprecations/deprecations_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

import { i18n } from '@kbn/i18n';
import type { Logger } from '@kbn/logging';
import { DeprecationsRegistry } from './deprecations_registry';
import type { Logger } from '../logging';
import type {
DomainDeprecationDetails,
DeprecationsDetails,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/deprecations/deprecations_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { firstValueFrom } from 'rxjs';

import type { Logger } from '@kbn/logging';
import { DeprecationsFactory } from './deprecations_factory';
import { DomainDeprecationDetails, RegisterDeprecationsConfig } from './types';
import { registerRoutes } from './routes';
Expand All @@ -16,7 +17,6 @@ import { CoreContext } from '../core_context';
import { IConfigService } from '../config';
import { CoreService } from '../../types';
import { InternalHttpServiceSetup } from '../http';
import { Logger } from '../logging';
import { IScopedClusterClient } from '../elasticsearch/client';
import { SavedObjectsClientContract } from '../saved_objects/types';

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/elasticsearch/client/cluster_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import type { Client } from '@elastic/elasticsearch';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';
import { IAuthHeadersStorage, Headers, isKibanaRequest, isRealRequest } from '../../http';
import { ensureRawRequest, filterHeaders } from '../../http/router';
import { ScopeableRequest } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/elasticsearch/client/configure_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Client, HttpConnection } from '@elastic/elasticsearch';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';
import { parseClientOptions, ElasticsearchClientConfig } from './client_config';
import { instrumentEsQueryAndDeprecationLogger } from './log_query_and_deprecation';
import { createTransport } from './create_transport';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { Buffer } from 'buffer';
import { stringify } from 'querystring';
import { errors, DiagnosticResult, RequestBody, Client } from '@elastic/elasticsearch';
import numeral from '@elastic/numeral';
import type { Logger } from '@kbn/logging';
import type { ElasticsearchErrorDetails } from './types';
import { getEcsResponseLog } from './get_ecs_response_log';
import { Logger } from '../../logging';

const convertQueryString = (qs: string | Record<string, any> | undefined): string => {
if (qs === undefined || typeof qs === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/elasticsearch/client/retry_call_cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { defer, throwError, iif, timer } from 'rxjs';
import { concatMap, retryWhen } from 'rxjs/operators';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';

const retryResponseStatuses = [
503, // ServiceUnavailable
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/elasticsearch/elasticsearch_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import { firstValueFrom, Observable, Subject } from 'rxjs';
import { map, shareReplay, takeUntil } from 'rxjs/operators';

import type { Logger } from '@kbn/logging';
import { registerAnalyticsContextProvider } from './register_analytics_context_provider';
import { AnalyticsServiceSetup } from '../analytics';
import { CoreService } from '../../types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';

import { ClusterClient, ElasticsearchClientConfig } from './client';
import { ElasticsearchConfig, ElasticsearchConfigType } from './elasticsearch_config';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

import { timer, of, from, Observable } from 'rxjs';
import { map, distinctUntilChanged, catchError, exhaustMap } from 'rxjs/operators';
import type { Logger } from '@kbn/logging';
import {
esVersionCompatibleWithKibana,
esVersionEqualsKibana,
} from './es_kibana_version_compatability';
import { Logger } from '../../logging';
import type { ElasticsearchClient } from '../client';

/** @public */
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/environment/create_data_folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

import { PathConfigType } from '@kbn/utils';
import type { Logger } from '@kbn/logging';
import { mkdir } from './fs';
import { Logger } from '../logging';

export async function createDataFolder({
pathConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/environment/environment_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import { firstValueFrom, of } from 'rxjs';
import { PathConfigType, config as pathConfigDef } from '@kbn/utils';
import type { Logger } from '@kbn/logging';
import type { AnalyticsServicePreboot } from '../analytics';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { IConfigService } from '../config';
import { HttpConfigType, config as httpConfigDef } from '../http';
import { PidConfigType, config as pidConfigDef } from './pid_config';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/environment/resolve_uuid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import uuid from 'uuid';
import { join } from 'path';
import { PathConfigType } from '@kbn/utils';
import type { Logger } from '@kbn/logging';
import { readFile, writeFile } from './fs';
import { HttpConfigType } from '../http';
import { Logger } from '../logging';
import { uuidRegexp } from '../http/http_config';

const FILE_ENCODING = 'utf8';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/environment/write_pid_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { unlinkSync as unlink } from 'fs';
import once from 'lodash/once';
import { Logger } from '../logging';
import type { Logger } from '@kbn/logging';
import { writeFile, exists } from './fs';
import { PidConfigType } from './pid_config';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import apm from 'elastic-apm-node';
import { isUndefined, omitBy } from 'lodash';
import type { Subscription } from 'rxjs';

import type { Logger } from '@kbn/logging';
import type { CoreService, KibanaExecutionContext } from '../../types';
import type { CoreContext } from '../core_context';
import type { Logger } from '../logging';
import type { ExecutionContextConfigType } from './execution_context_config';

import {
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/http_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type { Duration } from 'moment';
import { firstValueFrom, Observable } from 'rxjs';
import { take } from 'rxjs/operators';
import apm from 'elastic-apm-node';
import { Logger, LoggerFactory } from '../logging';
import type { Logger, LoggerFactory } from '@kbn/logging';
import { HttpConfig } from './http_config';
import type { InternalExecutionContextSetup } from '../execution_context';
import { adoptToHapiAuthFormat, AuthenticationHandler } from './lifecycle/auth';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/http_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { Observable, Subscription, combineLatest, firstValueFrom } from 'rxjs';
import { map } from 'rxjs/operators';
import { pick } from '@kbn/std';

import type { Logger } from '@kbn/logging';
import type { RequestHandlerContext } from '..';
import type { InternalExecutionContextSetup } from '../execution_context';
import { CoreService } from '../../types';
import { Logger } from '../logging';
import { ContextSetup, InternalContextPreboot } from '../context';
import { Env } from '../config';
import { CoreContext } from '../core_context';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/https_redirect_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import { Request, ResponseToolkit, Server } from '@hapi/hapi';
import { format as formatUrl } from 'url';
import { createServer, getListenerOptions, getServerOptions } from '@kbn/server-http-tools';
import type { Logger } from '@kbn/logging';

import { Logger } from '../logging';
import { HttpConfig } from './http_config';

export class HttpsRedirectServer {
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/lifecycle/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Lifecycle, Request, ResponseToolkit } from '@hapi/hapi';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';
import {
HapiResponseAdapter,
KibanaRequest,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/lifecycle/on_post_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';
import {
HapiResponseAdapter,
KibanaRequest,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/lifecycle/on_pre_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';
import {
HapiResponseAdapter,
KibanaRequest,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/lifecycle/on_pre_response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
ResponseToolkit as HapiResponseToolkit,
} from '@hapi/hapi';
import Boom from '@hapi/boom';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';

import { HapiResponseAdapter, KibanaRequest, ResponseHeaders } from '../router';

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/lifecycle/on_pre_routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';
import {
HapiResponseAdapter,
KibanaRequest,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/logging/get_payload_size.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { createReadStream } from 'fs';
import { PassThrough } from 'stream';
import { createGunzip, createGzip } from 'zlib';

import { loggerMock, MockedLogger } from '../../logging/logger.mock';
import { loggerMock, MockedLogger } from '@kbn/logging-mocks';

import { getResponsePayloadBytes } from './get_payload_size';

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/logging/get_payload_size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ReadStream } from 'fs';
import { Zlib } from 'zlib';
import { isBoom } from '@hapi/boom';
import type { Request } from '@hapi/hapi';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';

type Response = Request['response'];

Expand Down
Loading

0 comments on commit 027e432

Please sign in to comment.