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] Move FieldStatsFlyout, parseInterval, validators to packages. #193657

Merged
merged 12 commits into from
Sep 24, 2024

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Sep 22, 2024

Summary

Part of #159917.

Moves code from plugins/ml/common|public to packages that is used by transforms too.

While the transforms plugin is maintained by the ML team too, the transform plugin itself is independently available from the ML UI in the Kibana management section. We should try to avoid that the transform plugin is directly depending on the ml plugin. This PR moves some code from plugins/ml/common|public to packages so that we can remove ml from the list of requiredBundles of the transform plugin.

The packages were created with these commands:

node scripts/generate package @kbn/ml-field-stats-flyout --dir ./x-pack/packages/ml/field_stats_flyout
node scripts/generate package @kbn/ml-parse-interval --dir ./x-pack/packages/ml/parse_interval
node scripts/generate package @kbn/ml-validators --dir ./x-pack/packages/ml/validators

The following commands were used to check missing jsdoc comments and exports:

node scripts/build_api_docs --plugin @kbn/ml-field-stats-flyout --stats comments
node scripts/build_api_docs --plugin @kbn/ml-field-stats-flyout --stats exports
node scripts/build_api_docs --plugin @kbn/ml-parse-interval  --stats comments
node scripts/build_api_docs --plugin @kbn/ml-parse-interval  --stats exports
node scripts/build_api_docs --plugin @kbn/ml-validators --stats comments
node scripts/build_api_docs --plugin @kbn/ml-validators --stats exports

Checklist

@walterra walterra self-assigned this Sep 22, 2024
@walterra walterra force-pushed the ml-field-stats-flyout-package branch 2 times, most recently from f8f0e13 to 137f975 Compare September 22, 2024 16:36
@walterra walterra force-pushed the ml-field-stats-flyout-package branch from 137f975 to da4f7a4 Compare September 23, 2024 07:22
@walterra walterra changed the title [ML] Move field stats flyout to package. [ML] Move FieldStatsFlyout, parseInterval, validators to packages. Sep 23, 2024
@walterra walterra force-pushed the ml-field-stats-flyout-package branch from b305119 to 93103b4 Compare September 23, 2024 11:01
@walterra walterra added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 v8.16.0 :ml Feature:Transforms ML transforms backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Sep 23, 2024
@walterra walterra marked this pull request as ready for review September 23, 2024 12:39
@walterra walterra requested review from a team as code owners September 23, 2024 12:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ml 2038 2039 +1
transform 440 510 +70
total +71

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
ml 67 63 -4

Async chunks

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

id before after diff
ml 4.6MB 4.6MB -12.9KB
transform 549.6KB 585.5KB +35.9KB
total +23.0KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
ml 102 100 -2

Page load bundle

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

id before after diff
ml 76.0KB 74.2KB -1.9KB
transform 18.7KB 18.5KB -156.0B
total -2.0KB
Unknown metric groups

API count

id before after diff
@kbn/ml-field-stats-flyout - 29 +29
@kbn/ml-parse-interval - 3 +3
@kbn/ml-validators - 32 +32
ml 154 148 -6
total +58

async chunk count

id before after diff
ml 110 109 -1
transform 3 6 +3
total +2

ESLint disabled line counts

id before after diff
@kbn/ml-field-stats-flyout - 4 +4
ml 566 562 -4
total -0

Total ESLint disabled count

id before after diff
@kbn/ml-field-stats-flyout - 4 +4
ml 569 565 -4
total -0

History

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

cc @walterra

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.

LGTM. Gave the ML, Transforms and Change point pages a test and all looked good.

Copy link
Contributor

