-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Security Solution] Rule Updates in bulk with conflicts #196776
Merged
+555
−163
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
75e0d1f
Rule Updates in bulk with conflicts
jpdjere b7e772f
Transform IndexPatterns and DataView values during upgrade
jpdjere 673635e
Conditionally update to MERGED version on feature flag
jpdjere 2a5dc55
Remove debugger
jpdjere 05c1ec8
Fix typo
jpdjere c4e804b
Refactor
jpdjere 99f08d1
fix lint
jpdjere 98d42cb
Addressed comments
jpdjere c289c67
revert
jpdjere ad0bb91
revert
jpdjere 138a377
Added e2e tests
jpdjere 5879218
fix type
jpdjere f9ce6d3
Update x-pack/plugins/security_solution/public/detection_engine/rule_…
xcrzx 0762755
Update x-pack/plugins/security_solution/public/detection_engine/rule_…
xcrzx 88dce80
Update x-pack/plugins/security_solution/public/detection_engine/rule_…
xcrzx 231f0d3
Update x-pack/plugins/security_solution/public/detections/pages/detec…
xcrzx a826a69
Update x-pack/plugins/security_solution/public/detection_engine/rule_…
xcrzx f360a7d
Update modal title
xcrzx fe8eb54
Rebase fix
xcrzx 0d5a113
Merge branch 'main' into bulk-upgrade-rules-changes
xcrzx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
...engine/rule_management/api/hooks/prebuilt_rules/use_perform_all_rules_upgrade_mutation.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...ponents/rules_table/upgrade_prebuilt_rules_table/modals/upgrade_conflicts_modal/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiConfirmModal, EuiText } from '@elastic/eui'; | ||
import React, { memo } from 'react'; | ||
import * as i18n from './translations'; | ||
|
||
export interface UpgradeConflictsModalProps { | ||
onCancel: ( | ||
event?: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLButtonElement> | ||
) => void; | ||
onConfirm?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; | ||
} | ||
|
||
const UpgradeConflictsModalComponent = ({ onCancel, onConfirm }: UpgradeConflictsModalProps) => { | ||
return ( | ||
<EuiConfirmModal | ||
title={i18n.UPGRADE_CONFLICTS_MODAL_TITLE} | ||
onCancel={onCancel} | ||
onConfirm={onConfirm} | ||
cancelButtonText={i18n.UPGRADE_CONFLICTS_MODAL_CANCEL} | ||
confirmButtonText={i18n.UPGRADE_CONFLICTS_MODAL_CONFIRM} | ||
buttonColor="primary" | ||
defaultFocusedButton="confirm" | ||
data-test-subj="upgradeConflictsModal" | ||
> | ||
<EuiText>{i18n.UPGRADE_CONFLICTS_MODAL_BODY}</EuiText> | ||
</EuiConfirmModal> | ||
); | ||
}; | ||
|
||
export const UpgradeConflictsModal = memo(UpgradeConflictsModalComponent); |
37 changes: 37 additions & 0 deletions
37
.../rules_table/upgrade_prebuilt_rules_table/modals/upgrade_conflicts_modal/translations.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const UPGRADE_CONFLICTS_MODAL_TITLE = i18n.translate( | ||
'xpack.securitySolution.detectionEngine.upgradeConflictsModal.messageTitle', | ||
{ | ||
defaultMessage: 'Update rules without conflicts?', | ||
} | ||
); | ||
|
||
export const UPGRADE_CONFLICTS_MODAL_CANCEL = i18n.translate( | ||
'xpack.securitySolution.detectionEngine.upgradeConflictsModal.cancelTitle', | ||
{ | ||
defaultMessage: 'Cancel', | ||
} | ||
); | ||
|
||
export const UPGRADE_CONFLICTS_MODAL_CONFIRM = i18n.translate( | ||
'xpack.securitySolution.detectionEngine.upgradeConflictsModal.confirmTitle', | ||
{ | ||
defaultMessage: 'Update rules without conflicts', | ||
} | ||
); | ||
|
||
export const UPGRADE_CONFLICTS_MODAL_BODY = i18n.translate( | ||
'xpack.securitySolution.detectionEngine.upgradeConflictsModal.affectedJobsTitle', | ||
{ | ||
defaultMessage: | ||
"Some of the selected rules have conflicts and, for that reason, won't be updated. Resolve the conflicts to properly update the rules.", | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting this since from now onwards the frontend client will never be just sending a request to update ALL rules, since some of them might have conflicts: we want to filter those out before making the request, which is done in this PR.
API users can still send this type request, and will get detailed errors if there are conflicts.