fix(cli): affected shares the tool's one notion of a test file - #1688
Open
danusha2345 wants to merge 1 commit into
Open
fix(cli): affected shares the tool's one notion of a test file#1688danusha2345 wants to merge 1 commit into
danusha2345 wants to merge 1 commit into
Conversation
…mchenry#1507) `codegraph affected` kept six regexes of its own — `.test.`, `.spec.`, `/tests/`… — so a Go `foo_test.go`, a Python `test_foo.py` or a JVM `FooTest.kt` beside the changed file was never reported, and "no tests affected" read as "no coverage". Use isTestPath from search/query-utils, the same predicate search and the MCP tools already rank by.
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 #1507.
Problem
codegraph affectedkept six regexes of its own —.test.,.spec.,/tests/,/__tests__/,/e2e/,/spec/— so a Gofoo_test.go, a Pythontest_foo.pyor a JVMFooTest.ktbeside the changed file was never reported, and "No test files affected" read as "no coverage", whilesearchand the MCP tools counted those very files as tests.Change
Drop the local list and use
isTestPathfromsearch/query-utils— the narrow "a suite that exercises other code" predicate, not the wideisTestFilethat also covers examples and fixtures.--filterstill overrides.Verification
New
__tests__/cli-affected-test-conventions.test.tsagainst the built binary: Go_test.go, Pythontest_*.py, Kotlin*Test.ktare reported;--filterstill wins. Full suite green (221 files; the 16 skipped are the usual Windows/perf gates).🤖 Generated with Claude Code