Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

northdpole
Copy link
Contributor

@northdpole northdpole commented Jul 23, 2025

… aws

fixes #1031

@northdpole northdpole force-pushed the make-pdf-reporter-upload-to-configurable-s3-backends branch from c384053 to 468292e Compare July 23, 2025 19:08
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16479616874

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 37.835%

Totals Coverage Status
Change from base Build 16471275499: 0.0%
Covered Lines: 846
Relevant Lines: 2236

💛 - Coveralls

@northdpole northdpole force-pushed the make-pdf-reporter-upload-to-configurable-s3-backends branch 3 times, most recently from fe1959e to 836b0c3 Compare July 24, 2025 20:17
@northdpole northdpole force-pushed the make-pdf-reporter-upload-to-configurable-s3-backends branch from 836b0c3 to d466ee0 Compare July 24, 2025 20:18
Copy link
Contributor

@dlicheva dlicheva left a 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.
Copy link
Contributor

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
Copy link
Contributor

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))...,
Copy link
Contributor

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: ""
Copy link
Contributor

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")
Copy link
Contributor

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

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.

Component PDF with generic upload provider
4 participants