Skip to content

[release/3.1] Redo yarn install - #42173

Merged
dougbu merged 7 commits into
dotnet:release/3.1from
dougbu:dougbu/eventsource
Jun 18, 2022
Merged

dougbu merged 7 commits into
dotnet:release/3.1from
dougbu:dougbu/eventsource

Conversation

@dougbu

@dougbu dougbu commented Jun 13, 2022

Copy link
Copy Markdown
Contributor
  • get latest versions

@dougbu
dougbu requested a review from a team June 13, 2022 18:54
@dougbu
dougbu requested review from a team, BrennanConroy and halter73 as code owners June 13, 2022 18:54
@ghost ghost added this to the 3.1.x milestone Jun 13, 2022
@ghost

ghost commented Jun 13, 2022

Copy link
Copy Markdown

Hi @dougbu. If this is not a tell-mode PR, please make sure to follow the instructions laid out in the servicing process document.
Otherwise, please add tell-mode label.

@dougbu

dougbu commented Jun 13, 2022

Copy link
Copy Markdown
Contributor Author

Not sure this is quite what we want but I did the following:

  1. Remove url-parse from resolutions section of package.json
  2. rm yarn.lock
  3. yarn install

I suspect this isn't enough to clean up the branch because I got lots of warnings in the last step in most projects, mostly

warning @microsoft/signalr > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning @microsoft/signalr > request > [email protected]: this library is no longer supported
warning @microsoft/signalr > request > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the only mention of eventsource in a package.json file in this branch. The mention of @types/eventsource above is also unique. Should one or both be removed while I'm at it❔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is supposed to be here - should just update it to 1.1.1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll just leave it alone because yarn.lock shows 1.1.2 anyhow.

@dougbu dougbu added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jun 13, 2022
@ghost

ghost commented Jun 13, 2022

Copy link
Copy Markdown

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

@dougbu

dougbu commented Jun 13, 2022

Copy link
Copy Markdown
Contributor Author

@Pilchie should we treat this as tell-mode and should I notify Tactics❔

@dougbu

dougbu commented Jun 13, 2022

Copy link
Copy Markdown
Contributor Author

Build break may be due to an old version of npm or yarn, I'm not sure. Suggestions❔

node_modules/@types/node/assert.d.ts(44,94): error TS1144: '{' or ';' expected.

@BrennanConroy

Copy link
Copy Markdown
Member

Build break may be due to an old version of npm or yarn, I'm not sure. Suggestions❔

Looks like it's because >12.20.20 of @types/node package need Typescript version 3.7+
DefinitelyTyped/DefinitelyTyped#55430

@dougbu

dougbu commented Jun 13, 2022 •

Copy link
Copy Markdown
Contributor Author

Build break may be due to an old version of npm or yarn, I'm not sure. Suggestions❔

Looks like it's because >12.20.20 of @types/node package need Typescript version 3.7+
DefinitelyTyped/DefinitelyTyped#55430

Any downside to updating the TS version❔

@BrennanConroy

Copy link
Copy Markdown
Member

Probably new warnings/errors showing up in the code, but it should be fine otherwise, webpack should be controlling how the app is packaged and what format (ES5 etc.) to use.

@dougbu

dougbu commented Jun 13, 2022

Copy link
Copy Markdown
Contributor Author

Also hitting lots of version resolution issues w/ System.Text.Encodings.Web. Did you make a change in that area recently @wtgodbe❔ Any issues if I pin the newer version in the affected bunch o' projects❔

@dotnet/aspnet-blazor-eng the other warning about STEW is

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277: Found conflicts between different versions of "System.Text.Encodings.Web" that could not be resolved. [D:\a\_work\1\s\src\Components\Ignitor\src\Ignitor.csproj]

But we create a non-shipping Ignitor package. Can the STEW version be pinned there too❔


/fyi @BrennanConroy most of those issues are in SignalR test, benchmarks, and sample projects.

@wtgodbe

wtgodbe commented Jun 13, 2022

Copy link
Copy Markdown
Member

Also hitting lots of version resolution issues w/ System.Text.Encodings.Web. Did you make a change in that area recently @wtgodbe❔ Any issues if I pin the newer version in the affected bunch o' projects❔

I believe I did, but don't remember seeing any errors - pinning should be fine

