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

quarkus-cli plugin for asdf-vm #24829

Closed
HonoluluHenk opened this issue Apr 7, 2022 · 19 comments
Closed

quarkus-cli plugin for asdf-vm #24829

HonoluluHenk opened this issue Apr 7, 2022 · 19 comments
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) kind/enhancement New feature or request

Comments

@HonoluluHenk
Copy link

Description

It would be nice to have a quarkus plugin for asdf-vm, a widespread tooling version manager similar to SDKMAN.

Implementation ideas

I wrote an asdf-vm plugin to support the quarkus cli.

Currently, this is a working POC.
I'm willing to fleshen out the missing bits to keep up with your and asdf-vms quality standards.

Now I'd like to know if you're interested in eventually incorporating this plugin in your project or if I should pursue this venture on my own or whatever else comes to your mind.

@HonoluluHenk HonoluluHenk added the kind/enhancement New feature or request label Apr 7, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 7, 2022

/cc @ebullient, @maxandersen

@quarkus-bot quarkus-bot bot added the area/cli Related to quarkus cli (not maven/gradle/etc.) label Apr 7, 2022
@geoand
Copy link
Contributor

geoand commented Apr 8, 2022

Also cc @gsmet

@gsmet
Copy link
Member

gsmet commented Apr 8, 2022

I wonder if it's something that should be integrated into JReleaser instead. A bit similar to what it does for Chocolatey and Homebrew (i.e. pushing things to a Git repository).

@aalmiray WDYT?

@aalmiray
Copy link
Contributor

aalmiray commented Apr 8, 2022

Yes, I think adding asdf support to JReleaser would be great. @joschi has been very active by providing asdf plugins including https://github.com/joschi/asdf-jreleaser

@joschi
Copy link

joschi commented Apr 8, 2022

I think there's a misunderstanding of how asdf-vm and its plugins work.

JReleaser works with a push model: On release, it's pushing out notifications to SDKMan, Twitter, other services about the release.

asdf-vm plugins work with a pull model: They usually check GitHub releases (or wherever the software in question publishes its releases) and offers the identified releases as installation candidates. There's no notification to be pushed anywhere. Once the plugin exists (and is maintained in case the source of information of releases changed), it keeps working.

@aalmiray
Copy link
Contributor

aalmiray commented Apr 8, 2022

@joschi then perhaps what's needed is a way to bootstrap the plugin repository according to the distribution layouts supported by JReleaser. The JReleaser asdf publisher could check if the plugin repo exists an if its contents match generated files. If no match to any of those conditions the publisher creates/updates the repo. WDYT?

@joschi
Copy link

joschi commented Apr 8, 2022

@aalmiray You could take https://github.com/asdf-vm/asdf-plugin-template as a starting point for that.

@aalmiray
Copy link
Contributor

aalmiray commented Apr 8, 2022

@joschi Thanks. Hope that's enough for distros of type BINARY, JAVA_BINARY, JLINK, NATIVE_IMAGE that also post releases to GitHub.

@HonoluluHenk
Copy link
Author

@aalmiray as mentioned before: asdf-vm needs plugins to implement a pull method, nothing needs publishing anywhere.

fyi: my POC is parsing maven-metadata.xml directly from Maven Central.
It then downloads the quarkus-cli-$version-runner.jar from there and creates a minimal wrapper (analogous to jbang).

This makes my implementation evergreen, no maintenance needed.

@gsmet
Copy link
Member

gsmet commented Apr 8, 2022

@HonoluluHenk I think you misunderstand what JReleaser can do. Typically in the case of Homebrew, it just publishes the new version to a GitHub repository.
That's the beauty of it, we would have the GH repository automatically updated as soon as we release a new version.

@aalmiray
Copy link
Contributor

aalmiray commented Apr 8, 2022

Odd to have the cli-runner JAR posted to Maven Central unless the intention is perhaps to allow other tools to embed it? @gsmet perhaps you can shed some light in this regard.

The cli posts a binary distribution to the quarkus release page (such as https://github.com/quarkusio/quarkus/releases/tag/2.7.5.Final) which is used by package managers (sdkman, homebrew, chocolatey). My gut feeling is that other package managers should use this distribution as well, as this leads to reusing artifacts posted by the Quarkus team without additional modifications (such as a custom made launcher script).

@ebullient
Copy link
Contributor

jbang can pull from maven (it might also pull from GH.. but I believe it prefers mvn central for some things)

@maxandersen
Copy link
Contributor

We use the maven central from jbang because it's more reliably available than GitHub release artifacts. No other reason as in this case we don't even resolve dependencies it's just grabbed as a single jar.

@maxandersen
Copy link
Contributor

In case of asdf I agree using GitHub releases would be more consistent with other package managers.

@maxandersen
Copy link
Contributor

Hosting asdf-plug-in repo makes sense imo.

Could just do like https://github.com/joschi/asdf-jbang which have GitHub action to trigger publish.

Maybe jreleaser could trigger it via webhook ?

@joschi
Copy link

joschi commented Apr 11, 2022

Could just do like https://github.com/joschi/asdf-jbang which have GitHub action to trigger publish.

I'm not sure what you mean. The GitHub Actions workflow in https://github.com/joschi/asdf-jbang just makes sure that the latest JBang release didn't break anything (for example by changing the URLs of their artifacts).

Other than that the asdf-vm JBang plugin (or any other asdf-vm plugin) doesn't need any trigger for new releases since it consumes the data from GitHub releases.

https://github.com/joschi/asdf-jbang/blob/b3cf3e8e7add4972914f14995b9b65a5cb0cf0f9/bin/list-all#L3-L4
https://github.com/joschi/asdf-jbang/blob/b3cf3e8e7add4972914f14995b9b65a5cb0cf0f9/bin/install#L32

@HonoluluHenk
Copy link
Author

FYI: I just pushed an implementation that uses quarkus github releases.

Still a POC since some older releases do not have cli artifacts. Installing those versions currently leads to errors.

@HonoluluHenk
Copy link
Author

Thanks, guys!

@maxandersen
Copy link
Contributor

@HonoluluHenk where did you push it to @HonoluluHenk ? how can user use it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants