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

TypeScript 5.7 and fix coverage CI #10561

Merged
merged 6 commits into from
Nov 24, 2024
Merged

TypeScript 5.7 and fix coverage CI #10561

merged 6 commits into from
Nov 24, 2024

Conversation

turadg
Copy link
Member

@turadg turadg commented Nov 24, 2024

evergreen

Description

Bump Typescript to the 5.7 release
https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/

This also corrects a typo in the coverage job from #10560

Security Considerations

none

Scaling Considerations

none

Documentation Considerations

none

Testing Considerations

CI

Upgrade Considerations

none

@turadg turadg requested a review from a team as a code owner November 24, 2024 01:01
Copy link

cloudflare-workers-and-pages bot commented Nov 24, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 140ff5f
Status: ✅  Deploy successful!
Preview URL: https://62e8cd0f.agoric-sdk.pages.dev
Branch Preview URL: https://typescript-5-7.agoric-sdk.pages.dev

View logs

@@ -106,7 +106,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: generate test coverage report
run: ./scripts/ci/generage-test-coverage-report.sh
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I should have noticed this one. 😛

yarn.lock Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little leery of advancing to typescript@~5.7.1 when we're still getting errors that look like:

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.6.0

YOUR TYPESCRIPT VERSION: 5.6.3

Please only submit bug reports when using the officially supported version.

Even if we upgraded to typescript-eslint@^8.10.0 to get support for typescript@^5.6.0 (as https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.10.0 describes), there isn't yet a version of typescript-eslint that claims to support typescript@5.7.

Can we slow down our upgrades of typescript a little bit and first focus on upgrading to a version of the typescript-eslint toolchain that is officially supported?

Copy link
Member Author

@turadg turadg Nov 24, 2024

Choose a reason for hiding this comment

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

Fair. I've been working on that but it hasn't been a priority:

The reason I need TS 5.7 is for #10480 . Without it,

Error: tsconfig.build.json(7,5): error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.

The status quo is that we have this warning from typescript-eslint. Landing this PR doesn't change that. By the time we do update typescript-eslint, it will support 5.7 (already in master).

So I ask that you allow this PR to merge and if you want the lint error to go away you lobby that it be prioritized (vs other work, ofc).

Copy link
Member

Choose a reason for hiding this comment

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

I am not too concerned with the eslint warnings. They're par for the course

Copy link
Member

Choose a reason for hiding this comment

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

By the time we do update typescript-eslint, it will support 5.7 (typescript-eslint/typescript-eslint#10372).

I see typescript@5.7 support is already merged in typescript-eslint master, is currently in a canary release and will be officially released. That quells my concerns.

So I ask that you allow this PR to merge

Thanks for the additional context. Approved.

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

LGTM, except for a question on the runtime change in the reserve terms.

@@ -37,6 +37,15 @@ const FIRST_LOWER_NEAR_KEYWORD = /^[a-z][a-zA-Z0-9_$]*$/;
* @import {Bank, BankManager} from '@agoric/vats/src/vat-bank.js'
*/

// XXX when inferred, error TS2742: cannot be named without a reference to '../../../node_modules/@endo/exo/src/get-interface.js'. This is likely not portable. A type annotation is necessary.
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this error but explicit return values is totally acceptable anyway

@@ -2,8 +2,10 @@

import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance';

const makeReserveTerms = (poserInvitationAmount, timer) => ({
timer,
Copy link
Member

Choose a reason for hiding this comment

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

This is a change to the runtime behavior. A new chain will now no longer have the timer in the reserve terms where before that it would have. What is the motivation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Motivation is the caller never provided the argument and it's now detected. The runtime impact is that property will be omitted from the return instead of being undefined. I don't see anything checking for the key presence specifically.

Copy link
Member

Choose a reason for hiding this comment

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

Given lack of value at the caller site, that change sounds reasonable

yarn.lock Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I am not too concerned with the eslint warnings. They're par for the course

@@ -112,7 +112,7 @@ async function runTestScript(
/**
* Handle callback "command" from xsnap subprocess.
*
* @type { (msg: ArrayBuffer) => Promise<ArrayBuffer> }
* @type { (msg: ArrayBuffer) => Promise<Uint8Array<ArrayBufferLike>> }
Copy link
Member

Choose a reason for hiding this comment

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

This is a significant change of type. New one looks right but I'm surprised we didn't have an error before.

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

Thanks for clarifying the reserve terms change

@@ -2,8 +2,10 @@

import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance';

const makeReserveTerms = (poserInvitationAmount, timer) => ({
timer,
Copy link
Member

Choose a reason for hiding this comment

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

Given lack of value at the caller site, that change sounds reasonable

@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label Nov 24, 2024
@mergify mergify bot merged commit 5b09631 into master Nov 24, 2024
81 checks passed
@mergify mergify bot deleted the typescript-5.7 branch November 24, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants