Skip to content

[ResponseOps][Rules] Allow users to delete snooze schedule from a rule#213247

Merged
js-jankisalvi merged 19 commits intoelastic:mainfrom
js-jankisalvi:delete-snooze-api
Mar 17, 2025
Merged

[ResponseOps][Rules] Allow users to delete snooze schedule from a rule#213247
js-jankisalvi merged 19 commits intoelastic:mainfrom
js-jankisalvi:delete-snooze-api

Conversation

@js-jankisalvi
Copy link
Contributor

@js-jankisalvi js-jankisalvi commented Mar 5, 2025

Summary

Resolves #198783

This PR allows to delete existing snooze schedule from a rule using schedule id.

Checklist

How to test

  • Create a rule in kibana
  • Snooze that rule via new public API
  • delete that snooze schedule via public api

Method: DELETE
Path: https://localhost:5601/api/alerting/rule/<ruleId>/snooze_schedule/<scheduleId>

Flaky test runner:

https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8049

Release note

Allow users to delete a snooze schedule from a rule using schedule id

@js-jankisalvi js-jankisalvi added release_note:enhancement Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// Feature:Alerting/RulesManagement Issues related to the Rules Management UX backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Mar 5, 2025
@js-jankisalvi js-jankisalvi self-assigned this Mar 5, 2025
@js-jankisalvi js-jankisalvi requested a review from a team as a code owner March 5, 2025 14:17
@elasticmachine
Copy link
Contributor

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

kibanamachine and others added 3 commits March 5, 2025 14:35
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --include-path /api/dashboards --update'
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, assuming CI goes green

@js-jankisalvi
Copy link
Contributor Author

LGTM, assuming CI goes green

Thanks for the review!
Failing tests rely on create schedule api PR. Once it is merged, pipeline should be green here

js-jankisalvi and others added 6 commits March 14, 2025 11:16
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/dashboards --update'
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/dashboards --update'
@js-jankisalvi js-jankisalvi requested a review from lcawl March 14, 2025 17:12
Copy link
Contributor

@lcawl lcawl left a comment

Choose a reason for hiding this comment

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

I added path parameter descriptions and did a minor update to the operation summary then refreshed the output. Docs LGTM!

Copy link
Contributor

@adcoelho adcoelho 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 👍

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/test-suites-xpack 725 727 +2

Total ESLint disabled count

id before after diff
@kbn/test-suites-xpack 751 753 +2

History

cc @js-jankisalvi

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8049

[✅] x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/config.ts: 25/25 tests passed.
[✅] x-pack/test/alerting_api_integration/security_and_spaces/group4/config.ts: 25/25 tests passed.

see run history

@js-jankisalvi js-jankisalvi merged commit 6088eb2 into elastic:main Mar 17, 2025
9 checks passed
@js-jankisalvi js-jankisalvi deleted the delete-snooze-api branch March 17, 2025 14:50
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Mar 17, 2025
elastic#213247)

## Summary

Resolves elastic#198783

This PR allows to delete existing snooze schedule from a rule using
schedule id.

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### How to test
- Create a rule in kibana
- Snooze that rule via new public API
- delete that snooze schedule via public api

Method: `DELETE`
Path:
`https://localhost:5601/api/alerting/rule/<ruleId>/snooze_schedule/<scheduleId>`

### Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8049

