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

[Usage Collection & Telemetry] Migrate to TS project references #81017

Closed
7 tasks done
TinaHeiligers opened this issue Oct 19, 2020 · 9 comments · Fixed by #88073
Closed
7 tasks done

[Usage Collection & Telemetry] Migrate to TS project references #81017

TinaHeiligers opened this issue Oct 19, 2020 · 9 comments · Fixed by #88073
Assignees
Labels
Feature:Telemetry Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@TinaHeiligers
Copy link
Contributor

TinaHeiligers commented Oct 19, 2020

Summary

Now that the Kibana build system supports using TypeScript project references (#46773), the telemetry-related plugins must be migrated to participate. This is part of the overall effort tracked at #80508.

plugin migration status
kibana_usage_collection
newsfeed
telemetry
telemetry_collection_manager
telemetry_management_section
usage_collection
telemetry_collection_xpack

Migration order:

Blockers (removed)

telemetry_management_section depends on migration of the following first:

Acceptance criteria

The telemetry-related plugins can be referred to using a project reference, which means each...

  • has a tsconfig.json file which conforms to the documented form
  • references the dependencies
  • emits type definitions for its public API
  • compiles in tsc's build mode

Related information

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-telemetry (Team:KibanaTelemetry)

@Bamieh
Copy link
Member

Bamieh commented Oct 20, 2020

Thanks for creating the issue!

@TinaHeiligers
Copy link
Contributor Author

@restrry QQ on the guide's instructions:

List the reference to your newly created project in all the Kibana tsconfig.json files that could import your project: tsconfig.json, test/tsconfig.json, x-pack/tsconfig.json, x-pack/test/tsconfig.json. And in all the plugin-specific tsconfig.refs.json for dependent plugins.

I see some non-xpack plugins (e.g. kibana-legacy) aren't listed as refs in https://github.com/elastic/kibana/blob/master/x-pack/tsconfig.json and I've added some telemetry related ones. When should we be adding non-xpack refs and should I remove the telemetry related ones from exclude in that file?

@mshustov
Copy link
Contributor

I see some non-xpack plugins (e.g. kibana-legacy) aren't listed as refs in https://github.com/elastic/kibana/blob/master/x-pack/tsconfig.json and I've added some telemetry related ones.
When should we be adding non-xpack refs

That's okay, we do this to reduce number of processed for x-pack/tsconfig.json project.
node --max-old-space-size=6144 ./node_modules/.bin/tsc -p x-pack/tsconfig.json --extendedDiagnostics --noEmit
With project listed in refs: Files: 18224
without: Files: 18277

should I remove the telemetry related ones from exclude in that file?

Yes, you can delete them from excluded because src/plugins/** files do not belong to x-pack/tsconfig project.

We are going to delete all include & exclude sections as soon as all the code migrate to TS project refs.

@TinaHeiligers
Copy link
Contributor Author

TinaHeiligers commented Oct 21, 2020

@restrry thanks!
I'm trying to migrate the telemetry_collection_xpack plugin in PR 81269 and keep running into the following error with typescript checks:

18:34:25  /dev/shm/workspace/parallel/13/kibana/src/dev/typescript/project.ts:33
18:34:25      throw error;
18:34:25      ^
18:34:25  [object Object]

When I run node scripts/type_check locally, I also get that error and it's not very descriptive as to where the problem is. The plugin only has one other as a dependency and the tsconfig.json is fairly simple but obviously something's wrong. Have you seen this before and, if so, how would I get around it?

For anyone who happens to come across the same issue, the resolution was to fix the formatting in the tsconfig.json files.

@TinaHeiligers
Copy link
Contributor Author

TinaHeiligers commented Nov 30, 2020

@afharo Update: The blockers for migrating the telemetry_management_section plugin are still preventing us from finishing the work.

@afharo afharo added Feature:Telemetry Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc and removed Team:KibanaTelemetry labels Dec 10, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@afharo
Copy link
Member

afharo commented Dec 15, 2020

Update: still these blockers:

➜  kibana git:(master) node scripts/find_plugins_without_ts_refs.js --id telemetryManagementSection
 info Dependencies haven't been migrated to TS project refs yet:
      advancedSettings
      management
      home
      data
      bfetch
      expressions
      uiActions

@TinaHeiligers
Copy link
Contributor Author

Status update: The blockers listed previously are still holding up this work:

➜  kibana git:(master) node scripts/find_plugins_without_ts_refs.js --id telemetryManagementSection
 info Dependencies haven't been migrated to TS project refs yet:
      advancedSettings
      management
      home
      data
      bfetch
      expressions
      uiActions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Telemetry Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants