-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Initial introduction of delayed config concepts (Property, Provider, etc) for QuarkusPluginExtension
, QuarkusBuild
and QuarkusDev
#25615
Conversation
…etc) for `QuarkusPluginExtension`, `QuarkusBuild` and `QuarkusDev`
This first commit simply migrates things directly to use deferred configuration concepts ( I think some of the properties unnecessary probably. And I would like to understand better about the single-source-directory limitation some more. But those are other discussions. I just wanted to focus on the configuration changes. |
Thanks @sebersole this is great! What is the minimal supported gradle version for providers? |
This comment has been minimized.
This comment has been minimized.
@sebersole is there anything you were planning to add to this PR before making it ready for review/merging? We don't run the full CI for drafts. |
I want to go back and look at some of these properties and determine which are actually needed, if dropping (/deprecating) some are fine with y'all. E.g., in my opinion source-directory should probably just go away as a property in preference of just using the SourceSet; on the extension for sure, but even on the tasks (QuarkusDev aside possibly, see below). On related note, what about the |
Yes, |
This ties-in with #25511 (comment). If these really are not injectable, and are not really settable as I suspect, then objections to dropping these as properties?
I'm fairly confident that this is related to lack of deferrable configuration |
Would you prefer looking at constructor-injection (assuming y'all are ok with that as a design) as a separate PR? Or is a separate commit here fine? |
All your suggestions here seem reasonable to me @sebersole WDYT @glefloch? |
Let's remove those
Ah, indeed, looks like it could be. |
That work would need to build on top of this. So no need for them to be the same PR so long as I can build one PR on top of another (this) |
Marked as ready-for-review and I'll start another PR on top of this work |
@sebersole may I ask you to please collect or at least highlight to us some changes that could cause backwards incompatibility issues even if you think they are unlikely to affect our current users based on our imagination how the plugin is used? I mean changes like removal of |
This comment has been minimized.
This comment has been minimized.
|
Absolutely |
List of properties, per #25511 (comment) NOTE : this only focuses on the 3 classes I have been working on, though only 2 had properties I thought were maybe not real properties...
|
|
Sorry, I was in the wrong "gradle" directory |
Trying to fixup formatting leads to javadoc errors. E.g.
Are those things you really enforce? They always seem redundant to me, especially for Java Bean properties. |
If you mean at the moment, I actually think nothing changes. I changed the types of properties, but left the old accessors in place which simply delegate to the new ones. If that is not accurate, I can add back whichever y'all want. If you mean moving forward, based on #25615 (comment) and the other discussions... That depends on what type of changes y'all want to accept. I think you should consider dropping all of the non-property properties, but that's ultimately a decision you have to make. It is important there to consider the "impact" - changing those values has no effect or "wont work" based on what I saw, so in that respect I don't think there are compatibility concerns involved in dropping those. However, a build script might just use them which would cause an error if you dropped them. Assuming they were are not meant to be settable by users however, I'm not sure the error is a bad thing. |
What's even more strange is that methods I did not even touch fail for some of the same reasons. E.g.
leads to
|
The provider API seems to be present for quite a long time. The current minimal version we support is 6.1 so it should be good. Compilation warnings are generated by gradle (the maven command runs gradle), I think the For next steps, I think we should first display a warning message and deprecate the setter to see if user are impacted by this. WDYT ? |
BTW, those warning won't fail the build but we want to fix them in a further step. |
It's honestly hard to answer that. I am not being critical here; I'm sure there are reasons. But unless I miss something (quite possible), I have to go to the
I'll try this. |
I cannot even run that. Running
|
Unfortunately I cannot really move forward with any work on the plugins. The tests are failing here (GH Actions), but I cannot even build a clean main checkout locally to find out why, let alone easily debug them. I have to be honest, this seems like a huge barrier for contributions in general. Maybe we can brain-storm some improvements? |
For what it's worth, I've been doing |
Thanks @jskillin-idt I'll give that a try.
You mean delete it completely? Personally I have found relying on SNAPSHOTs in mavenLocal is usually not a good idea; at least from Gradle, not sure about Maven. Unless the project configures not caching snapshots.
Not a problem for me. Best practice is to set that on the project anyway, depending on whether that project wants build caching. E.g. https://github.com/hibernate/hibernate-orm/blob/main/settings.gradle#L210 As for build-caching and tests, I have no idea about what does that check. But considering This brings up a question for me... is a goal here to make the Quarkus tasks cacheable? Definitely a separate discussion, but curious about the road map |
Well actually, that first command is what failed that I pasted above:
|
Trying After that I guess I'll try deleting |
Alas,
|
No, just move it out of the way. I have a few reasons for doing this, and most of them come down to being pessimistic about builds I haven't fully investigated, and also it just guarantees that there's no sneaky bits (flags, artifacts, whatever) creating untested combinations for the build tool.
I live on the edge. :) Gradle's performance optimizations were hard to look past once I tasted how fast they run, and I have actually had no issues with them given that they're written very defensively.
I guess it could! It was such a non-issue for me that it didn't even occur to me that I should write an issue for it.
I'm not in charge of the roadmap, but I definitely think this would be a big quality of life improvement. Like I said earlier, the performance improvements from Gradle's optimization features are addicting. My understanding is Gradle will cache stuff naturally if you use its API for task inputs/outputs, so I think first focusing on refactoring the plugin to use more of Gradle's API, like you're doing here, will make it easier to then make that jump. |
For sure. That's why I ask. I saw pretty significant performance improvements in the Hibernate build when I applied all of these techniques.
Not really. At least it won't make use of the "build cache" (which is different then the normal caching it does for inputs and outputs for up-to-date checking). It will not consider a task for caching in the build cache at all unless it is marked as But you are absolutely correct that proper input and output definitions are critical for good build caching behavior. |
Ahhhh! Fascinating! I've just been lucky to be using plugins that were written with this in mind. That's really good to know. |
I wrote an issue for this: #25693 |
Ok, deleting That can't be the full-time solution though, right? @aloubyansky @glefloch - you guys don't do this each time do you? |
I never had to do it to run Gradle ITs, afair. |
How do you verify changes you made to either of the plugins? |
Just |
That way I know my workspace as well as the local Maven repo is proper state. |
I'm not understanding "I never had to do it to run Gradle ITs" versus "and then run IT tests". What is the difference? |
If I understand correctly, these I guess that is pretty tough considering the overall build is handled by Maven. We'd not really be able to set up a task dependency. But man, does this cause a fugly situation. It is simply a PITA testing any work one does on |
I never had to delete my local Maven repo for this. I built the whole repo after I rebase. That overrides previously installed snapshots in the local repo. Then I build and test modules I am working on. |
@aloubyansky Could you give me some specifics?
What command do you use for this?
What command here? I want to update the README files to detail all these steps because they are quite involved and not documented; but honestly, I still have no idea what I am supposed to do (without deleting Maybe y'all can help me understand this. For the time being, I will only be working on these pieces of Gradleness in Quarkus. Which seems to be particularly difficult given the overall build's use of Maven. will be working on code under I promise all of this will make it into the README for posterity ;) |
After a rebase from the root project dir After applying changes to a plugin To run integration tests: |
@sebersole I checked out your branch and built it locally. Tests are failing because a resolution of the The error is:
I tried to debug it, the I don't know how we should fix that as one of your next commit will actually deprecate that.;. |
Ah, thanks for taking a look @glefloch ! I had some pressing tasks for Hibernate I needed to finish up last week, but today / tomorrow I will get back to this. Now that I know about these separate integration tests I can hopefully check this stuff more incrementally. As for how to continue... if y'all are ok with the sum total of the changes I made across all 3 of my pull requests (in theory/principle anyway) would you and @aloubyansky be agreeable to me simply consolidating them together and fix the combination against those integration tests? |
If not, I'll try to fix each individually but that's obviously more work. And they build on each other anyway. |
I think it's ok as they will be part of the same version |
Superseded by #25819 |
Work from discussions at #25511