fix(gradle): match normalized gradlew/gradle basename lookups (#1177, #1178)#2482
Open
ousamabenyounes wants to merge 1 commit into
Open
fix(gradle): match normalized gradlew/gradle basename lookups (#1177, #1178)#2482ousamabenyounes wants to merge 1 commit into
ousamabenyounes wants to merge 1 commit into
Conversation
The `match_command` regex `^(gradle|gradlew|\\./)gradlew?\b` only matched `./gradlew …` (the literal-path form), never the normalised basename string that RTK actually looks up at runtime. When a user runs `rtk ./gradlew tasks`, RTK strips the leading `./` and looks up `"gradlew tasks"` — which the old regex never matched, so every Gradle invocation fell through to unfiltered passthrough. Fix: replace with `^gradlew?\b` which matches both `gradle …` and `gradlew …` as produced by RTK's basename normalisation. Also strip three common configuration-cache noise lines that are not build signal (fixes rtk-ai#1178): - `Calculating task graph …` - `Reusing configuration cache.` - `Configuration cache entry stored/reused.` Add two inline filter tests and a unit test that asserts the filter is discoverable via the normalised lookup string (regression guard for rtk-ai#1177). Closes rtk-ai#1177, closes rtk-ai#1178 Co-Authored-By: Claude <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.
Fixes #1177. Fixes #1178.
RTK normalises command lookups by stripping a leading
./and using the basename, sortk ./gradlew tasksbecomes the lookup string"gradlew tasks"(not"./gradlew tasks"). The gradle filter'smatch_commandnever matched that basename form, so every realrtk ./gradlew/rtk gradleinvocation fell through to passthrough — keeping the generic Gradle runtime chatter that isn't build signal (#1178).Fix
src/filters/gradle.tomlmatch_commandto match the normalised basename lookups (gradlew …,gradle …).test_gradle_filter_matches_normalized_lookup) that builds the realBUILTIN_TOMLfilter set and asserts the gradle filter matches the exact strings RTK produces at runtime, plus inline[[tests.gradle]]cases.Test verification (RED → GREEN)
RED —
gradle.tomlreverted to develop:GREEN — with the basename match fix:
(Re-proposes the accidentally-closed #1193, rebased onto current
develop.)