-
Notifications
You must be signed in to change notification settings - Fork 243
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
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/ |
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.
ping
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()
@@ -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?
tests/functional/s3cmd/tests.js
Outdated
|
||
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 ?
tests/functional/s3curl/tests.js
Outdated
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
tests/quota/awsNodeSdk.js
Outdated
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 = { |
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.
The test is failing otherwise waiting for undefined instead of nul
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.
we did not change the way we write the metadata, so the "input" parameter of the tests should not change
if the test fail, it is probably because we at some point compare to emptyReplicationMD
instead of emptyReplicationMDUndef
(which would be better renamed expectedEmptyReplicationMD
I think)
@@ -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...
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.
LGTM overall, but a few comments have not been adressed yet (esp. in gha)
Dockerfile
Outdated
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.
ping
lib/Config.js
Outdated
} = require('../constants'); | ||
const { utapiVersion } = require('utapi'); | ||
// const { utapiVersion } = require('utapi'); |
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.
"mock" the variable definition, so you don't need to add eslint-disable-line no-undef
// const { utapiVersion } = require('utapi'); | |
const utapiVersion = 0; // require('utapi'); |
tests/functional/aws-node-sdk/test/multipleBackend/objectCopy/azureObjectCopy.js
Show resolved
Hide resolved
const sendRequest = async (method, host, path, body = '', config = null) => | ||
new Promise(async (resolve, reject) => { | ||
const sendRequest = async (method, host, path, body = '', config = null) => { | ||
|
||
const service = 's3'; |
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.
- extra empty line
- bad indent: should be just 4 spaces
tests/quota/awsNodeSdk.js
Outdated
return new Promise((resolve, reject) => { | ||
metadata.setup(err => { | ||
if (err) { | ||
reject(err); |
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.
missing return
tests/quota/awsNodeSdk.js
Outdated
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.
do we really need to change the callback-based hook here?
as we are still using only callback-based functions internally, the updated code is more complex than the old one: if no constraint, may be better to keep it until those functions have been updated
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.
we did not change the way we write the metadata, so the "input" parameter of the tests should not change
if the test fail, it is probably because we at some point compare to emptyReplicationMD
instead of emptyReplicationMDUndef
(which would be better renamed expectedEmptyReplicationMD
I think)
bucketUtil.emptyIfExists(BUCKET_FOR_NULL_VERSION) | ||
.then(() => s3.createBucket({ Bucket: BUCKET_FOR_NULL_VERSION }).promise()) | ||
.then(() => done(), err => done(err)) | ||
); |
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 understand how this code "waits" for the bucket to be created :(
(it would be the case if promise was returned, but i don't see how it is here...)
Issue: CLDSRV-553