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

[Stack monitoring] Remove getAngularInjector and duplicated angular components #115593

Merged

Conversation

estermv
Copy link
Contributor

@estermv estermv commented Oct 19, 2021

Summary

Closes #115499.

This PR removes the getAngularInjector from the Legacy class that was throwing an error in the React app.

While removing it, I noticed that there were several components that were duplicated with a react suffix. I just removed the ones that were used in angular so we don't have unused code and to keep the PR easy to review, we can rename them in a follow-up PR.

@estermv estermv added v8.0.0 Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes Feature:Stack Monitoring auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 Epic: Stack Monitoring de-angularization labels Oct 19, 2021
@estermv estermv requested a review from a team as a code owner October 19, 2021 15:47
@estermv estermv requested review from a team October 19, 2021 15:47
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@@ -5,7 +5,6 @@
* 2.0.
*/

export { ElasticsearchOverview } from './overview';
Copy link
Contributor

@neptunian neptunian Oct 19, 2021

Choose a reason for hiding this comment

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

would you mind instead renaming ElasticsearchOverviewReact to ElasticsearchOverview? and removing the React postfix imports? I meant to do that after removal of the angular when we could delete the old components. Same with the other components I duplicated. Or if you prefer I can do it after. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was going to do it as a separate PR, because I thought that it would be easier to review, but I can also do it as part of this.

@estermv
Copy link
Contributor Author

estermv commented Oct 20, 2021

@elasticmachine merge upstream

@estermv
Copy link
Contributor Author

estermv commented Oct 20, 2021

@elasticmachine merge upstream

@estermv
Copy link
Contributor Author

estermv commented Oct 20, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/ml/jobs/categorization_field_examples·ts.apis Machine Learning jobs Categorization example endpoint - invalid, too many tokens.

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]     │
[00:00:00]       └-: apis
[00:00:00]         └-> "before all" hook in "apis"
[00:10:50]         └-: Machine Learning
[00:10:50]           └-> "before all" hook in "Machine Learning"
[00:10:50]           └-> "before all" hook in "Machine Learning"
[00:10:50]             │ debg creating role ft_ml_source
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_source]
[00:10:50]             │ debg creating role ft_ml_source_readonly
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_source_readonly]
[00:10:50]             │ debg creating role ft_ml_dest
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_dest]
[00:10:50]             │ debg creating role ft_ml_dest_readonly
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_dest_readonly]
[00:10:50]             │ debg creating role ft_ml_ui_extras
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_ui_extras]
[00:10:50]             │ debg creating role ft_default_space_ml_all
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space_ml_all]
[00:10:50]             │ debg creating role ft_default_space1_ml_all
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space1_ml_all]
[00:10:50]             │ debg creating role ft_all_spaces_ml_all
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_all_spaces_ml_all]
[00:10:50]             │ debg creating role ft_default_space_ml_read
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space_ml_read]
[00:10:50]             │ debg creating role ft_default_space1_ml_read
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space1_ml_read]
[00:10:50]             │ debg creating role ft_all_spaces_ml_read
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_all_spaces_ml_read]
[00:10:50]             │ debg creating role ft_default_space_ml_none
[00:10:50]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space_ml_none]
[00:10:50]             │ debg creating user ft_ml_poweruser
[00:10:50]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser]
[00:10:50]             │ debg created user ft_ml_poweruser
[00:10:50]             │ debg creating user ft_ml_poweruser_spaces
[00:10:51]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser_spaces]
[00:10:51]             │ debg created user ft_ml_poweruser_spaces
[00:10:51]             │ debg creating user ft_ml_poweruser_space1
[00:10:51]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser_space1]
[00:10:51]             │ debg created user ft_ml_poweruser_space1
[00:10:51]             │ debg creating user ft_ml_poweruser_all_spaces
[00:10:51]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser_all_spaces]
[00:10:51]             │ debg created user ft_ml_poweruser_all_spaces
[00:10:51]             │ debg creating user ft_ml_viewer
[00:10:51]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer]
[00:10:51]             │ debg created user ft_ml_viewer
[00:10:51]             │ debg creating user ft_ml_viewer_spaces
[00:10:51]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer_spaces]
[00:10:51]             │ debg created user ft_ml_viewer_spaces
[00:10:51]             │ debg creating user ft_ml_viewer_space1
[00:10:51]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer_space1]
[00:10:51]             │ debg created user ft_ml_viewer_space1
[00:10:51]             │ debg creating user ft_ml_viewer_all_spaces
[00:10:51]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer_all_spaces]
[00:10:51]             │ debg created user ft_ml_viewer_all_spaces
[00:10:51]             │ debg creating user ft_ml_unauthorized
[00:10:51]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_unauthorized]
[00:10:51]             │ debg created user ft_ml_unauthorized
[00:10:51]             │ debg creating user ft_ml_unauthorized_spaces
[00:10:51]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_unauthorized_spaces]
[00:10:51]             │ debg created user ft_ml_unauthorized_spaces
[00:14:55]           └-: jobs
[00:14:55]             └-> "before all" hook in "jobs"
[00:14:55]             └-: Categorization example endpoint - 
[00:14:55]               └-> "before all" hook for "valid with good number of tokens"
[00:14:55]               └-> "before all" hook for "valid with good number of tokens"
[00:14:55]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Loading "mappings.json"
[00:14:55]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Loading "data.json.gz"
[00:14:55]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [ft_categorization] creating index, cause [api], templates [], shards [1]/[0]
[00:14:55]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Created index "ft_categorization"
[00:14:55]                 │ debg [x-pack/test/functional/es_archives/ml/categorization] "ft_categorization" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:14:56]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Indexed 1501 docs into "ft_categorization"
[00:14:56]                 │ debg applying update to kibana config: {"dateFormat:tz":"UTC"}
[00:14:57]               └-> valid with good number of tokens
[00:14:57]                 └-> "before each" hook: global before each for "valid with good number of tokens"
[00:14:57]                 └- ✓ pass  (307ms)
[00:14:57]               └-> invalid, too many tokens.
[00:14:57]                 └-> "before each" hook: global before each for "invalid, too many tokens."
[00:14:57]                 │ info [r.suppressed] [node-01] path: /_analyze, params: {}
[00:14:57]                 │      org.elasticsearch.transport.RemoteTransportException: [node-01][127.0.0.1:6381][indices:admin/analyze[s]]
[00:14:57]                 │      Caused by: java.lang.IllegalStateException: The number of tokens produced by calling _analyze has exceeded the allowed maximum of [10000]. This limit can be set by changing the [index.analyze.max_token_count] index level setting.
[00:14:57]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction$TokenCounter.increment(TransportAnalyzeAction.java:397) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.simpleAnalyze(TransportAnalyzeAction.java:229) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.analyze(TransportAnalyzeAction.java:204) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.analyze(TransportAnalyzeAction.java:122) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:110) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:62) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction.lambda$asyncShardOperation$0(TransportSingleShardAction.java:99) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:737) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:57]                 │      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
[00:14:57]                 │      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
[00:14:57]                 │      	at java.lang.Thread.run(Thread.java:833) [?:?]
[00:14:58]                 └- ✖ fail: apis Machine Learning jobs Categorization example endpoint -  invalid, too many tokens.
[00:14:58]                 │       Error: expected 'partially_valid' to sort of equal 'invalid'
[00:14:58]                 │       + expected - actual
[00:14:58]                 │ 
[00:14:58]                 │       -partially_valid
[00:14:58]                 │       +invalid
[00:14:58]                 │       
[00:14:58]                 │       at Assertion.assert (/dev/shm/workspace/parallel/8/kibana/node_modules/@kbn/expect/expect.js:100:11)
[00:14:58]                 │       at Assertion.eql (/dev/shm/workspace/parallel/8/kibana/node_modules/@kbn/expect/expect.js:244:8)
[00:14:58]                 │       at Context.<anonymous> (test/api_integration/apis/ml/jobs/categorization_field_examples.ts:302:44)
[00:14:58]                 │       at runMicrotasks (<anonymous>)
[00:14:58]                 │       at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:14:58]                 │       at Object.apply (/dev/shm/workspace/parallel/8/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:14:58]                 │ 
[00:14:58]                 │ 

