Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/actions/setup-ci/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ runs:
run: |-
set -exu;
mkdir -p /tmp/coverage/${JOB_NAME}/;
- name: Enable Corepack
shell: bash
run: corepack enable
- uses: actions/setup-node@v4
id: node
with:
Expand All @@ -43,11 +46,11 @@ runs:
- name: install typescript
shell: bash
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn global add typescript@4.9.5
run: npm install -g typescript@4.9.5
- name: install dependencies
shell: bash
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --ignore-engines --frozen-lockfile --network-concurrency 1
run: yarn install --immutable
- uses: actions/cache@v6
with:
path: ~/.cache/pip
Expand Down
4 changes: 2 additions & 2 deletions .github/docker/docker-compose.sse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
# root because S3C images needs ownership permission on files and mounted paths
user: root
command: sh -c "chmod 400 tests/utils/keyfile && yarn start > /artifacts/vault.log 2> /artifacts/vault-stderr.log"
network_mode: "host"
network_mode: 'host'
volumes:
- /tmp/artifacts/${JOB_NAME}:/artifacts
- ./vault-config.json:/conf/config.json:ro
Expand Down Expand Up @@ -41,4 +41,4 @@ services:
cloudserver-sse-migration:
extends: cloudserver-sse-before-migration
profiles: [sse-migration]
command: sh -c "yarn start > /artifacts/s3.migration.log 2> /artifacts/s3-stderr.migration.log"
command: sh -c "npm run start > /artifacts/s3.migration.log 2> /artifacts/s3-stderr.migration.log"
6 changes: 4 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: '22.23.1'
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --network-concurrency 1
run: yarn install --immutable
- name: Prettier (changed files)
shell: bash
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
MERGE_BASE=$(git merge-base HEAD "origin/${BASE_REF}")
yarn run --silent prettier:diff --check "${MERGE_BASE}..HEAD"
yarn prettier:diff --check "${MERGE_BASE}..HEAD"
27 changes: 19 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
id: node
with:
Expand All @@ -96,10 +98,10 @@ jobs:
- name: install typescript
shell: bash
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn global add typescript@4.9.5
run: npm install -g typescript@4.9.5
- name: install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-concurrency 1
run: yarn install --immutable
- uses: actions/setup-python@v5
with:
python-version: '3.9'
Expand All @@ -108,9 +110,9 @@ jobs:
run: pip install flake8
- name: Lint Javascript (strict, excluding async migration rules)
run: |
yarn run --silent lint -- --max-warnings 0 --rule "promise/prefer-await-to-then: off" --rule "n/callback-return: off"
yarn lint --max-warnings 0 --rule "promise/prefer-await-to-then: off" --rule "n/callback-return: off"
- name: Lint Markdown
run: yarn run --silent lint_md
run: yarn lint_md
- name: Lint python
run: flake8 $(git ls-files "*.py")
- name: Lint Yaml
Expand All @@ -132,6 +134,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
id: node
with:
Expand All @@ -144,7 +148,7 @@ jobs:
key: ${{ runner.os }}-node-${{ steps.node.outputs.node-version }}-modules-${{ hashFiles('yarn.lock') }}
- name: install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-concurrency 1
run: yarn install --immutable
- name: Count async/await migration progress
run: yarn run count-async

Expand All @@ -153,6 +157,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
id: node
with:
Expand All @@ -166,15 +172,18 @@ jobs:
- name: install typescript
shell: bash
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn global add typescript@4.9.5
run: npm install -g typescript@4.9.5
- name: install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-concurrency 1
run: yarn install --immutable
- name: Unit Coverage
run: |
set -ex
yarn run cover test
yarn run cover test_legacy_location
# Berry does not run post* lifecycle scripts, so postcover
# (which writes the lcov report) has to be invoked explicitly.
yarn run postcover
env:
S3_LOCATION_FILE: tests/locationConfig/locationConfigTests.json
NO_PROXY: 'test.scality.com,scality.com'
Expand Down Expand Up @@ -1171,6 +1180,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
id: node
with:
Expand All @@ -1183,7 +1194,7 @@ jobs:
key: ${{ runner.os }}-node-${{ steps.node.outputs.node-version }}-modules-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-concurrency 1
run: yarn install --immutable
- name: Delete stale GCP CI buckets
run: yarn run cleanup_gcp_buckets
env:
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ junit

# config file build using jq to merge configs json
tests/functional/sse-kms-migration/config.json

# Yarn (Berry) — see .yarnrc.yml
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
21 changes: 21 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
nodeLinker: node-modules

# Required, not optional: Yarn's default is an empty allowlist, which blocks
# every Git fetch, so a repo with Git dependencies cannot install without
# this. Scoped to Scality rather than the "**" Yarn writes during migration.
# Every Git resolution here uses the .git clone form, which is the code path
# that actually enforces this (hosted github: shorthand would not be).
# npmMinimalAgeGate is deliberately left at Yarn's 1-day default, and
# enableScripts at its secure default — the packages that genuinely need
# compiling are allowlisted individually in package.json dependenciesMeta.
approvedGitRepositories:
- 'https://github.com/scality/*'
- 'ssh://git@github.com/scality/*'

# Several dependencies are Git repos that still carry Yarn 1 lockfiles, so Yarn
# bootstraps them with Yarn Classic when repacking. Run those serially: in
# parallel they race on Classic's shared cache and packing fails with ENOENT
# (YN0058). This replaces the --network-concurrency 1 flag Yarn 1 used, which
# Berry rejects on the CLI but still honours as a setting.
networkConcurrency: 1
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ ENV PYTHON=python3
RUN npm install -g \
node-gyp \
typescript@4.9.5
COPY package.json yarn.lock /usr/src/app/
COPY package.json yarn.lock .yarnrc.yml /usr/src/app/

