Skip to content

[eslint] add rule to forbid async subscribe bodies#112042

Closed
spalger wants to merge 14 commits intoelastic:mainfrom
spalger:implement/eslint-no-async-subscribe
Closed

[eslint] add rule to forbid async subscribe bodies#112042
spalger wants to merge 14 commits intoelastic:mainfrom
spalger:implement/eslint-no-async-subscribe

Conversation

@spalger
Copy link
Contributor

@spalger spalger commented Sep 14, 2021

WIP, based on #111637

@kibanamachine
Copy link
Contributor

kibanamachine commented Sep 14, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / general / Jest Integration Tests.src/cli/serve/integration_tests.cli invalid config support exits with statusCode 64 and logs a single line when config is invalid

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 17 times on tracked branches: https://github.com/elastic/kibana/issues/32240


Stack Trace

Error: expect(received).toContain(expected) // indexOf

Expected substring: "Error: Unknown configuration key(s): \"unknown.key\", \"other.unknown.key\", \"other.third\", \"some.flat.key\", \"some.array\". Check for spelling errors and ensure that expected plugins are installed."
Received string:    "/dev/shm/workspace/parallel/3/kibana/src/core/public/index.scss:1
@import './variables';
^·
SyntaxError: Invalid or unexpected token
    at compileFunction (<anonymous>)
    at wrapSafe (internal/modules/cjs/loader.js:988:16)
    at Module._compile (internal/modules/cjs/loader.js:1036:27)
    at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Object.newLoader [as .js] (/dev/shm/workspace/parallel/3/kibana/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at Module.Hook._require.Module.require (/dev/shm/workspace/parallel/3/kibana/node_modules/require-in-the-middle/index.js:80:39)
    at Module.Hook._require.Module.require (/dev/shm/workspace/parallel/3/kibana/node_modules/require-in-the-middle/index.js:80:39)
    at Module.Hook._require.Module.require (/dev/shm/workspace/parallel/3/kibana/node_modules/require-in-the-middle/index.js:80:39)
    at Module.Hook._require.Module.require (/dev/shm/workspace/parallel/3/kibana/node_modules/require-in-the-middle/index.js:80:39)
    at Module.Hook._require.Module.require (/dev/shm/workspace/parallel/3/kibana/node_modules/require-in-the-middle/index.js:80:39)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/dev/shm/workspace/parallel/3/kibana/src/core/public/index.ts:67:1)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)"
    at Object.<anonymous> (/dev/shm/workspace/parallel/3/kibana/src/cli/serve/integration_tests/invalid_config.test.ts:63:36)
    at Promise.then.completed (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-circus/build/utils.js:276:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-circus/build/utils.js:216:10)
    at _callCircusTest (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-circus/build/run.js:212:40)
    at _runTest (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/dev/shm/workspace/parallel/3/kibana/node_modules/jest-runner/build/runTest.js:472:34)

Kibana Pipeline / jest / Jest Tests.src/core/server/elasticsearch.#stop stops pollEsNodeVersions even if there are active subscriptions

Link to Jenkins

Standard Out

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


Stack Trace

Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)

Expected number of calls: 2
Received number of calls: 1
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/elasticsearch/elasticsearch_service.test.ts:394:37)

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
core 367 368 +1

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
core 997 1000 +3

Async chunks

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

id before after diff
enterpriseSearch 2.1MB 2.1MB -6.0B
lens 1.6MB 1.6MB +165.0B
maps 3.2MB 3.2MB +81.0B
observability 550.2KB 550.3KB +101.0B
security 764.1KB 764.2KB +114.0B
visTypeVislib 547.6KB 547.7KB +106.0B
visualizations 101.4KB 101.4KB -6.0B
visualize 87.0KB 87.1KB +178.0B
total +733.0B

Page load bundle

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

id before after diff
core 408.1KB 408.5KB +380.0B
embeddable 184.2KB 184.2KB -10.0B
kbnUiSharedDeps-elastic 2.7MB 2.7MB +11.0B
kbnUiSharedDeps-js 6.5MB 6.5MB +2.3KB
maps 80.7KB 80.8KB +66.0B
ml 65.0KB 65.1KB +123.0B
observability 59.0KB 59.1KB +66.0B
security 84.3KB 84.3KB +54.0B
telemetry 37.5KB 38.1KB +557.0B
visTypeVislib 32.0KB 32.0KB +66.0B
total +3.6KB
Unknown metric groups

API count

id before after diff
core 2249 2252 +3

References to deprecated APIs

id before after diff
maps 1173 1176 +3

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

@spalger spalger closed this Oct 31, 2021
@spalger spalger deleted the implement/eslint-no-async-subscribe branch October 31, 2021 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants