mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* [Telemetry] schema check throw on missing schema (#75750) * update schema for 7.x
This commit is contained in:
parent
512280336a
commit
de32e9f8f2
3 changed files with 25 additions and 3 deletions
|
@ -65,7 +65,8 @@ export function runTelemetryCheck() {
|
|||
},
|
||||
{
|
||||
title: 'Checking Matching collector.schema against stored json files',
|
||||
task: (context) => new Listr(checkMatchingSchemasTask(context), { exitOnError: true }),
|
||||
task: (context) =>
|
||||
new Listr(checkMatchingSchemasTask(context, !fix), { exitOnError: true }),
|
||||
},
|
||||
{
|
||||
enabled: (_) => fix,
|
||||
|
|
|
@ -22,7 +22,7 @@ import { TaskContext } from './task_context';
|
|||
import { checkMatchingMapping } from '../check_collector_integrity';
|
||||
import { readFileAsync } from '../utils';
|
||||
|
||||
export function checkMatchingSchemasTask({ roots }: TaskContext) {
|
||||
export function checkMatchingSchemasTask({ roots }: TaskContext, throwOnDiff: boolean) {
|
||||
return roots.map((root) => ({
|
||||
task: async () => {
|
||||
const fullPath = path.resolve(process.cwd(), root.config.output);
|
||||
|
@ -31,8 +31,16 @@ export function checkMatchingSchemasTask({ roots }: TaskContext) {
|
|||
|
||||
if (root.parsedCollections) {
|
||||
const differences = checkMatchingMapping(root.parsedCollections, esMapping);
|
||||
|
||||
root.esMappingDiffs = Object.keys(differences);
|
||||
if (root.esMappingDiffs.length && throwOnDiff) {
|
||||
throw Error(
|
||||
`The following changes must be persisted in ${fullPath} file. Use '--fix' to update.\n${JSON.stringify(
|
||||
differences,
|
||||
null,
|
||||
2
|
||||
)}`
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
title: `Checking in ${root.config.root}`,
|
||||
|
|
|
@ -48,6 +48,19 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"csp": {
|
||||
"properties": {
|
||||
"strict": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"warnLegacyBrowsers": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"rulesChangedFromDefault": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"telemetry": {
|
||||
"properties": {
|
||||
"opt_in_status": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue