[ML] Add warnings for actions for managed Anomaly detection jobs and Transforms#122305
[ML] Add warnings for actions for managed Anomaly detection jobs and Transforms#122305qn895 merged 34 commits intoelastic:mainfrom
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.
nit, these braces aren't needed
| jobClosed, | ||
| } = this.state; | ||
|
|
||
| console.log('job', job, isManagedJob(job)); |
There was a problem hiding this comment.
this console.log should probably be removed.
| 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.
we have a utils.d.ts that stopDatafeeds could be added to to avoid this @ts-ignore
| // '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.
My draft PR has been closed, so the change to remove managed will need to be added to this PR
| {startAction.isModalVisible && <StartActionModal {...startAction} />} | ||
| {stopAction.isModalVisible && <StopActionModal {...stopAction} />} | ||
|
|
||
| {editAction.config && editAction.isFlyoutVisible && ( |
There was a problem hiding this comment.
We should also add the warning if the user tries to edit the transform.
| 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.
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.
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.
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.
peteharverson
left a comment
There was a problem hiding this comment.
Added one comment about cloning transforms, but otherwise tested latest edits and 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