-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ci(NODE-5098): download node to local directory #3583
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
Conversation
cfd40d1
to
84114d0
Compare
# index.tab is a sorted tab separated values file with the following headers | ||
# 0 1 2 3 4 5 6 7 8 9 10 | ||
# version date files npm v8 uv zlib openssl modules lts security | ||
curl --retry 8 -sS "https://nodejs.org/dist/index.tab" --max-time 300 --output node_index.tab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a long script, could we consider breaking it into smaller functions? Or moving the logic that determines the download URL into a separate file? That might help with the readability and modularity of the script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's shorter than the script that proceeded it, I'd like to keep it in one file to make the porting and future updating easier. Perhaps I could put functionality inside bash functions to organize it? but it will be longer as a result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really care about the length, if it's well organized. This file is just dense and the code is opaque. Some logical grouping might make it easier to work with in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use bash functions, we can then source this locally and test each component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the green CI not testing enough? we can't proceed if any step in this script fails, which part is opaque, can I improve variable names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the logic related to finding the correct version of Node and downloading it is a little confusing, and since there's no clear boundary as to when it starts and stops, it's hard to tell when you're reading the script when that portion of code is finished. This is why we use functions, to logically group related functionality and to make understanding the higher-level purpose and logic of a script easier to GROK at a glance
From a CI maintenance standpoint, ideally we never touch this code again. But if we do have to, I'd rather that it was logically group so that it's easier to reason about at the high level without reading and thoroughly understand the entire script.
And yes, you're right, a green CI means the script is passing. But if we ever have to touch this again, it would be nice if we could source the file and test it in a piecemeal fashion, as opposed to testing the script in its entirety or commenting out large chunks of code to test parts of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from slack, we're aligned on the shortness of the script and since we plan to copy it to many places we're agreed that its fine as is, we may in the future improve this if there's a significant change needed to support a platform we don't currently predict here
1736922
to
ad803cb
Compare
This reverts commit 84fab70.
This reverts commit 84fab70.
This reverts commit 84fab70.
Description
What is changing?
Download nodejs to a local node-artifacts directory
Don't impact the global environment of the host
What is the motivation for this change?
nvm windows modifies the global environment
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript