Skip to content
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] Migrate cases configuration object #77998

Merged
merged 9 commits into from
Sep 29, 2020

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented Sep 21, 2020

Summary

#73778, #74357, and #68464 renamed the cases configuration object from casesConfiguration to incidentConfiguration. This PR creates a migration to accommodate this change.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@cnasikas cnasikas added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.10.0 labels Sep 21, 2020
@cnasikas cnasikas requested a review from a team as a code owner September 21, 2020 11:57
@cnasikas cnasikas self-assigned this Sep 21, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@gmmorris
Copy link
Contributor

gmmorris commented Sep 21, 2020

I'd suggest adding an end-to-end test for this, as I think you might find that this update results in a partial update which means you'll end up with the incidentConfiguration long side casesConfiguration instead of replacing it. 🤔

I can't recall if the migration uses update under the hood or not...

If so, you'll need to reset casesConfiguration by setting it to null or something like that

Here's an example of how this can be achieved: https://github.com/elastic/kibana/blob/master/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. I agree with Gidi, that it would be very useful to have end-to-end test for like he proposed. So, please add a functional test and don't hesitate to contact me if you need any help on this.

@cnasikas
Copy link
Member Author

I'd suggest adding an end-to-end test for this, as I think you might find that this update results in a partial update which means you'll end up with the incidentConfiguration long side casesConfiguration instead of replacing it. 🤔

I can't recall if the migration uses update under the hood or not...

If so, you'll need to reset casesConfiguration by setting it to null or something like that

Here's an example of how this can be achieved: https://github.com/elastic/kibana/blob/master/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts

Thanks a lot! I will add an end-to-end test for this. Migrations do not update the SO. They create a new index, read your SO from the old index, transform it as your likes, and then the new SO will be added to the new index. Its more like a delete and create operation than an update.

Code LGTM. I agree with Gidi, that it would be very useful to have end-to-end test for like he proposed. So, please add a functional test and don't hesitate to contact me if you need any help on this.

Thank you! I will!

@cnasikas
Copy link
Member Author

@elasticmachine merge upstream

@cnasikas
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@gmmorris gmmorris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

distributable file count

id value diff baseline
default 45848 +1 45847

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@cnasikas cnasikas merged commit 4f6df62 into elastic:master Sep 29, 2020
@cnasikas cnasikas deleted the actions_migration branch September 29, 2020 18:11
cnasikas added a commit to cnasikas/kibana that referenced this pull request Sep 29, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
cnasikas added a commit that referenced this pull request Sep 29, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants