-
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
Automatically execute plugin goals configured in phases preceding quarkus:dev #33617
Automatically execute plugin goals configured in phases preceding quarkus:dev #33617
Conversation
This comment has been minimized.
This comment has been minimized.
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.
Nice to see this long standing "gap" fixed!
I didn't have the time to test it, but I might have found two issues while running the algorithm through my brain. 😉
if (goal.equals(QUARKUS_GENERATE_CODE_GOAL)) { | ||
var clone = e.clone(); | ||
clone.setGoals(List.of(QUARKUS_GENERATE_CODE_GOAL)); | ||
// this will schedule it before the compile phase goals |
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.
Are you sure that it will always be added before any compile phase goals?
What if someone configures default-compile plugin execution (of m-compiler-p) first, without a phase, and then quarkus-m-p?
Better use add(0, Map.entry(p, clone))
?
} else { | ||
executeIfConfigured(IO_SMALLRYE, JANDEX_MAVEN_PLUGIN, JANDEX, Map.of()); | ||
for (int phaseIndex = latestHandledPhaseIndex + 1; phaseIndex < PRE_DEV_MODE_PHASES.size(); ++phaseIndex) { | ||
var executions = phaseExecutions.get(PRE_DEV_MODE_PHASES.get(phaseIndex)); |
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.
If I'm not mistaken, when no phase has been specified (e.g. just mvn quarkus:dev
), then phaseIndex
would start at 1 (because latestHandledPhaseIndex stayed at 0), hence skipping validate
and jumping right to initialize
, no?
75ff382
to
c763507
Compare
Thanks @famod both were spot on, fixed. |
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.
Nice!
I was thinking about a way to exclude some executions from being auto-run like that, but let's see if someone complains.
This comment has been minimized.
This comment has been minimized.
c763507
to
0e27aaf
Compare
Failing Jobs - Building 0e27aaf
Full information is available in the Build summary check run. Failures⚙️ Native Tests - Amazon #- Failing: integration-tests/amazon-lambda integration-tests/amazon-lambda-http
📦 integration-tests/amazon-lambda✖
📦 integration-tests/amazon-lambda-http✖
|
Nice work @aloubyansky looking forward to it! |
Hi @aloubyansky. Quarkus QE framework daily runs started to fail on daily runs after this PR. E.g. https://github.com/quarkus-qe/quarkus-test-framework/actions/runs/5182751224/jobs/9340270864 The failure can be seen using The main cause is:
Checkstyle xml file is in the root of the https://github.com/quarkus-qe/quarkus-test-framework repository and I can workaround this by adding |
Thanks @rsvoboda, I'll have a look. |
Interestingly it does not fail for me locally. |
@aloubyansky you need to revert quarkus-qe/quarkus-test-framework@08f9220 to see that |
I suspect it's because of the app module being moved to a new dir out of the project (although still in the dir hierarchy but out of the Maven project module hierarchy), so it ends being an orphaned project referencing the parent POM that is resolved from the local Maven repo, which configures the checkstyle plugin that is looking for the config file that is now not found in the new (orhaned) workspace. |
Basically, the project ends up in |
Hi @aloubyansky, thanks for looking into this! You are correct, we see the trouble because we use just part of the repo structure in orphaned location. |
As a workaround, you could probably adjust the parent location, i.e. the I didn't initially realize that we are copying just the module where the test is. |
Here is what I meant, as an idea, in case you are curious
|
For now I just skip checkstyle execution when invoking remote dev command. Will make a followup note about relativePath. |
Ah, you are quick! We would need something like for all the classes where we copy the module. |
It'd be still more like a hack though. Because the parent POM is still referencing the original module in its |
Fix #32816
Fix #30166
This change enhances DevMojo autocompile feature by figuring out the necessary phases and plugin goals that need to be handled before launching the app in dev mode.
@famod would you mind reviewing this one? Thanks.