-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Fix up "Use symbolic GitHub Actions Node.js versions (#49403)" #49420
Conversation
59ee071
to
6c9521f
Compare
I've added the The issue with that workflow was that between npm v6 and v7, The conclusion seems to have been that |
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Given we are using a v1 lockfile, we probably shouldn't have upgraded any of the workflows that could change the lockfile and push the code back; I'd like to see these brought back down to 14. Based on #49403, this means pretty much every workflow that isn't a test workflow should be restored back to Node 14 so NPM 6 is used; anything that messes with versions will change the lockfile (including the update-package-lock, set-version, sync-branch, release-branch-artifact, etc). It may also include any workflow that does Eventually, I think we'll be able to ignore this problem via corepack and specify which |
@jakebailey The v2 lockfile is backwards compatible to v1 lockfiles. I think this means we can use it with npm v6 as well as Node.js >= v16. I'll double check ... |
That is technically true, but causes pain for anyone who actually uses npm6 (like volta users who automatically get node14 when working in the TS repo), because the lockfile is converted back to v1, and then you have to deal with the fact that a committed file changed. Again, eventually we're going to change to v2, because 14 will be gone, but I don't think that a cleanup/tweak to our GitHub actions is the place to start requiring a totally different lockfile format. |
@jakebailey The reverse logic applies, no? Users on npm > v6 have to deal with the fact that the committed package-lock.json got converted to v2 vs. converted back to v1? I double checked and the npm v6 The only workflow that both runs |
That is true, but isn't feedback I've personally seen on the repo. I've seen at least one time a v2 lockfile was committed and had to be reversed, so it does happen. We aren't exactly good about documenting the versions we expect people to use outside the Unrelated, but another nit about the GHA changes are the way the unpinned versions look in the checks, which makes it a little unclear what actually failed if something does fail: So, I'm sort of iffy on whether or not the trick is beneficial if it's only saving us from modifying a list of versions once or twice a year; the other versions can be static as they aren't actually effects seen by end users. |
Does the update package-lock.json workflow handle rolling back any accidentally committed changes, nightly? Whether it be rolling back v2 -> v1 as now, or v1 -> v2 after we upgrade to npm > v6.
That's a thing. I'll see if there's a way to improve it. |
If you mean whether or not this workflow can undo an accidental upgrade or downgrade, probably given it reruns npm and then commits it back, but truthfully it's not clear to me how the workflow even does any updates at all (I would have never expected |
FWIW I don't know that the job names can be fixed; that is generated statically where you don't actually have info about what version of node an action is going to pick (if you're running an action, it's already too late). |
@weswigham @jakebailey gtg? |
|
||
- name: Configure git and update package-lock.json | ||
run: | | ||
git config user.email "typescriptbot@microsoft.com" | ||
git config user.name "TypeScript Bot" | ||
npm install --package-lock-only | ||
npm install --package-lock-only --ignore-scripts |
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.
Now that this is run with node 14, I think this can be dropped, though if it exists it probably won't be harmful. Shame about that npm bug.
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.
Note that this probably wouldn't work in npm7+ at all, because npm install
doesn't just overwrite package-lock with new versions anymore. When we switch to lockfile v2, I think we'll have to come up with a new updating system.
I see the nightly and update package-lock.json workflows failed last night thanks to my contribution:
I misunderstood the npm docs: A registry <-> token environment variable association is required. Set one up the same way as in the npm publish starter workflow (which is also the way it was before).