Repository navigation
Run annotation processors when sources are unchanged - #1136
Conversation
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
gnodet-bot
left a comment
There was a problem hiding this comment.
Correct fix — proc=only must bypass incremental source-change detection so annotation processors always run. The NONE aspect properly disables all incremental checks in ToolExecutor.applyIncrementalBuild(). Two minor observations below.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
gnodet-bot
left a comment
There was a problem hiding this comment.
Both previous findings addressed:
- Javadoc — expanded to describe
proc=onlydisabling incremental compilation. ✅ - Test fixture — removed hardcoded
<incrementalCompilation>classes</incrementalCompilation>, now tests the default (user-reported) scenario. ✅
No new issues introduced by the follow-up commit. The proc=only guard is correct — fires early, clears aspects, sets NONE, returns before the annotation processor check. Test covers the exact regression from #1006.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
gnodet-bot
left a comment
There was a problem hiding this comment.
All previous findings addressed:
- Javadoc — expanded to describe
proc=onlydisabling incremental compilation. ✅ - Test fixture — uses default
incrementalCompilation(no hardcoded override), matching the user-reported scenario from #1006. ✅ - Formatting (@desruisseaux) —
return;} ifreplaced with} else if. Semantically identical — nothing follows the if-else block in the method body. ✅
No new issues in commit 010495c.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
The rational for disabling incremental compilation when there is a Another inconsistency is that the current implementation modifies the configuration only when user did not specified explicitly an I propose to revert the changes in the As an optimization, if the project is modular and there is no include/exclude filters, the option should be |
|
Fixed CI failure: added The Fixed in 667a164. |
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit 667a164 (CI fix).
Previous findings status:
- ✅ Javadoc clarification — addressed (5b8f0e4)
- ✅ Test fixture uses default
incrementalCompilation— addressed (5b8f0e4) - ✅ Formatting (
else if) — addressed (010495c) ⚠️ @desruisseaux's design suggestion (handlingproc=fullconsistently, respecting user-explicitincrementalCompilation, alternative guard placement) — still open, awaiting author response
New commit 667a164: Adds the standard assertCompilerStubOutputFileExists(compileMojo) cleanup call at the end of the new test — all other tests in the suite follow this pattern. Prevents dependency:analyze from tripping on the empty stub compiled.class. Clean fix, no issues.
The implementation remains correct for the proc=only case. The outstanding design discussion with @desruisseaux about proc=full consistency and the MODULES optimization are reasonable follow-ups but do not block this fix for #1006.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
@gnodet-bot : no, at least the consistency point of above discussion is blocking. Doing that later would be a behavioural change for users and likely to cause "regression" bug reports. The comment was saying exactly what to do, please apply. The (being rude toward the bot, not toward the human) |
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
|
Applied the blocking consistency feedback in 05525cf. Added coverage for default |
gnodet-bot
left a comment
There was a problem hiding this comment.
All previous findings addressed in commit 05525cf:
- @desruisseaux consistency concern (blocking) — ✅
amendincrementalCompilationnow usesaspects.clear()+aspects.add(NONE)inside the existingisAbsent(incrementalCompilation)guard.hasAnnotationProcessorreturnstruefor bothproc=onlyandproc=full(they fall through past the"none"check), so both cases are handled consistently. - Explicit user configuration respected — ✅ The
isAbsent(incrementalCompilation)condition ensures explicitincrementalCompilationsettings are never overridden. New testtestCompilerProcOnlyRespectsExplicitIncrementalCompilationvalidates this. - MODULES optimization — Reasonably deferred;
amendincrementalCompilationdoesn't have modular-project context to selectMODULESwithout broadening the change. - Javadoc — ✅ Accurately describes the new behavior: "Amends the default configuration... does not amend an explicitly configured value."
- Test coverage — ✅ Three new tests:
proc=only(default),proc=full(default), andproc=onlywith explicitincrementalCompilation=classes. - Formatting (else if) — ✅ Addressed in 010495c, now superseded by the simplified method body.
No new issues introduced by commit 05525cf.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
|
Adjusted the explicit Validation: |
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit 218661a (test assertion fix).
Previous findings status — all addressed:
- ✅ Javadoc clarification (5b8f0e4)
- ✅ Test fixture uses default
incrementalCompilation(5b8f0e4) - ✅ Formatting
else ifper @desruisseaux (010495c) - ✅ CI stub cleanup
assertCompilerStubOutputFileExists(667a164) - ✅
proc=fullconsistency and explicit config precedence per @desruisseaux (05525cf)
New commit 218661a: Corrects the assertion in testCompilerProcOnlyRespectsExplicitIncrementalCompilation. With explicit incrementalCompilation=classes, amendincrementalCompilation does not fire (isAbsent guard), so the CLASSES aspect applies. The first execution generates class files, which the CLASSES aspect detects as changed on the second run — the second proc=only execution correctly recompiles. The previous verify(log).info("Nothing to compile...") was wrong; verify(log, never()) is correct.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
Some integration tests are failing (logs there):
Two of them seem related to incremental builds and may need adjustment for the new behaviour. The two others seem unrelated (judging by their title only) and would need some investigation. |
Signed-off-by: Efe Gökdemir <gokdemirefe1903@gmail.com>
|
Addressed the implicit pre-Java-23 Validation: focused |
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit 55c4389 (fix implicit proc default incremental behavior).
Previous findings status — all addressed:
- ✅ Javadoc clarification (5b8f0e4) — updated again in this commit to describe three-way behavior
- ✅ Test fixture default
incrementalCompilation(5b8f0e4) - ✅ Formatting
else ifper @desruisseaux (010495c) - ✅ CI stub cleanup
assertCompilerStubOutputFileExists(667a164) - ✅
proc=fullconsistency and explicit config precedence per @desruisseaux (05525cf) - ✅ IT failures reported by @desruisseaux — addressed by this commit
- ⏳
MODULESoptimization — reasonably deferred (author evaluated and explained)
Commit 55c4389 analysis: Correctly restores original master behavior for the implicit-proc pre-Java-23 case (REBUILD_ON_ADD + REBUILD_ON_CHANGE) while preserving the #1006 fix for explicit proc=only/proc=full (NONE). The condition isAbsent(proc) && !isVersionEqualOrNewer(RELEASE_23) properly distinguishes the three cases:
proc |
Java | Result |
|---|---|---|
| absent | <23 | REBUILD_ON_ADD + REBUILD_ON_CHANGE (unchanged from master) |
| absent | ≥23 | NONE (processor detected → disable incremental) |
| only/full | any | NONE (fixes #1006) |
The unit tests (proc=only, proc=full, explicit incrementalCompilation) are JDK-version-independent since they set proc explicitly, always taking the else branch. No new issues.
Note: CI shows action_required — likely needs a maintainer to approve the workflow run for this contributor.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit a31963f (deterministic test assertion).
Previous findings status — all addressed (unchanged from last review at 55c4389).
New commit a31963f: Replaces the full mojo-execution test (testCompilerProcOnlyRespectsExplicitIncrementalCompilation) with a direct unit assertion on amendincrementalCompilation(). The old test was non-deterministic — the CLASSES aspect caused incremental detection to fire on the second execute() because generated class files from the first run were detected as changes. The new test directly verifies that an explicitly configured incrementalCompilation is never overridden: creates EnumSet.of(CLASSES), calls amendincrementalCompilation with PROCESSOR_CLASSES, and asserts the set is unchanged. Correct and deterministic.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit cc9c788 (remove obsolete test fixture).
@desruisseaux's request addressed: The compiler-proc-only-explicit-incremental-test fixture directory is deleted, and the test method now uses direct CompilerMojo instantiation with field assignment — no mojo injection or test resources needed. The assertion is identical and deterministic.
Previous findings status — all addressed (unchanged from last review at a31963f).
No new issues. CI still needs maintainer workflow approval for this external contributor.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
Thanks, it looks fine to me. I would just like two comments to be added for helping the reader to understand why the amend method is doing a special case with |
Signed-off-by: Efe Gökdemir <gokdemirefe1903@gmail.com>
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit ea009b6 (docs: clarify annotation processor detection).
@desruisseaux's final requests — both addressed:
- ✅ Comment in
amendincrementalCompilationbelow theisAbsent(proc) && !isVersionEqualOrNewer(RELEASE_23)guard — added verbatim as requested - ✅ Javadoc addition in
hasAnnotationProcessor— added verbatim as requested
Previous findings status — all addressed (unchanged from last review at cc9c788).
No code changes in this commit — documentation only. All 8 rounds of review findings are resolved.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
@desruisseaux Please assign appropriate label to PR according to the type of change. |
Summary
Fixes #1006.
When
<proc>only</proc>is configured, the compiler execution is dedicated to annotation processing. Incremental source-change detection must not skip that execution merely because the Java sources are unchanged.The fix makes
proc=onlyuse the existingNONEincremental mode, so all sources remain available to javac and the processor runs on every execution. A unit regression test covers two executions with unchanged sources.Testing
mvn test— passed (17 tests)mvn -Dtest=CompilerMojoTestCase#testCompilerProcOnlyRunsWhenSourcesAreUnchanged test— passedmvn spotless:check— passedgit diff --check— passedmvn verify— attempted; the repository's dependency analysis failed while parsing the intentionally minimalcompiled.classemitted by the existing test compiler stub (Index 6 out of bounds for length 0). The test suite itself passed before that lifecycle step.Contribution checklist
AI assistance
Codex assisted with repository analysis, implementation, test authoring, and validation under human supervision. The submitted change and test results have been reviewed for correctness by the human contributor.