Open gastaldi opened 1 week ago
/cc @aloubyansky (extension-proposal), @gsmet (extension-proposal), @maxandersen (extension-proposal)
How would that work as an extension?
@aloubyansky I thought of introducing a MinimumQuarkusVersionBuildItem
which other extensions could produce and we perform the check here in a build step, failing the build (or logging a warning) if the expected version doesn't match
This is a kind of static config validation. Ideally this kind of validation should be performed before the augmentation process starts.
Right, I haven't yet checked if it might need some changes in core to allow that, but I agree
We have a few other validation checks in this category that are performed in build steps. @dmlloyd would you like to get them moved to pre-augmentation phase?
I think it may justify some changes in core. Specifically, we could introduce a proper config validation phase. That would include version alignment checks (currently we check platform member bom version alignment), possibly capability requirements check (required and provided + conflicts).
I think that would make sense.
What problem is this new extension going to solve?
@geoand one use case is that extensions could specify the minimum Quarkus version they require to function (because they use an APi introduced from that version onwards). This would hopefully avoid CNFE and method signature errors during the application's build time
That makes perfect sense, but is an extension the proper way to do this, or would the changes in the core that Alexey mentions suffice?
I am not sure yet what changes in core would need to be done to support this. My initial idea was so that extensions would produce BuildItems for the environment they would require and we'd consume them and fail the build if there is a mismatch
My feeling is that we could support this functionality without an extension, as it would essentially be static information that does not have to interact with the rest of the build - just prevent it if need be :)
Like others I'm not following how this would be useful as independent extension or are you assuming core will depend on it?
Because an extension would (in theory) not require changes in core and would work when an extension depending on it is included in an app using any existing Quarkus version
@gastaldi do i remember correctly that you mentioned there was a "min Quarkus version" field in extension metadata already? Could you please link to an example? Thanks.
@aloubyansky sorry I wasn't clear, I meant that we have the built-with-quarkus-core: "3.8.4"
in the quarkus-extension.yaml
metadata, not the minimum Quarkus version an extension supports
ok, so the question is how extensions would declare their Quarkus version compatibility compatibility requirements. Build items or metadata. Both would be pretty much be fixed at extension build time, which is a limitation when it comes to not yet released Quarkus versions. Either way, I would prefer metadata as the source of this data.
Either way, I would prefer metadata as the source of this data.
Definitely +1
How about we introduce a quarkus-core-compatibility: [3.8.4,)
metadata featuring a version range that could be checked somewhere in core?
Default would be [${built-with-quarkus-core},)
A version range would be a natural first step. BTW, don't we have the next Quarkus major version as the upper limit when displaying extensions on code.quarkus or even in the registry?
I don't think we want to default to [${built-with-quarkus-core},)
exactly, since that will put a limit on the micro version, which is updated often. We should probably be defaulting to major.minor.0, which seems to be too limiting too considering the frequency of releases. Tricky...
Maybe use streams instead (no patch version). In theory we shouldn't introduce API changes in patch releases, but who knows :)
Description
The idea of this extension is analogous to the Maven Enforcer Plugin: introduce Build Items to control certain environmental constraints such as Quarkus version, JDK version, and OS family along with many more built-in rules and user created rules.
Also a potential solution for #37169
Interested in this extension, please +1 via the emoji/reaction feature of GitHub (top right).
Repository name
quarkus-enforcer
Short description
Control certain environmental constraints and fail the build if they don't match
Repository Homepage URL
https://docs.quarkiverse.io//dev/
Repository Topics
Team Members
Additional context
No response