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

Support aliases like LTS #26

Closed
damccorm opened this issue Aug 9, 2019 · 104 comments
Closed

Support aliases like LTS #26

damccorm opened this issue Aug 9, 2019 · 104 comments
Labels
enhancement New feature or request

Comments

@damccorm
Copy link
Contributor

damccorm commented Aug 9, 2019

Right now, we're thinking it makes sense to support lts, latest, current, and LTS version names (e.g. dubinium)

@wesleytodd
Copy link

nodejs/package-maintenance#236

For reference, this is the alias list we are working out.

@JimiC
Copy link

JimiC commented Sep 5, 2019

@damccorm Do you mind if I give this a try to provide a PR?

@damccorm
Copy link
Contributor Author

damccorm commented Sep 6, 2019

@JimiC that would be great! One thing to note is that we would like to make this completely automated (e.g. it shouldn't rely on hardcoding dubinium to 10.16).

I've done a small bit of digging here, here are some things that might be helpful (apologies if you already know any/all of this):

@panva
Copy link
Contributor

panva commented Sep 6, 2019

this may be useful as a reference for using the dist json file.

@JimiC
Copy link

JimiC commented Sep 6, 2019

@damccorm Great!
I had a look at the code and how you are fetching the node version and have an idea on how to tackle this issue. Before I start coding I'll present you my course of actions, in order for everyone to agree on it.

@ljharb
Copy link

ljharb commented Sep 6, 2019

You may also want to reference how https://github.com/nvm-sh/nvm parses that very tab file to support its LTS aliases.

@JimiC
Copy link

JimiC commented Sep 9, 2019

After a lot of thought and searching the docs of popular CI services (Azure Pipelines, AppVeyor, TravisCI, GitLab CI/CD, CircleCi) I come to the conclusion that the following should be supported:

# shorthand of the latest version of node
- node:
    alias:
        - ' '
        - current (?)
        - latest  (?)

# shorthand of node version 4
- argon:
    alias:
        - Argon

# shorthand of node version 6
- boron:
    alias:
        - Boron

# shorthand of node version 8
- carbon:
    alias:
        - Carbon

# shorthand of node version 10
- dubnium:
    alias:
        - Dubnium

# shorthand of node version 12
- erbium (?):
    alias:
        - Erbium

Those with a question mark are cases that I like to discuss with you.

  • node is used as a shorthand in TravisCI and ' ' in AppVeyor. Should we also support those or are we going with our own shorthand like latest?
  • Erbium is pending and can't be yet automated. I'm just mentioning it here as a placeholder.

From my POV lts/* should not be a choice, since the GitHub (Azure Pipelines) matrix.node-version property actually executes an iteration of the values specified, passing a single value of the version each time to create an instance.
lts/* resolves to multiple node versions that can't be interpreted into firing up multiple instances.

Similarly lts=dubnium should not be a choice either, simply specifying dubnium should suffice.

I'm not sure if lts should be a choice either. Which node version should lts point to?

@damccorm
Copy link
Contributor Author

damccorm commented Sep 9, 2019

This generally looks great. A couple thoughts.

I think the idea of lts is that its the current lts. So right now, it would resolve to 10.x, but soon will resolve to 12.x. So lts and current are actually interchangeable here, while latest could resolve to a minor version (e.g. 13.x eventually). As long as we doc what we're doing there I think we'll be fine, the call from our product team based on customer conversations was supporting all 3 of these. I'd stick with these rather than go with a different placeholder, I think its a little more explicit this way.

Agreed on using dubinium instead of lts=dubinium.

Agreed on holding off on Erbium for now.

@JimiC
Copy link

JimiC commented Sep 9, 2019

One more clarification. According to https://nodejs.org/en/

  • lts -> 10.x
  • current -> 12.x which should also be resolved for shorthands ' ', node and latest

Correct?

Note: https://nodejs.org/en/about/releases/

@ljharb
Copy link

ljharb commented Sep 9, 2019

Is there a reason not to use nvm, and get all these conventional aliases for free?

@JimiC
Copy link

JimiC commented Sep 9, 2019

If only nvm for windows was the same as for *nix, Been wanting to start such a project but time is against me.

@damccorm
Copy link
Contributor Author

damccorm commented Sep 9, 2019

@JimiC yeah, you're right. I don't think we should resolve shorthands ' ' and node though. Those are pretty non-descriptive, so if you look at it and don't know what's going on it won't help you.

@JimiC
Copy link

JimiC commented Sep 9, 2019

OK. So we will dump the travis and appveyor shorthands and go with our own latest, current and lts ones.

Summarizing:

# shorthand of the latest version of node
# (as of the time of writing it's `12.x`)
- latest:
    alias:
        - current

# shorthand of the recommended `lts` version of node
# (as of the time of writing it's `10.x`)
- lts

# shorthand of node version 4.x
- argon:
    alias:
        - Argon

# shorthand of node version 6.x
- boron:
    alias:
        - Boron

# shorthand of node version 8.x
- carbon:
    alias:
        - Carbon

# shorthand of node version 10.x
- dubnium:
    alias:
        - Dubnium

# shorthand of node version 12.x
- erbium:
    alias:
        - Erbium

Note: As soon as Erbium is included in the index.json then it will be automatically supported.

@JimiC
Copy link

JimiC commented Sep 9, 2019

Something else that caught my eye while I was experimenting with jobs is that if you specify matrix.node-version: '' in strategy the setup-node resolves it to 10.x mainly because of this https://github.com/actions/setup-node/blob/master/action.yml#L10

Should this resolve be kept? It's not documented and may create support.

@damccorm
Copy link
Contributor Author

damccorm commented Sep 9, 2019

So that's a bit of a tricky question. I think I'd actually be in favor of cutting that. My only concern is that it might break some existing workflows, but that also enables you to not specify a version if you just want to do auth. Lets cut it.

@ljharb
Copy link

ljharb commented Sep 9, 2019

You could use nvm for nonwindows, and write an adapter for the specifier to map to whatever you use for windows - that way you’d match the overwhelmingly most common conventions.

@JimiC
Copy link

JimiC commented Sep 9, 2019

And why would I want to do that when I have an entire underlying code-base. Good thought but for another project, maybe?

@ljharb
Copy link

ljharb commented Sep 10, 2019

@JimiC to be clear, i meant this action/repo could do that for you - not that you’d have or want to do that locally.

@JimiC
Copy link

JimiC commented Sep 10, 2019

@ljharb Still don't get the logic behind your suggestion, but then again it's just me. A use case may help me understand.
@damccorm Even if the user wants to do just auth doesn't this mean that eventually (s)he will need npm?
Bare with me today as I have a bad headache.

@ljharb
Copy link

ljharb commented Sep 10, 2019

@JimiC what i mean is, since this action is controlling the mechanism for managing node, it can pretend to use nvm on non-WSL Windows by manually mapping nvm's versionish syntax to whatever windows tool you're choosing (or do something like, nvm version-remote ${versionish} in WSL and then pass that resolved version to the windows node version manager)

@damccorm
Copy link
Contributor Author

Even if the user wants to do just auth doesn't this mean that eventually (s)he will need npm?

Yes, but node/npm are installed by default. This action is responsible for making sure the correct version is used, but we do guarantee that a version will be installed. Right now, that's node 10.16.3 and npm 6.10.3 (at least on ubuntu) - that could change and there's no guarantee of which version will be installed

@JimiC
Copy link

JimiC commented Sep 10, 2019

@damccorm Let's reassess.
Q:

Something else that caught my eye while I was experimenting with jobs is that if you specify matrix.node-version: '' in strategy the setup-node resolves it to 10.x mainly because of this https://github.com/actions/setup-node/blob/master/action.yml#L10

Should this resolve be kept? It's not documented and may create support.

Ans:

So that's a bit of a tricky question. I think I'd actually be in favor of cutting that. My only concern is that it might break some existing workflows, but that also enables you to not specify a version if you just want to do auth. Lets cut it.

Removing default from action.yml and if a user sets node-version: '' the action will fail. Shouldn't we handle that?

@JimiC
Copy link

JimiC commented Sep 10, 2019

@ljharb Correct me if I'm wrong. What you are suggesting is that setup-node should have a similar syntax like nvm (i.e nvm install --lts=dubmium, nvm install --lts). Right?
Like node-version: --lts or node-version: --lts=dubnium?

@ljharb
Copy link

ljharb commented Sep 10, 2019

@JimiC lts/* or lts/dubnium, yes :-) the -- form is only for the command line, not for config files.

@mightyiam
Copy link

Sure. I'd like to test in CI against all currently supported major versions of Node.js. And it would be nice if I didn't have to occasionally bump explicitly specified versions. That's all, really.

@JimiC
Copy link

JimiC commented Jun 1, 2022

@mightyiam Doesn't this suffice?

@mightyiam
Copy link

@mightyiam Doesn't this suffice?

What syntax exactly? Node.js currently has three supported releases. How do I target the "maintenance LTS"?

@JimiC
Copy link

JimiC commented Jun 1, 2022

I guess your are not familiar with nvm. lts/* should do the trick.

@mightyiam
Copy link

I guess your are not familiar with nvm. lts/* should do the trick.

According to nvm, lts/* expands into the latest major Node.js LTS release, not the maintenance one. Node.js has two supported LTS releases currently: https://nodejs.org/en/about/releases/. There's a maintenance one and an active one. I'm looking for something that might look like LTS/maintenance.

@tooomm
Copy link
Contributor

tooomm commented Jun 1, 2022

Node.js currently has three supported releases. How do I target the "maintenance LTS".

With #481 you should be able to solve this with lts/-1.

To "test in CI against all currently supported major versions of Node.js", you would use lts/-1, lts/* and current.

@mightyiam
Copy link

Node.js currently has three supported releases. How do I target the "maintenance LTS".

With #481 you should be able to solve this with lts/-1.

To "test in CI against all currently supported major versions of Node.js", you would use lts/-1, lts/* and current.

Yes, that should do. I'll keep an eye on that. Thanks, everyone.

@JimiC
Copy link

JimiC commented Jun 1, 2022

If I'm not mistaken lts/* returns v14 (which is the maintenance LTS) and v16 (which is the active LTS). Maybe you should elaborate on what exactly you are trying to do.

@tooomm
Copy link
Contributor

tooomm commented Jun 1, 2022

If I'm not mistaken lts/* returns v14 (which is the maintenance LTS) and v16 (which is the active LTS).

Not sure. https://github.com/nvm-sh/nvm#long-term-support states:
You can reference LTS versions in aliases and .nvmrc files with the notation 'lts/*' for the latest LTS.

@dominykas
Copy link

@mightyiam you could also try something like https://github.com/pkgjs/action which will automatically construct the test matrix and call setup-node for you.

@ljharb
Copy link

ljharb commented Jun 1, 2022

@JimiC you are mistaken. lts/* returns the latest LTS only. You can use lts/-1 etc, or lts/argon, to target a specific maintenance line, but anything that depends on support dates is not part of nvm - nvm’s aliases do not change with the passage of time, only with the release of new node versions.

@JimiC
Copy link

JimiC commented Jun 1, 2022

@JimiC you are mistaken. lts/* returns the latest LTS only. You can use lts/-1 etc, or lts/argon, to target a specific maintenance line, but anything that depends on support dates is not part of nvm - nvm’s aliases do not change with the passage of time, only with the release of new node versions.

@ljharb Thanks for correcting me. Honestly I never use lts/* in my CI/CD as I like to have the control on what node version I'm targeting.

@msimerson
Copy link

Sure. I'd like to test in CI against all currently supported major versions of Node.js. And it would be nice if I didn't have to occasionally bump explicitly specified versions. That's all, really.

That's exactly what I wanted, which is what I created this node-LTS-versions for. Give it a try.

@mightyiam
Copy link

Sure. I'd like to test in CI against all currently supported major versions of Node.js. And it would be nice if I didn't have to occasionally bump explicitly specified versions. That's all, really.

That's exactly what I wanted, which is what I created this node-LTS-versions for. Give it a try.

That works for me. Thank you. Everyone.

@dmitry-shibanov
Copy link
Contributor

Hello everyone. We released a new version of the action with support of lts/-n aliases. The setup-node action supports such syntax.

For now I'm going to close the issue. If you any updates feel free to ping us or create a separate issue.

kodiakhq bot added a commit to 3x071c/lsg-musin that referenced this issue Oct 9, 2022
This PR contains the following updates:



Package
Change
Age
Adoption
Passing
Confidence
Type
Update




@astrojs/partytown (source)
1.0.0 -> 1.0.1




dependencies
patch


@picocss/pico (source)
1.5.5 -> 1.5.6




dependencies
patch


@types/node (source)
18.7.23 -> 18.8.3




devDependencies
minor


actions/checkout
v3.0.0 -> v3.1.0




action
minor


actions/setup-node
v3.0.0 -> v3.5.0




action
minor


actions/stale
v6.0.0 -> v6.0.1




action
patch


astro (source)
1.3.1 -> 1.4.6




dependencies
minor


astro-netlify-cms
0.2.2 -> 0.2.3




dependencies
patch


cspell (source)
6.10.1 -> 6.12.0




devDependencies
minor


eslint (source)
8.24.0 -> 8.25.0




devDependencies
minor


eslint-plugin-astro (source)
0.19.0 -> 0.20.0




devDependencies
minor


nick-fields/retry
v2.6.0 -> v2.8.1




action
minor


postcss (source)
8.4.16 -> 8.4.17




devDependencies
patch


prettier-plugin-astro
0.5.4 -> 0.5.5




devDependencies
patch


prettier-plugin-prisma
4.2.0 -> 4.4.0




devDependencies
minor


vite (source)
3.1.4 -> 3.1.6




devDependencies
patch




Release Notes

withastro/astro (@​astrojs/partytown)
v1.0.1
Compare Source
Patch Changes

#​4989 50a397c4b Thanks @​that-joao! - Update @​builder.io/partytown dependency



picocss/pico
v1.5.6
Compare Source
Features

Adds the ability to compile Pico with a root element other than body (E.g. #__next, #___gatsby, #root), by @​ja1den
Define your your CSS selector in scss/_variables.scss > $semantic-root-element
#​224 #​13 #​222

Fixes

aria-invalid for dates input, by @​rbf
#​242 #​243

Documentation

Improves Customization and Class-less pages
#​245

Full changelog
A huge thank you to all the contributors ❤️


actions/checkout
v3.1.0
Compare Source

Use @​actions/core saveState and getState
Add github-server-url input

v3.0.2
Compare Source

Add input set-safe-directory

v3.0.1
Compare Source

Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory
Bumped various npm package versions



actions/setup-node
v3.5.0
Compare Source
In scope of this release we add support for engines.node. The action will be able to grab the version form package.json#engines.node. actions/setup-node#485. Moreover, we added support for Volta
Besides, we updated @​actions/core to 1.9.1 and @​actions/cache to 3.0.4
v3.4.1
Compare Source
In scope of this release we fixed bugs related to the pnpm 7.5.1 output issue from pnpm store path actions/setup-node#545. Moreover we fixed the issue with falling on node-version output actions/setup-node#540.
v3.4.0
Compare Source
In scope of this release we updated actions/cache package as the new version contains fixes for caching error handling. Moreover, we added support for asdf format as Node.js version file actions/setup-node#373. Besides, we introduced new output node-version and added npm-shrinkwrap.json to dependency file patterns: actions/setup-node#439
v3.3.0
Compare Source
In scope of this release we added support for lts/-n aliases, improve logic for current, latest and node aliases to handle them from toolcache, update ncc package.
Support of lts/-n aliases

Related pull request: actions/setup-node#481
Related issue: actions/setup-node#26

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
  with:
    node-version: lts/-1
- run: npm ci
- run: npm test
Minor improvements

Update zeit/ncc to vercel/ncc: actions/setup-node#476
Get latest version from cache if exists: actions/setup-node#496

v3.2.0
Compare Source
In scope of this release we added new aliases to install the latest Node.js version. actions/setup-node#483
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
  with:
    node-version: current
- run: npm ci
- run: npm test
v3.1.1
Compare Source
In scope of this release we updated actions/cache package as the new version contains fixes related to GHES 3.5 (actions/setup-node#460)
v3.1.0
Compare Source
In scope of this release we added support for caching from GHES 3.5 and fixed download issue for files > 2GB during restore. Besides, we updated actions/cache dependency to 2.0.0 version.


actions/stale
v6.0.1
Compare Source
Update @​actions/core to 1.10.0 #​839
Full Changelog: actions/stale@v6.0.0...v6.0.1


withastro/astro (astro)
v1.4.6
Compare Source
Patch Changes

#​5013 ffbe4e71e Thanks @​matthewp! - Fixes getViteConfig from astro/config

v1.4.5
Compare Source
Patch Changes


#​4981 1f890b336 Thanks @​matthewp! - Ensure dynamic tags have their slot instructions yielded


#​4886 61d26f335 Thanks @​yuhang-dong! - Fix: import.meta.env.BASE_URL will be '/' in client loaded component on dev mode


#​4973 c733d4fb8 Thanks @​bluwy! - Support Astro.slots.render for mdx


#​4918 a6bb2694b Thanks @​bluwy! - Refactor hydration path handling


#​4977 4f73b98ae Thanks @​tony-sull! - Fixes a bug that logged route cache warnings in astro dev


#​4887 37cb2fc02 Thanks @​Calvin-LL! - fix object styles not escaped


#​4990 8f9791d84 Thanks @​matthewp! - Upgrade Astro compiler to 0.26.0


v1.4.4
Compare Source
Patch Changes


#​4967 e6a881081 Thanks @​matthewp! - Final perf fix from 1.3.0 regression
A regression in rendering perf happened in 1.3.0. This is the final fix for the underlying issue.


v1.4.3
Compare Source
Patch Changes


#​4956 ee8dd424f Thanks @​matthewp! - Fix perf regression in SSR


#​4952 5bcd76e3a Thanks @​bluwy! - Refactor ViteConfigWithSSR type


v1.4.2
Compare Source
Patch Changes


#​4932 9898088c0 Thanks @​matthewp! - Prevent hydration mismatch in streaming SSR


#​4939 cf2bba1e4 Thanks @​natemoo-re! - Fix MDX error handling, preventing a memory leak


v1.4.1
Compare Source
Patch Changes

#​4928 7690849a8 Thanks @​Princesseuh! - Fix module definition of Markdown and MDX files not being available outside Astro files

v1.4.0
Compare Source
Minor Changes


#​4907 01c1aaa00 Thanks @​matthewp! - Order Astro styles last, to override imported styles
This fixes CSS ordering so that imported styles are placed higher than page/component level styles. This means that if you do:




delucis/astro-netlify-cms
v0.2.3
Compare Source
Patch Changes

#​23 26243d5 Thanks @​codelastnight! - remove node join() from vite-plugin-admin-dashboard to allow windows to run dev



streetsidesoftware/cspell
v6.12.0
Compare Source
Features

Use cspell-dictionary Module (#​3686) (6441f4b)

6.11.1 (2022-09-30)
Bug Fixes

Fix export of SpellingDictionaryCollection (#​3683) (7665cdb)

v6.11.1
Compare Source
Bug Fixes

Fix export of SpellingDictionaryCollection (#​3683) (7665cdb)

v6.11.0
Compare Source
Note: Version bump only for package cspell-monorepo
6.10.1 (2022-09-20)
Note: Version bump only for package cspell-monorepo


eslint/eslint
v8.25.0
Compare Source
Features

173e820 feat: Pass --max-warnings value to formatters (#​16348) (Brandon Mills)
6964cb1 feat: remove support for ignore files in FlatESLint (#​16355) (Milos Djermanovic)
1cc4b3a feat: id-length counts graphemes instead of code units (#​16321) (Sosuke Suzuki)

Documentation

90c6028 docs: Conflicting fixes (#​16366) (Ben Perlmutter)
5a3fe70 docs: Add VS to integrations page (#​16381) (Maria José Solano)
49bd1e5 docs: remove unused link definitions (#​16376) (Nick Schonning)
3bd380d docs: typo cleanups for docs (#​16374) (Nick Schonning)
b3a0837 docs: remove duplicate words (#​16378) (Nick Schonning)
a682562 docs: add BigInt to new-cap docs (#​16362) (Sosuke Suzuki)
f6d57fb docs: Update docs README (#​16352) (Ben Perlmutter)
7214347 docs: fix logical-assignment-operators option typo (#​16346) (Jonathan Wilsson)

Chores

1f78594 chore: upgrade @​eslint/eslintrc@​1.3.3 (#​16397) (Milos Djermanovic)
8476a9b chore: Remove CODEOWNERS (#​16375) (Nick Schonning)
720ff75 chore: use "ci" for Dependabot commit message (#​16377) (Nick Schonning)
42f5479 chore: bump actions/stale from 5 to 6 (#​16350) (dependabot[bot])
e5e9e27 chore: remove jsdoc dev dependency (#​16344) (Milos Djermanovic)



ota-meshi/eslint-plugin-astro
v0.20.0
Compare Source
Minor Changes

#​116 9c481f8 Thanks @​renovate! - update dependency astro-eslint-parser to ^0.7.0



nick-fields/retry
v2.8.1
Compare Source
Refactor to make testing easier
v2.8.0
Compare Source
Use spawn rather than exec to support much larger outputs

Should resolve #​84  and #​76

v2.7.1
Compare Source
This release contains mostly dependency updates. There are a few very minor changes to runtime code based on development quality of life improvements from newly configured linting and styling.
v2.7.0
Compare Source
Features

retry only on specific exit code (#​58) (f227091)

Misc

Various dependabot updates



postcss/postcss
v8.4.17
Compare Source

Fixed Node.before() unexpected behavior (by Romain Menke).
Added TOC to docs (by Mikhail Dedov).



withastro/prettier-plugin-astro
v0.5.5
Compare Source
Patch Changes

fe68b94: Fix missing newline after attributes on inline elements when using singleAttributePerLine
96e2b28: Fix expressions not hugging the end of the tag in cases where they should
4e6fde8: Fix newlines being added to style tags even if they were empty



umidbekk/prettier-plugin-prisma
v4.4.0
Compare Source

feat: Bump @prisma/prisma-fmt-wasm to 4.4.0.  7e2fd9a

v4.3.0
Compare Source

feat: Bump @prisma/prisma-fmt-wasm to 4.3.0.  71f66fe
chore: Bump dependencies.  d976203



vitejs/vite
v3.1.6
Compare Source
Please refer to CHANGELOG.md for details.
v3.1.5
Compare Source
Please refer to CHANGELOG.md for details.


Configuration
📅 Schedule: Branch creation - "before 2am" in timezone Europe/Berlin, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


 If you want to rebase/retry this PR, click this checkbox.


This PR has been generated by Mend Renovate. View repository job log here.
krzyk pushed a commit to krzyk/setup-node that referenced this issue Apr 11, 2023
Added new command  add-property to add a property to a sandbox
deining pushed a commit to deining/setup-node that referenced this issue Nov 9, 2023
Improve grammar and formatting in README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.