Stack Trace

Error: expected 'partially_valid' to sort of equal 'invalid'
    at Assertion.assert (/dev/shm/workspace/parallel/8/kibana/node_modules/@kbn/expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/parallel/8/kibana/node_modules/@kbn/expect/expect.js:244:8)
    at Context.<anonymous> (test/api_integration/apis/ml/jobs/categorization_field_examples.ts:302:44)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.apply (/dev/shm/workspace/parallel/8/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16) {
  actual: 'partially_valid',
  expected: 'invalid',
  showDiff: true
}

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
monitoring 523 516 -7

Async chunks

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

id before after diff
monitoring 489.1KB 485.3KB -3.8KB

Page load bundle

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

id before after diff
monitoring 20.2KB 20.1KB -80.0B

History

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

@estermv estermv merged commit 7b7079b into elastic:master Oct 20, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
7.16 Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 115593

estermv added a commit to estermv/kibana that referenced this pull request Oct 20, 2021
…omponents (elastic#115593)

* remove getAngularInjector and old angular components

* Remove suffix from CcrShardReact component

* Remove suffix from ElasticsearchOverviewReact component

* Remove suffix from indexReact component

* Remove suffix from NodeReact component

* Remove suffix from ShardActivityReact

* Remove suffix from ShardAllocationReact component and its childs

* Fix import

* fix translations

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/monitoring/public/components/elasticsearch/node/node.js
estermv added a commit that referenced this pull request Oct 21, 2021
…gular components (#115593) (#115826)

* [Stack monitoring] Remove getAngularInjector and duplicated angular components (#115593)

* remove getAngularInjector and old angular components

* Remove suffix from CcrShardReact component

* Remove suffix from ElasticsearchOverviewReact component

* Remove suffix from indexReact component

* Remove suffix from NodeReact component

* Remove suffix from ShardActivityReact

* Remove suffix from ShardAllocationReact component and its childs

* Fix import

* fix translations

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/monitoring/public/components/elasticsearch/node/node.js

* Fix missing code not backported from #52276

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
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 Epic: Stack Monitoring de-angularization Feature:Stack Monitoring release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Stack monitoring] Remove getAngularInjector
4 participants