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 — mvnlog: build log viewer, integration tests, script routing by gnodet · Pull Request #12699 · apache/maven Conversation
|
| Area | Files |
|---|---|
| API | Tools.java, LogOptions, ParserRequest |
| Entry point | MavenLogCling |
| Invoker | LogInvoker, LogParser, LogContext, CommonsCliLogOptions |
| Renderer | BuildReportRenderer, SimpleJsonReader |
| Shell | BuiltinShellCommandRegistryFactory (mvnlog command) |
| Scripts | mvn, mvn.cmd, mvnlog, mvnlog.cmd, component.xml |
| CLI | CommonsCliOptions (+--log constant/option) |
| Tests | BuildReportRendererTest, SimpleJsonReaderTest |
| ITs | MavenITgh12571BuildReportTest + 11 existing ITs + 4 resource POMs |
| # | PR | Feature |
|---|---|---|
| 1 | #12694 | Logging foundation |
| 2 | #12695 | Build report |
| 3 | #13180 | Console modes |
| 4 | #12698 | Warning mode + diagnostics |
| 5 | This PR | mvnlog viewer |
| 6 | #12702 | Structured problems pipeline |
| 7 | #12714 | TRACE level migration |
mvn compile — clean compilemvn test -pl impl/maven-cli — all tests pass🤖 Generated with Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
0cc76eb to
6124231
Compare
dc3bccd to
a7c83db
Compare
a7c83db to
7243fd7
Compare
7243fd7 to
af945c2
Compare
af945c2 to
850a04c
Compare
9924a43 to
4d7e49f
Compare
850a04c to
5913a2b
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Well-structured mvnlog tool that follows established Maven tool patterns. Two minor polish items noted after verification (three other findings about shell script flag stripping and JSON parser depth were false positives).
Also noted:
--console=verbose are necessary for the new console mode system.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.
| } | ||
| } | ||
|
|
||
| private List<Completer> mvnlogCompleter(String name) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The tab-completer only offers --diagnostics, --failures, --full, --list but is missing 5 of the 9 supported options: --json, --module, --mojo, --level, --grep. This reduces discoverability in mvnsh.
| private List<Completer> mvnlogCompleter(String name) { | |
| private List<Completer> mvnlogCompleter(String name) { | |
| return List.of(new ArgumentCompleter(new StringsCompleter( | |
| "--diagnostics", "--failures", "--full", "--list", "--json", | |
| "--module", "--mojo", "--level", "--grep"))); |
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.
Well-structured addition of the mvnlog viewer tool that follows established Maven tool patterns. Two minor polish items:
Confirmed findings (verified independently):
[Medium — Dead code] BuildReportRenderer.java:51 — Unused constant MAX_PADDED_BUILD_TIME_DURATION_LENGTH is declared but never referenced anywhere in the class. The formatDuration method does not use it. Appears to be a leftover copy from ExecutionEventLogger where it is actively used.
[Low — Incomplete shell completer] BuiltinShellCommandRegistryFactory.java:268 — The mvnlogCompleter only includes --diagnostics, --failures, --full, --list but is missing the 5 filter/output options defined in CommonsCliLogOptions.CLIManager: --json, --module, --mojo, --level, --grep. Users in mvnsh will not get tab completion for these valid options.
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.
| private final Consumer<String> output; | ||
|
|
||
| public BuildReportRenderer(MessageBuilderFactory messageBuilderFactory, Consumer<String> output) { | ||
| this.messageBuilderFactory = messageBuilderFactory; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
[Medium — Dead code] This constant is declared but never referenced anywhere in this class. It's actively used in ExecutionEventLogger (lines 61 and 272), but appears to be a copy-paste leftover here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ParserRequest.mvnlog(input.args(), shellContext.invokerRequest.messageBuilderFactory()) | ||
| .cwd(shellContext.cwd.get()) | ||
| .build())); | ||
| } catch (InvokerException.ExitException e) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
[Low — Incomplete completer] This completer only includes 4 of the 9 options defined in CommonsCliLogOptions.CLIManager. Missing: --json, --module, --mojo, --level, --grep.
Users in mvnsh won't get tab completion for the filter features.
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.
Well-structured CLI viewer tool (mvnlog) with strong test coverage (33 unit tests + 12 integration tests). The zero-dependency JSON reader/writer is appropriate for the maven-cli module.
Security note: The security issues identified in the monolithic PR #12716 (HTTP server binding to 0.0.0.0, path traversal, CopyOnWriteArrayList) are not present in this decomposed PR — it has no network component. The System.exit() usage follows the established pattern in MavenCling.
Minor items from prior reviews still unaddressed:
Dead code (BuildReportRenderer.java line 45): MAX_PADDED_BUILD_TIME_DURATION_LENGTH is declared but never referenced. Likely a leftover from ExecutionEventLogger copy.
Incomplete shell completer (BuiltinShellCommandRegistryFactory.java): mvnlogCompleter only registers --diagnostics, --failures, --full, --list for tab completion but is missing 5 valid options: --json, --module, --mojo, --level, --grep.
No nesting depth guard (SimpleJsonReader.java): The recursive descent parser has no depth limit. Pathologically nested input could cause StackOverflowError. Low risk since it only parses self-generated build reports, but a depth counter (max ~512) would be cheap hardening.
Overall looks good — the decomposition from #12716 into independently reviewable pieces is the right approach.
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.
2a54465 to
94ee4ef
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Well-designed mvnlog viewer tool following established Maven CLI patterns. The zero-dependency JSON reader/writer pair is appropriate for maven-cli's dependency constraints, and the script routing approach is sound. Good integration test coverage with both positive and negative scenarios.
Five items to address:
1. Short option -l collision (high)
In CommonsCliLogOptions.java, LEVEL = "l" conflicts with the parent CommonsCliOptions.CLIManager.LOG_FILE = "l". When prepareOptions() calls super.prepareOptions(options), the parent registers -l as --log-file. Then line ~203 registers -l as --level. Commons CLI 1.11.0 silently overwrites, so -l will shadow --log-file and be interpreted as --level in the mvnlog context. Consider using a different short option for --level (e.g. -lv) or omitting the short form entirely.
2. Unused constant (medium)
BuildReportRenderer.java line ~45: MAX_PADDED_BUILD_TIME_DURATION_LENGTH is declared but never referenced. Dead code in new code.
3. Incomplete shell completer (medium)
BuiltinShellCommandRegistryFactory.java line ~268: mvnlogCompleter lists --diagnostics, --failures, --full, --list but is missing --json, --module, --mojo, --level, --grep — five valid options defined in CommonsCliLogOptions.CLIManager won't appear in tab-completion.
4. No trailing content check in JSON parser (low)
SimpleJsonReader.java line ~54: parse() does not verify pos == json.length() after parseValue(), so input like {"a":1}GARBAGE is silently accepted. Low risk since this only processes self-generated build reports.
5. Fully qualified java.util.List (low)
LogInvoker.java line ~143: Uses java.util.List<Map<String, Object>> fully qualified instead of importing java.util.List (while java.util.Map is already imported). Minor style inconsistency.
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.
94ee4ef to
32ce980
Compare
863b632 to
9e250d3
Compare
9e250d3 to
995c624
Compare
69b8969 to
79397b6
Compare
995c624 to
1c1c332
Compare
79397b6 to
bde251c
Compare
Add MAX_DEPTH = 512 guard to prevent StackOverflowError on pathologically nested JSON input. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.