-
Notifications
You must be signed in to change notification settings - Fork 20
ARSN-528: add BucketLoggingStatus to BucketInfo model #2538
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/8.2
Are you sure you want to change the base?
ARSN-528: add BucketLoggingStatus to BucketInfo model #2538
Conversation
Hello leif-scality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
e6293e8
to
ef0c028
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development/8.2 #2538 +/- ##
===================================================
- Coverage 71.07% 71.01% -0.06%
===================================================
Files 220 221 +1
Lines 17729 17781 +52
Branches 3652 3688 +36
===================================================
+ Hits 12601 12628 +27
- Misses 5124 5149 +25
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
LGTM (I can review again in the final version)
} catch (err) { | ||
return { | ||
error: { arsenalError: errors.MalformedXML, details: err }, | ||
res: undefined, |
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 assume we probably don't need to add an undefined res
property (if we do, then maybe we need to revisit how we interpret the results to avoid being too javascript-centric).
import { AzureInfoMetadata } from './BucketAzureInfo'; | ||
import BucketLoggingStatus from './BucketLoggingStatus'; | ||
|
||
// WHEN UPDATING THIS NUMBER, UPDATE BucketInfoModelVersion.md CHANGELOG |
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.
You should update the doc https://github.com/scality/Arsenal/blob/development/8.2/documentation/BucketInfoModelVersion.md
and bump modelVersion = 18
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.
Where should I do the bump?
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.
1 or 2 line below there is the variable
|
||
export type LoggingEnabled = { | ||
TargetBucket: string; | ||
TargetPrefix: string; |
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 include optional TargetGrants
and TargetObjectKeyFormat
? https://docs.aws.amazon.com/AmazonS3/latest/API/API_LoggingEnabled.html
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.
nvm I see they are not implemented
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.
Maybe add a comment in here to describe that those 2 fields are not implemented
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
return { | ||
error: { | ||
arsenalError: errors.NotImplemented, | ||
details: 'TargetGrants tag in LoggingEnabled is not implemented', |
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.
details: 'TargetGrants tag in LoggingEnabled is not implemented', | |
details: 'TargetGrants field in LoggingEnabled is not implemented', |
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 it aws that use tag
instead of field
in their error description ?
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, XML uses tag and element but we can use field
arsenalError: errors.NotImplemented, | ||
details: 'TargetObjectKeyFormat tag in LoggingEnabled is not implemented', |
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.
How is details going to be used ? Instead should we rather add a custom description directly on the error, to be returned to the client: errorInstances.NotImplemented.customDescription('...')
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.
You can generate a unit test with AI to covers these
lib/models/BucketLoggingStatus.ts
Outdated
}; | ||
} | ||
|
||
if (parsed.BuckerLoggingStatus.LoggingEnabled.TargetGrants) { |
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.
if (parsed.BuckerLoggingStatus.LoggingEnabled.TargetGrants) { | |
if (parsed.BucketLoggingStatus.LoggingEnabled.TargetGrants) { |
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.
fixed
lib/models/BucketLoggingStatus.ts
Outdated
}; | ||
} | ||
|
||
if (parsed.BuckerLoggingStatus.LoggingEnabled.TargetObjectKeyFormat) { |
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.
if (parsed.BuckerLoggingStatus.LoggingEnabled.TargetObjectKeyFormat) { | |
if (parsed.BucketLoggingStatus.LoggingEnabled.TargetObjectKeyFormat) { |
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.
fixed
lib/models/BucketLoggingStatus.ts
Outdated
TargetPrefix: parsed.BucketLoggingStatus.LoggingEnabled.TargetPrefix[0], | ||
TargetBucket: parsed.BucketLoggingStatus.LoggingEnabled.TargetBucket[0], |
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.
Aws performs no validation on those fields ?
Because bucket name is pretty restrictive format, and prefix should probably not go beyond a certains size
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.
Maybe but the docs mentions no checks https://docs.aws.amazon.com/AmazonS3/latest/API/API_LoggingEnabled.html
fce43fb
to
823a3ef
Compare
823a3ef
to
edebec8
Compare
add BucketLoggingStatus to BucketInfo model