Skip to content

Conversation

SylvainSenechal
Copy link
Contributor

@SylvainSenechal SylvainSenechal commented Sep 1, 2025

Issue : S3UTILS-204

@bert-e
Copy link
Contributor

bert-e commented Sep 1, 2025

Hello sylvainsenechal,

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.

};
return cb(null, resp);
});
} catch (err) {
Copy link
Contributor

@francoisferrand francoisferrand Sep 19, 2025

Choose a reason for hiding this comment

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

catch must not wrap the callback: otherwise, if the callback throws, we will call it again....


best way is to stick to a single approach:

  • if the function being implemented (i.e. getObjMd) is a callback API, probably best to use the promise directly : client.send().then(...)
  • if the function is async/promise-based (or updated this), then we can and should indeed use await

and/or we can make a trampoline to ease transition (in the same or different functions):

async function getObjMd(params, cb) {
   if (cb) {
       return getObjMd(params).then(result -> cb(null, result), cb);
   }

   // no need for catch actually, since that is the way to return the error!
   return await client.send(...);
} 

Copy link
Contributor

Choose a reason for hiding this comment

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

note: we need to make this PR correct, but to avoid too much changes we can also choose to be less ambitious (not moving to "proper" async yet, just use callbacks and promises), and upgrade to async later (in separate PR)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, I reverted it

}

function listObjects(params, cb) {
async function listObjects(params, cb) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same here: catch must not wrap the callback: otherwise, if the callback throws, we will call it again....

Delimiter: delimiter,
ContinuationToken: nextContinuationToken,
}));
return cb(null, data);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here: catch must not wrap the callback: otherwise, if the callback throws, we will call it again....

@SylvainSenechal SylvainSenechal force-pushed the improvement/S3UTILS-204 branch from ed7bd36 to ef6f505 Compare October 2, 2025 15:44
@scality scality deleted a comment from bert-e Oct 2, 2025
@bert-e
Copy link
Contributor

bert-e commented Oct 2, 2025

Waiting for approval

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

  • the author

  • 2 peers

@SylvainSenechal SylvainSenechal force-pushed the improvement/S3UTILS-204 branch from ef6f505 to cb852ce Compare October 2, 2025 16:03
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not fully related to this pr whose goal is to migrate removeDeleteMarkers, but I made a mistake in one of the previous ones, mixing callback and catch, so I'm fixing it here

@SylvainSenechal SylvainSenechal force-pushed the improvement/S3UTILS-204 branch from c284177 to 0ffbe21 Compare October 3, 2025 16:30
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.

3 participants