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

[RAM][HTTP Versioning] Version Public Rule Update Route #179587

Merged
merged 21 commits into from
Apr 15, 2024

Conversation

JiaweiWu
Copy link
Contributor

Summary

Issue: #179476
Parent issue: #157883

This PR versions the update (PUT '/api/alerting/rule/{id}') route. Still using config-schema for now, even though we will eventually switch to zod when core is ready with openapi doc generation support in the versioned router.

We are now validating update data using the update data schema when calling rulesClient->update. We are also validating (but not throwing) the updated rule as well.

Checklist

@JiaweiWu JiaweiWu added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Alerting/RulesManagement Issues related to the Rules Management UX v8.14.0 labels Mar 27, 2024
@JiaweiWu JiaweiWu requested a review from a team as a code owner March 27, 2024 22:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@JiaweiWu
Copy link
Contributor Author

@elasticmachine merge upstream

@JiaweiWu JiaweiWu changed the title Version rule update route [RAM] Version Public Rule Update Route Mar 27, 2024
@@ -63,7 +63,7 @@ describe('updateAlertRoute', () => {

expect(config.path).toMatchInlineSnapshot(`"/api/alerts/alert/{id}"`);

rulesClient.update.mockResolvedValueOnce(mockedResponse);
rulesClient.update.mockResolvedValueOnce(mockedResponse as unknown as SanitizedRule);
Copy link
Member

@umbopepato umbopepato Mar 28, 2024

Choose a reason for hiding this comment

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

nit: how about using only one type assertion when mockedResponse is declared?

Copy link
Member

@umbopepato umbopepato left a comment

Choose a reason for hiding this comment

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

LGTM!

@cnasikas cnasikas mentioned this pull request Mar 28, 2024
4 tasks
Copy link
Contributor

@Zacqary Zacqary left a comment

Choose a reason for hiding this comment

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

Initial code changes LGTM, ping me when tests are fixed and I can give a final approval

@JiaweiWu
Copy link
Contributor Author

JiaweiWu commented Apr 4, 2024

@elasticmachine merge upstream

@JiaweiWu
Copy link
Contributor Author

JiaweiWu commented Apr 5, 2024

@elasticmachine merge upstream

@JiaweiWu
Copy link
Contributor Author

JiaweiWu commented Apr 5, 2024

@elasticmachine merge upstream

@JiaweiWu
Copy link
Contributor Author

JiaweiWu commented Apr 7, 2024

@elasticmachine merge upstream

@JiaweiWu
Copy link
Contributor Author

JiaweiWu commented Apr 7, 2024

@elasticmachine merge upstream

@JiaweiWu JiaweiWu changed the title [RAM] Version Public Rule Update Route [RAM][HTTP Versioning] Version Public Rule Update Route Apr 11, 2024
Copy link
Contributor

@Zacqary Zacqary left a comment

Choose a reason for hiding this comment

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

LGTM

@JiaweiWu
Copy link
Contributor Author

@elasticmachine merge upstream

@JiaweiWu
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@JiaweiWu JiaweiWu merged commit ed4fade into elastic:main Apr 15, 2024
33 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Alerting/RulesManagement Issues related to the Rules Management UX release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants