repowise-dev / repowise-dev/repowise

[Bug] file_count is ~3% high due to external: import nodes being typed as 'file'

Open
#964 2 comments 0 reactions 1 assignee View on GitHub

@dev-ploy is already working on this.

Since Jul 21, 2026.

bug
Dominant language
Python
Stars
6.7k
Forks
711
Avg merge
1d 13h
Merged PRs (30d)
439

Description

Follow-up to #945 / #952.

This is a follow-up to #945 (the original bug about wildly inflated file counts) and #952 (the fix for that bug). While reviewing #952, a smaller, separate issue was found — the file count is still slightly too high, just for a different reason.

 `node_type` defaults to `'file'` in the writer (`packages/core/src/repowise/core/pipeline/persist.py`) whenever no type is recorded, and rows representing third-party imports (id prefix `external:`, e.g. `external:node:path`) never have a type recorded — so they get counted as files.

 On a real index this was 79 rows out of 3,010 file-typed rows (~2.6%), confirmed by @swati510 in review on #952.

 Affects both:
 - `packages/server/src/repowise/server/routers/workspace.py` (workspace mode)
 - `packages/server/src/repowise/server/routers/stats.py` (single-repo mode, same `node_type == "file"` filter)

 Fix should either exclude `id LIKE 'external:%'` in both places, or (better) have the writer in `persist.py` record an explicit `node_type` for external-import nodes instead of leaving it to default. Should be fixed in both routers together to keep the two pages consistent. make it a .md file

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.