-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nls/api-moves
- Loading branch information
Showing
96 changed files
with
2,740 additions
and
874 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
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
6 changes: 6 additions & 0 deletions
6
src/dev/code_coverage/ingest_coverage/integration_tests/fixtures/test_plugin/kibana.json
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,6 @@ | ||
{ | ||
"id": "codeCoverageTestPlugin", | ||
"version": "kibana", | ||
"server": true, | ||
"ui": false | ||
} |
13 changes: 13 additions & 0 deletions
13
src/dev/code_coverage/ingest_coverage/integration_tests/fixtures/test_plugin/server/index.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,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { Plugin } from './plugin'; | ||
|
||
export function plugin() { | ||
return new Plugin(); | ||
} |
23 changes: 23 additions & 0 deletions
23
...dev/code_coverage/ingest_coverage/integration_tests/fixtures/test_plugin/server/plugin.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,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { CoreSetup } from 'kibana/server'; | ||
|
||
export class Plugin { | ||
constructor() {} | ||
|
||
public setup(core: CoreSetup) {} | ||
|
||
public start() { | ||
// called after all plugins are set up | ||
} | ||
|
||
public stop() { | ||
// called when plugin is torn down during Kibana's shutdown sequence | ||
} | ||
} |
Validating CODEOWNERS rules …
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 was deleted.
Oops, something went wrong.
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,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import Path from 'path'; | ||
|
||
import execa from 'execa'; | ||
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; | ||
|
||
export const REF_CONFIG_PATHS = [Path.resolve(REPO_ROOT, 'tsconfig.refs.json')]; | ||
|
||
export async function buildAllTsRefs(log: ToolingLog) { | ||
for (const path of REF_CONFIG_PATHS) { | ||
const relative = Path.relative(REPO_ROOT, path); | ||
log.debug(`Building TypeScript projects refs for ${relative}...`); | ||
await execa(require.resolve('typescript/bin/tsc'), ['-b', relative, '--pretty'], { | ||
cwd: REPO_ROOT, | ||
}); | ||
} | ||
} |
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,37 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { run } from '@kbn/dev-utils'; | ||
import del from 'del'; | ||
|
||
import { buildAllTsRefs, REF_CONFIG_PATHS } from './build_ts_refs'; | ||
import { getOutputsDeep } from './ts_configfile'; | ||
import { concurrentMap } from './concurrent_map'; | ||
|
||
export async function runBuildRefsCli() { | ||
run( | ||
async ({ log, flags }) => { | ||
if (flags.clean) { | ||
const outDirs = getOutputsDeep(REF_CONFIG_PATHS); | ||
log.info('deleting', outDirs.length, 'ts output directories'); | ||
await concurrentMap(100, outDirs, (outDir) => del(outDir)); | ||
} | ||
|
||
await buildAllTsRefs(log); | ||
}, | ||
{ | ||
description: 'Build TypeScript projects', | ||
flags: { | ||
boolean: ['clean'], | ||
}, | ||
log: { | ||
defaultLevel: 'debug', | ||
}, | ||
} | ||
); | ||
} |
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,28 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import * as Rx from 'rxjs'; | ||
import { mergeMap, toArray, map } from 'rxjs/operators'; | ||
import { lastValueFrom } from '@kbn/std'; | ||
|
||
export async function concurrentMap<T, T2>( | ||
concurrency: number, | ||
arr: T[], | ||
fn: (item: T, i: number) => Promise<T2> | ||
): Promise<T2[]> { | ||
return await lastValueFrom( | ||
Rx.from(arr).pipe( | ||
// execute items in parallel based on concurrency | ||
mergeMap(async (item, index) => ({ index, result: await fn(item, index) }), concurrency), | ||
// collect the results into an array | ||
toArray(), | ||
// sort items back into order and return array of just results | ||
map((list) => list.sort((a, b) => a.index - b.index).map(({ result }) => result)) | ||
) | ||
); | ||
} |
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
Oops, something went wrong.