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

NodeToolV0: allow reading versionSpec from file #15615

Closed
wants to merge 9 commits into from

Conversation

fowl2
Copy link

@fowl2 fowl2 commented Dec 17, 2021

Task name: NodeToolV0

Description: allow reading versionSpec from file, for example a .nvmrc

Documentation changes required: Y

Added unit tests: Y

Attached related issue: #14094

Checklist:

  • Task version was bumped - please check instruction how to do it
  • Checked that applied changes work as expected

@fowl2 fowl2 requested a review from a team as a code owner December 17, 2021 09:34
@fowl2
Copy link
Author

fowl2 commented Dec 22, 2021

thinking perhaps (maybe in a follow up PR) making the version spec parameter optional and then reading .nvmrc and .node-version from the root automatically if blank/not specified

@fowl2
Copy link
Author

fowl2 commented Feb 1, 2022

@anatolybolshakov: Could take a look at this PR, or recommend another reviewer?

as per the docs I've semi-randomly picking you from the PR history :)

@EzzhevNikita EzzhevNikita removed their assignment Feb 1, 2022
@anatolybolshakov
Copy link
Contributor

@fowl2 thanks for contribution! Yes, let us take a look

@fowl2
Copy link
Author

fowl2 commented Apr 14, 2022

@anatolybolshakov gentle ping :) could you point me in the right direction?

@ljharb
Copy link

ljharb commented Apr 14, 2022

Note that it doesn't actually support .nvmrc unless it supports everything nvm does - which includes aliases (built-in ones like node, iojs, etc, as well as LTS ones like lts/*, lts/argon, etc, as well as user-defined ones) and also partial versions (4, 4., 4.1, 4.1., etc), with and without a leading v.

@fowl2
Copy link
Author

fowl2 commented Apr 14, 2022

You are indeed correct. This subset of the file format I think is still very useful. Completely matching nvm would be difficult short of actually using it - which isn't really feasible eg. because this needs to run on Windows.

Perhaps the doc changes could be clearer, do you have a suggestion?

@ljharb
Copy link

ljharb commented Apr 14, 2022

Why isn't it feasible? nvm supports Windows just fine on WSL2, git bash, or cygwin (just not in powershell or cmd.exe).

@fowl2
Copy link
Author

fowl2 commented Apr 14, 2022

Yes technically possible, the best kind of correct ;)

As I understand it, the agent runs in a "Windows Windows" ie. cmd.exe environment. Yes it would be possible to change this, but that would be an even bigger and wide reaching change that would have effects across all the actions, some of which are currently Windows only and likely to stay that way - eg the "run a Windows batch script" action.

IMHO for if you need bug gif bug nvm, a new Linux/Cygwin only task that shells out to nvm could be created (or just shell out directly in a bash task).

Or we could chip away at need functionality here, starting with the basics. :)

@ljharb
Copy link

ljharb commented Apr 14, 2022

Fair enough. It's pretty important tho that the caveats with reading nvmrc are well-communicated, especially since lts/* and node are encouraged usage.

@fowl2
Copy link
Author

fowl2 commented Apr 14, 2022

IMHO for, build pipelines, stability and reproducibility are most important. I'm struggling to imagine a node security vuln that would affect the code compiled with it, but I can easily see build breaks from patch releases. Maybe a failure of imagination on my part.

I dream that one day the node version will be in the package lock and respected by npm ci.

@ljharb
Copy link

ljharb commented Apr 14, 2022

That's a debate for another time, but suffice to say that reproducibility is not a universally desirable or achievable thing, in most ecosystems, but certainly not in the npm ecosystem. (and npm couldn't ever possibly address node versions; npm runs inside node)

return versionSpecInput;
}

const versionSpec = fs.readFileSync(versionSpecInput, { 'encoding': 'utf' });
Copy link
Contributor

Choose a reason for hiding this comment

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

Could it make sense to add separate task input for version spec specified as file path - to avoid any confusion around it?

@github-actions
Copy link

This PR is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the PR otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label Nov 14, 2022
@gentoo90
Copy link

Bump

@github-actions github-actions bot removed the stale label Nov 14, 2022
@github-actions
Copy link

This PR is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the PR otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label May 14, 2023
@fowl2
Copy link
Author

fowl2 commented May 15, 2023

I might take a look at this later this week

@github-actions github-actions bot removed the stale label May 15, 2023
Copy link

This PR is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the PR otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label Nov 11, 2023
@gentoo90
Copy link

Looks like this was superseded by #16835

@github-actions github-actions bot removed the stale label Nov 11, 2023
@fowl2 fowl2 closed this Nov 13, 2023
@fowl2 fowl2 deleted the nodetool-nvmrc branch November 13, 2023 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants