code-review-graph icon indicating copy to clipboard operation
code-review-graph copied to clipboard

.code-review-graph/ SQLite DB not gitignored by default — accidental commit risk

Open dev-arctik opened this issue 7 months ago • 2 comments

Problem

The install command creates a .code-review-graph/ directory containing an SQLite database with the full structural map of the codebase (functions, classes, call graphs, imports, inheritance). However, it never adds this directory to .gitignore.

Impact

  • A developer running git add . or using a GUI git client will accidentally commit the database
  • The SQLite DB exposes the full architecture of the codebase — function names, class hierarchies, inter-module dependencies — even if the source files themselves are private
  • For monorepos or shared team repos, this could leak internal structure to anyone with repo access

Note

Issue #157 ("Auto ignore gitignored paths") is a related but different request — it's about skipping gitignored files during indexing. This issue is specifically about the DB itself being committed accidentally.

Suggested Fix

During install, automatically append .code-review-graph/ to the project's .gitignore (creating one if it doesn't exist). Print a message confirming this was done so the user is aware.

# Added by code-review-graph
.code-review-graph/

dev-arctik avatar Apr 09 '26 06:04 dev-arctik

Valid bug. The install command does not add .code-review-graph/ to .gitignore, risking accidental commits of the SQLite database containing the full codebase structure.

The fix is straightforward: during install, append .code-review-graph/ to .gitignore (creating it if it doesn't exist) and print a confirmation message. A PR implementing this would be welcomed.

tirth8205 avatar Apr 11 '26 08:04 tirth8205

Fixed in v2.2.3, now live on PyPI: https://pypi.org/project/code-review-graph/2.2.3/

PR #185 makes code-review-graph install automatically add .code-review-graph/ to your repo's .gitignore so the SQLite database isn't accidentally committed. PR #171 also clarified the existing behavior in the docs.

Upgrade:

uvx --reinstall code-review-graph
# or
pip install -U code-review-graph

# Then re-run install so .gitignore gets the new entry:
code-review-graph install

Closing.

tirth8205 avatar Apr 11 '26 17:04 tirth8205