Skip to content

Commit

Permalink
Upgrade node dependencies and node to 22
Browse files Browse the repository at this point in the history
Issue: BB-585
  • Loading branch information
KillianG committed Nov 5, 2024
1 parent 0a32e66 commit b158da4
Show file tree
Hide file tree
Showing 9 changed files with 2,382 additions and 3,751 deletions.
2 changes: 1 addition & 1 deletion .github/dockerfiles/syntheticbucketd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
FROM node:22

RUN mkdir /app
COPY package.json /app
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/run_ft_tests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ NODE_PATH=${NODE_PATH:-node_modules}
# port for cloudserver
PORT=8000

git clone --branch 8.6.8 [email protected]:scality/cloudserver

if [ ! -d "${NODE_PATH}/@zenko/cloudserver" ]; then
echo "cloudserver module was not found!"
exit 1
Expand All @@ -19,6 +21,6 @@ killandsleep () {
sleep 10
}

cd ${NODE_PATH}/@zenko/cloudserver && yarn run mem_backend & bash tests/utils/wait_for_local_port.bash $PORT 40
cd cloudserver && yarn run mem_backend & bash tests/utils/wait_for_local_port.bash $PORT 40
./node_modules/.bin/nyc --clean --silent yarn run $1
./node_modules/.bin/nyc report --report-dir "./coverage/$1" --reporter=lcov
5 changes: 5 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '22'
cache: yarn

- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v3

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '22'
cache: yarn

# TODO: remove the following step once Oras CLI 0.13.0 bug https://github.com/oras-project/oras/issues/447 is fixed.
- name: Downgrade Oras to 0.12.0
run: |
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: tests

env:
GINKGO_VERSION: v1.15.2
GINKGO_VERSION: v2.21.0

on:
push:
Expand All @@ -21,6 +21,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '22'
cache: yarn

- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v3

Expand Down Expand Up @@ -67,17 +72,17 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.16.2'
go-version: '1.23.0'
cache-dependency-path: bucket-scanner/go.sum

- name: Install ginkgo
run: go get github.com/onsi/ginkgo/ginkgo@${GINKGO_VERSION}
run: go install github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION}

- name: Run bucket scanner unit tests
run: >-
ginkgo -r --randomizeAllSpecs --randomizeSuites --failOnPending --progress \
ginkgo -r --randomize-suites --fail-on-pending --show-node-events \
--cover --trace --race --covermode=atomic --coverprofile=coverage.out \
-nodes 1 -stream -timeout 5m -slowSpecThreshold 60
-nodes 1 -stream -timeout 5m
working-directory: bucket-scanner

- uses: codecov/codecov-action@v4
Expand Down Expand Up @@ -120,7 +125,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '22'
cache: yarn
- name: Install node dependencies
run: yarn install --ignore-engines --frozen-lockfile --network-concurrency 1
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG NODE_VERSION=16.20-bullseye-slim
ARG NODE_VERSION=22.11.0-bullseye-slim

FROM node:${NODE_VERSION} as builder
FROM node:${NODE_VERSION} AS builder

WORKDIR /usr/src/app

Expand All @@ -22,7 +22,7 @@ RUN apt-get update \
libffi-dev \
libzstd-dev

ENV DOCKERIZE_VERSION v0.6.1
ENV DOCKERIZE_VERSION=v0.8.0

RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
Expand Down
66 changes: 66 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import mocha from "eslint-plugin-mocha";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends("scality"), {
plugins: {
mocha,
},

languageOptions: {
ecmaVersion: 2020,
sourceType: "script",
},

settings: {
"import/resolver": {
node: {
paths: ["/backbeat/node_modules", "node_modules"],
},
},
},

rules: {
"object-curly-newline": "off",
"import/newline-after-import": "off",
"import/order": "off",
"prefer-destructuring": "off",
"operator-linebreak": "off",
"no-underscore-dangle": "off",
indent: "off",
"function-paren-newline": "off",
"implicit-arrow-linebreak": "off",
"no-bitwise": "off",
"comma-dangle": "off",
"padded-blocks": "off",
"lines-around-directive": "off",
"global-require": "off",
"import/no-dynamic-require": "off",
"object-property-newline": "off",
"no-plusplus": "off",
"class-methods-use-this": "off",
"no-lonely-if": "off",
"no-else-return": "off",
"dot-location": "off",
"no-restricted-properties": "off",
"no-buffer-constructor": "off",
"no-restricted-globals": "off",
"no-useless-return": "off",
"no-multi-spaces": "off",
"space-unary-ops": "off",
"no-undef-init": "off",
"newline-per-chained-call": "off",
"no-useless-escape": "off",
"mocha/no-exclusive-tests": "error",
},
}];
56 changes: 29 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,48 +46,50 @@
"homepage": "https://github.com/scality/backbeat#readme",
"dependencies": {
"JSONStream": "^1.3.5",
"arsenal": "git+https://github.com/scality/arsenal#8.1.115",
"async": "^2.3.0",
"arsenal": "git+https://github.com/scality/arsenal#9a6451d247a8c53605e0311b4b3824f2612481eb",
"async": "^3.2.6",
"aws-sdk": "^2.938.0",
"backo": "^1.1.0",
"breakbeat": "scality/breakbeat#v1.0.3",
"bucketclient": "scality/bucketclient#8.1.9",
"commander": "^2.11.0",
"bucketclient": "scality/bucketclient#dcb0ebd98bae477cfe8ac8f03621f8b412baa8db",
"commander": "^12.1.0",
"eslint-plugin-mocha": "^10.2.0",
"fcntl": "github:scality/node-fcntl#0.2.2",
"httpagent": "git+https://github.com/scality/httpagent#1.0.6",
"ioredis": "^4.9.5",
"httpagent": "git+https://github.com/scality/httpagent#1.1.0",
"ioredis": "^5.4.1",
"joi": "^17.6.0",
"minimatch": "^3.0.4",
"mongodb": "^3.1.13",
"node-forge": "^0.7.6",
"node-rdkafka": "^2.12.0",
"minimatch": "^10.0.1",
"mongodb": "^6.10.0",
"node-forge": "^1.3.1",
"node-rdkafka": "^3.1.1",
"node-rdkafka-prometheus": "^1.0.0",
"node-schedule": "^1.2.0",
"node-schedule": "^2.1.1",
"node-zookeeper-client": "^1.1.3",
"prom-client": "14.2.0",
"semver": "^5.6.0",
"typescript": "^4.9.5",
"uuid": "^3.1.0",
"vaultclient": "scality/vaultclient#8.3.11",
"werelogs": "scality/werelogs#8.1.2"
"prom-client": "15.1.3",
"semver": "^7.6.3",
"typescript": "^5.6.3",
"uuid": "^11.0.2",
"vaultclient": "scality/vaultclient#8.5.1",
"werelogs": "scality/werelogs#8.2.0"
},
"resolutions": {
"node-rdkafka-prometheus/prom-client": "14.2.0"
},
"devDependencies": {
"@zenko/cloudserver": "git+https://github.com/scality/cloudserver#8.6.8",
"c8": "^8.0.1",
"eslint": "^8.14.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-scality": "scality/Guidelines#8.2.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"c8": "^10.1.2",
"eslint": "^9.14.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-scality": "scality/Guidelines#8.3.0",
"eslint-plugin-import": "^2.14.0",
"lolex": "^2.7.5",
"mocha": "^3.3.0",
"nyc": "^15.1.0",
"sinon": "^10.0.0",
"lolex": "^6.0.0",
"mocha": "^10.8.2",
"nyc": "^17.1.0",
"sinon": "^19.0.2",
"zookeeper-mock": "^1.2.0"
},
"engines": {
"node": ">=16"
"node": ">=22"
}
}
Loading

0 comments on commit b158da4

Please sign in to comment.