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

Roundtrip to S3 fails with Dynamic Revisions #31

Closed
aecollver opened this issue Sep 5, 2014 · 6 comments
Closed

Roundtrip to S3 fails with Dynamic Revisions #31

aecollver opened this issue Sep 5, 2014 · 6 comments

Comments

@aecollver
Copy link

Observed Behavior

  • I can resolve a specific version of a module published to S3 with sbt-s3-resolver.
  • I can't resolve using dynamic revisions (e.g. 1.0.+) of a module published to S3 with sbt-s3-resolver.
  • I can resolve dynamic revisions (e.g. 1.0.+) of a module published to S3 with another plugin: https://github.com/frugalmechanic/fm-sbt-s3-resolver

Cause

I found that the fm-sbt-s3-resolver is creating a "directory" object in S3 (an empty object that has a key ending in "/"). Creating the same "directory" object from the AWS console allows Ivy to resolve a module published to S3 using sbt-s3-resolver.

Ivy's FileRepository returns a mix of directory and file names (but one level deep unlike the S3 listObjects overload that is currently used): https://github.com/sbt/ivy/blob/2.3.x-sbt/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java#L99-L112

Proposed Fix

Update https://github.com/ohnosequences/ivy-s3-resolver/blob/master/src/main/java/ohnosequences/ivy/S3Repository.java#L114-L133

@aecollver
Copy link
Author

Here's an untested implementation of the proposed fix:

https://github.com/acollver/ivy-s3-resolver/commit/98142489ea099e73330b75423127480615392a96

@aecollver
Copy link
Author

I have verified that my proposed fix works with both specific and dynamic versions.

@aecollver
Copy link
Author

I created a pull request for this issue. Apologies for creating the issue against sbt-s3-resolver when the proposed fix belongs in ivy-s3-resolver:

ohnosequences/ivy-s3-resolver#7

@aecollver
Copy link
Author

I updated my pull request to support pagination with AmazonS3.listObject

@laughedelic
Copy link
Contributor

Hi @acollver!
Thanks a lot! Actually, I wanted this feature too, but didn't know how to implement it and didn't have time to investigate.
The ivy-s3-resolver is maintained by @evdokim, but he's too busy now to review the code, so I'll just merge it and release a new version.

laughedelic added a commit to ohnosequences/ivy-s3-resolver that referenced this issue Sep 8, 2014
@laughedelic
Copy link
Contributor

I just released the new version with the fix: v0.12.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants