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

[Response Ops][Rules] Version Mute All Rule API #195572

Merged
merged 10 commits into from
Oct 14, 2024

Conversation

jcger
Copy link
Contributor

@jcger jcger commented Oct 9, 2024

Summary

POST /api/alerting/rule/{id}/_mute_all in #195181

@jcger jcger changed the title [Response Ops][Rules] Version Get Rule Types API [Response Ops][Rules] Version Mute All Rule API Oct 9, 2024
@jcger jcger force-pushed the issue-195181-rule_mute_all-api-versioning branch from e164b25 to 7855b81 Compare October 9, 2024 11:04
@jcger jcger 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) v9.0.0 v8.16.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 9, 2024
@jcger jcger marked this pull request as ready for review October 9, 2024 11:13
@jcger jcger requested a review from a team as a code owner October 9, 2024 11:13
@elasticmachine
Copy link
Contributor

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

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

LGTM!

async function muteAllWithOCC(context: RulesClientContext, { id }: { id: string }) {
async function muteAllWithOCC(context: RulesClientContext, params: MuteAllRuleParams) {
try {
muteAllRuleParamsSchema.validate(params);
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a unit test for this new change?

@@ -36,7 +31,7 @@ export const muteAllRuleRoute = (
},
validate: {
request: {
params: paramSchema,
params: muteAllRuleRequestParamsSchemaV1,
},
response: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Previously, when we did this versioning we ended up also updating the documentation. I don't know if we will do another passing but I noticed 403 is missing from the response. Maybe you could update that here? 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe 400 and 404 also. I'm thinking of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I'm not mistaken, there is an extra issue to do it afterwards (which should be also be ready for next ff) #195182. Are we talking about the same?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, I didn't realize there was a separate issue. Nevermind then!

@jcger jcger enabled auto-merge (squash) October 14, 2024 09:07
@jcger jcger merged commit f787b85 into elastic:main Oct 14, 2024
42 of 43 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11327378257

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 14, 2024
## Summary

`POST /api/alerting/rule/{id}/_mute_all` in
elastic#195181

(cherry picked from commit f787b85)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 14, 2024
)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Response Ops][Rules] Version Mute All Rule API
(#195572)](#195572)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julian
Gernun","email":"17549662+jcger@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-14T12:18:42Z","message":"[Response
Ops][Rules] Version Mute All Rule API (#195572)\n\n##
Summary\r\n\r\n`POST /api/alerting/rule/{id}/_mute_all`
in\r\nhttps://github.com//issues/195181","sha":"f787b852b23139fbc8e9926263d827ded4a1f451","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.16.0"],"title":"[Response
Ops][Rules] Version Mute All Rule
API","number":195572,"url":"https://github.com/elastic/kibana/pull/195572","mergeCommit":{"message":"[Response
Ops][Rules] Version Mute All Rule API (#195572)\n\n##
Summary\r\n\r\n`POST /api/alerting/rule/{id}/_mute_all`
in\r\nhttps://github.com//issues/195181","sha":"f787b852b23139fbc8e9926263d827ded4a1f451"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195572","number":195572,"mergeCommit":{"message":"[Response
Ops][Rules] Version Mute All Rule API (#195572)\n\n##
Summary\r\n\r\n`POST /api/alerting/rule/{id}/_mute_all`
in\r\nhttps://github.com//issues/195181","sha":"f787b852b23139fbc8e9926263d827ded4a1f451"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julian Gernun <17549662+jcger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) 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.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants