-
Notifications
You must be signed in to change notification settings - Fork 20
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/bb 632 bump mongo db driver 6 #2599
Improvement/bb 632 bump mongo db driver 6 #2599
Conversation
Hello benzekrimaha,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
... and 87 files with indirect coverage changes
@@ Coverage Diff @@
## development/9.0 #2599 +/- ##
====================================================
+ Coverage 54.35% 71.11% +16.76%
====================================================
Files 201 201
Lines 13336 13334 -2
====================================================
+ Hits 7249 9483 +2234
+ Misses 6077 3841 -2236
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. |
335ce49
to
be4bd02
Compare
be4bd02
to
22171f5
Compare
@@ -96,6 +90,12 @@ class LocationStatusStream { | |||
return cb(); | |||
}); | |||
return undefined; | |||
}).catch(err => { | |||
this._log.error('Could not connect to MongoDB', { |
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 should be able to test this case, just need to pass an invalid url
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.
65f195d
to
42913a5
Compare
Issue: BB-632
Issue: BB-632 Co-authored-by: KillianG <[email protected]> Co-authored-by: benzekrimaha <[email protected]>
Issue: BB-632 Co-authored-by: KillianG <[email protected]> Co-authored-by: benzekrimaha <[email protected]>
…s for sinon stubs
42913a5
to
4f3cb35
Compare
8fec511
to
f1db0df
Compare
.github/workflows/tests.yaml
Outdated
# DEBUG WAIT | ||
TMATE_SERVER_HOST: ${{ secrets.TMATE_SERVER_HOST }} | ||
TMATE_SERVER_PORT: ${{ secrets.TMATE_SERVER_PORT }} | ||
TMATE_SERVER_RSA_FINGERPRINT: ${{ secrets.TMATE_SERVER_RSA_FINGERPRINT }} | ||
TMATE_SERVER_ED25519_FINGERPRINT: ${{ secrets.TMATE_SERVER_ED25519_FINGERPRINT }} |
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 pattern is not very safe, as it exposed the secrets to all steps in the workflow : to avoid this, best to inject the secrets only in the debug-wait
step... which means basically inlining the separate action, which does not add any value...
# DEBUG WAIT | |
TMATE_SERVER_HOST: ${{ secrets.TMATE_SERVER_HOST }} | |
TMATE_SERVER_PORT: ${{ secrets.TMATE_SERVER_PORT }} | |
TMATE_SERVER_RSA_FINGERPRINT: ${{ secrets.TMATE_SERVER_RSA_FINGERPRINT }} | |
TMATE_SERVER_ED25519_FINGERPRINT: ${{ secrets.TMATE_SERVER_ED25519_FINGERPRINT }} |
.github/workflows/tests.yaml
Outdated
- name: Debug wait | ||
uses: ./.github/actions/debug-wait | ||
timeout-minutes: 60 | ||
if: failure() && runner.debug == '1' |
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.
- name: Debug wait | |
uses: ./.github/actions/debug-wait | |
timeout-minutes: 60 | |
if: failure() && runner.debug == '1' | |
- name: Debug wait | |
uses: scality/actions/[email protected] | |
with: | |
tmate-server-host: ${{ secrets.TMATE_SERVER_HOST }} | |
tmate-server-port: ${{ secrets.TMATE_SERVER_PORT }} | |
tmate-server-rsa-fingerprint: ${{ secrets.TMATE_SERVER_RSA_FINGERPRINT }} | |
tmate-server-ed25519-fingerprint: ${{ secrets.TMATE_SERVER_ED25519_FINGERPRINT }} | |
continue-on-error: true | |
timeout-minutes: 60 | |
if: failure() && runner.debug == '1' |
* Connects to MongoDB using the MongoClientInterface | ||
* and retreives the metastore collection | ||
* and retrieves the metastore collection |
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.
* Connects to MongoDB using the MongoClientInterface | |
* and retreives the metastore collection | |
* and retrieves the metastore collection | |
* Connect to MongoDB using the MongoClientInterface | |
* and retrieve the metastore collection |
}); | ||
|
||
try { | ||
client = await client.connect(); |
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 not replace the client variable : use a different variable or single statement/varialbe (const client = new MongoClient().connect()
)
this._mongoVersion = version; | ||
return cb(); | ||
}); | ||
return undefined; |
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.
merge the return statement and invocation of the last "callback-passing" function : to make it more explicit that the processing goes on asynchronously
return undefined; | |
return getMongoVersion(...); |
`mongodb://${testConfig.queuePopulator.mongo.replicaSetHosts}` + | ||
'/db?replicaSet=rs0'; | ||
const client = new MongoClient(mongoUrl, {}); | ||
let db; |
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.
nit: i think it should be possible to initialize this just one, even if client is not connected...
let db; | |
const db = client.db('metadata', { ignoreUndefined: true }); |
(may be left as is though, just sharing)
lib/api/BackbeatAPI.js
Outdated
const mongoUrl = constructConnectionString(mongoConfig); | ||
return MongoClient.connect(mongoUrl, { | ||
const client = new MongoClient(mongoUrl, { | ||
replicaSet: mongoConfig.replicaSet, | ||
useNewUrlParser: true, | ||
useUnifiedTopology: 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.
useUnifiedTopology: 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.
Same for all files with this option (mongodb/node-mongodb-native#3792)
7a641ec
to
287b942
Compare
/approve |
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue BB-632. Goodbye benzekrimaha. The following options are set: approve |
Issue: BB-632