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

[Fleet] Use TS project references #87574

Merged
merged 29 commits into from
Feb 9, 2021

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Jan 6, 2021

Summary

  • Added references to all dependencies
    "references": [
    { "path": "../../../src/core/tsconfig.json" },
    // add references to other TypeScript projects the plugin depends on
    // requiredPlugins from ./kibana.json
    { "path": "../licensing/tsconfig.json" },
    { "path": "../../../src/plugins/data/tsconfig.json" },
    { "path": "../encrypted_saved_objects/tsconfig.json" },
    // optionalPlugins from ./kibana.json
    { "path": "../security/tsconfig.json" },
    { "path": "../features/tsconfig.json" },
    { "path": "../cloud/tsconfig.json" },
    { "path": "../../../src/plugins/usage_collection/tsconfig.json" },
    { "path": "../../../src/plugins/home/tsconfig.json" },
    // requiredBundles from ./kibana.json
    { "path": "../../../src/plugins/kibana_react/tsconfig.json" },
    { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" },
    { "path": "../infra/tsconfig.json" },
    { "path": "../../../src/plugins/kibana_utils/tsconfig.json" },
    ]
  • node scripts/check_ts_projects is successful
  • node scripts/build_ts_refs is successful
node --max-old-space-size=4096 ./node_modules/.bin/tsc -p tsconfig.json --extendedDiagnostics --noEmit
Files:                        1436
Lines:                      267372
Nodes:                     1016769
Identifiers:                361835
Symbols:                    250405
Types:                       31105
Instantiations:              57570
Memory used:               347817K
Assignability cache size:     5597
Identity cache size:          3073
Subtype cache size:           2140
Strict subtype cache size:    1012
I/O Read time:               0.49s
Parse time:                  3.84s
ResolveModule time:          1.59s
ResolveTypeReference time:   0.16s
Program time:                7.46s
Bind time:                   1.87s
Check time:                  4.02s
printTime time:              0.00s
Emit time:                   0.00s
Total time:                 13.35s

@jfsiii jfsiii requested a review from a team January 6, 2021 20:32
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Jan 6, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@jfsiii jfsiii requested a review from mshustov January 6, 2021 20:32
@jfsiii jfsiii self-assigned this Jan 6, 2021
@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 7, 2021

Looks like I missed an entry. Check TS projects fails with

15:44:07  $ /dev/shm/workspace/parallel/12/kibana/node_modules/.bin/github-checks-reporter 'Check TypeScript Projects' node scripts/check_ts_projects
15:44:08  GitHub checks API - 13796 remaining out of 15000/hour
15:44:26  ERROR The following files do not belong to a tsconfig.json file, or that tsconfig.json file is not listed in src/dev/typescript/projects.ts
15:44:26         - x-pack/plugins/fleet/common/constants/agent.ts
15:44:26         - x-pack/plugins/fleet/common/constants/agent_policy.ts
...all the rest of the plugin files

@mshustov
Copy link
Contributor

mshustov commented Jan 7, 2021

@jfsiii yes, include should list all the folders to compile:

  "include": [
    "public/**/*",
    "server/**/*",
    "common/**/*"
  ]

@jfsiii jfsiii added the release_note:skip Skip the PR/issue when compiling release notes label Jan 7, 2021
@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 7, 2021

@elasticmachine merge upstream

@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 7, 2021

@restrry I added the include entries & linked the data plugin. Any idea about the CI failure ? Anything I should change here?

@jfsiii jfsiii linked an issue Jan 7, 2021 that may be closed by this pull request
16 tasks
@jfsiii jfsiii requested a review from a team January 7, 2021 20:31
@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 7, 2021

@restrry I found the source of the 10,000 errors. I wasn't extending the x-pack tsconfig fff562d

@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 11, 2021

@elasticmachine merge upstream

@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 11, 2021

Seeing these errors locally after enabled the features project reference in 3b4aed8

src/plugins/management/target/types/public/management_sections_service.d.ts:2:54 - error TS2307: Cannot find module '../../kibana_utils/public' or its corresponding type declarations.

2 declare const getSectionsServiceStartPrivate: import("../../kibana_utils/public").Get<ManagementSectionsStartPrivate>;
                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/management/target/types/public/plugin.d.ts:2:39 - error TS2307: Cannot find module '../../home/public' or its corresponding type declarations.

2 import { HomePublicPluginSetup } from '../../home/public';
                                        ~~~~~~~~~~~~~~~~~~~

src/plugins/management/target/types/public/plugin.d.ts:3:72 - error TS2307: Cannot find module '../../../core/public' or its corresponding type declarations.

3 import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '../../../core/public';
                                                                         ~~~~~~~~~~~~~~~~~~~~~~

src/plugins/management/target/types/public/types.d.ts:3:34 - error TS2307: Cannot find module '../../../core/public/' or its corresponding type declarations.

3 import { ChromeBreadcrumb } from '../../../core/public/';
                                   ~~~~~~~~~~~~~~~~~~~~~~~


Found 4 errors.

Pushed to see if they fail in CI as well. If so, I'll follow up with core to confirm a) they're issues outside the Fleet plugin b) what to do next

@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 12, 2021

@elasticmachine merge upstream

