Skip to content

feat: install Node v16 when lockfileVersion is 2 - #187

Closed
smoya wants to merge 6 commits into
asyncapi:masterfrom
smoya:feat/node16
Closed

smoya wants to merge 6 commits into
asyncapi:masterfrom
smoya:feat/node16

Conversation

@smoya

@smoya smoya commented Oct 18, 2022 •

Copy link
Copy Markdown
Member

Description
Partially fixes #123

Note: Not sure if this can be extracted to another action and reused?

Related issue(s)

@derberg

derberg commented Oct 19, 2022

Copy link
Copy Markdown
Member

I think this is actually the smartest solution we could do here 🍺 . So setting up Node environment based on lockfileVersion and maybe other prerequisites too.

I'm only not sure if the way you do it is proper:

sounds like best would be to have a custom GitHub action responsible for detecting what package-lock version is used and exposing it to output. It wouldn't have to be published to marketplace, could be placed inside this repo (example from generator -> https://github.com/asyncapi/generator/tree/master/.github/templates-list-validator and https://github.com/asyncapi/generator/blob/master/.github/workflows/templates-list-validation.yml#L14)

thoughts?

of course there is one downside, that we for example say that generator works with node > 12 but we will test on 16 only 😞 but these issues with lockfileVersion compatibility are out of our hands

we are not the only ones suffering https://twitter.com/search?q=lockfileVersion&src=typed_query&f=live

@smoya

smoya commented Mar 1, 2023

Copy link
Copy Markdown
Member Author

@derberg should we move forward with this?

@derberg

derberg commented Mar 27, 2023

Copy link
Copy Markdown
Member

@smoya did you see my comment?

other stuff:

@smoya

smoya commented Mar 28, 2023

Copy link
Copy Markdown
Member Author

@smoya did you see my comment?

Nope 😆 For some reason, I did not. Thanks for taking the time to collect and summarize all the info.
I like all your suggestions, except I should write javascript instead of a simple shell script. It's just a grep! We can still redirect an output to the right env vars: echo "{name}={value}" >> $GITHUB_OUTPUT.
I like the idea of having all of that into just one single script and reuse it. In fact, I think the script will just return the node version we should use, something like a recommended-node-version-by-lockfile.sh or similar.

@derberg

derberg commented Mar 28, 2023

Copy link
Copy Markdown
Member

yeah, for you grep for me magic 😃

I do not mind .sh as long as we just take this reusability direction. Global workflow can also push out .sh files to other repos

@derberg

derberg commented Apr 4, 2023

Copy link
Copy Markdown
Member

when you will work on this, refactor I mean, you might want to try apache/airflow#27371

more on composite actions -> https://asyncapi.slack.com/archives/C34AUKWQK/p1680613343254339

@derberg

derberg commented Apr 18, 2023

Copy link
Copy Markdown
Member

closing in favour of #230

@derberg derberg closed this Apr 18, 2023
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.

Update Node and npm to a more recent version

4 participants