Skip to content

Commit 69af9f9

Browse files
authored
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
1 parent 314bea9 commit 69af9f9

File tree

10 files changed

+262
-262
lines changed

10 files changed

+262
-262
lines changed

.drone.yml

+35-35
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ steps:
122122
- commands:
123123
- yarn install --immutable
124124
depends_on: []
125-
image: node:18.12.0-alpine
125+
image: node:20.9.0-alpine
126126
name: yarn-install
127127
- commands:
128128
- apk add --update git bash
129129
- yarn betterer ci
130130
depends_on:
131131
- yarn-install
132-
image: node:18.12.0-alpine
132+
image: node:20.9.0-alpine
133133
name: betterer-frontend
134134
- commands:
135135
- apk add --update curl jq bash
@@ -158,7 +158,7 @@ steps:
158158
- yarn-install
159159
environment:
160160
TEST_MAX_WORKERS: 50%
161-
image: node:18.12.0-alpine
161+
image: node:20.9.0-alpine
162162
name: test-frontend
163163
trigger:
164164
event:
@@ -222,7 +222,7 @@ steps:
222222
- commands:
223223
- yarn install --immutable
224224
depends_on: []
225-
image: node:18.12.0-alpine
225+
image: node:20.9.0-alpine
226226
name: yarn-install
227227
- commands:
228228
- yarn run prettier:check
@@ -232,7 +232,7 @@ steps:
232232
- yarn-install
233233
environment:
234234
TEST_MAX_WORKERS: 50%
235-
image: node:18.12.0-alpine
235+
image: node:20.9.0-alpine
236236
name: lint-frontend
237237
- commands:
238238
- apk add --update git
@@ -247,7 +247,7 @@ steps:
247247
- yarn run i18n:compile
248248
depends_on:
249249
- yarn-install
250-
image: node:18.12.0-alpine
250+
image: node:20.9.0-alpine
251251
name: verify-i18n
252252
trigger:
253253
event:
@@ -529,7 +529,7 @@ steps:
529529
- commands:
530530
- yarn install --immutable
531531
depends_on: []
532-
image: node:18.12.0-alpine
532+
image: node:20.9.0-alpine
533533
name: yarn-install
534534
- commands:
535535
- apk add --update jq bash
@@ -540,7 +540,7 @@ steps:
540540
- yarn-install
541541
environment:
542542
NODE_OPTIONS: --max_old_space_size=8192
543-
image: node:18.12.0-alpine
543+
image: node:20.9.0-alpine
544544
name: build-frontend-packages
545545
- failure: ignore
546546
image: grafana/drone-downstream
@@ -678,7 +678,7 @@ steps:
678678
- build-frontend-packages
679679
environment:
680680
NODE_OPTIONS: --max_old_space_size=4096
681-
image: node:18.12.0-alpine
681+
image: node:20.9.0-alpine
682682
name: build-storybook
683683
when:
684684
paths:
@@ -1035,7 +1035,7 @@ steps:
10351035
- commands:
10361036
- yarn install --immutable
10371037
depends_on: []
1038-
image: node:18.12.0-alpine
1038+
image: node:20.9.0-alpine
10391039
name: yarn-install
10401040
- commands:
10411041
- pip3 install codespell
@@ -1048,7 +1048,7 @@ steps:
10481048
- yarn-install
10491049
environment:
10501050
NODE_OPTIONS: --max_old_space_size=8192
1051-
image: node:18.12.0-alpine
1051+
image: node:20.9.0-alpine
10521052
name: lint-docs
10531053
- commands:
10541054
- mkdir -p /hugo/content/docs/grafana/latest
@@ -1388,7 +1388,7 @@ steps:
13881388
- commands:
13891389
- yarn install --immutable
13901390
depends_on: []
1391-
image: node:18.12.0-alpine
1391+
image: node:20.9.0-alpine
13921392
name: yarn-install
13931393
- commands:
13941394
- pip3 install codespell
@@ -1401,7 +1401,7 @@ steps:
14011401
- yarn-install
14021402
environment:
14031403
NODE_OPTIONS: --max_old_space_size=8192
1404-
image: node:18.12.0-alpine
1404+
image: node:20.9.0-alpine
14051405
name: lint-docs
14061406
- commands:
14071407
- mkdir -p /hugo/content/docs/grafana/latest
@@ -1462,22 +1462,22 @@ steps:
14621462
- commands:
14631463
- yarn install --immutable
14641464
depends_on: []
1465-
image: node:18.12.0-alpine
1465+
image: node:20.9.0-alpine
14661466
name: yarn-install
14671467
- commands:
14681468
- apk add --update git bash
14691469
- yarn betterer ci
14701470
depends_on:
14711471
- yarn-install
1472-
image: node:18.12.0-alpine
1472+
image: node:20.9.0-alpine
14731473
name: betterer-frontend
14741474
- commands:
14751475
- yarn run ci:test-frontend
14761476
depends_on:
14771477
- yarn-install
14781478
environment:
14791479
TEST_MAX_WORKERS: 50%
1480-
image: node:18.12.0-alpine
1480+
image: node:20.9.0-alpine
14811481
name: test-frontend
14821482
trigger:
14831483
branch: main
@@ -1519,7 +1519,7 @@ steps:
15191519
- commands:
15201520
- yarn install --immutable
15211521
depends_on: []
1522-
image: node:18.12.0-alpine
1522+
image: node:20.9.0-alpine
15231523
name: yarn-install
15241524
- commands:
15251525
- yarn run prettier:check
@@ -1529,7 +1529,7 @@ steps:
15291529
- yarn-install
15301530
environment:
15311531
TEST_MAX_WORKERS: 50%
1532-
image: node:18.12.0-alpine
1532+
image: node:20.9.0-alpine
15331533
name: lint-frontend
15341534
- commands:
15351535
- apk add --update git
@@ -1544,7 +1544,7 @@ steps:
15441544
- yarn run i18n:compile
15451545
depends_on:
15461546
- yarn-install
1547-
image: node:18.12.0-alpine
1547+
image: node:20.9.0-alpine
15481548
name: verify-i18n
15491549
trigger:
15501550
branch: main
@@ -1778,7 +1778,7 @@ steps:
17781778
- commands:
17791779
- yarn install --immutable
17801780
depends_on: []
1781-
image: node:18.12.0-alpine
1781+
image: node:20.9.0-alpine
17821782
name: yarn-install
17831783
- commands:
17841784
- apk add --update jq
@@ -1789,7 +1789,7 @@ steps:
17891789
- yarn install --mode=update-lockfile
17901790
depends_on:
17911791
- yarn-install
1792-
image: node:18.12.0-alpine
1792+
image: node:20.9.0-alpine
17931793
name: update-package-json-version
17941794
- commands:
17951795
- apk add --update jq bash
@@ -1801,7 +1801,7 @@ steps:
18011801
- update-package-json-version
18021802
environment:
18031803
NODE_OPTIONS: --max_old_space_size=8192
1804-
image: node:18.12.0-alpine
1804+
image: node:20.9.0-alpine
18051805
name: build-frontend-packages
18061806
- commands:
18071807
- /src/grafana-build package --distro=linux/amd64,linux/arm64 --go-version=1.20.10
@@ -1926,7 +1926,7 @@ steps:
19261926
- build-frontend-packages
19271927
environment:
19281928
NODE_OPTIONS: --max_old_space_size=4096
1929-
image: node:18.12.0-alpine
1929+
image: node:20.9.0-alpine
19301930
name: build-storybook
19311931
when:
19321932
paths:
@@ -1976,7 +1976,7 @@ steps:
19761976
GRAFANA_MISC_STATS_API_KEY:
19771977
from_secret: grafana_misc_stats_api_key
19781978
failure: ignore
1979-
image: node:18.12.0-alpine
1979+
image: node:20.9.0-alpine
19801980
name: publish-frontend-metrics
19811981
when:
19821982
repo:
@@ -2058,7 +2058,7 @@ steps:
20582058
environment:
20592059
NPM_TOKEN:
20602060
from_secret: npm_token
2061-
image: node:18.12.0-alpine
2061+
image: node:20.9.0-alpine
20622062
name: release-canary-npm-packages
20632063
when:
20642064
paths:
@@ -2686,7 +2686,7 @@ steps:
26862686
- commands:
26872687
- yarn install --immutable
26882688
depends_on: []
2689-
image: node:18.12.0-alpine
2689+
image: node:20.9.0-alpine
26902690
name: yarn-install
26912691
- commands:
26922692
- ./bin/build artifacts npm retrieve --tag ${DRONE_TAG}
@@ -2953,22 +2953,22 @@ steps:
29532953
- commands:
29542954
- yarn install --immutable
29552955
depends_on: []
2956-
image: node:18.12.0-alpine
2956+
image: node:20.9.0-alpine
29572957
name: yarn-install
29582958
- commands:
29592959
- apk add --update git bash
29602960
- yarn betterer ci
29612961
depends_on:
29622962
- yarn-install
2963-
image: node:18.12.0-alpine
2963+
image: node:20.9.0-alpine
29642964
name: betterer-frontend
29652965
- commands:
29662966
- yarn run ci:test-frontend
29672967
depends_on:
29682968
- yarn-install
29692969
environment:
29702970
TEST_MAX_WORKERS: 50%
2971-
image: node:18.12.0-alpine
2971+
image: node:20.9.0-alpine
29722972
name: test-frontend
29732973
trigger:
29742974
event:
@@ -3365,22 +3365,22 @@ steps:
33653365
- commands:
33663366
- yarn install --immutable
33673367
depends_on: []
3368-
image: node:18.12.0-alpine
3368+
image: node:20.9.0-alpine
33693369
name: yarn-install
33703370
- commands:
33713371
- apk add --update git bash
33723372
- yarn betterer ci
33733373
depends_on:
33743374
- yarn-install
3375-
image: node:18.12.0-alpine
3375+
image: node:20.9.0-alpine
33763376
name: betterer-frontend
33773377
- commands:
33783378
- yarn run ci:test-frontend
33793379
depends_on:
33803380
- yarn-install
33813381
environment:
33823382
TEST_MAX_WORKERS: 50%
3383-
image: node:18.12.0-alpine
3383+
image: node:20.9.0-alpine
33843384
name: test-frontend
33853385
trigger:
33863386
cron:
@@ -4386,7 +4386,7 @@ steps:
43864386
- commands:
43874387
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine/git:2.40.1
43884388
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM golang:1.20.10-alpine
4389-
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM node:18.12.0-alpine
4389+
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM node:20.9.0-alpine
43904390
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM google/cloud-sdk:431.0.0
43914391
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana-ci-deploy:1.3.3
43924392
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine:3.18.3
@@ -4420,7 +4420,7 @@ steps:
44204420
- commands:
44214421
- trivy --exit-code 1 --severity HIGH,CRITICAL alpine/git:2.40.1
44224422
- trivy --exit-code 1 --severity HIGH,CRITICAL golang:1.20.10-alpine
4423-
- trivy --exit-code 1 --severity HIGH,CRITICAL node:18.12.0-alpine
4423+
- trivy --exit-code 1 --severity HIGH,CRITICAL node:20.9.0-alpine
44244424
- trivy --exit-code 1 --severity HIGH,CRITICAL google/cloud-sdk:431.0.0
44254425
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/grafana-ci-deploy:1.3.3
44264426
- trivy --exit-code 1 --severity HIGH,CRITICAL alpine:3.18.3
@@ -4667,6 +4667,6 @@ kind: secret
46674667
name: gcr_credentials
46684668
---
46694669
kind: signature
4670-
hmac: 29a933affceb9cc39b285d936de9e6327deedbb80f1285fa645d596f89ede442
4670+
hmac: 975f4bc4ea819f11b9abf46a1e17fc55161551ab02b5c6a905393def886ad4ae
46714671

