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

Allow for downloads of dependencies whilst updating? #132

Closed
dharrigan opened this issue Jan 13, 2022 · 8 comments
Closed

Allow for downloads of dependencies whilst updating? #132

dharrigan opened this issue Jan 13, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@dharrigan
Copy link
Contributor

dharrigan commented Jan 13, 2022

Presently, if there are updates to any dependencies, antq will notice the update and modify the deps.edn to show a newer version is available. However, it's not until clj or clojure is launched will the actual resolving and downloading of the updated dependencies occurs (to .m2/....).

Would you consider an option to have antq not only update the deps.edn but also to download to .m2/... the newer dependency (thus saving a step that needs to happen later). It would be an opt-in option, maybe something called :download? which defaults to false. It can be set to to true if the user wishes to update and download the dependencies at the same time (similar to how :force is handled).

My use case of this is that we have a few dependencies that are behind a protected s3 bucket that requires the use of aws-vault exec foo -- clj -X:antq for antq to have access to the appropriate AWS session keys and so on to see if there library updates on the appropriate s3 bucket.

Often 'tho, later on - people forget to do aws-vault exec foo -- clj (and just do clj) and get lots of failures since clj can't download the artifacts (as no AWS session information is then available a they forgot to wrap the command).

It would be nice to have the option to combine the updating of the deps.edn with the downloading of the respective dependency with an opt-in option when using antq, so by doing aws-vault exec foo -- clj -X:antq the update and download happens in one go.

Thank you for your consideration.

-=david=-

@liquidz
Copy link
Owner

liquidz commented Jan 13, 2022

@dharrigan Thanks for your suggestion!

I see what you want to do.
In conclusion, I'm willing to implement this feature.

My biggest concern was whether this feature would be a role for antq.
The feature downloading deps to .m2 is seemingly not a role for antq, but for example, upgrading deps.edn is a feature for EASY and this is out of the nature of antq.

So, I thought downloading deps to .m2 is also a feture to make it easier to apply new versions, could be considered the same as the feature upgrading deps.edn.

@liquidz liquidz added the enhancement New feature or request label Jan 13, 2022
@dharrigan
Copy link
Contributor Author

Hi!

Thank you for your consideration, what I mean here, is that antq could simply delegate to the clojure tooling (deps) (which antq already uses) to perform the download, rather than implement the same logic itself :-)

@liquidz
Copy link
Owner

liquidz commented Jan 13, 2022

Yes, I'm planning to use tools.deps for downloading deps :)

@liquidz
Copy link
Owner

liquidz commented Jan 20, 2022

@dharrigan Sorry for late action.
I've added --download option to feature/download-deps branch.
Could you try?

@dharrigan
Copy link
Contributor Author

Sure, will give it a whirl this morning and let you know :-)

@dharrigan
Copy link
Contributor Author

Hi, works great. I've done a PR just to add a couple of things in.

One thing to note (perhaps has to be documented?) is that if antq is run as normal (and dependencies are updated) then if it's then run again with --download set, then no download is done (as there are no updates anymore :-) ). It's probably beyond the scope (and too much hassle) to walk through each dependency, checking if it exists on the file system and if not, to download it.

-=david=-

@liquidz
Copy link
Owner

liquidz commented Jan 21, 2022

@dharrigan Thanks for your confirmation!

It's probably beyond the scope (and too much hassle) to walk through each dependency, checking if it exists on the file system and if not, to download it.

I think so too. It is not a role for antq.

One thing to note (perhaps has to be documented?) is that if antq is run as normal (and dependencies are updated) then if it's then run again with --download set, then no download is done (as there are no updates anymore :-) ).

I'll add notes for this behavior :)

liquidz added a commit that referenced this issue Jan 21, 2022
@liquidz
Copy link
Owner

liquidz commented Jan 22, 2022

@dharrigan Just released v1.4.0 #142

@liquidz liquidz closed this as completed Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants