Skip to content

Commit

Permalink
Merge branches 'development/7.70' and 'w/7.10/dependabot/npm_and_yarn…
Browse files Browse the repository at this point in the history
…/development/7.4/xml2js-0.6.0' into tmp/octopus/w/7.70/dependabot/npm_and_yarn/development/7.4/xml2js-0.6.0
  • Loading branch information
bert-e committed Jul 13, 2023
3 parents 274125b + 68e4b06 + bd540ba commit a57e6a9
Show file tree
Hide file tree
Showing 19 changed files with 1,806 additions and 191 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: codeQL

on:
push:
branches: [development/*, stabilization/*, hotfix/*]
pull_request:
branches: [development/*, stabilization/*, hotfix/*]
workflow_dispatch:

jobs:
analyze:
name: Static analysis with CodeQL
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript, python, ruby

- name: Build and analyze
uses: github/codeql-action/analyze@v2
16 changes: 16 additions & 0 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: dependency review

on:
pull_request:
branches: [development/*, stabilization/*, hotfix/*]

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3

- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
12 changes: 3 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,31 +226,25 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: |
2.7
3.9
python-version: 3.9
- name: Setup CI environment
uses: ./.github/actions/setup-ci
- name: Setup matrix job artifacts directory
shell: bash
run: |
set -exu
mkdir -p /tmp/artifacts/${{ matrix.job-name }}/
- name: Setup python2 test environment
- name: Setup python test environment
run: |
sudo apt-get install -y libdigest-hmac-perl
pip install virtualenv==20.21.0
virtualenv -p $(which python2) ~/.virtualenv/py2
source ~/.virtualenv/py2/bin/activate
pip install 's3cmd==1.6.1'
pip install 's3cmd==2.3.0'
- name: Setup CI services
run: docker-compose up -d
working-directory: .github/docker
- name: Run file ft tests
run: |-
set -o pipefail;
bash wait_for_local_port.bash 8000 40
source ~/.virtualenv/py2/bin/activate
yarn run ft_test | tee /tmp/artifacts/${{ matrix.job-name }}/tests.log
- name: Upload logs to artifacts
uses: scality/action-artifacts@v3
Expand Down
1 change: 1 addition & 0 deletions constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ const constants = {
assumedRoleArnResourceType: 'assumed-role',
// Session name of the backbeat lifecycle assumed role session.
backbeatLifecycleSessionName: 'backbeat-lifecycle',
multiObjectDeleteConcurrency: 50,
};

module.exports = constants;
11 changes: 11 additions & 0 deletions lib/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const { azureAccountNameRegex, base64Regex,
} = require('../constants');
const { utapiVersion } = require('utapi');
const { versioning } = require('arsenal');
const constants = require('../constants');

const versionIdUtils = versioning.VersionID;

Expand Down Expand Up @@ -1320,6 +1321,16 @@ class Config extends EventEmitter {
}

this.lifecycleRoleName = config.lifecycleRoleName || null;
this.multiObjectDeleteConcurrency = constants.multiObjectDeleteConcurrency;
const extractedNumber = Number.parseInt(config.multiObjectDeleteConcurrency, 10);
if (!isNaN(extractedNumber) && extractedNumber > 0 && extractedNumber < 1000) {
this.multiObjectDeleteConcurrency = extractedNumber;
}

this.multiObjectDeleteEnableOptimizations = true;
if (config.multiObjectDeleteEnableOptimizations === false) {
this.multiObjectDeleteEnableOptimizations = false;
}
}

_configureBackends() {
Expand Down
18 changes: 18 additions & 0 deletions lib/api/apiUtils/object/deleteObject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* _bucketRequiresOplogUpdate - DELETE an object from a bucket
* @param {BucketInfo} bucket - bucket object
* @return {boolean} whether objects require oplog updates on deletion, or not
*/
function _bucketRequiresOplogUpdate(bucket) {
// Default behavior is to require an oplog update
if (!bucket || !bucket.getLifecycleConfiguration || !bucket.getNotificationConfiguration) {
return true;
}
// If the bucket has lifecycle configuration or notification configuration
// set, we also require an oplog update
return bucket.getLifecycleConfiguration() || bucket.getNotificationConfiguration();
}

module.exports = {
_bucketRequiresOplogUpdate,
};
Loading

0 comments on commit a57e6a9

Please sign in to comment.