@dougbu

dougbu commented Jun 13, 2022

Copy link
Copy Markdown
Contributor Author

Going back to the npm / TypeScript issue, I think the new errors are related primarily to our "request": "^2.88.0" dependency or the "@types/request": "^2.47.1" dev dependency in this branch, specifically the src/SignalR/clients/ts/signalr/package.json file. We don't have either in 'main' and also don't hit these errors there. Since the request package has been deprecated, should I remove them from package.json instead of bumping the typescript version❔

@BrennanConroy

Copy link
Copy Markdown
Member

Since the request package has been deprecated, should I remove them from package.json

No, there is a reason we depend on it

@dougbu

dougbu commented Jun 13, 2022

Copy link
Copy Markdown
Contributor Author

Well, it is request that's bringing in too new a version of @types/node for TypeScript:

"@types/request@^2.47.1":
  version "2.48.8"
  resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.8.tgz#0b90fde3b655ab50976cb8c5ac00faca22f5a82c"
  integrity sha512-whjk1EDJPcAR2kYHRbFl/lKeeKYTi05A15K9bnLInCVroNDCtXce57xKdI0/rQaA3K+6q0eFyUBPmqfSndUZdQ==
  dependencies:
    "@types/caseless" "*"
    "@types/node" "*"
    "@types/tough-cookie" "*"
    form-data "^2.5.0"

I'll bump typescript since it's a dev dependency and hope for the best

@Pilchie

Pilchie commented Jun 13, 2022

Copy link
Copy Markdown
Member

I think this and related changes are fine for tell-mode

@dougbu
dougbu enabled auto-merge (squash) June 14, 2022 00:03
@BrennanConroy

Copy link
Copy Markdown
Member

