liquidz / antq

Point out your outdated dependencies.
Other
403 stars 25 forks source link

S3 Error when computing diffs #133

Closed dharrigan closed 2 years ago

dharrigan commented 2 years ago

Hi,

I think that doing diffs on s3 artifacts should be skipped, otherwise the following errors occur:

When resolving S3:// artifacts for doing diffs, antq calls to the io/reader to return a stream.

Unfortunately, the java.io/reader which extends the protocol to String, only is aware of standard URL schemas, such as http, https (and falls back to file). It doesn't know how to handle s3:// URLs.

A MalformedUrlException is thrown and an attempt is then made to retrieve the artifact using a file based approach.

This causes the following errors to appear on the console:

Fetching pom from s3://maven.foo.com/releases/com/foo/bar/0.3.71/bar-0.3.71.pom failed because of the following error: s3:/maven.foo.com/releases/com/foo/bar/0.3.71/bar-0.3.71.pom (No such file or directory)
Fetching pom from s3://maven.foo.com/releases/com/foo/bar/0.3.71/bar-0.3.71.pom failed because of the following error: s3:/maven.foo.com/releases/com/foo/bar/0.3.71/bar-0.3.71.pom (No such file or directory)

(interestingly, notice the s3:/ as the schema, I think that's because of the attempt to resolve it as a file).

I'm not 100% sure how to go about approaching this one. It is possible to register a new S3 URLStreamHandler when creating an instance of the URL, so this line would need to change to something like (URL. nil x s3-schema-handler) (see the constructor in java.net.URL) (of course, the entire extend would need to be substituted in antq code).

-=david=-

liquidz commented 2 years ago

@dharrigan Just released v1.3.2. Thank you so much!

dharrigan commented 2 years ago

You're most welcome! Happy to help where I can :-)