-
Notifications
You must be signed in to change notification settings - Fork 861
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
Gradle implementation of Project (re)load API #7665
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.
Looks fine to me.
88d86d3
to
6ea5e5e
Compare
283a9aa
to
d2b6769
Compare
During testing, I've discovered that This is a general problem and affetcs all (even production) code that uses pattern:
though the client code even opens the project in a hope it will be fully initialized afterwards, the Sources may report no source groups as the java-specific provider might not be recognized/loaded yet. This happens randomly. In this PR, I've introduced waitForProjectLookup that hides a hacky way how to wait for the project lookup's implementations to initialize. |
note that gradle tests are known to be unreliable, So the problems experienced here could be new or potentially just highlight already existing issues by changing the timing. (one of the consequences of unreliable tests: you can never be sure) |
@mbien I am 90% sure the problem (or its root cause) is ages-old; will manifest itself primarily in tests, as the query almost immediately follows project open with a not-yet-recognized contents of the layers ... IMHO it affects the IDE only in a limited way, as in a typical "bootrstrap" the IDE displays whatever is available then refreshes on change events (which will come). But automated operations after POM/build.gradle change are in much greater danger, especially if adding a technology dependency (i.e. micronaut, spring, ...) to the project. This issue affects equally Maven - and most probably any tests that setup maven/gradle project and then try to "read something", as e.g. java / micronaut / ejb providers do not initialize in a consistent way. I'd like to invent "something" that would allow the projects to fire e.g. another property change event on full initialization, but it will be ... rather hard; I'll try to minimize API changes. |
the only maven related sporadic test failure I remember is #7263. But we could check master merges and build some statistics if needed since they have retry script warnings and also logs of my manual restarts. also note that contrary to the gradle tests, those are not wrapped in retry scripts. The retry scripts for gradle tests fire often. |
Stats would be good to observe the change in gradle after this merges. The test hack may stabilize some things, that's why I put it into the abstract test core many of the tests derive from. |
If no objections are raised, will merge this PR tomorrow early morning. |
Gradle implementation, based on improvements in #7646 implementing SPI introduced in #7651.
The implementation allows the caller to grant project trust when loading the project. Doing so requires implementation dependency on Gradle Projects module ... I hope that the ProjectReload will be soon (~ within 24 release cycle) move into project API and the impl dependency can be removed.
Note: as the preerquisite PRs will be merged, I'll clean up the commits here. Only 9cf5c1c should remain at the end.