src/HandshakeProtocol.ts(42,59): error TS2345: Argument of type 'Uint8Array' is not assignable to parameter of type 'number[]'. [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/HandshakeProtocol.ts(42,59): error TS2345: Argument of type 'Uint8Array' is not assignable to parameter of type 'number[]'.
Type 'Uint8Array' is missing the following properties from type 'number[]': pop, push, concat, shift, and 3 more.
src/HttpConnection.ts(437,29): error TS2322: Type 'unknown' is not assignable to type 'Error | ITransport'. [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/HttpConnection.ts(437,29): error TS2322: Type 'unknown' is not assignable to type 'Error | ITransport'.
src/HubConnection.ts(232,40): error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error | undefined'. [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/HubConnection.ts(232,40): error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error | undefined'.
src/HubConnection.ts(740,13): error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead? [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/HubConnection.ts(740,13): error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
src/HubConnection.ts(773,21): error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead? [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/HubConnection.ts(773,21): error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
src/HubConnection.ts(794,65): error TS2571: Object is of type 'unknown'. [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/HubConnection.ts(794,65): error TS2571: Object is of type 'unknown'.
src/LongPollingTransport.ts(153,113): error TS2571: Object is of type 'unknown'. [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/LongPollingTransport.ts(153,113): error TS2571: Object is of type 'unknown'.
src/LongPollingTransport.ts(160,29): error TS2322: Type 'unknown' is not assignable to type 'Error | undefined'. [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/LongPollingTransport.ts(160,29): error TS2322: Type 'unknown' is not assignable to type 'Error | undefined'.
src/ServerSentEventsTransport.ts(75,40): error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error | undefined'. [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/ServerSentEventsTransport.ts(75,40): error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error | undefined'.
src/ServerSentEventsTransport.ts(81,17): error TS2322: Type '(e: MessageEvent) => void' is not assignable to type '(this: EventSource, ev: Event) => any'. [D:\a_work\1\s\src\SignalR\clients\ts\signalr\signalr.npmproj]
##[error]src/ServerSentEventsTransport.ts(81,17): error TS2322: Type '(e: MessageEvent) => void' is not assignable to type '(this: EventSource, ev: Event) => any'.
Types of parameters 'e' and 'ev' are incompatible.
Type 'Event' is missing the following properties from type 'MessageEvent': data, lastEventId, origin, ports, and 2 more.

Like I said, errors 😆

@dougbu

dougbu commented Jun 14, 2022

Copy link
Copy Markdown
Contributor Author

Glad you're pleased @BrennanConroy 😃 I could either mosey through the specific errors or try porting the portions of 739f585 that updated the src/SignalR/clients/ts/signalr/src/*.ts files in 'main'. Thoughts❔

@BrennanConroy

Copy link
Copy Markdown
Member

That change isn't going to be helpful, Typescript was already at 4.x by then.
#29905 is the best you'd be able to draw inspiration from

@dougbu

dougbu commented Jun 14, 2022

Copy link
Copy Markdown
Contributor Author

#29905 is the best you'd be able to draw inspiration from

I'm inspired but won't get back to it for a couple of hours.

@vseanreesermsft @mmitche how much time do I have to get release/3.1 building today❔

@dougbu

dougbu commented Jun 14, 2022

Copy link
Copy Markdown
Contributor Author

This isn't quite enough but I'll look at the remaining errors tomorrow

src/HttpConnection.ts(437,29): error TS2322: Type 'unknown' is not assignable to type 'Error | ITransport'. [...\src\SignalR\clients\ts\signalr\signalr.npmproj]
src/HubConnection.ts(232,40): error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error |undefined'. [...\src\SignalR\clients\ts\signalr\signalr.npmproj]
src/HubConnection.ts(794,65): error TS2571: Object is of type 'unknown'. [...\src\SignalR\clients\ts\signalr\signalr.npmproj]
src/LongPollingTransport.ts(153,113): error TS2571: Object is of type 'unknown'. [...\src\SignalR\clients\ts\signalr\signalr.npmproj]
src/LongPollingTransport.ts(160,29): error TS2322: Type 'unknown' is not assignable to type 'Error | undefined'. [...\src\SignalR\clients\ts\signalr\signalr.npmproj]
src/ServerSentEventsTransport.ts(75,40): error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error | undefined'. [...\src\SignalR\clients\ts\signalr\signalr.npmproj]

@dougbu

dougbu commented Jun 14, 2022

Copy link
Copy Markdown
Contributor Author

Current iteration will likely fail w/ Module versus module problems in src/Components/*.ts files. I think 19252d6 may contain some of what's needed to fix things but that looks like a fairly major refactoring and might depend on WASM changes that weren't made here. Looking for and greatly appreciating help from @dotnet/aspnet-blazor-eng because I don't understand TypeScript versions enough to know what may have busted things.

@dougbu

dougbu commented Jun 15, 2022

Copy link
Copy Markdown
Contributor Author

Errors already visible in macOS build:

  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Boot.WebAssembly.ts(68,16)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Boot.WebAssembly.ts(68,42)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Boot.WebAssembly.ts(70,7)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
...
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(17,44)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(18,44)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(19,46)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(24,20)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(29,46)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(67,27)
        TS2304: Cannot find name 'Module'.
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(188,54)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(243,5)
        TS2322: Type '(arg_0: number) => number' is not assignable to type '(managedString: System_String) => Pointer'.
    Types of parameters 'arg_0' and 'managedString' are incompatible.
      Type 'System_String' is not assignable to type 'number'.
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(319,27)
        TS2552: Cannot find name 'Module'. Did you mean 'module'?
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts(320,41)
        TS2304: Cannot find name 'Module'.
...
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/TimezoneDataFile.ts(32,5)
        TS2304: Cannot find name 'Module'.
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/TimezoneDataFile.ts(34,7)
        TS2304: Cannot find name 'Module'.
  [tsl] ERROR in /Users/runner/work/1/s/src/Components/Web.JS/src/Platform/Mono/TimezoneDataFile.ts(38,7)
        TS2304: Cannot find name 'Module'.

@dougbu

dougbu commented Jun 15, 2022

Copy link
Copy Markdown
Contributor Author

@BrennanConroy I also see a lot of new apparent syntax errors starting at https://dev.azure.com/dnceng/public/_build/results?buildId=1825044&view=logs&j=f43b187f-6c15-531c-a59b-e4fba4e9ed20&t=9e357cb9-1774-5509-1b39-7d8136be93e2&l=1122 with

  FAIL signalr/tests/HubConnection.test.ts
    ● Test suite failed to run
  
      TypeScript diagnostics (customize using `[jest-config].globals.ts-jest.diagnostics` option):
      signalr/tests/HubConnection.test.ts:25:1 - error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.

Suggestions appreciated❕

Comment thread src/SignalR/clients/ts/jest.config.js Resolved
Comment thread src/SignalR/clients/ts/jest.config.js Resolved
- get latest versions
@dougbu

dougbu commented Jun 15, 2022

Copy link
Copy Markdown
Contributor Author

@dotnet/aspnet-blazor-eng please comment on the many problems compiling in src/Components/Web.JS/Microsoft.AspNetCore.Components.Web.JS.npmproj w/ the new TypeScript version. That's the remaining build problem in this PR.

@dougbu

dougbu commented Jun 15, 2022

Copy link
Copy Markdown
Contributor Author

@BrennanConroy some SignalR tests are also failing, specifically in client-ts.npmproj and SignalR.Npm.FunctionalTests.npmproj. I suspect the issues are compilation errors that aren't caught when building. But one message worries me:

ts-jest[versions] (WARN) Version 4.7.3 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.

Do we need to update ts-jest too❔

@BrennanConroy

Copy link
Copy Markdown
Member

Let's step back here, what is the overall goal? Is it just to fixup things like getting eventsource to be version 1.1.2? If so we should try not to update the entire world in a patch branch and do the minimal updates needed.

@dougbu

dougbu commented Jun 15, 2022

Copy link
Copy Markdown
Contributor Author

Let's step back here, what is the overall goal? Is it just to fixup things like getting eventsource to be version 1.1.2?

That's my aim at least.

If so we should try not to update the entire world in a patch branch and do the minimal updates needed.

I agree but the rolling stone is gathering moss.

@dougbu

dougbu commented Jun 15, 2022

Copy link
Copy Markdown
Contributor Author

I'm wondering for example if we could undo the TypeScript upgrade and downstream changes. Then, turn left instead of right and for example use resolutions to limit the @types/node version. Could that work❔

dougbu added 2 commits June 15, 2022 17:48
- avoid package resolution (`MSB3277`) warnings
- avoid version that dropped support for TypeScript < 3.7
- see DefinitelyTyped/DefinitelyTyped#55430

@dougbu dougbu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Trying my alternative to bumping the typescript version…

"resolutions": {
"url-parse": ">=1.5.8"
"//": "Avoid version that drops support for TypeScript < 3.7",
"@types/node": "<12.20.21"

@dougbu dougbu Jun 16, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With this and removing "@types/node": "^10.9.4" under devDependencies above, 12.20.20 gets resolved everywhere. Is that better or worse than current settings, which resolve 10.17.60 for everything except request (which gets 12.20.20)❔

@dougbu

dougbu commented Jun 18, 2022

Copy link
Copy Markdown
Contributor Author

General story w/ the last few commits is that we use old enough versions of typescript that yarn install tends to grab unusable versions of various packages. Seems more than just @types/node drop compatibility w/ typescript packages of a certain age in their patch or minor version updates ☹️

@dougbu
dougbu merged commit 014b815 into dotnet:release/3.1 Jun 18, 2022
@dougbu
dougbu deleted the dougbu/eventsource branch June 18, 2022 05:06
@dougbu

dougbu commented Jun 18, 2022

Copy link
Copy Markdown
Contributor Author

@vseanreesermsft @mmitche I don't remember enabling auto-merge and am sorry this went in. Did the new commit cause problems anywhere❔ Should I revert it or perhaps force push the branches back the way they were❔

@wtgodbe

wtgodbe commented Jun 20, 2022

Copy link
Copy Markdown
Member

I believe the 3.1 build is already staged, in which case we'd be fine - generally though, with servicing builds, the problem is not the new commit, it's the new build which triggers new PRs, so reverting actually makes things worse (and force-pushing causes new problems if the updated dependency has already flowed, since now nonexistant commits are getting referenced). The best thing to do is to cancel the triggered build in time, or close the opened dependency update PRs. If any of those auto-opened PRs have already been merged, it's pretty much too late & we have to let everything flow

@dougbu dougbu modified the milestones: 3.1.x, 3.1.27 Jul 12, 2022
@dougbu dougbu added the tell-mode Indicates a PR which is being merged during tell-mode label Jul 12, 2022
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework tell-mode Indicates a PR which is being merged during tell-mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants