GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Migrate internal plumbing DEBUG statements to TRACE level by gnodet · Pull Request #12714 · apache/maven Conversation
|
| Area | Files | Changes |
|---|---|---|
| Infrastructure | Slf4jConfiguration, MavenSimpleConfiguration, CliUtils |
TRACE level support |
| Lifecycle engine | LifecycleDebugLogger, BuildPlanExecutor, MultiThreadedBuilder |
~32 statements |
| Cache internals | DefaultRequestCache, CacheConfigurationResolver |
~22 statements |
| Classrealm | DefaultClassRealmManager |
~8 statements |
| Resolver | DefaultArtifactDescriptorReader, relocation sources, TypeDeriver |
~8 statements |
| Plugin resolution | DefaultPluginVersionResolver, DefaultPluginPrefixResolver |
~6 statements |
| Tests | DefaultClassRealmManagerTest, LookupInvokerLoggingTest |
Updated mocks |
DefaultClassRealmManagerTest passes (mock expectations updated)LookupInvokerLoggingTest passes (new TRACE enum value)🤖 Generated with Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
84d77ae to
b6a409b
Compare
c0b643f to
2a79603
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Clean mechanical migration of 70+ debug statements to trace level. MavenSimpleConfiguration, CliUtils, and tests are all correctly updated to handle the new Level.TRACE enum value.
Missing TRACE handling in two logging backends:
The new TRACE enum value is correctly handled in MavenSimpleConfiguration (case TRACE -> "trace"), CliUtils (case TRACE, DEBUG ->), and the test, but two other setRootLoggerLevel implementations were not updated:
Log4j2Configuration.java (line 32-36): default -> "error" silently maps TRACE to "error" — should add case TRACE -> "trace"LogbackConfiguration.java (line 34-37): default -> ch.qos.logback.classic.Level.ERROR silently maps TRACE to ERROR — should add case TRACE -> ch.qos.logback.classic.Level.TRACEBoth are live code — registered in META-INF/maven/slf4j-configuration.properties as runtime-selected implementations. While Level.TRACE is not yet wired to a CLI option (limiting immediate impact), the inconsistency should be fixed to prevent a silent bug when trace-level CLI support lands.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Clean mechanical migration of 70+ internal DEBUG statements to TRACE level. All switch expressions, guard conditions, and tests are correctly updated.
Non-blocking observations:
LifecycleDebugLogger.debug(String) now calls logger.trace(), making the method name misleading. However, the class is non-public API and renaming would expand the scope unnecessarily.DefaultModelBuilder.java:2722: afterSize - beforeSize produces a negative count for removed entries. Should be beforeSize - afterSize. This PR only changed the log level.LGTM — the migration is well-scoped: only internal plumbing is demoted to TRACE, while plugin-facing DEBUG output correctly remains at DEBUG.
This review was generated by an AI agent (Claude Code) and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Clean mechanical migration of 70+ internal DEBUG statements to TRACE level across 18 files. All switch expressions, guard conditions, and tests are correctly updated.
The migration scoping is well-reasoned: only internal framework plumbing (lifecycle engine, classrealm, cache internals, resolver, model builder, plugin resolution) is demoted to TRACE. Plugin-facing DEBUG output (parameter resolution, mojo configuration) correctly remains at DEBUG, preserving the signal that plugin developers need from -X.
Note: the two prior AI-generated reviews flagged Log4j2Configuration and LogbackConfiguration as missing TRACE handling — this is a false positive since both files were removed in an earlier PR in the chain and do not exist on the target branch feature/12643-structured-problems.
Looks good overall. ✅
This review was generated by an AI agent (Claude Code) and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2a79603 to
6eff81f
Compare
b6a409b to
4b6969b
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Clean mechanical migration of 70+ internal DEBUG statements to TRACE across 18 files. The scoping is well-reasoned — only internal framework plumbing (lifecycle engine, classrealm, cache internals, resolver, model builder, plugin resolution) is demoted to TRACE, while plugin-facing DEBUG output (parameter resolution, mojo configuration) correctly remains at DEBUG.
The Slf4jConfiguration.Level enum update is correctly propagated to MavenSimpleConfiguration, and the CliUtils mapping functions correctly map TRACE to the same level as DEBUG for legacy APIs that lack a TRACE concept.
A few minor pre-existing observations (not introduced by this PR):
DefaultModelBuilder.java line ~2722: afterSize - beforeSize produces a negative value when reporting "removed {} entries" — should be beforeSize - afterSizeLifecycleDebugLogger: Several trace log calls use string concatenation instead of parameterized logging ("Project: " + ... vs "Project: {}", ...)compat/maven-resolver-provider TypeDeriver still has debug() calls for the same messages migrated to trace() in the impl/ version — acceptable since compat modules are legacy wrappersLGTM — the rebase introduced no content changes and the migration is correct throughout.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
Sorry, something went wrong.
There was an error while loading. Please reload this page.
4b6969b to
3b439d0
Compare
6eff81f to
6c40a9e
Compare
3b439d0 to
5f53884
Compare
6c40a9e to
7a6b6ad
Compare
5f53884 to
a964976
Compare
7a6b6ad to
2d77564
Compare
a964976 to
33f16e8
Compare
2d77564 to
0d2db3b
Compare
33f16e8 to
0661b09
Compare
0d2db3b to
b282ea5
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The logging migration itself (DEBUG → TRACE for 70+ statements) is clean and well-scoped. The Slf4jConfiguration.Level.TRACE enum addition, switch propagation in CliUtils/MavenSimpleConfiguration, and test updates are all correct.
However, the DefaultModelBuilder.java diff includes several non-logging functional changes that revert or weaken fixes that were already present on the base branch (feature/12643-structured-problems). These need to be addressed before merge.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // to prevent StackOverflowError from path representation mismatches (GH-12598). | ||
| Path normalizedPath = | ||
| sourcePath != null ? sourcePath.toAbsolutePath().normalize() : null; | ||
| Path normalizedPath = sourcePath != null ? sourcePath.normalize() : null; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
sourcePath.normalize() without toAbsolutePath()
The base branch used sourcePath.toAbsolutePath().normalize() here to ensure a canonical, absolute path is stored in activeModelReads. The comment that was removed explicitly explained why:
Use
toAbsolutePath().normalize()for consistent path identity inactiveModelReads. This must match the normalization used ingetEnhancedProperties()guard check to prevent StackOverflowError from path representation mismatches (GH-12598).
With only .normalize(), a relative sourcePath (e.g. when modelSource.getPath() returns a relative Path) will be stored as-is. The guard in getEnhancedProperties at line 751 uses rootModelPath.normalize() — also without toAbsolutePath(). If the two paths represent the same file but one is absolute and one is relative, the contains() check returns false and the StackOverflow reappears on projects that triggered GH-12598.
| Path normalizedPath = sourcePath != null ? sourcePath.normalize() : null; | |
| Path normalizedPath = sourcePath != null ? sourcePath.toAbsolutePath().normalize() : null; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (isParentWithinRootDirectory(rootModelPath, rootDirectory) | ||
| && !activeModelReads.contains( | ||
| rootModelPath.toAbsolutePath().normalize())) { | ||
| && !activeModelReads.contains(rootModelPath.normalize())) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
rootModelPath.normalize() without toAbsolutePath()
The base branch guard was rootModelPath.toAbsolutePath().normalize() to match the identity of entries put into activeModelReads by doReadFileModel. That comment was deleted here:
Use
toAbsolutePath().normalize()for the guard check to handle paths obtained via different representations (e.g., symlinks, relative segments).
The rootModelPath comes from modelProcessor.locateExistingPom(rootDirectory). If that returns a relative or symlinked path while the entry in activeModelReads is an absolute path (or vice versa), the cycle guard fires when it shouldn't, or misses when it should fire.
| && !activeModelReads.contains(rootModelPath.normalize())) { | |
| && !activeModelReads.contains(rootModelPath.toAbsolutePath().normalize())) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return dominant; | ||
| return List.copyOf( | ||
| request.getRepositories() != null | ||
| ? request.getRepositories() |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
mergeRepositoriesById removed
The base branch's repos() method called mergeRepositoriesById() which merged duplicate repo entries (same ID, different snapshot/release policies) that mirror injection can produce. The Javadoc explained:
Without this merge, policy deduplication in the resolver can drop the snapshot policy, causing SNAPSHOT parent resolution to fail (MNG-12769).
This PR replaces repos() with a plain List.copyOf(...), silently reintroducing the MNG-12769 bug for projects that use mirrors with split release/snapshot policies.
The fix should be re-applied here, or moved to a layer below ModelBuilderSessionState if the intent is to clean up its scope.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Migrates ~70 DEBUG log statements to TRACE in internal plumbing code: lifecycle engine, classrealm, cache internals, resolver, plugin resolution. DEBUG (-X) remains the right level for plugin development. TRACE is for Maven core developers diagnosing framework internals, accessible via -Dmaven.logger.defaultLogLevel=trace. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
b282ea5 to
fdab681
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Following up on my earlier review — the DefaultModelBuilder.java issues (sourcePath normalization, rootModelPath normalization, mergeRepositoriesById) are all resolved: the PR has been rebased onto master and those changes have been removed from the diff entirely. ✅
The logging migration itself is clean and correctly applied across all 17 files. One issue remains before merge:
Missing case TRACE in LogbackConfiguration and Log4j2Configuration
MavenSimpleConfiguration was correctly updated with case TRACE -> "trace". But two sibling implementations were not:
LogbackConfiguration.java (line 34–37): uses default -> ch.qos.logback.classic.Level.ERROR, so Level.TRACE maps silently to ERRORLog4j2Configuration.java (line 32–35): uses default -> "error", same silent failureCurrently no code path sets context.loggerLevel = Level.TRACE in LookupInvoker, so this is latent. But the PR description explicitly advertises -Dmaven.logger.defaultLogLevel=trace support — when that path is wired, users on Logback/Log4j2 backends will get ERROR output instead of TRACE with zero diagnostic indication. Add explicit case TRACE arms to both.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * Level | ||
| */ | ||
| enum Level { | ||
| TRACE, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Adding TRACE here requires updating all Slf4jConfiguration implementations. MavenSimpleConfiguration is updated ✅ but LogbackConfiguration and Log4j2Configuration both use default -> ERROR — Level.TRACE will silently map to ERROR on those backends.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.