-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Archive Migrations] security_solution-timelines #142363
[Archive Migrations] security_solution-timelines #142363
Conversation
c304957
to
9ced15f
Compare
33418f4
to
e871def
Compare
@wayneseymour I guess x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/data.json.gz contains Kibana saved objects that there isn't any API to create and so that's why they have to stay in the esArchive? Is it just one 'type' of saved objects or a couple? I'm not really sure we should add a new kbnArchive in a case where we're not eliminating the esArchive completely. |
The original list of types within the archive was:
Now, the index-pattern, the config and the space are gone. @elastic/security-solution With a little help, perhaps we can programmatically create the timeline objects and delete the archive entirely? :) |
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.
LGTM - code review only
a9499e7
to
7d590a5
Compare
@elasticmachine merge upstream |
@michaelolo24 I've added you to this pr as a reviewer after chatting with @jonathan-buttner |
@@ -366,6 +383,12 @@ save_kbn() { | |||
# node scripts/kbn_archiver.js --config x-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts save x-pack/test/functional/fixtures/kbn_archiver/saved_objects/default_space --type search,index-pattern,visualization,dashboard,lens,map,graph-workspace,query,tag,url,canvas-workpad | |||
} | |||
|
|||
load_my_kbn() { |
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.
Should we keep these changes? is my-es-archive.json
a file we are including in the kibana repo?
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.
We can drop this! Good catch!
x-pack/test/api_integration/apis/security_solution/timeline_migrations.ts
Show resolved
Hide resolved
42c3974
to
1cd6a65
Compare
); | ||
}); | ||
|
||
after(async () => await spacesService.delete('awesome-space')); |
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.
Should we add the esArchiver.unload()
here?
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.
Hrmm, well if they archives are loading into space then no....
Lemme triple check as you may be onto something.
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.
Ok, good thing you had me check!
I noticed two objects that should not have been within the archive. (awesome!)
Also, yes we should still be good only dropping the space.
This is because all the archives are loaded into that space && deleting a space drops all of the objects.
TLDR
Since it's on disk as a gzipped archive, I ran the following and then visually inspected it
node scripts/es_archiver.js edit x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space --config x-pack/test/api_integration/config.ts
jq '[.value.id]| .[]' x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/data.json
"awesome-space:siem-ui-timeline:1211b430-25f8-11ec-a981-b77847c6ef30"
"awesome-space:siem-ui-timeline:120f9150-25f8-11ec-a981-b77847c6ef30"
"awesome-space:siem-ui-timeline:12205a30-25f8-11ec-a981-b77847c6ef30"
"awesome-space:siem-ui-timeline:12208140-25f8-11ec-a981-b77847c6ef30"
"awesome-space:siem-ui-timeline:1e2e9850-25f8-11ec-a981-b77847c6ef30"
"awesome-space:siem-ui-timeline-note:2d230670-25f8-11ec-a981-b77847c6ef30"
"awesome-space:siem-ui-timeline-pinned-event:2694b600-25f8-11ec-a981-b77847c6ef30"
"awesome-space:siem-ui-timeline-note:323df0c0-25f8-11ec-a981-b77847c6ef30"
Unless I missed my guess (totally possible lol), I think we are good as they are "namespaced" to awesome-space
.
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: elastic#102552
original archive.
09f96dc
to
d7c854d
Compare
@elasticmachine merge upstream |
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.
LGTM
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.
Apologies for the delay here, it definitely got lost in the shuffle for me. Looks good!
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
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.
The original list of types within the archive was:
config
index-pattern
siem-ui-timeline
siem-ui-timeline-note
siem-ui-timeline-pinned-event
space
Now, the index-pattern, the config and the space are gone.
So, the new kbn-archive contains only the index-pattern.
The space is programmatically created now.
Helps with: #102552