fix(cli): affected shares the tool's one notion of a test file - #1688
fix(cli): affected shares the tool's one notion of a test file#1688danusha2345 wants to merge 16 commits 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.
…t-conventions # Conflicts: # CHANGELOG.md
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
…t-conventions # Conflicts: # src/bin/codegraph.ts
…t-conventions # Conflicts: # CHANGELOG.md
|
Merged current |
|
Superseded by #1803 — Forge cherry-picked your fix commit ( Thank you @danusha2345 — closing this PR as superseded (agency pattern; we do not merge contributor branches directly onto main from Forge). |
|
Superseded by #1803. |
#1803) `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. Cherry-picked from danusha2345's upstream PR #1688 (commit 995b6f1). Preserve main's CLI imports and Unreleased entries, and credit the contributor in the changelog. The default affected depth remains 5. Fixes #1507. Supersedes #1688. Verified on Linux with Node 22.19.0: npm run build; the Go fixture changes from no affected tests to math_test.go; matching and nonmatching custom filters still override. Vitest: 3 files, 36 tests passed, including the upstream Go/Python/Kotlin suite and affected path/dependency coverage. Co-authored-by: danusha2345 <ewidusoc498@gmail.com>
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