Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c50d2a1
fix: index Java packages named build (#1642)
Aug 30, 2026
d30436c
merge: current upstream main into fix/1642-java-build-package-ignore
Sep 1, 2026
4b5c9c6
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
093cc70
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
f3444cd
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
4b6c8d5
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
5a6e413
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
16d0750
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
c0bea44
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
e9224ca
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
7408fd3
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
b9bbd4d
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
9fea386
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
d4e7702
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
8e78497
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
792a1ee
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
3e1576a
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 8, 2026
51d98bc
Merge remote-tracking branch 'origin/main' into fix/1642-java-build-p…
Sep 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

#### Symbols, tests and the viewer

- Java packages named `build` under standard main and test source roots are now indexed without pulling Gradle or Maven build output into the graph. (#1642)
- Kotlin functions and methods now carry their signature — `(params): ReturnType` — in `codegraph_explore`, `node` and the viewer, instead of no signature at all. Re-index Kotlin projects after upgrading. (#1495)
- `codegraph affected` now finds Go, Python and JVM test files that previously went unreported, while preserving custom `--filter` behavior (thanks @danusha2345; #1507, #1688).

Expand Down
33 changes: 33 additions & 0 deletions __tests__/extraction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8188,6 +8188,39 @@ describe('Nested non-submodule git repos', () => {
expect(ig.ignores('src/app.ts')).toBe(false);
});

it('keeps Java packages named build while excluding build output (#1642)', () => {
const sourceFile = 'module/src/main/java/com/acme/build/RealtimePlusService.java';
const testFile = 'module/src/test/java/com/acme/build/RealtimePlusServiceTest.java';
const outputFile = 'module/build/generated/Generated.java';

for (const rel of [sourceFile, testFile, outputFile]) {
const abs = path.join(tempDir, rel);
fs.mkdirSync(path.dirname(abs), { recursive: true });
fs.writeFileSync(abs, 'class Example {}\n');
}

const scope = buildScopeIgnore(tempDir);
expect(scope.ignores(sourceFile)).toBe(false);
expect(scope.ignores(testFile)).toBe(false);
expect(scope.ignores(outputFile)).toBe(true);

const files = scanDirectory(tempDir);
expect(files).toContain(sourceFile);
expect(files).toContain(testFile);
expect(files).not.toContain(outputFile);
});

it('lets an explicit .gitignore exclude a Java package named build (#1642)', () => {
const sourceFile = 'src/main/java/com/acme/build/Hidden.java';
const abs = path.join(tempDir, sourceFile);
fs.mkdirSync(path.dirname(abs), { recursive: true });
fs.writeFileSync(abs, 'class Hidden {}\n');
fs.writeFileSync(path.join(tempDir, '.gitignore'), 'src/main/java/**/build/\n');

expect(buildScopeIgnore(tempDir).ignores(sourceFile)).toBe(true);
expect(scanDirectory(tempDir)).not.toContain(sourceFile);
});

it('buildDefaultIgnore honors .git/info/exclude (#1728)', async () => {
const { execFileSync } = await import('child_process');
const git = (cwd: string, ...args: string[]) =>
Expand Down
6 changes: 6 additions & 0 deletions src/extraction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ const DEFAULT_IGNORE_PATTERNS: string[] = [
'bazel-*/', // Bazel output symlink trees
// Android resource dirs at any depth, with their qualifier variants (#1047).
...ANDROID_RES_TYPES.map((t) => `**/res/${t}*/`),
// `build` is also a legal Java package segment. Keep it under conventional
// Java source roots while continuing to exclude module/build output (#1642).
'!**/src/main/java/**/build/',
'!**/src/main/java/**/build/**',
'!**/src/test/java/**/build/',
'!**/src/test/java/**/build/**',
];

/** True if `buf` decodes as strict UTF-8 (no invalid byte sequences). */
Expand Down