46724672
...

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.12.0
1+
v20.9.0

.yarn/releases/yarn-3.6.1.cjs .yarn/releases/yarn-3.6.4.cjs

+213-213
Large diffs are not rendered by default.

.yarnrc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ nodeLinker: pnp
55
packageExtensions:
66
'@storybook/[email protected]':
77
dependencies:
8-
'@storybook/react-webpack5': '7.4.5'
8+
'@storybook/react-webpack5': 7.4.5
99
1010
dependencies:
1111
assert: 2.0.0
@@ -35,7 +35,7 @@ plugins:
3535
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
3636
spec: 'https://mskelton.dev/yarn-outdated/v2'
3737

38-
yarnPath: .yarn/releases/yarn-3.6.1.cjs
38+
yarnPath: .yarn/releases/yarn-3.6.4.cjs
3939
# Uncomment the following lines if you want to use Verdaccio local npm registry. Read more at packages/README.md
4040
# npmScopes:
4141
# grafana:

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22

33
ARG BASE_IMAGE=alpine:3.18.3
4-
ARG JS_IMAGE=node:18-alpine3.18
4+
ARG JS_IMAGE=node:20-alpine3.18
55
ARG JS_PLATFORM=linux/amd64
66
ARG GO_IMAGE=golang:1.20.10-alpine3.18
77

