-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Add warnings for actions for managed Anomaly detection jobs and Transforms #122305
Conversation
...ns/ml/public/application/jobs/jobs_list/components/confirm_modals/edit_job_confirm_modal.tsx
Outdated
Show resolved
Hide resolved
...ublic/application/jobs/jobs_list/components/confirm_modals/start_datafeeds_confirm_modal.tsx
Outdated
Show resolved
Hide resolved
...public/application/jobs/jobs_list/components/confirm_modals/stop_datafeeds_confirm_modal.tsx
Outdated
Show resolved
Hide resolved
...lugins/ml/public/application/jobs/jobs_list/components/delete_job_modal/delete_job_modal.tsx
Outdated
Show resolved
Hide resolved
...rm/public/app/sections/transform_management/components/action_delete/delete_action_modal.tsx
Outdated
Show resolved
Hide resolved
...rm/public/app/sections/transform_management/components/action_delete/delete_action_modal.tsx
Outdated
Show resolved
Hide resolved
...form/public/app/sections/transform_management/components/action_start/start_action_modal.tsx
Outdated
Show resolved
Hide resolved
Pinging @elastic/ml-ui (:ml) |
I'm not sure about having these warnings in new modals. E.g. at the top of the edit jobs flyout or in the delete modal For the stop datafeed option we would need a new modal, but it could contain the same callout. Thoughts @peteharverson @qn895 ? |
Do we want to strip out the |
For the examples we have, the |
...ublic/application/jobs/jobs_list/components/confirm_modals/start_datafeeds_confirm_modal.tsx
Outdated
Show resolved
Hide resolved
jobId: jobIds[0], | ||
}} | ||
/> | ||
{ |
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.
nit, these braces aren't needed
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.
Removed here 352559c
@@ -324,6 +327,8 @@ export class EditJobFlyoutUI extends Component { | |||
jobClosed, | |||
} = this.state; | |||
|
|||
console.log('job', job, isManagedJob(job)); |
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.
this console.log
should probably be removed.
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.
Removed here 352559c
import { i18n } from '@kbn/i18n'; | ||
import { MlSummaryJob } from '../../../../../../common/types/anomaly_detection_jobs'; | ||
import { isManagedJob } from '../../../jobs_utils'; | ||
// @ts-ignore |
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.
we have a utils.d.ts
that stopDatafeeds
could be added to to avoid this @ts-ignore
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.
Updated here af963d1
// 'Managed' means job is preconfigured and deployed by other solutions | ||
// we should not clone the setting | ||
if (job.custom_settings?.managed === true) { | ||
job.custom_settings.managed = false; |
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.
My draft PR has been closed, so the change to remove managed
will need to be added to this PR
@@ -42,6 +43,8 @@ export const useActions = ({ | |||
modals: ( | |||
<> | |||
{startAction.isModalVisible && <StartActionModal {...startAction} />} | |||
{stopAction.isModalVisible && <StopActionModal {...stopAction} />} | |||
|
|||
{editAction.config && editAction.isFlyoutVisible && ( |
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.
We should also add the warning if the user tries to edit the transform.
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.
Updated here a7f844b
export const overrideTransformForCloning = (originalConfig: TransformConfigUnion) => { | ||
// 'Managed' means job is preconfigured and deployed by other solutions | ||
// we should not clone this setting | ||
return { ...originalConfig, _meta: { ...originalConfig._meta, managed: false } }; |
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.
Nit - should we be adding
"_meta": {
"managed": false
}
when cloning any transform (including ones which aren't managed
), or not adding the managed
field at all?
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.
I think managed:false
is more explicit but to match with what we have in ML, I removed it altogether here a13f502
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.
The problem with setting it to false
is that we'll only get transforms (or AD jobs) with "managed": false
in them if they are cloned.
The user may wonder why "managed": false
is only appearing for their cloned transforms and not for other other transforms they've created.
If we want to always have a managed
property in transforms and AD jobs we'll have to add this to the wizards.
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.
Added one comment about cloning transforms, but otherwise tested latest edits and LGTM.
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.
LGTM
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
History
To update your PR or re-run it, just comment with: cc @qn895 |
💔 Backport failedThe pull request could not be backported due to the following error: How to fixRe-run the backport manually:
Questions ?Please refer to the Backport tool documentation |
## Summary This PR makes the following updates to the pre-built Security ML jobs: - Making the `security-packetbeat` compatible with Agent - Removing superfluous fields from the job configurations to make them consistent - Updating the `detector_description` field for almost all jobs - Adding influencers where missing and/or relevant - Adding a `job_revision` custom setting similar to the Logs [jobs](https://github.com/elastic/kibana/blob/main/x-pack/plugins/ml/server/models/data_recognizer/modules/logs_ui_analysis/ml/log_entry_rate.json#L29). Moving forward, this number will be updated each time a job is updated. We are starting with 4 since the `linux` and `windows` jobs are at v3 right now - Adding a `managed`: `true` tag to indicate that these jobs are pre-configured by Elastic and so users will see the warnings added in [this](#122305) PR if users choose to delete, or modify these jobs --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR addresses #120631 adds warning modals when users modify or delete one or more Anomaly detection jobs or Transforms that are managed by other solutions. If the job is not managed, these modals will not be visible.
Anomaly detection
Delete
Edit
Stop
Start
Close
Reset
Transforms
Delete
Start
Stop
Checklist