refactor getReplicationInfo into object parameters#6232
Open
SylvainSenechal wants to merge 1 commit into
Open
Conversation
Contributor
Hello sylvainsenechal,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
SylvainSenechal
force-pushed
the
improvement/CLDSRV-950
branch
from
July 21, 2026 18:59
13f735e to
e42d8b6
Compare
SylvainSenechal
marked this pull request as ready for review
July 21, 2026 20:15
There was a problem hiding this comment.
Pull request overview
This PR refactors the internal getReplicationInfo helper (used across S3 object and Backbeat replication paths) to take a single named-parameters object, improving call-site clarity and making optional arguments more explicit.
Changes:
- Refactored
getReplicationInfofrom positional arguments to a{ ...params }object and updated its JSDoc accordingly. - Updated all in-repo call sites to the new invocation style (object ops, Backbeat route, metadata ACL).
- Updated unit tests for
getReplicationInfoto use the new signature.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
lib/api/apiUtils/object/getReplicationInfo.js |
Changes function signature to a params object and updates JSDoc/parameter handling. |
lib/api/apiUtils/object/createAndStoreObject.js |
Updates replicationInfo generation to call getReplicationInfo({ ... }). |
lib/api/completeMultipartUpload.js |
Updates call site to pass named params (including operationType). |
lib/api/objectCopy.js |
Updates call site to pass named params (incl. objSize). |
lib/api/objectDeleteTagging.js |
Updates call site to pass named params for replication stamping on tagging delete. |
lib/api/objectPutLegalHold.js |
Updates call site to pass named params for replication stamping on legal-hold updates. |
lib/api/objectPutRetention.js |
Updates call site to pass named params for replication stamping on retention updates. |
lib/api/objectPutTagging.js |
Updates call site to pass named params for replication stamping on tagging updates. |
lib/metadata/acl.js |
Updates call site to pass named params for replication backend role checks. |
lib/routes/routeBackbeat.js |
Updates replication “next hop” computation call to use named params. |
tests/unit/api/apiUtils/getReplicationInfo.js |
Updates unit tests to use the new getReplicationInfo({ ... }) API. |
| * @param {string} params.objKey - The key of the object | ||
| * @param {object} params.bucketMD - The bucket metadata | ||
| * @param {boolean} params.isMD - Whether the operation is only updating metadata | ||
| * @param {number} params.objSize - The size, in bytes, of the object being PUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: CLDSRV-950
Refactor getReplicationInfo with object parameters
Not super useful but we said we would do it during the crr cascade so here we are