### Release note
Allow users to delete a snooze schedule from a rule using schedule id

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
(cherry picked from commit 6088eb2)
@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 Mar 17, 2025
… a rule (#213247) (#214796)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ResponseOps][Rules] Allow users to delete snooze schedule from a
rule (#213247)](#213247)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Janki
Salvi","email":"117571355+js-jankisalvi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-03-17T14:50:47Z","message":"[ResponseOps][Rules]
Allow users to delete snooze schedule from a rule (#213247)\n\n##
Summary\n\nResolves
https://github.com/elastic/kibana/issues/198783\n\nThis PR allows to
delete existing snooze schedule from a rule using\nschedule id.\n\n\n###
Checklist\n\n-
[x]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### How to
test\n- Create a rule in kibana\n- Snooze that rule via new public
API\n- delete that snooze schedule via public api\n\nMethod:
`DELETE`\nPath:\n`https://localhost:5601/api/alerting/rule/<ruleId>/snooze_schedule/<scheduleId>`\n\n###
Flaky test
runner:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8049\n\n###
Release note\nAllow users to delete a snooze schedule from a rule using
schedule id\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: lcawl
<lcawley@elastic.co>","sha":"6088eb221ec13d597baaaca479e3d40eb7e5e8cb","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:ResponseOps","Feature:Alerting/RulesManagement","backport:version","v9.1.0","v8.19.0"],"title":"[ResponseOps][Rules]
Allow users to delete snooze schedule from a
rule","number":213247,"url":"https://github.com/elastic/kibana/pull/213247","mergeCommit":{"message":"[ResponseOps][Rules]
Allow users to delete snooze schedule from a rule (#213247)\n\n##
Summary\n\nResolves
https://github.com/elastic/kibana/issues/198783\n\nThis PR allows to
delete existing snooze schedule from a rule using\nschedule id.\n\n\n###
Checklist\n\n-
[x]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### How to
test\n- Create a rule in kibana\n- Snooze that rule via new public
API\n- delete that snooze schedule via public api\n\nMethod:
`DELETE`\nPath:\n`https://localhost:5601/api/alerting/rule/<ruleId>/snooze_schedule/<scheduleId>`\n\n###
Flaky test
runner:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8049\n\n###
Release note\nAllow users to delete a snooze schedule from a rule using
schedule id\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: lcawl
<lcawley@elastic.co>","sha":"6088eb221ec13d597baaaca479e3d40eb7e5e8cb"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213247","number":213247,"mergeCommit":{"message":"[ResponseOps][Rules]
Allow users to delete snooze schedule from a rule (#213247)\n\n##
Summary\n\nResolves
https://github.com/elastic/kibana/issues/198783\n\nThis PR allows to
delete existing snooze schedule from a rule using\nschedule id.\n\n\n###
Checklist\n\n-
[x]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### How to
test\n- Create a rule in kibana\n- Snooze that rule via new public
API\n- delete that snooze schedule via public api\n\nMethod:
`DELETE`\nPath:\n`https://localhost:5601/api/alerting/rule/<ruleId>/snooze_schedule/<scheduleId>`\n\n###
Flaky test
runner:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8049\n\n###
Release note\nAllow users to delete a snooze schedule from a rule using
schedule id\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: lcawl
<lcawley@elastic.co>","sha":"6088eb221ec13d597baaaca479e3d40eb7e5e8cb"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com>
clintandrewhall pushed a commit to clintandrewhall/kibana that referenced this pull request Mar 20, 2025
elastic#213247)

## Summary

Resolves elastic#198783

This PR allows to delete existing snooze schedule from a rule using
schedule id.


### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### How to test
- Create a rule in kibana
- Snooze that rule via new public API
- delete that snooze schedule via public api

Method: `DELETE`
Path:
`https://localhost:5601/api/alerting/rule/<ruleId>/snooze_schedule/<scheduleId>`

### Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8049

### Release note
Allow users to delete a snooze schedule from a rule using schedule id

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
elastic#213247)

## Summary

Resolves elastic#198783

This PR allows to delete existing snooze schedule from a rule using
schedule id.


### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### How to test
- Create a rule in kibana
- Snooze that rule via new public API
- delete that snooze schedule via public api

Method: `DELETE`
Path:
`https://localhost:5601/api/alerting/rule/<ruleId>/snooze_schedule/<scheduleId>`

### Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8049

### Release note
Allow users to delete a snooze schedule from a rule using schedule id

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Alerting/RulesManagement Issues related to the Rules Management UX release_note:enhancement Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ResponseOps][Rules] Provide public APIs to snooze and unsnooze rules

6 participants