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

[Draft] Followup issues for alerting saved object sharing #106787

Closed
chrisronline opened this issue Jul 26, 2021 · 4 comments
Closed

[Draft] Followup issues for alerting saved object sharing #106787

chrisronline opened this issue Jul 26, 2021 · 4 comments
Labels
needs-team Issues missing a team label

Comments

@chrisronline
Copy link
Contributor

chrisronline commented Jul 26, 2021

In #100067, we need to ensure that all rule and connector saved objects are shareable. Part of this effort involves needing to regenerate saved object IDs to guarantee uniqueness across all spaces (which is currently not guaranteed). This affects existing saved objects, as every saved object will receive a new ID as part of this effort and the new .resolve() saved objects API is designed to give insight into that process for a specific saved object.

This new API not only returns the saved object (it will attempt to find the actual saved object even if the consumer provides the outdated ID) but also information on the new and old saved object IDs and based on the response, plugin owners are expected to provide a quality UX and let the user know of any actions they need to take (such as updating bookmarks, etc). (#95958 is a good reference PR for the expected type of change)\

For the sake of consistency, I recommend all .get() calls change to .resolve() (instead of attempting to only find the places where we need to change to .resolve()). It's unclear when/if the .resolve() API deprecates, but if/when that happens, we can change all .resolve() back to .get() in one move.

As a result of the above, various plugin's server code needs to convert to using this new saved object .resolve API. We also need to ensure the UI handles showing the user an appropriate message regarding this situation. Luckily, the core/security team built out shareable React components to do that and a good example of how is here

We should also be able to add functional and unit tests for the above changes. For functional tests, we will need to use the es archiver tool to create saved objects from a different environment (without the changes to make our saved objects shareable, I'd recommend just going with the current minor) and use those for the tests. Here is an example

@botelastic botelastic bot added the needs-team Issues missing a team label label Jul 26, 2021
@chrisronline
Copy link
Contributor Author

chrisronline commented Jul 26, 2021

[Actions] Convert all savedObjectClient.get() calls to use savedObjectClient.resolve and handle the response appropriately

See #106787 (comment)

As a result of the above, the actions plugin's server code needs to convert to using this new saved object .resolve API. Our PoC PR revealed a few places where we need to do this:

There may be more places, and changes to the above listed files might mean additional changes to callers of the above code paths.

@chrisronline
Copy link
Contributor Author

chrisronline commented Jul 28, 2021

[Alerting] Convert all savedObjectClient.get() calls to use savedObjectClient.resolve and handle the response appropriately

See #106787 (comment)

As a result of the above, the alerting plugin's server code needs to convert to using this new saved object .resolve API. Our PoC PR revealed a few places where we need to do this:

We also need to handle the situation where a stored task contains a reference to an outdated saved object id, specifically the alert id, such as:

There may be more places, and changes to the above listed files might mean additional changes to callers of the above code paths.

@chrisronline
Copy link
Contributor Author

chrisronline commented Jul 28, 2021

[Cases] Convert all savedObjectClient.get() calls to use savedObjectClient.resolve and handle the response appropriately

See #106787 (comment)

As a result of the above, the cases plugin's server code needs to convert to using this new saved object .resolve API. Our PoC PR revealed a few places where we need to do this:

There may be more places, and changes to the above listed files might mean additional changes to callers of the above code paths.

@chrisronline
Copy link
Contributor Author

chrisronline commented Jul 28, 2021

[ESO] Convert all savedObjectClient.get() calls to use savedObjectClient.resolve and handle the response appropriately

See #106787 (comment)

As a result of the above, the cases plugin's server code needs to convert to using this new saved object .resolve API. Our PoC PR revealed a few places where we need to do this:

There may be more places, and changes to the above listed files might mean additional changes to callers of the above code paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-team Issues missing a team label
Projects
None yet
Development

No branches or pull requests

1 participant