-
Notifications
You must be signed in to change notification settings - Fork 561
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
chore: upgrade to typescript 4.8 #3875
Conversation
@magdziarek could you please take a look? Thank you! |
cee4945
to
35551c8
Compare
I just rebased this again... @novalex thank you for the approval! @teodora-sandu @jonathansantilli @admons @tonidevine1 and anyone else - Is there anything I can do to move this along? |
590c752
to
695699e
Compare
695699e
to
ea11ba2
Compare
Dear @candrews, |
Thanks for this information and for enabling workflows! I'll get right on figuring out and addressing these issues. |
9b345d6
to
b34f84a
Compare
@PeterSchafer I've updated this PR - all failures have been fixed. When I run
Thank you again for taking a look, approving the workflow, and providing feedback. I believe your concerns have now been addressed, so hopefully this is now ready to merge. |
b34f84a
to
8ec1309
Compare
@PeterSchafer I updated this PR fixing the error in |
@candrews Thanks for the additional changes. I just triggered |
I'm sorry I forgot to do that :(
I fixed the "tap" test compilation errors. I get failures in the tests themselves, but I'm hoping that's due to my system's setup and that they pass when run in the workflow environment. The node 12 tests is failing because Typescript no longer Node 12. Node 12 has been end of life and out of support since 30 Apr 2022 (5 months ago). Therefore I suggest Snyk stop running tests with it; I've added a commit to do so. I don't know why the 2 windows tests, v2 / Jest Acceptance Tests (windows/amd64) and Acceptance Tests (snyk-win.exe), are failing. The tests don't have any output that indicates what the problem is. If you give me some hints as to what the problem is or how I can reproduce it, I'd be happy to do my best to fix it. |
8ec1309
to
8709316
Compare
825ddc1
to
4856ab8
Compare
a3fda59
to
fff6c57
Compare
The output can contain ansi escape sequences which must be stripped to ensure consistent test behavior.
node-tap automatically runs tests in parallel instead of one at at time. See: https://node-tap.org/changelog/#130---2019-04-25 node-tap 15.0 changed the behavior of teardown, making it asynchronous. See: https://node-tap.org/changelog/#150---2021-03-30 Therefore one tap tests may be running while another runs or while another has finished running but hasn't finished executing teardown. With all tests using the same port, 12345, multiple tests would try to start a server on that port at the same time resulting it tests randomly failing with: listen EADDRINUSE: address already in use :::12345 Using a different port per process eliminates this problem. See: https://node-tap.org/docs/api/parallel-tests/
Since tap tests can run in parallel, if multiple tap tests use the same configuration directory and they try to update configuration, they'll overwrite each other and end up in indeterminate states, causing unexpected test failures.
Node 12 went end of life on April 30, 2022. See: https://twitter.com/nodejs/status/1524081123579596800 See: https://github.com/nodejs/Release#release-schedule Signed-off-by: Craig Andrews <[email protected]>
Upgrade typescript from 3.9.10 to 4.8.4 Includes necessary upgrades to these packages as well: @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-jest jest tap ts-jest ts-loader ts-node Signed-off-by: Craig Andrews <[email protected]>
Solves error when using node 17 (and later): Error: error:0308010C:digital envelope routines::unsupported See: webpack/webpack#14532
fff6c57
to
e72d1fa
Compare
I found (and fixed) more race conditions in the tap tests. Can you please run the workflow so can I see if there's anything else wrong? I continue to not know why the Windows tests faill; I am eager to get whatever information you can share about them. |
I have no idea what this means. And the link goes to an access denied page. |
That is a check for newly introduced vulnerabilities, but the 9 detected issues are just because of the test file changes and not actually new issues so have bypassed it. |
I broke this PR up into a few smaller ones that are easier to review in hope of making at least some progress 🤞 |
is this PR still relevant @candrews? or can we close it? |
It's still relevant. Snyk's typescript dependency is still out of date and per Snyk's own documentation, having out of date dependencies is problematic for maintainbility as well as security. |
okay then, I thought this would be done in more, smaller PRs from the comment here #3875 (comment) |
I'd love to get this done in whatever works for Snyk - big PR or small PRs, whatever we can actually do to make progress would be great from my perspective. If Snyk wants to do smaller PRs, can the workflows please be run for them, and then we can merge them? #4147 might be a nice starting point. |
no problem by me, I was only going through the pull request reviews pending, and noticed the comment I mentioned. feel free to work in any way you prefer :) |
This upgrade has now been implemented as part of #5046 |
What does this PR do?
Upgrade typescript from 3.9.10 to 4.8.3
Includes necessary upgrades to these packages as well: @typescript-eslint/eslint-plugin
@typescript-eslint/parser
eslint
eslint-config-prettier
eslint-plugin-jest
jest
tap
ts-jest
ts-loader
ts-node
Where should the reviewer start?
There's no functional change here. The only changes made are the results newly identified issues from the upgraded typescript and eslint.
How should this be manually tested?
Run snyk :)
Any background context you want to provide?
Using the latest versions of dependencies is a general best practice for a number of reasons.
My primary motivation here is that I want to add a feature to snyk cli (for which I will submit a pull request in the future) that uses a dependency that's written in Typescript 4.8, and Typescript 3.9 (which snyk cli currently uses) cannot compile against it.
What are the relevant tickets?
Screenshots
Additional questions