bf: CLDSRV-647 crash in getReplicationInfo with no replication endpoint#5796
Conversation
Hello jonathan-gramain,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 |
|
/create_integration_branches |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/7.70
$ git merge origin/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpointThe following options are set: create_integration_branches |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/8.8
$ git merge origin/w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpointThe following options are set: create_integration_branches |
6edbf9c to
e0f23a1
Compare
History mismatchMerge commit #787728a3df11bc5b55b4baea57812ac3b2bc4117 on the integration branch It is likely due to a rebase of the branch Please use the The following options are set: create_integration_branches |
e0f23a1 to
7cbc72b
Compare
|
/reset |
Reset completeI have successfully deleted this pull request's integration branches. The following options are set: create_integration_branches |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/7.70
$ git merge origin/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpointThe following options are set: create_integration_branches |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/8.8
$ git merge origin/w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpointThe following options are set: create_integration_branches |
ConflictA conflict has been raised during the update of Please resolve the conflict on the integration branch ( Here are the steps to resolve this conflict: $ git fetch
$ git checkout w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
$ git pull # or "git reset --hard origin/w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint"
$ git merge origin/development/8.8
$ # <intense conflict resolution>
$ git commit
$ git merge origin/w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpointThe following options are set: create_integration_branches |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/9.0/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/9.0
$ git merge origin/w/8.8/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/9.0/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpointThe following options are set: create_integration_branches |
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option The following options are set: create_integration_branches |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
The following options are set: create_integration_branches |
In the caller's context, it's usually named In the callee's context ( |
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a crash in getReplicationInfo by returning undefined when no StorageClass is provided or when no replication endpoint is configured, and it refactors the function to become pure by passing the S3 configuration explicitly.
- Refactors getReplicationInfo and internal helper functions to accept a config parameter.
- Updates multiple API endpoints and tests to ensure consistent usage of the new function signature.
- Bumps the package version from 7.10.54 to 7.10.55.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/api/apiUtils/getReplicationInfo.js | Updated tests to pass TEST_CONFIG explicitly to _getObjectReplicationInfo. |
| package.json | Version bump to reflect the update. |
| lib/metadata/acl.js | Updated getReplicationInfo call to include config. |
| lib/api/objectPutTagging.js | Updated getReplicationInfo call to include config. |
| lib/api/objectPutRetention.js | Updated getReplicationInfo call to include config. |
| lib/api/objectPutLegalHold.js | Updated getReplicationInfo call to include config. |
| lib/api/objectDeleteTagging.js | Updated getReplicationInfo call to include config. |
| lib/api/objectCopy.js | Updated getReplicationInfo call to include config. |
| lib/api/completeMultipartUpload.js | Updated getReplicationInfo call to include config. |
| lib/api/apiUtils/object/getReplicationInfo.js | Refactored internal functions and updated signature to accept s3config. |
| lib/api/apiUtils/object/createAndStoreObject.js | Updated getReplicationInfo call to include config. |
Instead of pulling the location constraints and replication endpoints from the Cloudserver config within the getReplicationInfo helper itself, pass the config object explicitly. This makes the function pure, using only its input parameters, hence more test cases can be easily added with a different configuration for location constraints and/or replication endpoints.
Fix an exception in getReplicationInfo when: - no StorageClass is provided - no replication endpoint is configured Instead, return `undefined` so the object is not set to PENDING state for replication, even if the bucket already has a replication configuration enabled.
b6a6d54 to
71bbee6
Compare
History mismatchMerge commit #164b61488049a6eaf8e53a8cd1416b2272e5bf1f on the integration branch It is likely due to a rebase of the branch Please use the The following options are set: create_integration_branches |
|
/reset |
Reset completeI have successfully deleted this pull request's integration branches. The following options are set: create_integration_branches |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint origin/development/7.70
$ git merge origin/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpoint
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/7.70/bugfix/CLDSRV-647-exceptionOnPutIfNoReplicationEndpointThe following options are set: create_integration_branches |
History mismatchMerge commit #a698c2f0f51788fd4232bc40cb62d20b8102df3e on the integration branch It is likely due to a rebase of the branch Please use the The following options are set: create_integration_branches |
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option The following options are set: create_integration_branches |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
The following options are set: create_integration_branches |
|
/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 CLDSRV-647. Goodbye jonathan-gramain. The following options are set: approve, create_integration_branches |
Fix an exception in getReplicationInfo when:
Instead, return
undefinedso the object is not set to PENDING state for replication, even if the bucket already has a replication configuration enabled.[refactor] pass S3 config to getReplicationInfo
Instead of pulling the location constraints and replication endpoints from the Cloudserver config within the getReplicationInfo helper itself, pass the config object explicitly. This makes the function pure, using only its input parameters, hence more test cases can be easily added with a different configuration for location constraints and/or replication endpoints.