contribute/developer-guide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ We recommend using [Homebrew](https://brew.sh/) for installing any missing depen
1818
```
1919
brew install git
2020
brew install go
21-
brew install node@18
21+
brew install node@20
2222
npm install -g yarn
2323
```
2424

@@ -61,7 +61,7 @@ To remove precommit hooks, run
6161
make lefthook-uninstall
6262
```
6363

64-
> [!NOTE]
64+
> [!NOTE]
6565
> 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.
6666
6767
## Build Grafana

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,9 @@
442442
]
443443
},
444444
"engines": {
445-
"node": ">= 18"
445+
"node": ">= 20"
446446
},
447-
"packageManager": "[email protected].1",
447+
"packageManager": "[email protected].4",
448448
"dependenciesMeta": {
449449
450450
"unplugged": true

packages/grafana-data/src/datetime/formats.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('Date Formats', () => {
1414
''
1515
);
1616

17-
expect(format).toBe('MM/DD/YYYY, hh:mm:ss A');
17+
expect(format).toBe('MM/DD/YYYY, hh:mm:ssA');
1818
});
1919
});
2020

@@ -52,8 +52,8 @@ describe('systemDateFormats', () => {
5252

5353
it('contains correct browser-localized date formats', () => {
5454
systemDateFormats.useBrowserLocale();
55-
expect(systemDateFormats.fullDate).toBe('MM/DD/YYYY, hh:mm:ss A');
56-
expect(systemDateFormats.fullDateMS).toBe('MM/DD/YYYY, hh:mm:ss.SSS A');
55+
expect(systemDateFormats.fullDate).toBe('MM/DD/YYYY, hh:mm:ssA');
56+
expect(systemDateFormats.fullDateMS).toBe('MM/DD/YYYY, hh:mm:ss.SSSA');
5757
expect(systemDateFormats.interval.millisecond).toBe('HH:mm:ss.SSS');
5858
expect(systemDateFormats.interval.second).toBe('HH:mm:ss');
5959
expect(systemDateFormats.interval.minute).toBe('HH:mm');

0 commit comments

Comments
 (0)