[ML] Fix incorrect behaviors for Anomaly Detection jobs when resetting or converting to advanced job#90078
Conversation
|
Pinging @elastic/ml-ui (:ml) |
| const hasDatafeed = | ||
| typeof job.datafeed_config === 'object' && Object.keys(job.datafeed_config).length > 0; | ||
| const datafeedId = hasDatafeed ? job.datafeed_config.datafeed_id : ''; | ||
| const hasDatafeed = typeof datafeed === 'object' && Object.keys(datafeed).length > 0; |
There was a problem hiding this comment.
datafeed should be set to undefined like job is on line 377.
This should also happen here:
Sorry, I missed this on the previous PR.
|
jenkins test this |
|
I'm seeing some strange behavior when resetting a multi metric, or population job, after it has run. Sometimes it goes into the Single metric wizard, and sometimes it's gone into the Advanced wizard. For example, with this config on Update: I no longer see this issue after the edits in b8de989 |
peteharverson
left a comment
There was a problem hiding this comment.
I no longer see the issues with Reset job after the changes in b8de989.
peteharverson
left a comment
There was a problem hiding this comment.
Tested latest edit and LGTM
| saveNewJob(job: any): Promise<any>; | ||
| cloneDatafeed(datafeed: any): Datafeed; | ||
| saveNewJob(job: Job): Promise<any>; | ||
| cloneDatafeed(Datafeed: Datafeed | undefined): Datafeed; |
There was a problem hiding this comment.
this function shouldn't take undefined as it doesn't know how to deal with it.
we need a check here to ensure datafeed is not undefined:
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
This PR fixes a bug introduced by #88898 which causes datafeed_config to be appended back to the job when resetting or converting to advanced job.
Before