-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Actions] [8.0] Prepare for making action saved objects sharecapable. #109756
[Actions] [8.0] Prepare for making action saved objects sharecapable. #109756
Conversation
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
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.
Some of the work is covered in this PR: #108964 and can be removed.
92f9a77
to
afe7ad9
Compare
x-pack/plugins/actions/server/saved_objects/action_task_params_migrations.ts
Outdated
Show resolved
Hide resolved
@@ -35,7 +35,8 @@ export function setupSavedObjects( | |||
savedObjects.registerType({ | |||
name: ACTION_SAVED_OBJECT_TYPE, | |||
hidden: true, | |||
namespaceType: 'single', | |||
namespaceType: 'multiple-isolated', | |||
convertToMultiNamespaceTypeVersion: '8.0.0', | |||
mappings: mappings.action as SavedObjectsTypeMappingDefinition, | |||
migrations: getActionsMigrations(encryptedSavedObjects), |
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.
I think you need to add a no-op migration for the ACTION_SAVED_OBJECT_TYPE
type too, right?
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.
Ah.., I forgot about this. Thank you for pointing!
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.
I added comments for a couple of nits, overall LGTM!
I checked and it appears there are already end-to-end integration tests for migrating actions and testing to ensure secrets are decrypted properly (x-pack/test/alerting_api_integration/spaces_only/tests/actions/migrations.ts
), that's why CI was failing before you added the no-op migration for actions 😄
So, assuming CI passes now, those migration tests are 👍
IMO, you don't need to add a specific 8.0.0 migration integration test, but you could optionally add a comment in that file mentioning that the conversion is getting tested implicitly by virtue of the secret getting decrypted properly.
There are also end-to-end integration test for migrating action_task_params (x-pack/test/alerting_api_integration/spaces_only/tests/action_task_params/migrations.ts
), but the data in the fixtures doesn't actually include any encrypted attributes. That's an area for possible improvement in the future, but is outside the scope of this PR, IMO.
x-pack/plugins/actions/server/saved_objects/action_task_params_migrations.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts
Outdated
Show resolved
Hide resolved
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.
LGTM when failing unit test is resolved
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: cc @YulNaumenko |
* [Alerting] [8.0] Prepare for making alerting saved objects sharecapable (#109990) * [Alerting] [8.0] Prepare for making alerting saved objects sharecapable * removed v8 check * removed link * added no op migration * fixed name Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * [Actions] [8.0] Prepare for making action saved objects sharecapable. (#109756) * [Actions] [8.0] Prepare for making action saved objects sharecapable. * added more tests * made it compatible to merge to 7.x * fixed due to comments * fixed tests * added tests * fixed tests * fixed due to comments * added no-opactions migration * fixed test * [Task Manager][8.0] Added migrations to savedObject Ids for "actions:* and "alerting:*" task types (#109180) * [Task Manager][8.0] Added migrations to savedObject Ids for "actions:* and "alerting:*" task types * fixed due to comments * fixed typo * added more tests * added unit test * added func test * added func tests * fixed test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * fixed merge * fixed legacy tests * fixed tests * fixed eslint * Update migrations.ts fixed action task * fixed due to comments Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Resolves #107083