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

build(workflow): same node version on all stages #1319

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Conversation

roschaefer
Copy link
Contributor

@roschaefer roschaefer commented Jul 2, 2024

Motivation

We have completely different node --versions on local development,
build server (even in different jobs) and production.

My suggestion is that we configure the node version in a central file in
the root folder and reference it from everywhere.

For me, any version manager is fine. If I have the choice, I suggest
asdf-vm.

How to test

  1. Check status checks

@roschaefer roschaefer requested review from mahula and Elweyn July 2, 2024 15:42
@roschaefer roschaefer marked this pull request as draft July 2, 2024 15:43
@roschaefer roschaefer force-pushed the tool-versions branch 3 times, most recently from 7af0f9f to cdad51a Compare July 2, 2024 15:48
.tool-versions Outdated
@@ -0,0 +1 @@
nodejs 21.4.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Elweyn what's the version that we're using in production? On my vagrant machine on alpine 3.19 it's still v18.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We checked and its also different between production and staging:

Prod: v20.11.1
Stage: v20.12.1

@@ -9,13 +9,13 @@ jobs:
runs-on: ubuntu-latest
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN_ADMIN }}
WORKING_DIRECTORY: ./admin
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not related to nodejs but there is absolutely no reason why we should pollute process.env and have no benefit of another variable WORKING_DIRECTORY if we're using it only once.

@roschaefer roschaefer force-pushed the tool-versions branch 3 times, most recently from 8d8b42e to 2689076 Compare July 2, 2024 16:58
@roschaefer roschaefer self-assigned this Jul 2, 2024
@roschaefer roschaefer marked this pull request as ready for review July 2, 2024 17:15
@roschaefer roschaefer force-pushed the tool-versions branch 3 times, most recently from bd94773 to ca3be47 Compare July 3, 2024 11:27
@mahula mahula added the dependencies Pull requests that update a dependency file label Jul 3, 2024
@roschaefer roschaefer force-pushed the tool-versions branch 2 times, most recently from a678f3c to 2cec036 Compare July 4, 2024 10:08
@@ -87,7 +87,7 @@
"#types/*": "./src/graphql/types/*"
},
"engines": {
"node": ">=21"
"node": ">=20"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That one is important for eslint.

"typescript": "^5.5.2"
},
"engines": {
"node": ">=21"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That one was obsolete.

@roschaefer roschaefer force-pushed the tool-versions branch 2 times, most recently from bafb1a3 to 70d993d Compare July 4, 2024 10:13
"devDependencies": {
"@vuepress/bundler-vite": "^2.0.0-rc.11",
"@vuepress/theme-default": "^2.0.0-rc.35",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated, missing from #1325

Copy link
Contributor

@Mogge Mogge left a comment

Choose a reason for hiding this comment

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

One question: Does this mean, that every developer must use asdf?

@roschaefer
Copy link
Contributor Author

One question: Does this mean, that every developer must use asdf?

No, it is completely up to the developer what they use. As written in the README just make sure that you use the node version specified in tool-versions. Use whatever version manager you like.

We just have to save the version in some file. Workflows shall take this file as a reference.

Good?

@roschaefer roschaefer enabled auto-merge (squash) July 8, 2024 18:06
@roschaefer roschaefer force-pushed the tool-versions branch 2 times, most recently from dc736ec to 6854a5b Compare July 8, 2024 20:48
@roschaefer roschaefer requested a review from Mogge July 8, 2024 20:48
roschaefer added a commit that referenced this pull request Jul 8, 2024
Motivation
----------
These volumes are not in use, let's remove them. As the comment says,
the original intention was to have a different node version in the
container and the host.

This is something that we *don't* want. We want to use the same node
version *always*, see #1319.

How to test
-----------
1. Nothing to test, disabled code.
roschaefer added a commit that referenced this pull request Jul 9, 2024
Motivation
----------
These volumes are not in use, let's remove them. As the comment says,
the original intention was to have a different node version in the
container and the host.

This is something that we *don't* want. We want to use the same node
version *always*, see #1319.

How to test
-----------
1. Nothing to test, disabled code.
roschaefer added a commit that referenced this pull request Jul 9, 2024
Motivation
----------
These volumes are not in use, let's remove them. As the comment says,
the original intention was to have a different node version in the
container and the host.

This is something that we *don't* want. We want to use the same node
version *always*, see #1319.

How to test
-----------
1. Nothing to test, disabled code.
Motivation
----------
We have completely different `node --version`s on local development,
build server (even in different jobs) and production.

My suggestion is that we configure the node version in a central file in
the root folder and reference it from everywhere.

For me, any version manager is fine. If I have the choice, I suggest
[asdf-vm]](https://github.com/asdf-vm/asdf).

How to test
-----------
1. Check status checks
@roschaefer roschaefer merged commit 149db22 into master Jul 9, 2024
35 checks passed
@mahula mahula deleted the tool-versions branch July 25, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file devops
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants