diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index aed8ebf0f..be1997d14 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '22' cache: 'yarn' - name: install dependencies run: yarn install --frozen-lockfile --prefer-offline --network-concurrency 1 @@ -43,6 +43,8 @@ jobs: sudo sh -c "echo '127.0.0.1 testrequestbucket.localhost' >> /etc/hosts" - name: test and coverage run: yarn --silent coverage + env: + NODE_OPTIONS: "--tls-max-v1.2" - name: run functional tests run: yarn ft_test - uses: codecov/codecov-action@v4 @@ -62,7 +64,7 @@ jobs: - name: Install NodeJS uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '22' cache: yarn - name: Install dependencies run: yarn install --frozen-lockfile --prefer-offline diff --git a/lib/models/ReplicationConfiguration.ts b/lib/models/ReplicationConfiguration.ts index 0010788c9..6f853088f 100644 --- a/lib/models/ReplicationConfiguration.ts +++ b/lib/models/ReplicationConfiguration.ts @@ -1,5 +1,5 @@ import assert from 'assert'; -import UUID from 'uuid'; +const { v4: uuid } = require('uuid'); import { RequestLogger } from 'werelogs'; @@ -157,7 +157,7 @@ export default class ReplicationConfiguration { obj.id = rule.ID && rule.ID[0] !== '' ? rule.ID[0] - : Buffer.from(UUID.v4()).toString('base64'); + : Buffer.from(uuid()).toString('base64'); // StorageClass is an optional property. if (rule.Destination[0].StorageClass) { obj.storageClass = rule.Destination[0].StorageClass[0]; diff --git a/lib/policyEvaluator/utils/conditions.ts b/lib/policyEvaluator/utils/conditions.ts index fa91c1a52..719a98409 100644 --- a/lib/policyEvaluator/utils/conditions.ts +++ b/lib/policyEvaluator/utils/conditions.ts @@ -277,7 +277,7 @@ export function convertConditionOperator(operator: string): boolean { } else { return policyValRegex(key); } - return true; + return undefined; }, StringNotLike: function stringNotLike(key: string, value: string[]) { return !operatorMap.StringLike(key, value); diff --git a/package.json b/package.json index aca05b9a9..0b8d23b75 100644 --- a/package.json +++ b/package.json @@ -84,11 +84,11 @@ "lint": "eslint $(git ls-files '*ts' ' *.js')", "lint_md": "mdlint $(git ls-files '*.md')", "lint_yml": "yamllint $(git ls-files '*.yml')", - "test": "export NODE_OPTIONS=\"--tls-max-v1.2\" && jest tests/unit --detectOpenHandles", + "test": "jest tests/unit --detectOpenHandles", "build": "tsc", "prepare": "yarn build", "ft_test": "jest tests/functional --testTimeout=120000 --forceExit", - "coverage": "export NODE_OPTIONS=\"--tls-max-v1.2\" && nyc --clean jest tests --coverage --testTimeout=120000 --forceExit", + "coverage": "nyc --clean jest tests --coverage --testTimeout=120000 --forceExit", "build_doc": "cd documentation/listingAlgos/pics; dot -Tsvg delimiterStateChart.dot > delimiterStateChart.svg; dot -Tsvg delimiterMasterV0StateChart.dot > delimiterMasterV0StateChart.svg; dot -Tsvg delimiterVersionsStateChart.dot > delimiterVersionsStateChart.svg" }, "private": true,