-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrations v2: don't auto-create indices + FTR/esArchiver support #85778
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
c91b296
Migrations V2 on by default
rudolf c82a595
esArchiver delete migrations v2 indices
rudolf cebb9c0
Fix saved_objects_management api_integration tests
rudolf a9a9355
Try to fix v2 migrations for pre-release builds
rudolf aba78bd
esArchiver delete auto-created v2 migration indices like .kibana_8.0.0
rudolf a1a1567
Try to fix v2 migrations for pre-release builds
rudolf 3d76664
Use require_alias to prevent auto-created saved objects index
rudolf 2a991a0
Wrap SO routes until core logs all internal errors
rudolf 2edc8ce
Fix api_integration tests requiring an empty kibana index
rudolf be152a5
Delete corrupt saved object from lens archives
rudolf f971b3e
Update docs
rudolf 46a3f35
Merge branch 'master' into so-migrations-on-by-default
rudolf 30cf7fc
Fix ui_settings tests
rudolf 4e71702
Fix core jest tests
rudolf bb8dc12
Fix type errors
rudolf b806398
Fix accessibility tests
rudolf 117e992
Fix plugin functional tests
rudolf 7898f0c
Fix api_integration tests after merging in master
rudolf 55b1461
Fix plugin functional tests #2
rudolf 0387fa3
EsArchiver: Don't reset ui settings after the .kibana index was deleted
rudolf 03b4f1b
Fix functional management/visualize tests
rudolf b82616d
Fix oss security functional tests
rudolf 329b9c6
EsArchiver clean task manager indices to fix alerting api integration…
rudolf 9baf383
migrationsv2 correctly handle unknown saved object type mappings
rudolf 34c5d87
Revert "Try to fix v2 migrations for pre-release builds"
rudolf bb4f238
Revert "Try to fix v2 migrations for pre-release builds"
rudolf 07809d5
Merge branch 'master' into so-migrations-on-by-default
rudolf 4cbda7f
Re-enable v2 migrations in tests after merging in master
rudolf 1b2dbd9
Try to fix async dashboard functional test
rudolf e95c441
Merge branch 'master' into so-migrations-on-by-default
rudolf 9cdd1d6
Restore UiSettings defaults after emptyKibanaIndex()
rudolf 6f8972b
Merge branch 'master' into so-migrations-on-by-default
rudolf 0da675d
Review feedback: rename test to match behaviour
rudolf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...na-plugin-core-server.savedobjectserrorhelpers.createindexaliasnotfounderror.md
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 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) > [createIndexAliasNotFoundError](./kibana-plugin-core-server.savedobjectserrorhelpers.createindexaliasnotfounderror.md) | ||
|
||
## SavedObjectsErrorHelpers.createIndexAliasNotFoundError() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static createIndexAliasNotFoundError(alias: string): DecoratedError; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| alias | <code>string</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`DecoratedError` | ||
|
23 changes: 23 additions & 0 deletions
23
...-plugin-core-server.savedobjectserrorhelpers.decorateindexaliasnotfounderror.md
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 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) > [decorateIndexAliasNotFoundError](./kibana-plugin-core-server.savedobjectserrorhelpers.decorateindexaliasnotfounderror.md) | ||
|
||
## SavedObjectsErrorHelpers.decorateIndexAliasNotFoundError() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static decorateIndexAliasNotFoundError(error: Error, alias: string): DecoratedError; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| error | <code>Error</code> | | | ||
| alias | <code>string</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`DecoratedError` | ||
|
22 changes: 22 additions & 0 deletions
22
...ore/server/kibana-plugin-core-server.savedobjectserrorhelpers.isgeneralerror.md
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 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) > [isGeneralError](./kibana-plugin-core-server.savedobjectserrorhelpers.isgeneralerror.md) | ||
|
||
## SavedObjectsErrorHelpers.isGeneralError() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static isGeneralError(error: Error | DecoratedError): boolean; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| error | <code>Error | DecoratedError</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`boolean` | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,9 @@ export async function migrateKibanaIndex({ | |
*/ | ||
async function fetchKibanaIndices(client: Client) { | ||
const kibanaIndices = await client.cat.indices({ index: '.kibana*', format: 'json' }); | ||
const isKibanaIndex = (index: string) => /^\.kibana(:?_\d*)?$/.test(index); | ||
const isKibanaIndex = (index: string) => | ||
/^\.kibana(:?_\d*)?$/.test(index) || | ||
/^\.kibana(_task_manager)?_(pre)?\d+\.\d+\.\d+/.test(index); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. esArchiver previously didn't handle the task manager index |
||
return kibanaIndices.map((x: { index: string }) => x.index).filter(isKibanaIndex); | ||
} | ||
|
||
|
@@ -103,7 +105,7 @@ export async function cleanKibanaIndices({ | |
|
||
while (true) { | ||
const resp = await client.deleteByQuery({ | ||
index: `.kibana`, | ||
index: `.kibana,.kibana_task_manager`, | ||
body: { | ||
query: { | ||
bool: { | ||
|
@@ -115,7 +117,7 @@ export async function cleanKibanaIndices({ | |
}, | ||
}, | ||
}, | ||
ignore: [409], | ||
ignore: [404, 409], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. some tests don't load the task manager index, so we need to ignore it if this index doesn't exist |
||
}); | ||
|
||
if (resp.total !== resp.deleted) { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An existing bug. By adding it to the created stats, the
extendEsArchiver
will restore any UiSettings defaults after a test callsemptyKibanaIndex()