Skip to content
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

feat: only include provided upload options in publisher-gcs #3576

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

Conversation

kochrt
Copy link

@kochrt kochrt commented Apr 25, 2024

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

  • Only provide options to bucket.upload if they are specified by the user.

I was facing an issue where artifacts could not be uploaded to a bucket that had uniform bucket-level access, which essentially meant that files could not be uploaded that had specified private or public or predefinedAcl. This change removes those fields from the bucket.upload call unless they are added by the user.

@kochrt kochrt requested a review from a team as a code owner April 25, 2024 03:42
@erickzhao erickzhao self-requested a review April 30, 2024 17:23
@@ -23,24 +23,26 @@ export default class PublisherGCS extends PublisherStatic<PublisherGCSConfig> {
async publish({ makeResults, setStatusLine }: PublisherOptions): Promise<void> {
const artifacts: GCSArtifact[] = [];

if (!this.config.bucket) {
const { storageOptions, bucket: configBucket, folder, ...uploadOptions } = this.config;
Copy link
Member

Choose a reason for hiding this comment

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

question: I haven't tested this locally yet but we do have a custom keyResolver property in the Config as well that would get rolled up with ...uploadOptions. Would passing in that unknown key into bucket.upload trigger an error on the GCS SDK side?

Copy link
Author

Choose a reason for hiding this comment

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

I haven't had any trouble with it, and it doesn't look like there's any checking for extraneous keys in their library. That could change, of course.

We could also pull out keyResolver here if you think it's a concern

@erickzhao erickzhao self-assigned this May 14, 2024
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.

None yet

2 participants