Alerting: Add alert rule version history - part1 (#99490)
* Add alertingRuleVersionHistory feature toggle * WIP: Add version history tab * revert temp change in index.ts * wip2 * --wip-- * sync code with the BE changes in the endpoint * add translations * Add translations * use ff only for restore feature * WIP: Add tracking, make version required, and start mapping dif results Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com> * Tweak more translations and improve types * Add button to show/hide JSON diff * update type for top level rule fields * Create types * Make updated_by/version properties optional * Update mocks to remove updated by and version * add comments to restore code * rename fetature flag, as we use this one only for the restore feature * Update version history to handle special cases * Add diff numbers * Fix conflicts * Move generic computeVersionDiff to a utils file * Update DOM structure of version summary and tidy up types * Add tests for version comparison logic * Lint fix utils file * Rename props and add docs * Change to EmptyState and log when no versions * Remove CreatedBy component and simplify * Add missing i18n for version history * add test for computeVersionDiff * update test * fix number diff order and add a test * fix prettier * fix prettier * Add promise resolve back in * Rename to humanReadableDiff and tweak translation * Show tab for recording rules as well * Split components out to separate files * Add optional interval seconds * Update i18n * Remove commented code * Remove value * Remove unneeded version * Consistent rendering of updated by * Mode parseVersionInfo to a separate pure function * update invalidate/provide tags for getAlertVersionHistory * Use checkedVersions state only in the parent component * update getSpecialUidMap name and create an interface * Fix prettier * update tab description * use set instead of map for checkedVersions --------- Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
This commit is contained in:
co-authored by
Tom Ratcliffe
parent
c9250c9135
commit
2014d27def
@@ -1801,6 +1801,15 @@ var (
|
||||
FrontendOnly: true,
|
||||
HideFromDocs: true,
|
||||
},
|
||||
{
|
||||
Name: "alertingRuleVersionHistoryRestore",
|
||||
Description: "Enables the alert rule version history restore feature",
|
||||
FrontendOnly: true,
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaAlertingSquad,
|
||||
HideFromAdminPage: true,
|
||||
HideFromDocs: true,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -239,3 +239,4 @@ newLogsPanel,experimental,@grafana/observability-logs,false,false,true
|
||||
grafanaconThemes,experimental,@grafana/grafana-frontend-platform,false,true,false
|
||||
pluginsCDNSyncLoader,experimental,@grafana/plugins-platform-backend,false,false,false
|
||||
alertingJiraIntegration,experimental,@grafana/alerting-squad,false,false,true
|
||||
alertingRuleVersionHistoryRestore,experimental,@grafana/alerting-squad,false,false,true
|
||||
|
||||
|
@@ -966,4 +966,8 @@ const (
|
||||
// FlagAlertingJiraIntegration
|
||||
// Enables the new Jira integration for contact points in cloud alert managers.
|
||||
FlagAlertingJiraIntegration = "alertingJiraIntegration"
|
||||
|
||||
// FlagAlertingRuleVersionHistoryRestore
|
||||
// Enables the alert rule version history restore feature
|
||||
FlagAlertingRuleVersionHistoryRestore = "alertingRuleVersionHistoryRestore"
|
||||
)
|
||||
|
||||
@@ -401,6 +401,24 @@
|
||||
"expression": "false"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "alertingRuleVersionHistoryRestore",
|
||||
"resourceVersion": "1738831836776",
|
||||
"creationTimestamp": "2025-01-16T14:08:12Z",
|
||||
"annotations": {
|
||||
"grafana.app/updatedTimestamp": "2025-02-06 08:50:36.776739 +0000 UTC"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enables the alert rule version history restore feature",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/alerting-squad",
|
||||
"frontend": true,
|
||||
"hideFromAdminPage": true,
|
||||
"hideFromDocs": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "alertingSaveStateCompressed",
|
||||
|
||||
Reference in New Issue
Block a user