-
Notifications
You must be signed in to change notification settings - Fork 243
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
Fix make alert rule uid settable to avoid accidental overwriting of existing rule history #1971
base: main
Are you sure you want to change the base?
Conversation
In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically. |
b44e148
to
c6e5be8
Compare
…xisting rule history Unfortunately this is the only viable workaround. It will require users to manually set the uid for alert rules similar to how it is done in file provisioning. Addresses #1928
c6e5be8
to
c7c6a1f
Compare
The change looks good to me, however I think there is still a bug that will cause this to be an incomplete fix. Reproduction:
Likely there is a bug in the API that is causing the group to not actually re-order itself. This shouldn't necessarily prevent the merge of this change, but we should probably add a test case to cover this since tests passed here and probably shouldn't have. Other (likely related) cases also fail, such as:
|
This was discovered as part of work to add support `uid` to the alert rule terraform provider. When modifying rule groups the uid can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected. Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group. TODO: This breaks a number of tests and breaks the PutRule endpoint as it uses the same underlying function. I need to figure out how to bifurcate the usages of the delta calculator as PutRule should not allow creation of new rules. Context: grafana/terraform-provider-grafana#1971 (comment) Relates to: grafana/terraform-provider-grafana#1928
This was discovered as part of work to add support `uid` to the alert rule terraform provider. When modifying rule groups the uid can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected. Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group. Context: grafana/terraform-provider-grafana#1971 (comment) Relates to: grafana/terraform-provider-grafana#1928
This was discovered as part of work to add support `uid` to the alert rule terraform provider. When modifying rule groups the uid can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected. Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group. Context: grafana/terraform-provider-grafana#1971 (comment) Relates to: grafana/terraform-provider-grafana#1928
Hopefully grafana/grafana#99858 should address the issues @JacobsonMT pointed out, but the question is then how should we merge and release this so that we can clarify that setting the |
When modifying rule groups the `uid` can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected. This updates the RuleGroup provisioning apis to allow specifying the `uid` when creating/updating rule groups. Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group. Context: grafana/terraform-provider-grafana#1971 (comment) Relates to: grafana/terraform-provider-grafana#1928 Fixes: #98283
When modifying rule groups the `uid` can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected. This updates the RuleGroup provisioning apis to allow specifying the `uid` when creating/updating rule groups. Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group. Context: grafana/terraform-provider-grafana#1971 (comment) Relates to: grafana/terraform-provider-grafana#1928 Fixes: #98283 (cherry picked from commit 7dee4d1)
When modifying rule groups the `uid` can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected. This updates the RuleGroup provisioning apis to allow specifying the `uid` when creating/updating rule groups. Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group. Context: grafana/terraform-provider-grafana#1971 (comment) Relates to: grafana/terraform-provider-grafana#1928 Fixes: #98283 (cherry picked from commit 7dee4d1)
…#99858) When modifying rule groups the `uid` can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected. This updates the RuleGroup provisioning apis to allow specifying the `uid` when creating/updating rule groups. Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group. Context: grafana/terraform-provider-grafana#1971 (comment) Relates to: grafana/terraform-provider-grafana#1928 Fixes: grafana#98283
When modifying rule groups the `uid` can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected. This updates the RuleGroup provisioning apis to allow specifying the `uid` when creating/updating rule groups. Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group. Context: grafana/terraform-provider-grafana#1971 (comment) Relates to: grafana/terraform-provider-grafana#1928 Fixes: #98283 (cherry picked from commit 7dee4d1)
Unfortunately this is the only viable workaround. It will require users to manually set the uid for alert rules similar to how it is done in file provisioning.
Addresses #1928