Skip to content

Visual improvements to worker lines with live test-progress suffix (2.x) - #1667

Merged
slachiewicz merged 3 commits into
apache:masterfrom
ammachado:feature/worker-line-display-2x
Aug 3, 2026
Merged

Visual improvements to worker lines with live test-progress suffix (2.x)#1667
slachiewicz merged 3 commits into
apache:masterfrom
ammachado:feature/worker-line-display-2x

Conversation

@ammachado

@ammachado ammachado commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What

Presentation-only reshaping of mvnd's live terminal display, plus the client-side plumbing for a live per-test progress suffix, on master (2.x, Maven 4).

Live now (driven by existing messages)

  • A drawn progress bar with percent prefixed to the status line.
  • Concise arrow-style worker lines: > :module goal (execution).
  • Dimmed > IDLE slots for free worker threads.

Wired but dormant (client-side only)

  • New PROJECT_TEST_PROGRESS wire message (Message.ProjectTestProgressEvent, round-trip serialization).
  • TerminalOutput.appendTestProgress(...) renders a styled suffix [Tests: N, Failures: .., Errors: .., Skipped: ..] Class#method, with failure/error counts in red.

Follow-up

The daemon-side feed that emits PROJECT_TEST_PROGRESS (the surefire ForkNodeFactory bridge) is not implemented on master yet, so the test-progress suffix stays dormant until a follow-up commit lands it. This is a deliberate, spike-gated separation; a TODO on the PROJECT_TEST_PROGRESS constant records it.

Verification

  • common unit tests pass (message round-trip; bar geometry; suffix formatting and styles), RAT clean.
  • MultiModuleTest integration test passes (the reshaping did not break message-driven client assertions).
  • Built and verified with JDK 17.

🤖 Generated with Cursor

@ammachado
ammachado marked this pull request as ready for review July 2, 2026 19:03

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-structured UI improvement with solid tests. Two design points to discuss before the daemon-side follow-up lands:

  1. Message priority ordering (medium): PROJECT_TEST_PROGRESS is assigned class order 2 in getClassOrder(), which is higher priority than PROJECT_STARTED (3) and MOJO_STARTED (4). Since the daemon's sendQueue is a PriorityBlockingQueue ordered by getClassOrder(), a test progress message could theoretically be dequeued before the corresponding PROJECT_STARTED, causing projects.get(e.getProjectId()) to return null and silently drop the message. Practical risk is low since the daemon emitter is not yet implemented, but consider placing it at order 5 or higher before the follow-up — the fix is a one-line change.

  2. Removed plugin version from display (medium): The worker line format changed from prefix:version:mojo to prefix:mojo, removing the version that was deliberately added in commit 2a8d18d (PR #748). The groupId fallback when no goalPrefix is set also dropped the groupId. This appears to be an intentional UX tradeoff for conciseness by the same author, but it does lose debugging info for plugin version conflicts. Worth confirming this is the desired direction.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-structured presentation improvement PR with good test coverage. The concise arrow-style worker lines, idle-slot rendering, and progress bar are all nicely implemented.

One item to consider:

Redundant writeNullableUTF / readNullableUTF (medium)

The new helper methods introduce a second wire-format convention for nullable strings (boolean prefix) when the existing writeUTF/readUTF already handle null via the -1 sentinel convention. Every other nullable string in Message.java uses writeUTF/readUTF directly.

The ProjectTestProgressEvent serialization can simply use the existing methods:

// read:
final String testClass = readUTF(input);
final String testMethod = readUTF(input);

// write:
writeUTF(output, testClass);
writeUTF(output, testMethod);

This avoids maintaining two incompatible null-encoding conventions in the same class and saves 1 byte per nullable field on the wire.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@ammachado
ammachado force-pushed the feature/worker-line-display-2x branch from d85c8af to c716d57 Compare July 31, 2026 04:31

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after rebase (d85c8afc716d57): no functional changes detected.

The previous finding about redundant writeNullableUTF/readNullableUTF remains unaddressed — the existing writeUTF/readUTF already handle null via the -1 sentinel convention. ProjectTestProgressEvent can simply use them directly, avoiding a second incompatible wire-format convention in the same class.

Visual improvements and test coverage continue to look good.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@ammachado

ammachado commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Once #1670 is merged, I'll port it to the master branch.

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after new commit (786ec64): the writeNullableUTF/readNullableUTF finding from the previous review has been fully addressed — the redundant helpers are removed and the existing readUTF/writeUTF null-sentinel convention is used correctly. The null round-trip test covers this path. No new issues introduced.

Minor note (not blocking): PROJECT_TEST_PROGRESS still sits at class order 2, higher priority than PROJECT_STARTED (3) and MOJO_STARTED (4). When the daemon-side emitter lands (follow-up PR), a test-progress message could be dequeued before its corresponding PROJECT_STARTED. Consider bumping it to order 5+ before that follow-up merges.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of @gnodet

ammachado added a commit to ammachado/maven-mvnd that referenced this pull request Jul 31, 2026
Applies the review-driven fixes from the sibling 2.x PR (apache#1667):
- PROJECT_TEST_PROGRESS now sorts after PROJECT_STARTED/MOJO_STARTED in the
  sendQueue, avoiding a race where the progress message could be dequeued
  before its project's PROJECT_STARTED event.
- ProjectTestProgressEvent reuses the existing readUTF/writeUTF null-sentinel
  convention instead of a redundant boolean-prefixed nullable encoding.
- Restores the plugin groupId/version in the worker line display, which was
  dropped by the visual redesign.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after commit 7bb1417: both prior findings are now resolved.

  1. Message priority orderingPROJECT_TEST_PROGRESS moved from class order 2 to 5 (after MOJO_STARTED=4), preventing the dequeue race.
  2. Plugin version displaypluginGroupId and pluginVersion restored in the worker line, matching master.

No new issues. Looks good! ✅

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of @gnodet

ammachado and others added 3 commits August 1, 2026 12:24
…fix on 2.x

Reshape the live terminal display: a drawn progress bar with percent on the
status line, concise arrow-style worker lines (> :module goal (execution)),
and dimmed > IDLE slots for free threads. At addProjectLine, append a styled
live test-progress suffix (tests/failures/errors/skipped counts plus the
current test class#method) driven by the new PROJECT_TEST_PROGRESS message.

Co-Authored-By: Auto <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
readUTF/writeUTF already encode null via a -1 length sentinel, so the
boolean-prefixed readNullableUTF/writeNullableUTF helpers duplicated an
existing convention. Remove them and use readUTF/writeUTF directly.
…n version in worker line

PROJECT_TEST_PROGRESS now sorts after PROJECT_STARTED/MOJO_STARTED in the
sendQueue to avoid a message racing ahead of its project's PROJECT_STARTED
event. Also restores the plugin groupId/version in the worker line display,
which was dropped by the 2.x visual redesign.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ammachado
ammachado force-pushed the feature/worker-line-display-2x branch from 7bb1417 to 5ff75e7 Compare August 1, 2026 16:24
slachiewicz pushed a commit that referenced this pull request Aug 3, 2026
…vnd-1.x) (#1666)

* test: prevent ambient environment from leaking into daemon builds on CI

- Extract buildRequestEnvironment() in DefaultClient for subclass override
- Strip MAVEN_ARGS from JvmTestClient and NativeTestClient to block per-test flag overrides
- Write an isolated settings.xml in MvndTestExtension so tests never fall back to
  the runner's user settings (fixes InteractiveTest when actions/setup-java sets interactiveMode)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat: visual improvements to worker lines with live test-progress suffix on mvnd-1.x

Reshape the live terminal display: a drawn progress bar with percent on the
status line, concise arrow-style worker lines (> :module goal (execution)),
and dimmed > IDLE slots for free threads. At addProjectLine, append a styled
live test-progress suffix (tests/failures/errors/skipped counts plus the
current test class#method) driven by the new PROJECT_TEST_PROGRESS message.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: port PR #1667 review feedback to mvnd-1.x

Applies the review-driven fixes from the sibling 2.x PR (#1667):
- PROJECT_TEST_PROGRESS now sorts after PROJECT_STARTED/MOJO_STARTED in the
  sendQueue, avoiding a race where the progress message could be dequeued
  before its project's PROJECT_STARTED event.
- ProjectTestProgressEvent reuses the existing readUTF/writeUTF null-sentinel
  convention instead of a redundant boolean-prefixed nullable encoding.
- Restores the plugin groupId/version in the worker line display, which was
  dropped by the visual redesign.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@slachiewicz
slachiewicz merged commit 53516c2 into apache:master Aug 3, 2026
@github-actions github-actions Bot added this to the 2.0.0-rc-4 milestone Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@slachiewicz Please assign appropriate label to PR according to the type of change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants