-
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' of https://github.com/elastic/kibana into alert…
…ing/default-es-index-schema
- Loading branch information
Showing
64 changed files
with
2,714 additions
and
1,379 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,5 @@ jobs: | |
uses: elastic/github-actions/[email protected] | ||
id: project_assigner | ||
with: | ||
issue-mappings: '[{"label": "Feature:Lens", "projectNumber": 32, "columnName": "Long-term goals"}, {"label": "Feature:Canvas", "projectNumber": 38, "columnName": "Inbox"}, {"label": "Feature:Dashboard", "projectNumber": 68, "columnName": "Inbox"}, {"label": "Feature:Drilldowns", "projectNumber": 68, "columnName": "Inbox"}], {"label": "Feature:Input Controls", "projectNumber": 72, "columnName": "Inbox"}]' | ||
issue-mappings: '[{"label": "Feature:Lens", "projectNumber": 32, "columnName": "Long-term goals"}, {"label": "Feature:Canvas", "projectNumber": 38, "columnName": "Inbox"}, {"label": "Feature:Dashboard", "projectNumber": 68, "columnName": "Inbox"}, {"label": "Feature:Drilldowns", "projectNumber": 68, "columnName": "Inbox"}, {"label": "Feature:Input Controls", "projectNumber": 72, "columnName": "Inbox"}]' | ||
ghToken: ${{ secrets.PROJECT_ASSIGNER_TOKEN }} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* 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 type { ConfigDeprecationProvider } from '@kbn/config'; | ||
import { configDeprecationFactory, applyDeprecations } from '@kbn/config'; | ||
|
||
function collectDeprecations( | ||
provider: ConfigDeprecationProvider, | ||
settings: Record<string, any>, | ||
path: string | ||
) { | ||
const deprecations = provider(configDeprecationFactory); | ||
const deprecationMessages: string[] = []; | ||
const migrated = applyDeprecations( | ||
settings, | ||
deprecations.map((deprecation) => ({ | ||
deprecation, | ||
path, | ||
})), | ||
() => ({ message }) => deprecationMessages.push(message) | ||
); | ||
return { | ||
messages: deprecationMessages, | ||
migrated, | ||
}; | ||
} | ||
|
||
export const getDeprecationsFor = ({ | ||
provider, | ||
settings = {}, | ||
path, | ||
}: { | ||
provider: ConfigDeprecationProvider; | ||
settings?: Record<string, any>; | ||
path: string; | ||
}) => { | ||
return collectDeprecations(provider, { [path]: settings }, path); | ||
}; | ||
|
||
export const getDeprecationsForGlobalSettings = ({ | ||
provider, | ||
settings = {}, | ||
}: { | ||
provider: ConfigDeprecationProvider; | ||
settings?: Record<string, any>; | ||
}) => { | ||
return collectDeprecations(provider, settings, ''); | ||
}; |
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
44 changes: 44 additions & 0 deletions
44
src/core/server/saved_objects/saved_objects_config.test.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,44 @@ | ||
/* | ||
* 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 { savedObjectsMigrationConfig } from './saved_objects_config'; | ||
import { getDeprecationsFor } from '../config/test_utils'; | ||
|
||
const applyMigrationsDeprecations = (settings: Record<string, any> = {}) => | ||
getDeprecationsFor({ | ||
provider: savedObjectsMigrationConfig.deprecations!, | ||
settings, | ||
path: 'migrations', | ||
}); | ||
|
||
describe('migrations config', function () { | ||
describe('deprecations', () => { | ||
it('logs a warning if migrations.enableV2 is set: true', () => { | ||
const { messages } = applyMigrationsDeprecations({ enableV2: true }); | ||
expect(messages).toMatchInlineSnapshot(` | ||
Array [ | ||
"\\"migrations.enableV2\\" is deprecated and will be removed in an upcoming release without any further notice.", | ||
] | ||
`); | ||
}); | ||
|
||
it('logs a warning if migrations.enableV2 is set: false', () => { | ||
const { messages } = applyMigrationsDeprecations({ enableV2: false }); | ||
expect(messages).toMatchInlineSnapshot(` | ||
Array [ | ||
"\\"migrations.enableV2\\" is deprecated and will be removed in an upcoming release without any further notice.", | ||
] | ||
`); | ||
}); | ||
}); | ||
|
||
it('does not log a warning if migrations.enableV2 is not set', () => { | ||
const { messages } = applyMigrationsDeprecations({ batchSize: 1_000 }); | ||
expect(messages).toMatchInlineSnapshot(`Array []`); | ||
}); | ||
}); |
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
Oops, something went wrong.