// optionalPlugins from ./kibana.json
{ "path": "../security/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
// TODO { "path": "../cloud/tsconfig.json" },
Copy link
Contributor

Choose a reason for hiding this comment

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

cloud should be available soon: #88676

@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 20, 2021

@elasticmachine merge upstream

@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 22, 2021

@elasticmachine merge upstream

@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 25, 2021

@elasticmachine merge upstream

@pgayvallet
Copy link
Contributor

Btw, how is the build passing given that?

// TODO { "path": "../infra/tsconfig.json" },

@jfsiii
Copy link
Contributor Author

jfsiii commented Jan 26, 2021

@pgayvallet fair question, but I don't know. It's been building without issues since there were many more

// requiredPlugins from ./kibana.json
{ "path": "../licensing/tsconfig.json" },
{ "path": "../../../src/plugins/data/tsconfig.json" },
// TODO { "path": "../encrypted_saved_objects/tsconfig.json" },
// optionalPlugins from ./kibana.json
// TODO { "path": "../security/tsconfig.json" },
// TODO { "path": "../features/tsconfig.json" },
// TODO { "path": "../cloud/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../../../src/plugins/home/tsconfig.json" },
// requiredBundles from ./kibana.json
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
// TODO { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" },
// TODO { "path": "../infra/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_utils/tsconfig.json" },

@jfsiii
Copy link
Contributor Author

jfsiii commented Feb 8, 2021

@elasticmachine merge upstream

@jfsiii
Copy link
Contributor Author

jfsiii commented Feb 8, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@jfsiii jfsiii requested a review from pgayvallet February 8, 2021 19:21
@jfsiii
Copy link
Contributor Author

jfsiii commented Feb 8, 2021

ping @restrry & @pgayvallet. All dependencies are linked and CI is 💚

@jfsiii jfsiii merged commit af75079 into elastic:master Feb 9, 2021
jfsiii pushed a commit to jfsiii/kibana that referenced this pull request Feb 9, 2021
## Summary
 * Added references to all dependencies
    https://github.com/elastic/kibana/blob/6bc6f3459a120eddfae70ad2fc7e4669e3a996b0/x-pack/plugins/fleet/tsconfig.json#L17-L38
 * `node scripts/check_ts_projects` is successful
 * `node scripts/build_ts_refs` is successful
<details><summary><code>node --max-old-space-size=4096 ./node_modules/.bin/tsc -p tsconfig.json --extendedDiagnostics --noEmit</code></summary>

```
Files:                        1436
Lines:                      267372
Nodes:                     1016769
Identifiers:                361835
Symbols:                    250405
Types:                       31105
Instantiations:              57570
Memory used:               347817K
Assignability cache size:     5597
Identity cache size:          3073
Subtype cache size:           2140
Strict subtype cache size:    1012
I/O Read time:               0.49s
Parse time:                  3.84s
ResolveModule time:          1.59s
ResolveTypeReference time:   0.16s
Program time:                7.46s
Bind time:                   1.87s
Check time:                  4.02s
printTime time:              0.00s
Emit time:                   0.00s
Total time:                 13.35s
```
</details>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Feb 9, 2021
…timeline-and-rollover-info

* 'master' of github.com:elastic/kibana: (47 commits)
  [Fleet] Use TS project references (elastic#87574)
  before/beforeEach clean up (elastic#90663)
  [Vega] user should be able to set a specific tilemap service using the mapStyle property (elastic#88440)
  [Security Solution][Case] ServiceNow SIR Connector (elastic#88655)
  [Search Sessions] Enable extend from management (elastic#90558)
  [ILM] Delete phase redesign (rework) (elastic#90291)
  [APM-UI][E2E] use withGithubStatus step (elastic#90651)
  Add folding in kb-monaco and update some viewers (elastic#90152)
  [Grok Debugger] Changed test to wait for grok debugger container to exist to fix test flakiness (elastic#90543)
  Strongly typed EUI theme for styled-components (elastic#90106)
  Fix vega renovate label (elastic#90591)
  [Uptime] Migrate to TypeScript project references (elastic#90510)
  [Monitoring] Migrate data source for legacy alerts to monitoring data directly (elastic#87377)
  [Upgrade Assistant] Add A11y Tests (elastic#90265)
  [Time to Visualize] Adds functional tests for linking/unlinking panel from embeddable library (elastic#89612)
  [dev-utils/ship-ci-stats] fail when CI stats is down (elastic#90678)
  chore(NA): remove write permissions on Bazel remote cache for PRs (elastic#90652)
  chore(NA): move bazel workspace status from bash script into nodejs executable (elastic#90560)
  Use default ES distribution for functional tests (elastic#88737)
  [Alerts] Jira: Disallow labels with spaces (elastic#90548)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/timeline/timeline.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/lib/absolute_timing_to_relative_timing.test.ts
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/lib/absolute_timing_to_relative_timing.ts
jfsiii pushed a commit that referenced this pull request Feb 9, 2021
## Summary
 * Added references to all dependencies
    https://github.com/elastic/kibana/blob/6bc6f3459a120eddfae70ad2fc7e4669e3a996b0/x-pack/plugins/fleet/tsconfig.json#L17-L38
 * `node scripts/check_ts_projects` is successful
 * `node scripts/build_ts_refs` is successful
<details><summary><code>node --max-old-space-size=4096 ./node_modules/.bin/tsc -p tsconfig.json --extendedDiagnostics --noEmit</code></summary>

```
Files:                        1436
Lines:                      267372
Nodes:                     1016769
Identifiers:                361835
Symbols:                    250405
Types:                       31105
Instantiations:              57570
Memory used:               347817K
Assignability cache size:     5597
Identity cache size:          3073
Subtype cache size:           2140
Strict subtype cache size:    1012
I/O Read time:               0.49s
Parse time:                  3.84s
ResolveModule time:          1.59s
ResolveTypeReference time:   0.16s
Program time:                7.46s
Bind time:                   1.87s
Check time:                  4.02s
printTime time:              0.00s
Emit time:                   0.00s
Total time:                 13.35s
```
</details>
@jfsiii jfsiii deleted the 82220-use-ts-project-references branch April 6, 2021 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] TS project references migration
5 participants