abdolence / sbt-gcs-resolver

SBT plugin for Google Cloud Storage (GCS) and Google Artifact Registry with Coursier support
Apache License 2.0
28 stars 7 forks source link

Don't do a head request in connect #73

Closed peterrosell closed 4 months ago

peterrosell commented 4 months ago

Problem

When fetching an artifact two requests are done against Google Artifact Registry, one in the connect() method and one in the getInputStream method. This will double the load on GAR and of course also counts against the request quota. When looking at upstream requests in a virtual repository in GAR all HEAD requests in the connect() methods results in GET requests against the upstreams until the requested artifact is found.

Solution

The HEAD request is not necessary as the error will occur at the getInputStream if there is a problem with downloading the artifact so by remove this request there will be a performance boost. (#71)

Also includes a fix for the redundant log when downloading. (#70)

abdolence commented 4 months ago

Thanks for improvements 👍🏻 Left only one suggestion