forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into elastic#205329
- Loading branch information
Showing
131 changed files
with
908 additions
and
691 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
48 changes: 48 additions & 0 deletions
48
packages/kbn-test/src/functional_test_runner/cli/code_owners.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,48 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import { run } from '@kbn/dev-cli-runner'; | ||
import { createFailError } from '@kbn/dev-cli-errors'; | ||
import { getRepoFiles } from '@kbn/get-repo-files'; | ||
import { getCodeOwnersEntries } from '@kbn/code-owners'; | ||
import ignore from 'ignore'; | ||
|
||
const TEST_DIRECTORIES = ['test', 'x-pack/test', 'x-pack/test_serverless']; | ||
|
||
export async function checkFTRCodeOwnersCLI() { | ||
await run( | ||
async ({ log }) => { | ||
const matcher = ignore().add( | ||
getCodeOwnersEntries() | ||
.filter((entry) => entry.teams.length > 0) | ||
.map((entry) => entry.pattern) | ||
); | ||
const hasOwner = (path: string): boolean => matcher.test(path).ignored; | ||
|
||
const testFiles = await getRepoFiles(TEST_DIRECTORIES); | ||
const filesWithoutOwner = testFiles | ||
.filter((repoPath) => !hasOwner(repoPath.repoRel)) | ||
.map((repoPath) => repoPath.repoRel); | ||
|
||
log.info(`Checked ${testFiles.length} test files in ${process.uptime().toFixed(2)}s`); | ||
|
||
if (filesWithoutOwner.length === 0) { | ||
log.success(`All test files have a code owner 🥳`); | ||
return; | ||
} | ||
|
||
log.write('Test files without a code owner:'); | ||
log.write(filesWithoutOwner.map((i) => ` - ${i}`).join('\n')); | ||
throw createFailError(`Found ${filesWithoutOwner.length} test files without code owner`); | ||
}, | ||
{ | ||
description: 'Check that all test files are covered by GitHub CODEOWNERS', | ||
} | ||
); | ||
} |
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
67 changes: 0 additions & 67 deletions
67
packages/kbn-test/src/functional_test_runner/run_check_ftr_code_owners.ts
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
22 changes: 22 additions & 0 deletions
22
src/platform/packages/shared/presentation/presentation_publishing/embeddable_api_context.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,22 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
export interface EmbeddableApiContext { | ||
/** | ||
* TODO: once all actions are entirely decoupled from the embeddable system, this key should be renamed to "api" | ||
* to reflect the fact that this context could contain any api. | ||
*/ | ||
embeddable: unknown; | ||
} | ||
|
||
export const isEmbeddableApiContext = (context: unknown): context is EmbeddableApiContext => | ||
!!context && | ||
typeof context === 'object' && | ||
!!(context as EmbeddableApiContext).embeddable && | ||
typeof (context as EmbeddableApiContext).embeddable === 'object'; |
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
58 changes: 0 additions & 58 deletions
58
src/platform/plugins/shared/embeddable/public/lib/embeddables/embeddable_error_handler.tsx
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
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.