-
Notifications
You must be signed in to change notification settings - Fork 249
CLDSRV754: add GetBucketLogging and PutBucketLogging endpoints #5966
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
base: development/9.0
Are you sure you want to change the base?
CLDSRV754: add GetBucketLogging and PutBucketLogging endpoints #5966
Conversation
Hello leif-scality,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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 1 file with indirect coverage changes @@ Coverage Diff @@
## development/9.0 #5966 +/- ##
===================================================
+ Coverage 83.37% 83.47% +0.09%
===================================================
Files 189 191 +2
Lines 12198 12271 +73
===================================================
+ Hits 10170 10243 +73
Misses 2028 2028
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
lib/api/bucketPutLogging.js
Outdated
return callback(err); | ||
} | ||
|
||
return callback(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return callback(null); | |
return callback(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tests/unit/api/bucketGetLogging.js
Outdated
const request = createGetLoggingRequest(bucketName); | ||
|
||
bucketGetLogging(authInfo, request, log, (err, xml) => { | ||
assert.strictEqual(err, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert.strictEqual(err, null); | |
assert.ifError(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced the strict equal with ifError in both test files
const putRequest = createLoggingRequest(bucketName, loggingXML); | ||
|
||
// First enable logging | ||
bucketPutLogging(authInfo, putRequest, log, err => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: you may want to use async.series
or async.waterfall
to reduce nesting levels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to waterfall to handle logging and metrics in only one place
tests/unit/api/bucketGetLogging.js
Outdated
}); | ||
}); | ||
|
||
it('should handle multiple get requests consistently', done => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this test is really useful, but no problem to keep it if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
tests/unit/api/bucketPutLogging.js
Outdated
bucketPutLogging(authInfo, request, log, err => { | ||
assert(err); | ||
// Missing body should trigger XML parsing error | ||
assert(err.is.MalformedXML || err.code === 'MalformedXML'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to support both error types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, removed the string check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
We should also add monitoring to these APIs:
cloudserver/lib/api/bucketPutACL.js
Line 303 in e2ace24
monitoring.promMetrics('PUT', bucketName, '200', 'bucketPutACL'); |
added metrics |
856c74c
to
3402063
Compare
I think you need to remove Line 120 in e2ace24
|
request, | ||
}; | ||
|
||
return waterfall([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if the target bucket exists? Do you know if AWS returns an error if it does not exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An error occurred (InvalidTargetBucketForLogging) when calling the PutBucketLogging operation: The target bucket for logging does not exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a check and functional tests
3402063
to
d7f1f64
Compare
83f49e7
to
10f4dcd
Compare
Add GetBucketLogging and PutBucketLogging endpoints