Chore: Update to node 20 (#76097)

* chore(node): update node version to 20

* chore(node): bump to 20.8.0, update drone variables

* chore(drone): update yaml config

* chore(yarn): bump yarn to latest to fix building binaries ERR_IMPORT_ASSERTION_TYPE_MISSING errors

* test(grafana-data): update whitespace in time formats for node 20 (18.13+)

* chore(node): move to LTS 20.8.1

* chore(node): bump to LTS 20.9.0
This commit is contained in:
Jack Westbrook 2023-10-26 09:34:50 +02:00 committed by GitHub
parent 314bea935f
commit 69af9f9ad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 262 additions and 262 deletions

View File

@ -122,14 +122,14 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update git bash
- yarn betterer ci
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: betterer-frontend
- commands:
- apk add --update curl jq bash
@ -158,7 +158,7 @@ steps:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: test-frontend
trigger:
event:
@ -222,7 +222,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- yarn run prettier:check
@ -232,7 +232,7 @@ steps:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: lint-frontend
- commands:
- apk add --update git
@ -247,7 +247,7 @@ steps:
- yarn run i18n:compile
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: verify-i18n
trigger:
event:
@ -529,7 +529,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update jq bash
@ -540,7 +540,7 @@ steps:
- yarn-install
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: build-frontend-packages
- failure: ignore
image: grafana/drone-downstream
@ -678,7 +678,7 @@ steps:
- build-frontend-packages
environment:
NODE_OPTIONS: --max_old_space_size=4096
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: build-storybook
when:
paths:
@ -1035,7 +1035,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- pip3 install codespell
@ -1048,7 +1048,7 @@ steps:
- yarn-install
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: lint-docs
- commands:
- mkdir -p /hugo/content/docs/grafana/latest
@ -1388,7 +1388,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- pip3 install codespell
@ -1401,7 +1401,7 @@ steps:
- yarn-install
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: lint-docs
- commands:
- mkdir -p /hugo/content/docs/grafana/latest
@ -1462,14 +1462,14 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update git bash
- yarn betterer ci
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: betterer-frontend
- commands:
- yarn run ci:test-frontend
@ -1477,7 +1477,7 @@ steps:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: test-frontend
trigger:
branch: main
@ -1519,7 +1519,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- yarn run prettier:check
@ -1529,7 +1529,7 @@ steps:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: lint-frontend
- commands:
- apk add --update git
@ -1544,7 +1544,7 @@ steps:
- yarn run i18n:compile
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: verify-i18n
trigger:
branch: main
@ -1778,7 +1778,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update jq
@ -1789,7 +1789,7 @@ steps:
- yarn install --mode=update-lockfile
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: update-package-json-version
- commands:
- apk add --update jq bash
@ -1801,7 +1801,7 @@ steps:
- update-package-json-version
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: build-frontend-packages
- commands:
- /src/grafana-build package --distro=linux/amd64,linux/arm64 --go-version=1.20.10
@ -1926,7 +1926,7 @@ steps:
- build-frontend-packages
environment:
NODE_OPTIONS: --max_old_space_size=4096
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: build-storybook
when:
paths:
@ -1976,7 +1976,7 @@ steps:
GRAFANA_MISC_STATS_API_KEY:
from_secret: grafana_misc_stats_api_key
failure: ignore
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: publish-frontend-metrics
when:
repo:
@ -2058,7 +2058,7 @@ steps:
environment:
NPM_TOKEN:
from_secret: npm_token
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: release-canary-npm-packages
when:
paths:
@ -2686,7 +2686,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- ./bin/build artifacts npm retrieve --tag ${DRONE_TAG}
@ -2953,14 +2953,14 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update git bash
- yarn betterer ci
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: betterer-frontend
- commands:
- yarn run ci:test-frontend
@ -2968,7 +2968,7 @@ steps:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: test-frontend
trigger:
event:
@ -3365,14 +3365,14 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update git bash
- yarn betterer ci
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: betterer-frontend
- commands:
- yarn run ci:test-frontend
@ -3380,7 +3380,7 @@ steps:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: test-frontend
trigger:
cron:
@ -4386,7 +4386,7 @@ steps:
- commands:
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine/git:2.40.1
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM golang:1.20.10-alpine
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM node:18.12.0-alpine
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM node:20.9.0-alpine
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM google/cloud-sdk:431.0.0
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana-ci-deploy:1.3.3
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine:3.18.3
@ -4420,7 +4420,7 @@ steps:
- commands:
- trivy --exit-code 1 --severity HIGH,CRITICAL alpine/git:2.40.1
- trivy --exit-code 1 --severity HIGH,CRITICAL golang:1.20.10-alpine
- trivy --exit-code 1 --severity HIGH,CRITICAL node:18.12.0-alpine
- trivy --exit-code 1 --severity HIGH,CRITICAL node:20.9.0-alpine
- trivy --exit-code 1 --severity HIGH,CRITICAL google/cloud-sdk:431.0.0
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/grafana-ci-deploy:1.3.3
- trivy --exit-code 1 --severity HIGH,CRITICAL alpine:3.18.3
@ -4667,6 +4667,6 @@ kind: secret
name: gcr_credentials
---
kind: signature
hmac: 29a933affceb9cc39b285d936de9e6327deedbb80f1285fa645d596f89ede442
hmac: 975f4bc4ea819f11b9abf46a1e17fc55161551ab02b5c6a905393def886ad4ae
...

2
.nvmrc
View File

@ -1 +1 @@
v18.12.0
v20.9.0

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@ nodeLinker: pnp
packageExtensions:
'@storybook/core-common@7.4.5':
dependencies:
'@storybook/react-webpack5': '7.4.5'
'@storybook/react-webpack5': 7.4.5
doctrine@3.0.0:
dependencies:
assert: 2.0.0
@ -35,7 +35,7 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: 'https://mskelton.dev/yarn-outdated/v2'
yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-3.6.4.cjs
# Uncomment the following lines if you want to use Verdaccio local npm registry. Read more at packages/README.md
# npmScopes:
# grafana:

View File

@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE=alpine:3.18.3
ARG JS_IMAGE=node:18-alpine3.18
ARG JS_IMAGE=node:20-alpine3.18
ARG JS_PLATFORM=linux/amd64
ARG GO_IMAGE=golang:1.20.10-alpine3.18

View File

@ -18,7 +18,7 @@ We recommend using [Homebrew](https://brew.sh/) for installing any missing depen
```
brew install git
brew install go
brew install node@18
brew install node@20
npm install -g yarn
```
@ -61,7 +61,7 @@ To remove precommit hooks, run
make lefthook-uninstall
```
> [!NOTE]
> [!NOTE]
> Contributors working on the frontend are highly encouraged to install the precommit hooks, even if your IDE formats on save, so the `.betterer.results` file is kept up to sync.
## Build Grafana

View File

@ -442,9 +442,9 @@
]
},
"engines": {
"node": ">= 18"
"node": ">= 20"
},
"packageManager": "yarn@3.6.1",
"packageManager": "yarn@3.6.4",
"dependenciesMeta": {
"prettier@3.0.0": {
"unplugged": true

View File

@ -14,7 +14,7 @@ describe('Date Formats', () => {
''
);
expect(format).toBe('MM/DD/YYYY, hh:mm:ss A');
expect(format).toBe('MM/DD/YYYY, hh:mm:ssA');
});
});
@ -52,8 +52,8 @@ describe('systemDateFormats', () => {
it('contains correct browser-localized date formats', () => {
systemDateFormats.useBrowserLocale();
expect(systemDateFormats.fullDate).toBe('MM/DD/YYYY, hh:mm:ss A');
expect(systemDateFormats.fullDateMS).toBe('MM/DD/YYYY, hh:mm:ss.SSS A');
expect(systemDateFormats.fullDate).toBe('MM/DD/YYYY, hh:mm:ssA');
expect(systemDateFormats.fullDateMS).toBe('MM/DD/YYYY, hh:mm:ss.SSSA');
expect(systemDateFormats.interval.millisecond).toBe('HH:mm:ss.SSS');
expect(systemDateFormats.interval.second).toBe('HH:mm:ss');
expect(systemDateFormats.interval.minute).toBe('HH:mm');

View File

@ -111,7 +111,7 @@ FROM debian:buster-20220822
ENV GOVERSION=1.20.10 \
PATH=/usr/local/go/bin:$PATH \
GOPATH=/go \
NODEVERSION=18.12.0-1nodesource1 \
NODEVERSION=20.9.0-1nodesource1 \
YARNVERSION=1.22.19-1
# Use ARG so as not to persist environment variable in image
@ -148,7 +148,7 @@ RUN apt-get update && \
gem install --conservative -N fpm && \
ln -s /usr/bin/llvm-dsymutil-6.0 /usr/bin/dsymutil && \
curl -fsS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
curl -O https://deb.nodesource.com/node_18.x/pool/main/n/nodejs/nodejs_${NODEVERSION}_amd64.deb &&\
curl -O https://deb.nodesource.com/node_20.x/pool/main/n/nodejs/nodejs_${NODEVERSION}_amd64.deb &&\
dpkg -i nodejs_${NODEVERSION}_amd64.deb &&\
rm nodejs_${NODEVERSION}_amd64.deb &&\
curl -fsS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \

View File

@ -6,4 +6,4 @@ grabpl_version = "v3.0.42"
golang_version = "1.20.10"
# nodejs_version should match what's in ".nvmrc", but without the v prefix.
nodejs_version = "18.12.0"
nodejs_version = "20.9.0"