Skip to content

Commit

Permalink
[Archive Migrations] security_solution-timelines (#142363)
Browse files Browse the repository at this point in the history
* [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>
  • Loading branch information
wayneseymour and kibanamachine authored Nov 4, 2022
1 parent 9e6ee2a commit d4064c8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 11 deletions.
29 changes: 23 additions & 6 deletions scripts/archive_migration_functions.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
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"
#!/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

orig_archive="x-pack/test/functional/es_archives/banners/multispace"
new_archive="x-pack/test/functional/fixtures/kbn_archiver/banners/multi_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"

# newArchives=("x-pack/test/functional/fixtures/kbn_archiver/dashboard/session_in_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"

# testFiles=("x-pack/test/functional/apps/discover/preserve_url.ts")
testFiles=("x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts")

test_config="x-pack/test/banners_functional/config.ts"
test_config="x-pack/test/api_integration/config.ts"

list_stragglers() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit d4064c8

Please sign in to comment.