Skip to content

Bug: Committed vendor/ directory is indexed in Go project despite .gitignore, resulting in bloated database (v0.9.2) #316

@waterMirrors

Description

@waterMirrors

Description

After upgrading to v0.9.2, CodeGraph enforces a behavior change where committed files that are not gitignored are now indexed even under vendor/. However, for Go microservices, it is a common practice to commit the vendor/ directory to the repository to ensure CI/CD stability and faster builds.

Because the vendor/ directory contains huge amounts of third-party dependency code and is already committed, there is currently no way to exclude it from being indexed. Adding vendor/ to .gitignore does not prevent indexing because Git still tracks committed files, and CodeGraph continues to index them. This results in an extremely bloated database (over 200MB for a single lightweight microservice) and wastes massive amounts of local index time.

Steps to Reproduce

  1. Create a Go project where the vendor/ folder is committed to the git repository (standard workflow for some CI/CD pipelines).
  2. Add vendor/ to the project's .gitignore (which naturally doesn't stop git from tracking already committed files).
  3. Attempted workarounds like adding vendor/ to .git/info/exclude or running git update-index --assume-unchanged.
  4. Run npx @colbymchenry/codegraph init -i.

Expected Behavior

There should be a way to force-exclude specific committed folders like vendor/ or Pods/ from being indexed to keep the local database lightweight and prevent the AI from being distracted by third-party dependencies.

Actual Behavior

CodeGraph forces indexing on all committed vendor/ files, generating a .codegraph/codegraph.db file of over 200MB for a small microservice.

Suggested Solution / Feature Request

Please consider providing a --exclude CLI flag or bringing back a minimal local ignore override mechanism (like a fallback custom ignore or respecting local .git/info/exclude), so that developers who must commit their vendor/dependencies can still use CodeGraph without database bloating.

Environment

  • CodeGraph Version: v0.9.2
  • Language: Go (Golang)
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions