Skip to content
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] Transforms: Fix editing retention policy without default value. #123450

Merged

Conversation

walterra
Copy link
Contributor

Summary

Fixes #122913.

  • Previously, a bug with how the form state would handle retention policy and populating the field select, a user could be blocked from setting the field or the form state wouldn't pick up the initial setting.
  • This is now fixed by setting hasNoInitialSelection to reflect the form set. If no retention policy had been set previously, the select dropdown will be empty until the user does a selection (which will then correctly update the to be updated transform config).
  • Functional tests have been updated to fail reflect the change and fail without the fix.

Checklist

@walterra walterra added bug Fixes for quality problems that affect the customer experience release_note:fix :ml Feature:Transforms ML transforms v8.1.0 labels Jan 20, 2022
@walterra walterra requested review from pheyos and qn895 January 20, 2022 11:21
@walterra walterra self-assigned this Jan 20, 2022
@walterra walterra requested a review from a team as a code owner January 20, 2022 11:21
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@qn895
Copy link
Member

qn895 commented Jan 20, 2022

Tested and confirmed the issue is fixed. Code change LGTM 🎉

@walterra
Copy link
Contributor Author

@elasticmachine merge upstream

@walterra
Copy link
Contributor Author

@pheyos this one is ready for another look, updated the tests.

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

Test changes LGTM and I couldn't reproduce the linked issue with this fix anymore.
But I've noticed a different issue:

  • Create a transform with source data that has more than 1 time field (e.g. the ecommerce sample data)
  • Add a retention policy and don't use the first time field for the max age retention field (in the ecommerce example use order_date)
  • Clone that transform
  • => The wizard pre-fills the retention policy max age field with the wrong value (it seems to pick the first available entry and not the one saved in the transform - in the ecommerce example it picks customer_birth_date instead of the configured order_date).

@walterra
Copy link
Contributor Author

@pheyos Thanks for catching the cloning issue. When loading the wizard it didn't pick up the value provided by the config to be cloned but always fell back to the first available date field. Fixed and now covered by functional tests in f81c9e2.

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

Code LGTM

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
transform 363.3KB 363.4KB +111.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @walterra

@walterra walterra mentioned this pull request Jan 24, 2022
13 tasks
Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

LGTM

@walterra walterra merged commit 1ecb42b into elastic:main Jan 24, 2022
@walterra walterra deleted the ml-transform-fix-edit-retention-policy branch January 24, 2022 14:30
walterra added a commit to walterra/kibana that referenced this pull request Jan 24, 2022
…lastic#123450)

- Previously, a bug with how the form state would handle retention policy and populating the field select, a user could be blocked from setting the field or the form state wouldn't pick up the initial setting.
- This is now fixed by setting hasNoInitialSelection to reflect the form set. If no retention policy had been set previously, the select dropdown will be empty until the user does a selection (which will then correctly update the to be updated transform config).
- Functional tests have been updated to fail reflect the change and fail without the fix.
- Fixed a cloning issue: When loading the wizard it didn't pick up the retention policy value provided by the config to be cloned but always fell back to the first available date field.

(cherry picked from commit 1ecb42b)
walterra added a commit that referenced this pull request Jan 24, 2022
…123450) (#123602)

- Previously, a bug with how the form state would handle retention policy and populating the field select, a user could be blocked from setting the field or the form state wouldn't pick up the initial setting.
- This is now fixed by setting hasNoInitialSelection to reflect the form set. If no retention policy had been set previously, the select dropdown will be empty until the user does a selection (which will then correctly update the to be updated transform config).
- Functional tests have been updated to fail reflect the change and fail without the fix.
- Fixed a cloning issue: When loading the wizard it didn't pick up the retention policy value provided by the config to be cloned but always fell back to the first available date field.

(cherry picked from commit 1ecb42b)
walterra added a commit to walterra/kibana that referenced this pull request Feb 17, 2022
…lastic#123450)

- Previously, a bug with how the form state would handle retention policy and populating the field select, a user could be blocked from setting the field or the form state wouldn't pick up the initial setting.
- This is now fixed by setting hasNoInitialSelection to reflect the form set. If no retention policy had been set previously, the select dropdown will be empty until the user does a selection (which will then correctly update the to be updated transform config).
- Functional tests have been updated to fail reflect the change and fail without the fix.
- Fixed a cloning issue: When loading the wizard it didn't pick up the retention policy value provided by the config to be cloned but always fell back to the first available date field.

(cherry picked from commit 1ecb42b)
walterra added a commit that referenced this pull request Feb 17, 2022
…123450) (#125926)

- Previously, a bug with how the form state would handle retention policy and populating the field select, a user could be blocked from setting the field or the form state wouldn't pick up the initial setting.
- This is now fixed by setting hasNoInitialSelection to reflect the form set. If no retention policy had been set previously, the select dropdown will be empty until the user does a selection (which will then correctly update the to be updated transform config).
- Functional tests have been updated to fail reflect the change and fail without the fix.
- Fixed a cloning issue: When loading the wizard it didn't pick up the retention policy value provided by the config to be cloned but always fell back to the first available date field.

(cherry picked from commit 1ecb42b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Transforms ML transforms :ml release_note:fix v7.17.0 v8.0.1 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Edit transform retention policy fails with default field value
7 participants