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] Anomaly Detection: Migrate validation messages links to use docLinks. #94568

Merged

Conversation

walterra
Copy link
Contributor

Summary

Fixes #94549

  • To make use of the docsLinks service which is only usable in client side code, Anomaly Detection's validation messages are not fully returned from the server anymore. Instead just the message ID and necessary metadata to parse the message template gets returned.
  • getMessages() no longer uses inline hard coded documentation links but picks links from the docsLinks service.
  • The code that rendered the messages originally on the server has been move to a function parseMessages() which can now be used on the client side and accepts the docsLinks services to get URLs to documentation from it.
  • This means we no longer need to get the current version/branch information for the server side code.
  • Tests have been updated to reflect the changes: API integration tests only check for the now reduced messages containing only message IDs and metadata. The expected results of the API integration tests are used as mocks for the client side function parseMessages(), this allows use to cover the same code and messages as previously.

Checklist

@walterra walterra added :ml Feature:Anomaly Detection ML anomaly detection refactoring v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.13.0 labels Mar 15, 2021
@walterra walterra self-assigned this Mar 15, 2021
@walterra walterra requested review from a team as code owners March 15, 2021 13:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@walterra walterra changed the title Ml move validation message parsing to client [ML] Anomaly Detection: Migrate validation messages links to use docLinks. Mar 15, 2021
@lcawl lcawl mentioned this pull request Mar 15, 2021
8 tasks
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ml 1742 1743 +1

Async chunks

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

id before after diff
ml 6.4MB 6.4MB +23.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 432.1KB 433.1KB +1.1KB
ml 70.1KB 70.2KB +83.0B
total +1.1KB

History

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

cc @walterra

@walterra walterra mentioned this pull request Mar 16, 2021
15 tasks
Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested and LGTM

Copy link
Member

@jgowdyelastic jgowdyelastic 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

Copy link
Member

@afharo afharo 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 added the auto-backport Deprecated - use backport:version if exact versions are needed label Mar 17, 2021
@walterra walterra merged commit 83c6bcc into elastic:master Mar 17, 2021
@walterra walterra deleted the ml-move-validation-message-parsing-to-client branch March 17, 2021 06:53
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 17, 2021
…inks. (elastic#94568)

- To make use of the docsLinks service which is only usable in client side code, Anomaly Detection's validation messages are not fully returned from the server anymore. Instead just the message ID and necessary metadata to parse the message template gets returned.
- getMessages() no longer uses inline hard coded documentation links but picks links from the docsLinks service.
- The code that rendered the messages originally on the server has been move to a function parseMessages() which can now be used on the client side and accepts the docsLinks services to get URLs to documentation from it.
- This means we no longer need to get the current version/branch information for the server side code.
- Tests have been updated to reflect the changes: API integration tests only check for the now reduced messages containing only message IDs and metadata. The expected results of the API integration tests are used as mocks for the client side function parseMessages(), this allows use to cover the same code and messages as previously.
@kibanamachine
Copy link
Contributor

💚 Backport successful

7.x / #94778

Successful backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Mar 17, 2021
…inks. (#94568) (#94778)

- To make use of the docsLinks service which is only usable in client side code, Anomaly Detection's validation messages are not fully returned from the server anymore. Instead just the message ID and necessary metadata to parse the message template gets returned.
- getMessages() no longer uses inline hard coded documentation links but picks links from the docsLinks service.
- The code that rendered the messages originally on the server has been move to a function parseMessages() which can now be used on the client side and accepts the docsLinks services to get URLs to documentation from it.
- This means we no longer need to get the current version/branch information for the server side code.
- Tests have been updated to reflect the changes: API integration tests only check for the now reduced messages containing only message IDs and metadata. The expected results of the API integration tests are used as mocks for the client side function parseMessages(), this allows use to cover the same code and messages as previously.

Co-authored-by: Walter Rafelsberger <walter@elastic.co>
jloleysens added a commit that referenced this pull request Mar 17, 2021
…-action

* 'master' of github.com:elastic/kibana: (44 commits)
  Migrate the optimizer mixin to core (#94272)
  Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid (#92442)
  [ML] Anomaly Detection: Migrate validation messages links to use docLinks. (#94568)
  [Lists][Exceptions] - Adding basic linting, i18n and storybook support (#94772)
  [Fleet] Add test/fix for invalid/missing ids in bulk agent reassign (#94632)
  [Security Solution] [Cases] Move create page components and dependencies to Cases (#94444)
  [ML] Data Frame Analytics accessibility tests: fix flaky outlier creation test (#94735)
  [Security Solutions] Remove commented out old linter rules (#94753)
  [App Search] Role mappings migration part 2 (#94461)
  [CI] Update Backport action inputs to match updated ones (#94721)
  [chore] Remove the infra team from CODEOWNERS (#94740)
  [Connectors UI] Make UI use new connector APIs (#94180)
  [ML] Use indices options in anomaly detection job wizards (#91830)
  Remove `string` as a valid registry var type value (#94174)
  [Alerts] Replaces legacy es client with the ElasticsearchClient for alerts and triggers_actions_ui plugins. (#93364)
  [Reporting-CSV Export] Re-write CSV Export using SearchSource (#88303)
  chore(NA): upgrade bazel rules nodejs to v3.2.2 (#94726)
  [APM] Settings: Update layout and update/add descriptions (#94398)
  skip flaky suite (#94666)
  [XY axis] Integrates legend color picker with the eui palette (#90589)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/cold_phase/cold_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/constants.ts
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/configuration_context.tsx
#	x-pack/plugins/index_lifecycle_management/public/shared_imports.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Anomaly Detection ML anomaly detection :ml refactoring release_note:skip Skip the PR/issue when compiling release notes v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Anomaly Detection: Migrate validation messages links to use docLinks
7 participants