-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Extension metadata and generation of extensions.json #4423
Extension metadata and generation of extensions.json #4423
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, added a few minor comments
devtools/maven/src/main/java/io/quarkus/maven/GenerateExtensionsJsonMojo.java
Outdated
Show resolved
Hide resolved
796c951
to
2706925
Compare
2706925
to
ad0e573
Compare
Weren't we going to put these in quarkus-extension.properties rather than introduce another marker file ? |
@maxandersen i mentioned my reasons in the summary of the PR. |
I added a few changed since @gastaldi has approved it, specifically I added the BOM GAV from which the JSON was generated to the resulting JSON. So now it's an object with attributes: |
|
||
{ | ||
"name": "Agroal - Database connection pool", | ||
"labels": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should include at least part of the info we have on the extensions.yaml
file from the website?
See https://github.com/quarkusio/quarkusio.github.io/blob/develop/_data/extensions.yaml .
I'm thinking about:
- the description
- a key defining the category (I would keep the list of category key <-> name mapping and the order in the website - or on
code.quarkus.io
).
If we do that, I wouldn't have to add the extensions on the website.
Note that I haven't followed all the discussions so maybe it's a stupid idea :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Here I'm taking what's in the current extensions.json
as a start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on getting the minimal version in first.
Next step there efter is to add the additional features such as description, category, etc.
Please, don't merge it yet. I'm looking into a build issue in Eclipse. |
I'm not following why we wouldn't want to reuse the existing properites, nor why there should be |
The properties file has been used so far to store the GAV of the corresponding deployment artifact. While I did have in mind to possibly extend this file with more info (primarily provisioning related), the way it is evolving now is not looking to be effective to me.
|
ad0e573
to
29ecf77
Compare
That's related to mojo parameter initialization. E.g. we've had a parameter |
It is intentional we are committing the marker files for each extension or do we plan to have our own extension using the mojo's ? also if we are introducing This was one of the reasons I was liking more |
Not sure I understand your question. Every extension is supposed to include the description. Whether it's generated or written maintained manually.
Why?
To later support 3 formats? |
just curious as thought you said you wanted the extensions in core to have the maven plugin generate it. |
yaml is better for humans - json is for machines ;) |
no, to avoid having to deal with anything but built-in to java parsing/formats :) |
processMetaInfDir(artifact, artifactFs.getPath(BootstrapConstants.META_INF), extJsonBuilder); | ||
} | ||
} | ||
} catch (Throwable t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this not just catch (Exception e) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I am actually throwing a wrong exception here. Copy-pasted from another class.
devtools/maven/src/main/java/io/quarkus/maven/GenerateExtensionsJsonMojo.java
Show resolved
Hide resolved
...-projects/bootstrap/maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are few minor things in this but I approve this as its generally what we want to get to and I would rather have generation of extensions.json in core now than wait.
The other things we can fix in follow-up PR's as we haven't yet removed core extensions.json thus not breaking anything.
just noticed that the generated quarkus-extension.json in some cases ends up with:
i.e. others have no GAV at all:
and finally also when existing data you get:
Shouldn't there at least be a groupid and artifactid in here ? |
@maxandersen I wasn't able to reproduce your last issue with groupId and artifactId being null. Everything is OK here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few questions.
It needs a rebase and once it's done, if you could run a full build with an empty repo and check that:
- it works
- we don't have these null groupIds and artifactIds issues
Once you have checked that, I would say let's commit it and make incremental changes on top of it.
@@ -61,6 +61,10 @@ | |||
<groupId>org.apache.maven</groupId> | |||
<artifactId>maven-core</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.eclipsesource.minimal-json</groupId> | |||
<artifactId>minimal-json</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use this here and not the regular JSON dependency we use elsewhere?
(Not blocking, just a question)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was originally using the glassfish one but then George suggested me to use this impl as a smaller and faster one. Given that it's an independent project, I didn't mind changing. I won't mind changing back neither.
...-projects/bootstrap/maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java
Show resolved
Hide resolved
shouldn't |
Ah, that's a good question for Alexey. With Quarkus, I usually do |
I did a new run with Still have neither in
|
I can do that. But I'll keep only one format. The aggregated extensions list will still be in JSON though, I guess. |
That's probably your IDE building it? There is a comment somewhere above where I summarized my struggling figuring out why Eclipse (in my case) didn't properly initialize Mojo parameters. |
Yes, but that's |
The |
Worked for me. |
…nerate META-INF/quarkus-extension.json with the extension descr/props; * Added quarkus:generate-extensions-json mojo that generates extensions.json file (and attaches it as a Maven artifact to the project) for a BOM by collecting all the META-INF/quarkus-extension.json files from its managed deps; * Added devtools/core-extensions-json module that generates extensions.json file for Quarkus Core (which for now isn't used yet as it needs refinement).
29ecf77
to
1901746
Compare
could be - I had code open that uses m2e behind the scenes. |
Damnit, I only noticed this issue now. I would prefer to generate that
|
@@ -78,5 +95,37 @@ public void execute() throws MojoExecutionException { | |||
} catch(IOException e) { | |||
throw new MojoExecutionException("Failed to persist extension descriptor " + output.resolve(BootstrapConstants.DESCRIPTOR_FILE_NAME), e); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aloubyansky I don't understand this code: it appears to read the file if it exists, and then writes it back. Surely I'm reading this wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely wrong :) At this point, the file that's actually on the disk is missing groupId and artifactId, which makes it more like a template that needs to be complete by the plugin. However, you're right, it could originally be complete, in which case persisting it is useless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you're reading it from the output folder. Shouldn't it be read from the src folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am reading it from the output folder to support filtering of resources, just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, if it's done on purpose then fine :)
We should introduce the WIP bot in here? |
isn't that superseeded by github now directly supporting drafts pull-requests ? |
Fixes #833, #4317
I decided not to re-use
META-INF/quarkus-extension.properties
for this, I think we should deprecate it and have a simplerMETA-INF/quarkus-extension-deployment-gav
or something to make it easier/faster to resolve the deployment artifact at build time.FYI @maxandersen, @paulrobinson, @quintesse, @gastaldi