fix(discover): deploy/ directories indexed as duplicate source in full mode

deploy/ and deployed/ build artifact directories were in FAST_SKIP_DIRS,
which only applies in fast/moderate indexing modes. In the default full
mode they were indexed alongside source files, creating duplicate
Class/Method rows with stale data. Any MATCH (c:Class {name:'Foo'})
without a file_path filter returned multiple rows — one from source,
one from the build copy.

Move deploy and deployed to ALWAYS_SKIP_DIRS so they are excluded in all
indexing modes.

Regression test: discover_deploy_excluded_full_mode in test_discover.c.

Signed-off-by: Thomas Dyar <tdyar@intersystems.com>
This commit is contained in:
Thomas Dyar committed 2026-06-12 14:55:46 -04:00
1 parent e599df1d56
commit bfd53f33ec
2 files changed
+23 -1

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ static const char *ALWAYS_SKIP_DIRS[] = {
".cargo", ".stack-work", ".dart_tool", "zig-cache", "zig-out", ".metals", ".bloop", ".bsp",
".ccls-cache", ".clangd", "elm-stuff", "_opam", ".cpcache", ".shadow-cljs",
/* Deploy */
".vercel", ".netlify",
".vercel", ".netlify", "deploy", "deployed",
/* Misc */
".qdrant_code_embeddings", ".tmp", "vendor", "vendored", NULL};
+22
View File
@@ -605,6 +605,27 @@ TEST(discover_generic_dirs_fast_mode) {
PASS();
}
TEST(discover_deploy_excluded_full_mode) {
char *base = th_mktempdir("cbm_disc_deploy");
ASSERT(base != NULL);
th_write_file(TH_PATH(base, "src/main.go"), "package main\n");
th_write_file(TH_PATH(base, "deploy/main.go"), "package deploy\n");
th_write_file(TH_PATH(base, "deployed/main.go"), "package deployed\n");
cbm_discover_opts_t opts = {.mode = CBM_MODE_FULL};
cbm_file_info_t *files = NULL;
int count = 0;
int rc = cbm_discover(base, &opts, &files, &count);
ASSERT_EQ(rc, 0);
ASSERT_EQ(count, 1);
cbm_discover_free(files, count);
th_cleanup(base);
PASS();
}
TEST(discover_cbmignore_no_git) {
char *base = th_mktempdir("cbm_disc_nogit");
ASSERT(base != NULL);
@@ -792,6 +813,7 @@ SUITE(discover) {
RUN_TEST(discover_new_ignore_patterns);
RUN_TEST(discover_generic_dirs_full_mode);
RUN_TEST(discover_generic_dirs_fast_mode);
RUN_TEST(discover_deploy_excluded_full_mode);
RUN_TEST(discover_cbmignore_no_git);
/* Nested .gitignore tests (issue #178) */