-
Notifications
You must be signed in to change notification settings - Fork 17
make the pdf reporter upload to any configurable s3 backend, not only… #1055
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: main
Are you sure you want to change the base?
make the pdf reporter upload to any configurable s3 backend, not only… #1055
Conversation
c384053
to
468292e
Compare
Pull Request Test Coverage Report for Build 16479616874Details
💛 - Coveralls |
fe1959e
to
836b0c3
Compare
836b0c3
to
d466ee0
Compare
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 code-wise, with some minor comments. Could you please add details on how to test it locally?
} | ||
} | ||
|
||
// WithEndpoint allows providing a custom AWS region. |
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.
comment doesn't match
for _, opt := range opts { | ||
config = opt(config) | ||
} | ||
if config.Endpoint != nil { // a lot of local/testing S3 implementations that need custom endoints do not support the default subdomain style |
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 worth returning an error according to this comment, so the user knows why it doesn't work?
true, | ||
append(envOpts, env.WithDefaultOnError(false))..., | ||
false, | ||
append(envOpts, env.WithDefaultOnError(true))..., |
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.
When that is set to false, we are always requiring an upload of the PDF to a bucket. This makes it more difficult to test locally.
pdf: | ||
- name: "bucket_endpoint" | ||
type: "string" | ||
value: "" |
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.
Would that example be simpler if we skip the s3 upload (since it's local)?
logger := componentlogger.LoggerFromContext(ctx) | ||
|
||
if conf.Bucket == "" { | ||
err := errors.New("bucket is empty, you need to provide a bucket name") |
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.
That's already checked in the uploadToS3()
function
… aws
fixes #1031