-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement/cldsrv 553 bump deps #5711
base: development/9.0
Are you sure you want to change the base?
Conversation
Hello benzekrimaha,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
dcc7c34
to
0eadb81
Compare
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
Dockerfile
Outdated
@@ -1,4 +1,4 @@ | |||
ARG NODE_VERSION=16.20.2-bookworm-slim | |||
ARG NODE_VERSION=22-bookworm-slim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should stick to a specific node version, to ensure reproductible & repeatable builds
RUN npm install -g node-gyp | ||
COPY package.json yarn.lock /usr/src/app/ | ||
RUN npm install [email protected] -g |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best to install all "global" packages in a single step,
before package.json copy (to avoid invalidatoin),
and specifying the node-gyp version (just like we do for typescript)
RUN npm install -g node-gyp | |
COPY package.json yarn.lock /usr/src/app/ | |
RUN npm install [email protected] -g | |
RUN npm install -g \ | |
[email protected] \ | |
[email protected] | |
COPY package.json yarn.lock /usr/src/app/ |
@@ -154,13 +154,6 @@ function prepareRequestContexts(apiMethod, request, sourceBucket, | |||
generateRequestContext('objectPutTaggingVersion'); | |||
requestContexts.push(putObjectVersionRequestContext); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we changing permissions?
if it was (already) a bug, it shoudl be fixed on 8.8 as well instead here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benzekrimaha did you miss this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not changing the permission ,this code is actually duplicated see here : https://github.com/scality/cloudserver/pull/5711/files#diff-465d8f1849b67c1a40847391c0a7ea074b6357a8b7cdeb2db2be89ad9dfce50bL79-L80
we are never going to cross this condition
15b93ac
to
57325de
Compare
57325de
to
2639bf6
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
8bb9b0a
to
b5e6e01
Compare
@@ -342,39 +342,6 @@ jobs: | |||
source: /tmp/artifacts | |||
if: always() | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be skipped instead of removed:
utapi-v2-tests: | |
if: false |
please rebase, there are conflicts. |
@@ -1,4 +0,0 @@ | |||
#!/usr/bin/env node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should keep this file, and just add early return (if needed) in listMetrics()
#!/usr/bin/env node | ||
'use strict'; // eslint-disable-line strict | ||
|
||
require('../lib/utapi/utilities.js').listMetrics('buckets'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should keep this file, and just add early return (if needed) in listMetrics()
@@ -149,7 +149,7 @@ jobs: | |||
if: always() | |||
|
|||
build: | |||
runs-on: ubuntu-20.04 | |||
runs-on: ubuntu-latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best to specify the version explicitely (24.04)
@@ -261,6 +263,9 @@ function bucketPutACL(authInfo, request, log, callback) { | |||
return next(null, bucket, revisedAddACLParams); | |||
}); | |||
} | |||
if (hasError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be earlier in the code (eright after the jsonGrants.forEach
loop) : otherwise we may continue while we had an error, and risk calling the callback again (like on line 263)
@@ -272,6 +274,9 @@ function objectPutACL(authInfo, request, log, cb) { | |||
revisedAddACLParams); | |||
}); | |||
} | |||
if (hasError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, should be called earlier : to avoid having a duplicate call via line 273...
// const { config } = require('../Config'); | ||
|
||
const reindexConfig = config.utapi && config.utapi.reindex; | ||
if (reindexConfig && reindexConfig.password === undefined) { | ||
reindexConfig.password = config.utapi && config.utapi.redis | ||
&& config.utapi.redis.password; | ||
} | ||
const reindex = new UtapiReindex(reindexConfig); | ||
reindex.start(); | ||
// const reindexConfig = config.utapi && config.utapi.reindex; | ||
// if (reindexConfig && reindexConfig.password === undefined) { | ||
// reindexConfig.password = config.utapi && config.utapi.redis | ||
// && config.utapi.redis.password; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to comment these
// const _config = require('../Config').config; | ||
|
||
const utapiConfig = _config.utapi && | ||
Object.assign({}, _config.utapi, { redis: _config.redis }); | ||
const replay = new UtapiReplay(utapiConfig); // start utapi server | ||
replay.start(); | ||
// const utapiConfig = _config.utapi && | ||
// Object.assign({}, _config.utapi, { redis: _config.redis }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to comment
const { azureAccountNameRegex, base64Regex, | ||
allowedUtapiEventFilterFields, allowedUtapiEventFilterStates, | ||
supportedLifecycleRules | ||
} = require('../constants'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change not needed?
@@ -1236,7 +1233,7 @@ class Config extends EventEmitter { | |||
maxStaleness, | |||
enableInflights, | |||
}; | |||
if (config.utapi) { | |||
if (config.utapi && false) { // eslint-disable-line no-constant-condition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to change, will work in case we don't have utapi?
if (Object.keys(this.locationConstraints).some( | ||
loc => this.locationConstraints[loc].sizeLimitGB)) { | ||
loc => this.locationConstraints[loc].sizeLimitGB) && false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to 'fase' this, we should never run into this code anyway
@@ -3,7 +3,7 @@ const { EventEmitter } = require('events'); | |||
const fs = require('fs'); | |||
const path = require('path'); | |||
const url = require('url'); | |||
const crypto = require('crypto'); | |||
const mycrypto = require('crypto'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why rename?
can't we use node22's new built-in crypto module?
@@ -1,5 +1,5 @@ | |||
const childProcess = require('child_process'); | |||
const Promise = require('bluebird'); | |||
const myPromise = require('bluebird'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename bluebirdPromise
(or bbPromise
).... or can we switch to using "standard" node.js Promise instead ?
@@ -1,6 +1,6 @@ | |||
const assert = require('assert'); | |||
const tv4 = require('tv4'); | |||
const Promise = require('bluebird'); | |||
const myPromise = require('bluebird'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -1,5 +1,5 @@ | |||
const assert = require('assert'); | |||
const process = require('process'); | |||
const myProcess = require('process'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we switch to using the new standard process module?
const process = require('node:process');
@@ -1,5 +1,5 @@ | |||
const assert = require('assert'); | |||
const process = require('process'); | |||
const myProcess = require('process'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -31,7 +31,7 @@ const bigMD5 = '5f363e0e58a95f06cbe9bbc662c5dfb6'; | |||
const emptyMD5 = 'd41d8cd98f00b204e9800998ecf8427e'; | |||
const locMetaHeader = constants.objectLocationConstraintHeader.substring(11); | |||
|
|||
const Promise = require('bluebird'); | |||
const myPromise = require('bluebird'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use default Promise & promisify?
@@ -19,7 +19,7 @@ const body = Buffer.from('I am a body', 'utf8'); | |||
const correctMD5 = 'be747eb4b75517bf6b3cf7c5fbb62f3a'; | |||
const emptyMD5 = 'd41d8cd98f00b204e9800998ecf8427e'; | |||
const locMetaHeader = constants.objectLocationConstraintHeader.substring(11); | |||
const Promise = require('bluebird'); | |||
const myPromise = require('bluebird'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use default Promise & promisify?
@@ -1,5 +1,5 @@ | |||
const assert = require('assert'); | |||
const crypto = require('crypto'); | |||
const myCrypto = require('crypto'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use default node:crypto ?
@@ -11,7 +11,7 @@ const { versioningEnabled } = require('../../../lib/utility/versioning-util'); | |||
const { describeSkipIfNotMultiple, getAwsRetry, awsLocation, | |||
awsLocationEncryption, memLocation, fileLocation, genUniqID, isCEPH } | |||
= require('../utils'); | |||
const Promise = require('bluebird'); | |||
const myPromise = require('bluebird'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -1,5 +1,5 @@ | |||
const assert = require('assert'); | |||
const crypto = require('crypto'); | |||
const myCrypto = require('crypto'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
const myCrypto = require('crypto'); | ||
|
||
const Promise = require('bluebird'); | ||
const myPromise = require('bluebird'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
reject(result); | ||
} else { | ||
resolve(result); | ||
(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this?
since the code is already async/wait, we can simply remove the outer Promise, and keep the function async:
const sendRequest = async (method, host, path, body = '', config = null) =>
const service = 's3';
const endpoint = new AWS.Endpoint(host);
[...]
const response = await nodeFetch(url, options);
const text = await response.text();
const result = await xml2js.parseStringPromise(text);
if (result && result.Error) {
throw result;
}
return result;
}
after(() => { | ||
mongoClient.close(true); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mongodClient.close() is async (ie returns a Promise), so need to make the function passed to after async as well: too ensure it waits until mongo client is closed.
after(() => { | |
mongoClient.close(true); | |
}); | |
after(() => mongoClient.close(true)); |
or
after(() => { | |
mongoClient.close(true); | |
}); | |
after(async () => { | |
await mongoClient.close(true); | |
}); |
@@ -44,7 +44,7 @@ const updatedObjVal = { updated: true }; | |||
const runIfMongo = | |||
process.env.S3METADATA === 'mongodb' ? describe : describe.skip; | |||
|
|||
function unescape(obj) { | |||
function unescapeFunc(obj) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function unescapeFunc(obj) { | |
function unescapeJSON(obj) { |
@@ -1,11 +1,11 @@ | |||
const crypto = require('crypto'); | |||
const myCrypto = require('crypto'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use node:crypto?
|
||
const proc = require('child_process'); | ||
const process = require('process'); | ||
const myProcess = require('process'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use node:process ?
const myProcess = require('process'); | ||
const parseString = require('xml2js').parseString; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -1,7 +1,7 @@ | |||
const assert = require('assert'); | |||
const AWS = require('aws-sdk'); | |||
const async = require('async'); | |||
const crypto = require('crypto'); | |||
const myCrypto = require('crypto'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use node:crypto?
@@ -1,5 +1,5 @@ | |||
const assert = require('assert'); | |||
const crypto = require('crypto'); | |||
const myCrypto = require('crypto'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
before(async () => { | ||
const config = getConfig('default', { signatureVersion: 'v4', maxRetries: 0 }); | ||
s3Client = new S3(config); | ||
scuba.start(); | ||
return metadata.setup(err => wait(2000, () => done(err))); | ||
await new Promise((resolve, reject) => { | ||
metadata.setup(err => { | ||
if (err) { | ||
reject(err); | ||
} | ||
wait(2000, resolve); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before(async () => { | |
const config = getConfig('default', { signatureVersion: 'v4', maxRetries: 0 }); | |
s3Client = new S3(config); | |
scuba.start(); | |
return metadata.setup(err => wait(2000, () => done(err))); | |
await new Promise((resolve, reject) => { | |
metadata.setup(err => { | |
if (err) { | |
reject(err); | |
} | |
wait(2000, resolve); | |
}); | |
}); | |
}); | |
before(() => { | |
const config = getConfig('default', { signatureVersion: 'v4', maxRetries: 0 }); | |
s3Client = new S3(config); | |
scuba.start(); | |
return new Promise((resolve, reject) => { | |
metadata.setup(err => { | |
if (err) { | |
reject(err); | |
} | |
wait(2000, resolve); | |
}); | |
}); | |
}); |
isNFS: null, | ||
isNFS: undefined, | ||
}; | ||
const emptyReplicationMDUndef = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we put replicationInfo with isNFS: undefined
: same (empty) fields are indeed not returned anymore (change in arsenal), but we did not change the way we write the metadata, so the "input" parameter of the tests should not change
const emptyReplicationMDUndef = { | |
isNFS: null, | |
}; | |
const expectedEmptyReplicationMD = { |
@@ -470,7 +470,7 @@ describe('Config', () => { | |||
process.env.S3_CONFIG_FILE = oldConfig; | |||
}); | |||
|
|||
it('should set up utapi local cache', () => { | |||
it.skip('should set up utapi local cache', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should make linter fail : as it does not, it seems something is missing from the config :-(
so we'll need to think about adding it later...
Issue: CLDSRV-553