@rbrtj rbrtj 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 b2d85d5 into elastic:main Sep 24, 2024
39 checks passed
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [Fleet] Reuse package infos for synthetics bulk ops (#191486)
- [Threat Hunting Investigations] Use OpenAPI types in more timeline routes (#189977)
- Upgrade EUI to v95.11.0 (#192756)
- Allow elasticsearch.publicBaseUrl to be set using an environment variable (#193716)
- [APM] Use excluded data tiers setting (#192373)

Manual backport

To create the backport manually run:

node scripts/backport --pr 193657

Questions ?

Please refer to the Backport tool documentation

@walterra walterra deleted the ml-field-stats-flyout-package branch September 24, 2024 12:17
walterra added a commit to walterra/kibana that referenced this pull request Sep 24, 2024
…lastic#193657)

## Summary

Part of elastic#159917.

Moves code from `plugins/ml/common|public` to packages that is used by
transforms too.

While the transforms plugin is maintained by the ML team too, the
transform plugin itself is independently available from the ML UI in the
Kibana management section. We should try to avoid that the transform
plugin is directly depending on the `ml` plugin. This PR moves some code
from `plugins/ml/common|public` to packages so that we can remove `ml`
from the list of `requiredBundles` of the `transform` plugin.

The packages were created with these commands:

```
node scripts/generate package @kbn/ml-field-stats-flyout --dir ./x-pack/packages/ml/field_stats_flyout
node scripts/generate package @kbn/ml-parse-interval --dir ./x-pack/packages/ml/parse_interval
node scripts/generate package @kbn/ml-validators --dir ./x-pack/packages/ml/validators
```

The following commands were used to check missing jsdoc comments and
exports:

```
node scripts/build_api_docs --plugin @kbn/ml-field-stats-flyout --stats comments
node scripts/build_api_docs --plugin @kbn/ml-field-stats-flyout --stats exports
node scripts/build_api_docs --plugin @kbn/ml-parse-interval  --stats comments
node scripts/build_api_docs --plugin @kbn/ml-parse-interval  --stats exports
node scripts/build_api_docs --plugin @kbn/ml-validators --stats comments
node scripts/build_api_docs --plugin @kbn/ml-validators --stats exports
```

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit b2d85d5)

# Conflicts:
#	.github/CODEOWNERS
@walterra
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

walterra added a commit that referenced this pull request Sep 24, 2024
…es. (#193657) (#193859)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] Move FieldStatsFlyout, parseInterval, validators to packages.
(#193657)](#193657)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Walter
Rafelsberger","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-24T12:00:55Z","message":"[ML]
Move FieldStatsFlyout, parseInterval, validators to packages.
(#193657)\n\n## Summary\r\n\r\nPart of #159917.\r\n\r\nMoves code from
`plugins/ml/common|public` to packages that is used by\r\ntransforms
too.\r\n\r\nWhile the transforms plugin is maintained by the ML team
too, the\r\ntransform plugin itself is independently available from the
ML UI in the\r\nKibana management section. We should try to avoid that
the transform\r\nplugin is directly depending on the `ml` plugin. This
PR moves some code\r\nfrom `plugins/ml/common|public` to packages so
that we can remove `ml`\r\nfrom the list of `requiredBundles` of the
`transform` plugin.\r\n\r\nThe packages were created with these
commands:\r\n\r\n```\r\nnode scripts/generate package
@kbn/ml-field-stats-flyout --dir
./x-pack/packages/ml/field_stats_flyout\r\nnode scripts/generate package
@kbn/ml-parse-interval --dir ./x-pack/packages/ml/parse_interval\r\nnode
scripts/generate package @kbn/ml-validators --dir
./x-pack/packages/ml/validators\r\n```\r\n\r\nThe following commands
were used to check missing jsdoc comments
and\r\nexports:\r\n\r\n```\r\nnode scripts/build_api_docs --plugin
@kbn/ml-field-stats-flyout --stats comments\r\nnode
scripts/build_api_docs --plugin @kbn/ml-field-stats-flyout --stats
exports\r\nnode scripts/build_api_docs --plugin @kbn/ml-parse-interval
--stats comments\r\nnode scripts/build_api_docs --plugin
@kbn/ml-parse-interval --stats exports\r\nnode scripts/build_api_docs
--plugin @kbn/ml-validators --stats comments\r\nnode
scripts/build_api_docs --plugin @kbn/ml-validators --stats
exports\r\n```\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"b2d85d5f8f10f7c460c3a3b732844a19c8b20d7b","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","Feature:Transforms","v9.0.0","backport:prev-minor","v8.16.0"],"number":193657,"url":"https://github.com/elastic/kibana/pull/193657","mergeCommit":{"message":"[ML]
Move FieldStatsFlyout, parseInterval, validators to packages.
(#193657)\n\n## Summary\r\n\r\nPart of #159917.\r\n\r\nMoves code from
`plugins/ml/common|public` to packages that is used by\r\ntransforms
too.\r\n\r\nWhile the transforms plugin is maintained by the ML team
too, the\r\ntransform plugin itself is independently available from the
ML UI in the\r\nKibana management section. We should try to avoid that
the transform\r\nplugin is directly depending on the `ml` plugin. This
PR moves some code\r\nfrom `plugins/ml/common|public` to packages so
that we can remove `ml`\r\nfrom the list of `requiredBundles` of the
`transform` plugin.\r\n\r\nThe packages were created with these
commands:\r\n\r\n```\r\nnode scripts/generate package
@kbn/ml-field-stats-flyout --dir
./x-pack/packages/ml/field_stats_flyout\r\nnode scripts/generate package
@kbn/ml-parse-interval --dir ./x-pack/packages/ml/parse_interval\r\nnode
scripts/generate package @kbn/ml-validators --dir
./x-pack/packages/ml/validators\r\n```\r\n\r\nThe following commands
were used to check missing jsdoc comments
and\r\nexports:\r\n\r\n```\r\nnode scripts/build_api_docs --plugin
@kbn/ml-field-stats-flyout --stats comments\r\nnode
scripts/build_api_docs --plugin @kbn/ml-field-stats-flyout --stats
exports\r\nnode scripts/build_api_docs --plugin @kbn/ml-parse-interval
--stats comments\r\nnode scripts/build_api_docs --plugin
@kbn/ml-parse-interval --stats exports\r\nnode scripts/build_api_docs
--plugin @kbn/ml-validators --stats comments\r\nnode
scripts/build_api_docs --plugin @kbn/ml-validators --stats
exports\r\n```\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"b2d85d5f8f10f7c460c3a3b732844a19c8b20d7b"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193657","number":193657,"mergeCommit":{"message":"[ML]
Move FieldStatsFlyout, parseInterval, validators to packages.
(#193657)\n\n## Summary\r\n\r\nPart of #159917.\r\n\r\nMoves code from
`plugins/ml/common|public` to packages that is used by\r\ntransforms
too.\r\n\r\nWhile the transforms plugin is maintained by the ML team
too, the\r\ntransform plugin itself is independently available from the
ML UI in the\r\nKibana management section. We should try to avoid that
the transform\r\nplugin is directly depending on the `ml` plugin. This
PR moves some code\r\nfrom `plugins/ml/common|public` to packages so
that we can remove `ml`\r\nfrom the list of `requiredBundles` of the
`transform` plugin.\r\n\r\nThe packages were created with these
commands:\r\n\r\n```\r\nnode scripts/generate package
@kbn/ml-field-stats-flyout --dir
./x-pack/packages/ml/field_stats_flyout\r\nnode scripts/generate package
@kbn/ml-parse-interval --dir ./x-pack/packages/ml/parse_interval\r\nnode
scripts/generate package @kbn/ml-validators --dir
./x-pack/packages/ml/validators\r\n```\r\n\r\nThe following commands
were used to check missing jsdoc comments
and\r\nexports:\r\n\r\n```\r\nnode scripts/build_api_docs --plugin
@kbn/ml-field-stats-flyout --stats comments\r\nnode
scripts/build_api_docs --plugin @kbn/ml-field-stats-flyout --stats
exports\r\nnode scripts/build_api_docs --plugin @kbn/ml-parse-interval
--stats comments\r\nnode scripts/build_api_docs --plugin
@kbn/ml-parse-interval --stats exports\r\nnode scripts/build_api_docs
--plugin @kbn/ml-validators --stats comments\r\nnode
scripts/build_api_docs --plugin @kbn/ml-validators --stats
exports\r\n```\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"b2d85d5f8f10f7c460c3a3b732844a19c8b20d7b"}},{"branch":"8.x","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
walterra added a commit that referenced this pull request Oct 2, 2024
…ut (#194517)

## Summary

Part of #187772.
Follow up to #193657.

The previous PR #193657 moved `FieldStatsFlyout` to a package, the
`aiops` plugin didn't make full use of that refactor by still passing in
the flyout into the app context.

### Checklist

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 2, 2024
…ut (elastic#194517)

## Summary

Part of elastic#187772.
Follow up to elastic#193657.

The previous PR elastic#193657 moved `FieldStatsFlyout` to a package, the
`aiops` plugin didn't make full use of that refactor by still passing in
the flyout into the app context.

### Checklist

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit eebfba4)
kibanamachine added a commit that referenced this pull request Oct 2, 2024
…s flyout (#194517) (#194710)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] AIOps: Use package instead of context for using field stats
flyout (#194517)](#194517)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Walter
Rafelsberger","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-02T13:23:23Z","message":"[ML]
AIOps: Use package instead of context for using field stats flyout
(#194517)\n\n## Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/187772.\r\nFollow up to
#193657.\r\n\r\nThe previous PR #193657 moved `FieldStatsFlyout` to a
package, the\r\n`aiops` plugin didn't make full use of that refactor by
still passing in\r\nthe flyout into the app context.\r\n\r\n###
Checklist\r\n\r\n- [x] This was checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"eebfba4f9bfe2592ce92d35aed9cf3c0c8540130","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","v9.0.0","Feature:ML/AIOps","v8.16.0","backport:version"],"title":"[ML]
AIOps: Use package instead of context for using field stats
flyout","number":194517,"url":"https://github.com/elastic/kibana/pull/194517","mergeCommit":{"message":"[ML]
AIOps: Use package instead of context for using field stats flyout
(#194517)\n\n## Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/187772.\r\nFollow up to
#193657.\r\n\r\nThe previous PR #193657 moved `FieldStatsFlyout` to a
package, the\r\n`aiops` plugin didn't make full use of that refactor by
still passing in\r\nthe flyout into the app context.\r\n\r\n###
Checklist\r\n\r\n- [x] This was checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"eebfba4f9bfe2592ce92d35aed9cf3c0c8540130"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194517","number":194517,"mergeCommit":{"message":"[ML]
AIOps: Use package instead of context for using field stats flyout
(#194517)\n\n## Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/187772.\r\nFollow up to
#193657.\r\n\r\nThe previous PR #193657 moved `FieldStatsFlyout` to a
package, the\r\n`aiops` plugin didn't make full use of that refactor by
still passing in\r\nthe flyout into the app context.\r\n\r\n###
Checklist\r\n\r\n- [x] This was checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"eebfba4f9bfe2592ce92d35aed9cf3c0c8540130"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Walter Rafelsberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Transforms ML transforms :ml release_note:skip Skip the PR/issue when compiling release notes v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants