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] Adding reset anomaly detection jobs link to jobs list #108039
Merged
jgowdyelastic
merged 24 commits into
elastic:master
from
jgowdyelastic:adding-reset-job-links-to-job-list
Aug 17, 2021
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
6dfe7e0
[ML] Adding reset jobs link to jobs list
jgowdyelastic 6dc576f
fixing types
jgowdyelastic 9a0af18
Merge branch 'master' into adding-reset-job-links-to-job-list
kibanamachine d4b3a78
updating types
jgowdyelastic a66e429
improving react code
jgowdyelastic e6d3a2a
adding closed job warning callout
jgowdyelastic 06f04dc
small code changes after review
jgowdyelastic 4f6220d
updating comment for api docs
jgowdyelastic 4e150e5
adding canResetJob to security's emptyMlCapabilities
jgowdyelastic 268098f
updating apidoc
jgowdyelastic 797c274
adding blocked to job summary
jgowdyelastic c78d183
udating test
jgowdyelastic 115ad46
adding delayed refresh back in
jgowdyelastic 1864380
updating tests
jgowdyelastic 25c8085
Merge branch 'master' into adding-reset-job-links-to-job-list
kibanamachine d8a0969
adding better reverting controls and labels
jgowdyelastic a7b9e2e
fixing bug in delete modal
jgowdyelastic 8841935
updating job task polling for all blocking tasks
jgowdyelastic a2ad0a8
Merge branch 'master' into adding-reset-job-links-to-job-list
kibanamachine 5e3bfe7
Merge branch 'master' into adding-reset-job-links-to-job-list
kibanamachine c709342
Merge branch 'master' into adding-reset-job-links-to-job-list
kibanamachine a40bed4
fixing types after es client update
jgowdyelastic 4c2ba81
one other type correction
jgowdyelastic fb4fd17
Merge branch 'master' into adding-reset-job-links-to-job-list
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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,43 @@ | ||
/* | ||
* 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 JOB_ACTION = { | ||
DELETE: 'delete', | ||
RESET: 'reset', | ||
REVERT: 'revert', | ||
} as const; | ||
|
||
export type JobAction = typeof JOB_ACTION[keyof typeof JOB_ACTION]; | ||
|
||
export function getJobActionString(action: JobAction) { | ||
switch (action) { | ||
case JOB_ACTION.DELETE: | ||
return i18n.translate('xpack.ml.models.jobService.deletingJob', { | ||
defaultMessage: 'deleting', | ||
}); | ||
case JOB_ACTION.RESET: | ||
return i18n.translate('xpack.ml.models.jobService.resettingJob', { | ||
defaultMessage: 'resetting', | ||
}); | ||
case JOB_ACTION.REVERT: | ||
return i18n.translate('xpack.ml.models.jobService.revertingJob', { | ||
defaultMessage: 'reverting', | ||
}); | ||
default: | ||
return ''; | ||
} | ||
} | ||
|
||
export const JOB_ACTION_TASK: Record<string, JobAction> = { | ||
'cluster:admin/xpack/ml/job/delete': JOB_ACTION.DELETE, | ||
'cluster:admin/xpack/ml/job/reset': JOB_ACTION.RESET, | ||
'cluster:admin/xpack/ml/job/model_snapshots/revert': JOB_ACTION.REVERT, | ||
}; | ||
|
||
export const JOB_ACTION_TASKS = Object.keys(JOB_ACTION_TASK); |
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
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
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
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
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
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.
I don't see these action items disabled after hitting reset. Is this to be expected, without the planned follow-up for polling?
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.
797c274 fixes this issue.
It's still tricky to reproduce as you need to catch the job while the reset task is running.
I think i might need to reinstate the slight delay to refresh the jobs after applying the reset, just to increase the chance that the first refresh will catch the the job why the task is running, and not before, which is happening now.
The follow up work will add a poll for the tasks so the jobs list will update once the task is complete.
Note, delete is still available. I've raised this as a question in a previous comment.