[Archive Migrations] security_solution-timelines (#142363)

* [Archive Migrations] security_solution-timelines

Add new kbn archive with an index pattern
taken from the es archive.

Change the test to use both es and kbn archives.
Since all these objects are loaded into a space,
just delete the space afterwards instead of
unloading with es archiver.

Helps with: #102552

* Drop exclusive

* Drop unneeded fn.

* Lint in my pocket.

* Thanks to J. Buttner, "re-drop" non needed objects from the
original archive.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tre 2022-11-04 10:06:25 +00:00 committed by GitHub
parent 9e6ee2a58c
commit d4064c888a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 11 deletions

View file

@ -1,13 +1,30 @@
#!/bin/bash
# ??? Should we migrate
# x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space
# ### Yes, it needs migration
# ### Saved Object type(s) that we care about:
# index-pattern
# ### Test file(s) that use it:
# x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts
# ### Config(s) that govern the test file(s):
# x-pack/test/api_integration/config.ts
# The other types it contains:
# config
# index-pattern
# siem-ui-timeline
# siem-ui-timeline-note
# siem-ui-timeline-pinned-event
# space
standard_list="url,index-pattern,query,graph-workspace,tag,visualization,canvas-element,canvas-workpad,dashboard,search,lens,map,cases,uptime-dynamic-settings,osquery-saved-query,osquery-pack,infrastructure-ui-source,metrics-explorer-view,inventory-view,infrastructure-monitoring-log-view,apm-indices"
orig_archive="x-pack/test/functional/es_archives/banners/multispace"
new_archive="x-pack/test/functional/fixtures/kbn_archiver/banners/multi_space"
orig_archive="x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space"
new_archive="x-pack/test/functional/fixtures/kbn_archiver/security_solution/timelines/7.15.0_space"
# newArchives=("x-pack/test/functional/fixtures/kbn_archiver/dashboard/session_in_space")
testFiles=("x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts")
# testFiles=("x-pack/test/functional/apps/discover/preserve_url.ts")
test_config="x-pack/test/banners_functional/config.ts"
test_config="x-pack/test/api_integration/config.ts"
list_stragglers() {

View file

@ -36,6 +36,8 @@ export default function ({ getService }: FtrProviderContext) {
describe('Timeline migrations', () => {
const esArchiver = getService('esArchiver');
const es = getService('es');
const kibanaServer = getService('kibanaServer');
const spacesService = getService('spaces');
describe('8.0 id migration', () => {
const resolveWithSpaceApi = '/s/awesome-space/api/timeline/resolve';
@ -44,14 +46,14 @@ export default function ({ getService }: FtrProviderContext) {
await esArchiver.load(
'x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space'
);
});
after(async () => {
await esArchiver.unload(
'x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space'
await kibanaServer.importExport.load(
'x-pack/test/functional/fixtures/kbn_archiver/security_solution/timelines/7.15.0_space',
{ space: 'awesome-space' }
);
});
after(async () => await spacesService.delete('awesome-space'));
describe('resolve', () => {
it('should return an aliasMatch outcome', async () => {
const resp = await supertest

View file

@ -0,0 +1,20 @@
{
"attributes": {
"fieldAttrs": "{}",
"fields": "[]",
"runtimeFieldMap": "{}",
"timeFieldName": "",
"title": ".kibana_7.15.0",
"typeMeta": "{}"
},
"coreMigrationVersion": "8.6.0",
"id": "cf0a7895-d367-5eff-9d71-8d6b58b0b5d9",
"migrationVersion": {
"index-pattern": "8.0.0"
},
"originId": "4f57d680-25f3-11ec-a981-b77847c6ef30",
"references": [],
"type": "index-pattern",
"updated_at": "2021-10-05T15:45:48.019Z",
"version": "WzIyLDJd"
}