Skip to content

[ML] Enhance created_by check for custom rules - #47825

Merged
darnautov merged 3 commits into
elastic:masterfrom
darnautov:ML-45638-enhance-created-by-removal-check
Oct 11, 2019
Merged

darnautov merged 3 commits into
elastic:masterfrom
darnautov:ML-45638-enhance-created-by-removal-check

Conversation

@darnautov

@darnautov darnautov commented Oct 10, 2019 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #45638. Remove created_by field only in case the job has been created by wizard.

Checklist

For maintainers

@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

@darnautov

Copy link
Copy Markdown
Contributor Author

retest

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@darnautov

Copy link
Copy Markdown
Contributor Author

retest

import { ml } from '../../services/ml_api_service';
import { mlJobService } from '../../services/job_service';
import { i18n } from '@kbn/i18n';
import { WIZARD_TYPE } from '../../jobs/new_job/simple/components/constants/general';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the values out of ml/public/jobs/new_job_new/common/job_creator/util/constants.ts be used here. @jgowdyelastic ? Or the CREATED_BY_LABEL enum in that file could be moved to a more generic constants file perhaps?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about CREATED_BY_LABEL, but this enum might be extended I guess because created_by might me module values as well

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

* it was created by a job wizard as the rules cannot currently be edited
* in the job wizards and so would be lost in a clone.
*/
export function processCreatedBy(customSettings) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this function is better suited to a shared location? job_utils.js perhaps?

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@jgowdyelastic jgowdyelastic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@peteharverson peteharverson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest edits LGTM

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@darnautov
darnautov merged commit 860b074 into elastic:master Oct 11, 2019
@darnautov
darnautov deleted the ML-45638-enhance-created-by-removal-check branch October 11, 2019 11:26
darnautov added a commit to darnautov/kibana that referenced this pull request Oct 11, 2019
* [ML] delete created_by only for wizards

* [ML] use CREATED_BY_LABEL enum

* [ML] move processCreatedBy
darnautov added a commit that referenced this pull request Oct 11, 2019
* [ML] delete created_by only for wizards

* [ML] use CREATED_BY_LABEL enum

* [ML] move processCreatedBy
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
* [ML] delete created_by only for wizards

* [ML] use CREATED_BY_LABEL enum

* [ML] move processCreatedBy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ML] Custom rules - enhanced check for created_by removal

4 participants