RUN yarn install --production --frozen-lockfile --ignore-engines --network-concurrency 1
# `workspaces focus` cannot enforce lockfile immutability (it silently
# re-resolves), so validate the lockfile first with a cheap build-less
# install. Together these preserve what --frozen-lockfile used to give us.
RUN corepack enable \
&& yarn install --immutable --mode=skip-build \
&& yarn workspaces focus --production

################################################################################
FROM node:${NODE_VERSION} AS production
Expand Down Expand Up @@ -56,11 +61,11 @@ VOLUME ["/usr/src/app/localData","/usr/src/app/localMetadata"]

ENTRYPOINT ["tini", "-g", "--", "/usr/src/app/docker-entrypoint.sh"]

CMD [ "yarn", "start" ]
CMD [ "npm", "run", "start" ]

################################################################################
FROM production AS testcoverage

RUN yarn global add nyc
RUN npm install -g nyc

CMD [ "./docker-test-with-coverage.sh" ]
2 changes: 1 addition & 1 deletion docker-test-with-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

nyc --clean --silent yarn start > /artifacts/s3.log 2> /artifacts/s3-stderr.log &
nyc --clean --silent npm run start > /artifacts/s3.log 2> /artifacts/s3-stderr.log &

PID=$!

Expand Down
45 changes: 35 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@opentelemetry/instrumentation-http": "~0.218.0",
"@opentelemetry/instrumentation-ioredis": "~0.64.0",
"@opentelemetry/instrumentation-mongodb": "~0.69.0",
"@scality/cloudserverclient": "1.0.12",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/arsenal#8.5.17",
"async": "2.6.4",
Expand All @@ -57,14 +58,13 @@
"request": "^2.88.2",
"scubaclient": "git+https://github.com/scality/scubaclient.git#1.1.4",
"sql-where-parser": "^2.2.1",
"utapi": "github:scality/utapi#8.2.4",
"utapi": "github:scality/utapi#8.2.7",
"utf-8-validate": "^6.0.5",
"utf8": "^3.0.0",
"uuid": "^11.0.3",
"vaultclient": "scality/vaultclient#8.5.8",
"werelogs": "scality/werelogs#semver:^8.2.4",
"ws": "^8.18.0",
"@scality/cloudserverclient": "1.0.12",
"xml2js": "^0.6.2"
},
"devDependencies": {
Expand Down Expand Up @@ -95,9 +95,7 @@
"resolutions": {
"jsonwebtoken": "^9.0.0",
"nan": "v2.22.0",
"fast-xml-parser": "^5.5.6",
"ts-morph/**/brace-expansion": "^5.0.5",
"ts-morph/**/picomatch": "^4.0.4"
"fast-xml-parser": "^5.5.6"
},
"countAsyncSourcePaths": [
"lib/**/*.js",
Expand All @@ -123,14 +121,14 @@
"ft_awssdk_external_backends": "cd tests/functional/aws-node-sdk && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json test/multipleBackend --exit",
"ft_checksums_disabled": "cd tests/functional/checksumsDisabled && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 120000 *.js --exit",
"ft_mixed_bucket_format_version": "cd tests/functional/metadata && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json MixedVersionFormat.js --exit",
"ft_management": "cd tests/functional/report && yarn test",
"ft_management": "cd tests/functional/report && mocha -t 40000 *.js --exit",
"ft_backbeat": "cd tests/functional/backbeat && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js --exit",
"ft_node": "cd tests/functional/raw-node && yarn test",
"ft_node_routes": "cd tests/functional/raw-node && yarn run test-routes",
"ft_node": "cd tests/functional/raw-node && mocha -t 40000 test/ --exit",
"ft_node_routes": "cd tests/functional/raw-node && mocha -t 40000 test/routes/ --exit",
"ft_route_backbeat": "cd tests/multipleBackend/routes && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 routeBackbeat.js routeBackbeatForReplication.js --exit",
"ft_gcp": "cd tests/functional/raw-node && yarn run test-gcp",
"ft_gcp": "cd tests/functional/raw-node && mocha -t 40000 test/GCP/ --exit",
"cleanup_gcp_buckets": "node .github/scripts/cleanupOldGCPBuckets.js",
"ft_healthchecks": "cd tests/functional/healthchecks && yarn test",
"ft_healthchecks": "cd tests/functional/healthchecks && mocha -t 40000 test/ --exit",
"ft_s3cmd": "cd tests/functional/s3cmd && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js --exit",
"ft_s3curl": "cd tests/functional/s3curl && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js --exit",
"ft_scripts": "cd tests/functional/scripts && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js --exit",
Expand Down Expand Up @@ -171,5 +169,32 @@
"check-diff-async": "node .github/scripts/check-diff-async.mjs",
"prettier": "prettier",
"prettier:diff": "bash scripts/prettier-diff.sh"
},
"packageManager": "yarn@4.18.0+sha512.fcb8716fe7cd0eece141ffc18b92193a9df9204c1ba83189c288835223fc0bbe64af473bab0d5e9927a7daeb5caf2bb07eb2787cc9338ca040ea125f2a1f2f7e",
"dependenciesMeta": {
"aws-crt": {
"built": true
},
"bufferutil": {
"built": true
},
"diskusage": {
"built": true
},
"fcntl": {
"built": true
},
"ioctl": {
"built": true
},
"leveldown": {
"built": true
},
"scubaclient": {
"built": true
},
"utf-8-validate": {
"built": true
}
}
}
Loading
Loading