Skip to content

Conversation

@tmacro
Copy link
Contributor

@tmacro tmacro commented Nov 12, 2025

No description provided.

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.01%. Comparing base (7b65049) to head (c6dc6d9).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/api/bucketDeleteRateLimit.js 0.00% 2 Missing ⚠️
lib/api/bucketPutRateLimit.js 85.71% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/api.js 91.82% <100.00%> (+0.60%) ⬆️
lib/api/bucketGetRateLimit.js 100.00% <100.00%> (+100.00%) ⬆️
lib/api/bucketPutRateLimit.js 82.85% <85.71%> (+82.85%) ⬆️
lib/api/bucketDeleteRateLimit.js 24.00% <0.00%> (+24.00%) ⬆️

... and 3 files with indirect coverage changes

@@                               Coverage Diff                               @@
##           improvement/CLDSRV-766/bucket_rate_limiting    #5997      +/-   ##
===============================================================================
+ Coverage                                        83.43%   84.01%   +0.57%     
===============================================================================
  Files                                              200      200              
  Lines                                            12508    12505       -3     
===============================================================================
+ Hits                                             10436    10506      +70     
+ Misses                                            2072     1999      -73     
Flag Coverage Δ
ceph-backend-test 64.50% <80.00%> (+0.55%) ⬆️
file-ft-tests 66.69% <80.00%> (+0.57%) ⬆️
kmip-ft-tests 27.06% <26.66%> (+0.25%) ⬆️
mongo-v0-ft-tests 67.97% <80.00%> (+0.55%) ⬆️
mongo-v1-ft-tests 67.99% <80.00%> (+0.57%) ⬆️
multiple-backend 34.14% <26.66%> (+0.25%) ⬆️
sur-tests 34.48% <26.66%> (+0.25%) ⬆️
sur-tests-inflights 36.40% <26.66%> (+0.28%) ⬆️
unit 69.57% <80.00%> (+0.53%) ⬆️
utapi-v2-tests 33.29% <26.66%> (+0.25%) ⬆️

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tcarmet tcarmet requested a review from a team November 13, 2025 22:45
headers: request.headers,
};

if (method !== 'GET' && method !== 'DELETE') {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a bit odd to attach a body for all other types of requests (i.e. to have a negative check), I'd rather check if (method === 'PUT' || method === 'POST') instead.

try {
const json = JSON.parse(text);
if (json.error) {
throw json;
Copy link
Contributor

Choose a reason for hiding this comment

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

This throw would be caught by the below catch, right? Not sure this is what you intended to do.

Also, do you want to throw an error in 100% of cases where !request.ok is true? In case it is so, the code doesn't throw in all cases (but maybe you did this on purpose so asking, in which case an extra comment after the try/catch block could help understanding this intent).

it('should return NoSuchBucket error when bucket does not exist', async () => {
try {
await sendRateLimitRequest('GET', '127.0.0.1:8000', '/nonexistentbucket/?rate-limit');
} catch (err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add an assert.fail here too like in the above test

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.

5 participants