Skip to content
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

Merged
merged 11 commits into from
Jan 10, 2025

Conversation

benzekrimaha
Copy link
Contributor

@benzekrimaha benzekrimaha commented Dec 10, 2024

Issue: BB-632

@bert-e
Copy link
Contributor

bert-e commented Dec 10, 2024

Hello benzekrimaha,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Dec 10, 2024

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 71.11%. Comparing base (070472c) to head (287b942).
Report is 11 commits behind head on development/9.0.

Files with missing lines Patch % Lines
lib/util/LocationStatusManager.js 68.75% 5 Missing ⚠️
...s/notification/configManager/MongoConfigManager.js 83.33% 2 Missing ⚠️
extensions/utils/LocationStatusStream.js 81.81% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
extensions/oplogPopulator/OplogPopulator.js 89.14% <100.00%> (ø)
extensions/replication/tasks/ReplicateObject.js 91.49% <100.00%> (ø)
lib/api/BackbeatAPI.js 90.10% <100.00%> (+3.05%) ⬆️
...s/notification/configManager/MongoConfigManager.js 97.80% <83.33%> (+14.82%) ⬆️
extensions/utils/LocationStatusStream.js 92.59% <81.81%> (+19.86%) ⬆️
lib/util/LocationStatusManager.js 77.51% <68.75%> (+17.12%) ⬆️

... and 87 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 75.37% <83.33%> (+59.65%) ⬆️
Core Library 75.75% <77.41%> (+14.06%) ⬆️
Ingestion 69.24% <ø> (+1.70%) ⬆️
Lifecycle 76.14% <ø> (+29.52%) ⬆️
Oplog Populator 85.06% <100.00%> (+0.86%) ⬆️
Replication 57.79% <100.00%> (+6.39%) ⬆️
Bucket Scanner 85.60% <ø> (ø)
@@                 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               
Flag Coverage Δ
api:retry 9.52% <20.00%> (-0.02%) ⬇️
api:routes 9.34% <20.00%> (-0.02%) ⬇️
bucket-scanner 85.60% <ø> (ø)
ingestion 12.29% <0.00%> (+<0.01%) ⬆️
lib 7.36% <0.00%> (+<0.01%) ⬆️
lifecycle 18.82% <13.33%> (-0.01%) ⬇️
notification 1.07% <17.77%> (-0.02%) ⬇️
replication 18.59% <2.22%> (+<0.01%) ⬆️
unit 48.14% <71.11%> (+43.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@benzekrimaha benzekrimaha force-pushed the improvement/BB-632-bump-mongo-db-driver-6 branch 5 times, most recently from 335ce49 to be4bd02 Compare December 12, 2024 13:49
@benzekrimaha benzekrimaha marked this pull request as ready for review December 12, 2024 13:51
@benzekrimaha benzekrimaha force-pushed the improvement/BB-632-bump-mongo-db-driver-6 branch from be4bd02 to 22171f5 Compare December 12, 2024 13:51
@@ -96,6 +90,12 @@ class LocationStatusStream {
return cb();
});
return undefined;
}).catch(err => {
this._log.error('Could not connect to MongoDB', {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benzekrimaha benzekrimaha force-pushed the improvement/BB-632-bump-mongo-db-driver-6 branch 3 times, most recently from 65f195d to 42913a5 Compare January 7, 2025 08:52
@benzekrimaha benzekrimaha force-pushed the improvement/BB-632-bump-mongo-db-driver-6 branch from 42913a5 to 4f3cb35 Compare January 7, 2025 08:53
@benzekrimaha benzekrimaha force-pushed the improvement/BB-632-bump-mongo-db-driver-6 branch from 8fec511 to f1db0df Compare January 7, 2025 09:01
Comment on lines 6 to 10
# 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 }}
Copy link
Contributor

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...

Suggested change
# 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 }}

Comment on lines 201 to 204
- name: Debug wait
uses: ./.github/actions/debug-wait
timeout-minutes: 60
if: failure() && runner.debug == '1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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'

Comment on lines 93 to 94
* Connects to MongoDB using the MongoClientInterface
* and retreives the metastore collection
* and retrieves the metastore collection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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();
Copy link
Contributor

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;
Copy link
Contributor

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

Suggested change
return undefined;
return getMongoVersion(...);

`mongodb://${testConfig.queuePopulator.mongo.replicaSetHosts}` +
'/db?replicaSet=rs0';
const client = new MongoClient(mongoUrl, {});
let db;
Copy link
Contributor

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...

Suggested change
let db;
const db = client.db('metadata', { ignoreUndefined: true });

(may be left as is though, just sharing)

const mongoUrl = constructConnectionString(mongoConfig);
return MongoClient.connect(mongoUrl, {
const client = new MongoClient(mongoUrl, {
replicaSet: mongoConfig.replicaSet,
useNewUrlParser: true,
useUnifiedTopology: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
useUnifiedTopology: true,

Copy link
Contributor

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)

extensions/oplogPopulator/OplogPopulator.js Outdated Show resolved Hide resolved
@benzekrimaha benzekrimaha force-pushed the improvement/BB-632-bump-mongo-db-driver-6 branch from 7a641ec to 287b942 Compare January 9, 2025 15:17
@benzekrimaha
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Jan 10, 2025

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/9.0

The following branches have NOT changed:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.6

Please check the status of the associated issue BB-632.

Goodbye benzekrimaha.

The following options are set: approve

@bert-e bert-e merged commit 287b942 into development/9.0 Jan 10, 2025
9 checks passed
@bert-e bert-e deleted the improvement/BB-632-bump-mongo-db-driver-6 branch January 10, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants