-
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] Adding ability to change data view in advanced job wizard #115191
[ML] Adding ability to change data view in advanced job wizard #115191
Conversation
@elasticmachine merge upstream |
Pinging @elastic/ml-ui (:ml) |
...cation/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx
Outdated
Show resolved
Hide resolved
...cation/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx
Outdated
Show resolved
Hide resolved
...cation/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx
Outdated
Show resolved
Hide resolved
...cation/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx
Outdated
Show resolved
Hide resolved
...cation/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx
Outdated
Show resolved
Hide resolved
...cation/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx
Outdated
Show resolved
Hide resolved
...cation/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx
Outdated
Show resolved
Hide resolved
...jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view_button.tsx
Outdated
Show resolved
Hide resolved
description={ | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.description" | ||
defaultMessage="The currently selected Data view being used for this job. Change this text." |
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.
data view
. Are you looking for a suggestion from @szabosteve for the last part of this message?
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 in 489f0e3 to remove the change this text
part, but yes, all text in this PR needs review please @szabosteve
The warning text at the bottom of the JSON editor can probably be changed too, to say something like @peteharverson updated in c89ca51 Also changes all uses of "data view" to "index pattern" |
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.
Tested for the principal use case of editing the index pattern for a job created in the advanced wizard and looks good overall. Just left some suggestions for the text.
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 left a couple of suggestions. Please let me know if you have any questions or requests.
> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.validation.noDetectors.message" | ||
defaultMessage="No detectors have been configured, so changing to this data view should be ok." |
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.
defaultMessage="No detectors have been configured, so changing to this data view should be ok." | |
defaultMessage="No detectors have been configured; this data view can be applied to the 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.
Updated in 0336d02
> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.validation.valid.message" | ||
defaultMessage="This data view appears to be a good match for this 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.
defaultMessage="This data view appears to be a good match for this job." | |
defaultMessage="This data view can be applied to this 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.
Updated in 0336d02
> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.validation.possiblyInvalid.message" | ||
defaultMessage="This data view produced no results when previewing the datafeed. This could be due to there being no documents in {dataViewTitle}." |
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.
defaultMessage="This data view produced no results when previewing the datafeed. This could be due to there being no documents in {dataViewTitle}." | |
defaultMessage="This data view produced no results when previewing the datafeed. There might be no documents in {dataViewTitle}." |
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 in 0336d02
> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.validation.invalid.message" | ||
defaultMessage="This data view produced an error when attempting to preview the datafeed. This could be due to fields selected for this job not existing in {dataViewTitle}." |
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.
defaultMessage="This data view produced an error when attempting to preview the datafeed. This could be due to fields selected for this job not existing in {dataViewTitle}." | |
defaultMessage="This data view produced an error when attempting to preview the datafeed. The fields selected for this job might not exist in {dataViewTitle}." |
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 in 0336d02
<EuiCallOut color="warning"> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.step0.description" | ||
defaultMessage="Changing the current data view may cause problems with the current job configuration as it may not contain the same fields." |
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 the it
in the second part of the sentence refers to the data view that the user wants to switch to. If my assumption is correct, then I suggest a clarification. Let me know if I misinterpret the sentence, please.
defaultMessage="Changing the current data view may cause problems with the current job configuration as it may not contain the same fields." | |
defaultMessage="Changing the current data view may cause problems with the corresponding job configuration as the newly selected data view may not contain the same fields." |
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 in 0336d02
<> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.step1.title" | ||
defaultMessage="Select new data view for 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.
defaultMessage="Select new data view for job" | |
defaultMessage="Select new data view for the 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.
Updated in 0336d02
<EuiLoadingSpinner /> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.step2.validatingText" | ||
defaultMessage=" Checking compatibility of data view with 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.
defaultMessage=" Checking compatibility of data view with job" | |
defaultMessage=" Checking data view and job compatibility" |
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 in 0336d02
description={ | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.description" | ||
defaultMessage="The currently selected data view being used for this 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.
defaultMessage="The currently selected data view being used for this job." | |
defaultMessage="The data view that is currently used for this 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.
Updated in 0336d02
@@ -204,7 +204,7 @@ export const JsonEditorFlyout: FC<Props> = ({ isDisabled, jobEditorMode, datafee | |||
> | |||
<FormattedMessage | |||
id="xpack.ml.newJob.wizard.jsonFlyout.indicesChange.calloutText" | |||
defaultMessage="It is not possible to alter the indices being used by the datafeed here. If you wish to select a different index pattern or saved search, please start the job creation again, selecting a different index pattern." | |||
defaultMessage="It is not possible to alter the indices being used by the datafeed here. If you wish to select a different index pattern or saved search, please jump to step 1 of the wizard and select change index pattern." |
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.
Somehow I missed this part, I think it was updated while I was reviewing the PR.
defaultMessage="It is not possible to alter the indices being used by the datafeed here. If you wish to select a different index pattern or saved search, please jump to step 1 of the wizard and select change index pattern." | |
defaultMessage="You cannot alter the indices being used by the datafeed here. To select a different index pattern or saved search, go to step 1 of the wizard and select the Change index pattern option." |
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.
Another option if you want it shorter:
You cannot alter ... To select a different index pattern or saved search, go to step 1...
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.
Even better. I updated my suggestion accordingly.
<EuiCallOut color="warning"> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.datafeedStep.dataView.step0.description" | ||
defaultMessage="Changing the current index pattern may cause problems with the corresponding job configuration as the newly selected index pattern may not contain the same fields." |
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.
Changing the current index pattern may cause problems with the corresponding job configuration as the newly selected index pattern may not contain the same fields.
Drive-by comment that it's unclear what the user is supposed to do with this message. Is it really necessary at this stage? IMO it would be more helpful to qualify only the error/warning checks' messages with something like: "If you apply this change, the mismatch between the index pattern and the job configuration might cause.... the job to fail? the analysis to be incorrect? (whatever the consequences are that we're trying to warn folks about there)".
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.
Yes I agree, this first warning step was added last minute, but I don't think it's needed.
I've removed it in f161ef4
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.
Latest changes LGTM
@elasticmachine merge upstream |
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.
Great to see the tests coming as part of this PR 🎉
Left a few comments.
x-pack/test/api_integration/apis/ml/job_validation/datafeed_preview_validation.ts
Outdated
Show resolved
Hide resolved
x-pack/test/api_integration/apis/ml/job_validation/datafeed_preview_validation.ts
Outdated
Show resolved
Hide resolved
x-pack/test/api_integration/apis/ml/job_validation/datafeed_preview_validation.ts
Show resolved
Hide resolved
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
const indices = title.split(','); | ||
if (jobCreator.detectors.length) { | ||
const datafeed: Datafeed = { ...jobCreator.datafeedConfig, indices }; | ||
const gg = await validateDatafeedPreview({ |
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.
shall we rename this variable?
const gg = await validateDatafeedPreview({ | |
const validationResponse = await validateDatafeedPreview({ |
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.
ha!! gg
and hh
are my go to names for variables when halfway through writing something.
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 in 35edeee
...jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view_button.tsx
Show resolved
Hide resolved
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.
Functional tests LGTM
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
…ic#115191) * [ML] Adding ability to change data view in advanced job wizard * updating translation ids * type and text changes * code clean up * route id change * text changes * text change * changing data view to index pattern * adding api tests * text updates * removing first step * renaming temp variable * adding permission checks Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…-link-to-kibana-app * 'master' of github.com:elastic/kibana: (30 commits) Fix potential error from undefined (elastic#115562) [App Search, Crawler] Fix validation step panel padding/whitespace (elastic#115542) [Cases][Connectors] ServiceNow ITOM: MVP (elastic#114125) Change default session idle timeout to 8 hours. (elastic#115565) Upgrade EUI to v39.1.1 (elastic#114732) [App Search] Wired up organic results on Curation Suggestions view (elastic#114717) [i18n] remove i18n html extractor (elastic#115004) [Logs/Metrics UI] Add deprecated field configuration to Deprecations API (elastic#115103) [Transform] Add alerting rules management to Transform UI (elastic#115363) Update UI links to Fleet and Agent docs (elastic#115295) [ML] Adding ability to change data view in advanced job wizard (elastic#115191) Change deleteByNamespace to include legacy URL aliases (elastic#115459) [Unified Integrations] Remove and cleanup add data views (elastic#115424) [Discover] Show ignored field values (elastic#115040) [ML] Stop reading the ml.max_open_jobs node attribute (elastic#115524) [Discover] Improve doc viewer code in Discover (elastic#114759) [Security Solutions] Adds security detection rule actions as importable and exportable (elastic#115243) [Security Solution] [Platform] Migrate legacy actions whenever user interacts with the rule (elastic#115101) [Fleet] Add telemetry for integration cards (elastic#115413) 🐛 Fix single percentile case when ES is returning no buckets (elastic#115214) ... # Conflicts: # x-pack/plugins/reporting/public/management/__snapshots__/report_listing.test.tsx.snap
…) (#115585) * [ML] Adding ability to change data view in advanced job wizard * updating translation ids * type and text changes * code clean up * route id change * text changes * text change * changing data view to index pattern * adding api tests * text updates * removing first step * renaming temp variable * adding permission checks Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: James Gowdy <jgowdy@elastic.co>
Adds a new setting to the Advanced Job Wizard to allow the user to change the selected data view.
Problems may occur if the newly selected data view does not contain the fields are being used in the job, therefore we run a datafeed preview to validate that the current job works with the selected data view before applying it.
We would not expect the user to use this feature when creating a brand new job from scratch, as the data view is selected moments before the wizard opens. However, this feature is useful for users who need to adjust an existing job by allowing them to clone the job and then change the data view.
@szabosteve could you please review the text used in the UI.
Note, screenshots below use the term "Data view", this has now been changed to "Index pattern"
There are 4 validation results
The job does not contain any detectors and so validation is skipped.
Datafeed preview ran successfully and produced results
Datafeed preview ran successfully but no results were produced, this may be due to the index being empty.
The datafeed preview failed to run. Most probably the job contains fields which do not exist in the newly selected data view
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers