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

[v10.2.x] Alerting: Fix deleting rules in a folder with matching UID in another organization #79011

Merged
merged 1 commit into from Dec 5, 2023

Conversation

papagian
Copy link
Contributor

@papagian papagian commented Dec 4, 2023

Backport 6d4625a from #78258


What is this feature?

The deleteFolderAlertRules() function that is declared inside dashboard service has become obsolete since #67259 (alert rules get deleted here using DeleteInFolder()) but it was still got called.
Unfortunately, this function doesn't take into account the org_id. As a result:

  • trying to delete a folder without alerts with matching folder UID in another organization (with alerts) wrongly fails with folder cannot be deleted: folder contains alert rules
  • deleting a folder using forceDeleteRules=true would wrongly delete alert rules with matching folder (namespace_uid) UID in another organization (with alerts)

Why do we need this feature?

It fixes the above issues by removing the obsolete call.

Who is this feature for?

[Add information on what kind of user the feature is for.]

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

… organization (#78258)

* Remove usage of obsolete function for deleting alert rules under folder

* Apply suggestion from code review

* Update tests

(cherry picked from commit 6d4625a)
@papagian papagian merged commit aec2c55 into v10.2.x Dec 5, 2023
22 checks passed
@papagian papagian deleted the backport-78258-to-v10.2.x branch December 5, 2023 11:30
@aangelisc aangelisc modified the milestones: 10.2.x, 10.2.3 Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants