feat(mvn): inject -B / --no-transfer-progress to kill noise at source#2449
Open
ryanmurf wants to merge 1 commit into
Open
feat(mvn): inject -B / --no-transfer-progress to kill noise at source#2449ryanmurf wants to merge 1 commit into
ryanmurf wants to merge 1 commit into
Conversation
The cheapest way to compress Maven output is to not emit the noise in the first place. rtk now injects two flags when running mvn: - `-B` (batch mode) — suppresses interactive/ANSI output - `--no-transfer-progress` — suppresses the per-artifact download log, version-gated to Maven >= 3.6.1 (older Maven hard-errors on the unknown flag). The version is probed once via `mvn --version` and cached per binary path; probe failure fails CLOSED (no injection). Injection is skipped when the user already passed the flag (long, short `-B`/`-ntp`, or `key=value` form) and can be disabled entirely with `RTK_NO_INJECT_FLAGS=1`. Adds unit tests for version parsing, the 3.6.1 threshold, the env kill-switch semantics, and already-present-flag detection. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The cheapest Maven output to filter is the output that never gets emitted. This teaches
rtk mvnto inject two flags into the underlying invocation:-B(batch mode) — suppresses interactive/ANSI output and progress spinners.--no-transfer-progress— suppresses the per-artifactDownloading/Downloaded/Progresslog, which can be hundreds of lines on a cold build.This complements the existing post-hoc filtering — it removes noise at the source so the filter has less to do and the tee'd raw log is smaller too.
Safety
--no-transfer-progressonly exists in Maven ≥ 3.6.1; older Maven hard-errors on the unknown flag. rtk probesmvn --versiononce (cached per resolved binary path) and fails CLOSED — if the version can't be determined, nothing is injected.--batch-mode), short (-B/-ntp), orkey=valueform.RTK_NO_INJECT_FLAGS=1disables all injection for users who need exact raw invocation semantics.Injection happens in
new_mvn_command, so it applies to the filtered phases (test/compile/package/quiet). The-X/-edebug passthrough paths are unaffected.Testing
New unit tests:
mvn --versionparsing (full triple, missing-patch defaulting, junk → None)RTK_NO_INJECT_FLAGSenv semantics (unset/empty/0→ enabled;1→ disabled)=formsFull suite green:
cargo fmt --all && cargo clippy --all-targets && cargo test --all(2201 passing).Context
Part of a series contributing JVM build-tool improvements back upstream (see #2448 for Apache Ant support). Independent of that PR. CLA signed under @ryanmurf.
🤖 Generated with Claude Code