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

Set a user agent when downloading most artifacts #2671

Merged
merged 1 commit into from Mar 20, 2024
Merged

Conversation

yob
Copy link
Contributor

@yob yob commented Mar 5, 2024

This downloader tooling was using the default golang user agent which works fine, but it's nice to indicate to the servers what the client is with a little more detail.

We already have a helper for generating a user agent string on API calls to Buildkite, so I've used it here too. This helper is used for artifatc downloads from:

  • S3 (AWS)
  • GCS (Google)
  • Artifactory

It is not used for artifact downloads from Azure blob store.

I'm only setting the user agent if none is provided to the downloader, but currently none of the places its used pass one in.

Fixes PLT-2222

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go fmt ./...)

This downloader tooling was using the default golang user agent which
works fine, but it's nice to indicate to the servers what the client is
with a little more detail.

We already have a helper for generating a user agent string on API calls
to Buildkite, so I've used it here too. This helper is used for artifatc
downloads from:

* S3 (AWS)
* GCS (Google)
* Artifactory

It is not used for artifact downloads from Azure blob store.

I'm only setting the user agent if none is provided to the downloader,
but currently none of the places its used pass one in.
@yob yob marked this pull request as ready for review March 5, 2024 12:38
Copy link
Contributor

@moskyb moskyb left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

@yob yob merged commit 9f38721 into main Mar 20, 2024
1 check passed
@yob yob deleted the downloader-useragent branch March 20, 2024 12:33
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