Working Group - Quarkus Config and IDEs #42671
Replies: 11 comments 57 replies
-
I published a very quick experiment here which can give an idea of the information we need to include: #42677 . Note that this is just an experiment to give you an idea of the data we need to include in the output. Still, I think it's useful to understand what is specific to Quarkus. The result of this experiment is the following files: You can for instance have a look at those of |
Beta Was this translation helpful? Give feedback.
-
I love this idea! |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @gsmet for creating this wonderful discussion that we have been waiting for a very long time.! Having the properties available for a Quarkus extension could perhaps improve the performance of loading the properties available for the application.properties file (to manage completion, validation, hover, etc.), but the biggest difficulty for us is the management of Quarkus deployments which slow down the project loading performance. Indeed we have coded in JDT Eclipse and IJ the downloads of the Quarkus deployments and then added them to the search classpath to find the properties of the Quarkus deployment. This works but can degrade performance. For performance reasons we do not look for Quarkus deployments that reference the Quarkus deployment of an extension, and in this case we lose properties. An example is the Quarkus Kubernetes extension. We had to hard code the fact that we have to look for Quarkus deployments that reference the root Quarkus deployment. As language server uses JSON to coomunicate with LSP client (vscode, IJ, Eclipse IDE, etc) we use JSON as format to describe properties. We generate this JSON metadata by scanning Java classes by using MicroProfile annotations (ex: Configproperty) or Quarkus annotations. When some properties cannot be retrieved by annotations, we hard coded in JSON files. You can find them:
Here the sample for
I have tried to follow the same format than Spring https://www.baeldung.com/spring-boot-configuration-metadata#generating-metadata (but I had to add some new property like sourceField, extensionName, etc) Ideally what we would need is to have a JSON file (which has the same format as I gave above) stored in the Quarkus extension JAR that describes all the properties of the extension and includes those of the deployment JARs (it would be amazing for us to have this and it would considerably boost the loading of properties!) I hope I explained our need correctly and we are very excited to use the mechanism you intend to implement. Thanks for thinking of us (IDE support)! |
Beta Was this translation helpful? Give feedback.
-
Are these hard requirements or points to discuss?
AFAIU, this is for specific types of metadata, right? This one still seems more like an implementation detail to me.
As @angelozerr suggests, I think this should be discussed further. We could certainly produce a single file per extension for IDEs to consume.
I think it'd be worth exploring it. It'd be a lot less painful to consume for an IDE than a deployment JAR.
This seems to fit the direction of @holly-cummins 's ADR, so we could put a start to it with this effort?
Let's consider the big picture though. Thanks for starting this discussion. |
Beta Was this translation helpful? Give feedback.
-
I wanted to add another requirement: IDEs sjouke aware of conditional dependencies whose conditions are satisfied. Conditional dependencies is a core feature that's not going away, in fact it seems it's getting more popular. It should be taken into account in the design phase of a contract. For that reason I'd suggest considering the Gradle Tooling API approach (https://docs.gradle.org/current/javadoc/org/gradle/tooling/GradleConnector.html) Conditional dependencies won't be present during the compile phase of a project (at least that's how it is today) but they will certainly contribute config properties and other extensions metadata. |
Beta Was this translation helpful? Give feedback.
-
I played a bit more with my experiment following the feedback here as I wanted to check how hard it would be to go with another approach. I pushed my new stuff here: #42677 . The main idea of this new approach is:
This is just an experiment and very much in flux. The downside on the Quarkus side is that we would need to add a plugin execution to each extension deployment module. But we might need to do that anyway for other purposes. Here is the result of this experiment on three extensions: |
Beta Was this translation helpful? Give feedback.
-
I summarized the status of the discussions in the |
Beta Was this translation helpful? Give feedback.
-
@gsmet could you do your experimentation with kubernetes openshift extension. For IDE this extension is a nightmare,because we need to download the kubernetes openshift deployment which defines some properties, but too download other depdencies deployment like quarkus-container-image-openshift-deployment, io.dekorate, etc. To collect all artifact to scan to collect properties, we have started to resolve it with maven , but it was so long. It is the reason why we have hard coded those dependencies to know which deployment JARs must be downloadedfrom a givendeployment JAR in https://github.com/redhat-developer/intellij-quarkus/blob/821038d1e707fa8e523a918a13576884f862cb59/src/main/java/com/redhat/devtools/intellij/quarkus/buildtool/BuildToolDelegate.java#L44 for kubernetes. If we could get properties from a given runtime for deployment + dependencies deployment in the same JAR, it would be fantastic. |
Beta Was this translation helpful? Give feedback.
-
I have a question about the format of the maps, which are VERY often used in Quarkus (for instance when you have several datasources, persistence units, clients...). In the files I generate atm, they look like this:
I know I have seen files @angelozerr was using that had the maps with things like Which is a bit unfortunate for two reasons:
Interested in your feedback @angelozerr and @aleksey-stukalov . |
Beta Was this translation helpful? Give feedback.
-
And I think I have one last important question: the format of the actual doc. In Quarkus, we are using both traditional HTML based Javadoc and Asciidoc (we have a marker in the doc to differentiate them). For inclusion in our doc, we translate the HTML based Javadoc to Asciidoc. So for our internal doc, we have everything Asciidoc (but our translator is not exactly perfect). We also know that there will be some Markdown Javadoc support coming soon in the JDK (we might not use it in Quarkus but some extensions outside of Quarkus might use it). I was wondering if you were able to display Asciidoc and Markdown in the IDE? Markdown, I'm pretty sure, Asciidoc I'm not so sure. Also I think we should have a marker of the format so that you can pick the right renderer? Finally are you able to render traditional Javadoc without the full context: for instance, let's say it's the Javadoc of a deployment class and you have a Interested in your feedback @angelozerr and @aleksey-stukalov . Once this and the map format are sorted out, I think we could prototype something great for Quarkus 3.16. |
Beta Was this translation helpful? Give feedback.
-
Hi,
With the introduction of the new extension annotation processor in Quarkus 3.14, we now have a comprehensive and structured model of our configuration properties when we build the extensions.
This model is used to generate the Asciidoc documentation but it can also be used to generate files embedded in the extension jars that could be consumed by IDEs to provide information about the available configuration.
We won't generate a file per IDE/IDE plugin so we need to define a common format that works well for everyone.
Tip
You can find a summary of the discussions in the
In the previous episodes...
section below.I will update it regularly.
Current situation
We generate a file named
META-INF/quarkus-javadoc.properties
that is embedded in the jar and contains the javadoc of the config in the standard Properties format.There is no other information so, if an IDE wants to get an idea of the available configuration properties, they have to go through the config classes and extract the configuration properties themselves.
This is not sustainable, error prone and duplicate efforts, especially since the Quarkus config has a lot of advanced features and it's hard to stay on top of them.
What we aim for
The main goal of this working group is to define a common format describing the Quarkus properties, format that could be consumed by all IDEs.
Constraints
Warning
If you arrive now, skip this paragraph, it contains some constraints that we will probably alleviate given the discussions we had.
-deployment
module, depending on where the config root is: IDEs will have to scan both.properties
as we might want to embed more information in it)@deprecated
note in the model to point to the new property.Outputs
How to proceed
If you are interested in this initiative, please add a comment here and I will include you in the discussions about the format.
Once the format is defined, the implementation in the annotation processor should be fairly easy.
In the previous episodes...
Note
I will try to summarize the discussions here as we make progress.
Consensus
quarkus
node for instance).sourceField
/sourceMethod
to indicate the source element of the property. This field will be added at the root so that's it's close tosourceType
.-deployment
module. This artifact will contain the config metadata in the Spring format (+ some additional Quarkus-specific metadata). So for each runtime extension (ie any jar having aMETA-INF/quarkus-extension.properties
in it), IDEs will download an additional artifact with name<extension>-deployment-<version>-config-metadata.json
. IDEs don't need to download the deployment artifacts to get the configuration properties, just these additional JSON files. The file might not contain properties if the extension doesn't have any configuration properties but it will exist.Remaining constraints
quarkus-core
for instance). The reason is that part of the config is in the-deployment
artifact and the-deployment
artifact depends on the runtime one. This is not going to change.Exploration and ideas
deprecation
and we probably need an annotation in Quarkus to handle that better.Experiments
The latest status of the experiments has been posted here: #42671 (comment) .
Beta Was this translation helpful? Give feedback.
All reactions