[Bug] A deep commit_limit bump re-reads the whole fix walk once more than 2,000 commits are missing from the cache

Open
#6,265 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@leo7martins is already working on this.

Since Nov 25, 2026.

  • #6271 by @leo7martins — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
git, python
Domain
backend

Research direction

Start in packages/core/src/repowise/core/ingestion/git_indexer/prior_defects.py at _cached_read, where the cache returns None once the missing count exceeds _MAX_PATCHED_COMMITS in ingestion/git_commit_index.py, then follow the fallback in _walk_fix_commits. Read how #6250 handled the commit window cache as a ranged run, since the fix should follow that design. Done means that above the old cap only missing commits are read, output is unchanged, and the tests/unit/ingestion/ fix-walk cache tests cover it. An open PR (#6271) already targets this, so coordinate there first.

Written by the indexing model from the issue text.

Description

bug help wanted

Summary

The fix-walk cache is dropped whole once more than 2,000 commits are missing from it, so a deeper commit_limit re-reads the entire walk instead of only the missing commits.

Mechanism

  • _cached_read (packages/core/src/repowise/core/ingestion/git_indexer/prior_defects.py:404) returns None when len(missing) > _MAX_PATCHED_COMMITS (2,000, ingestion/git_commit_index.py:157).
  • _walk_fix_commits then calls _read_commits(repo, rev_range) for the full range.
  • #6250 removed the same cliff for the commit window cache by reading the missing part as a ranged run.

Repro

Scratch repo with 2,600 commits, cache seeded with all but N of them:

missing=1900 commits_read=1900 total=2600
missing=2100 commits_read=2600 total=2600

Output on main (6ea4f0a3e). Going from 1,900 to 2,100 missing commits adds 700 reads.

Impact

The first deep commit_limit bump on a large repo pays for the whole fix walk again; the cost follows history size, not what is new.

Done looks like

  • Read the missing commits as ranges between cached shas, in chunks, with no hard cap.
  • Output for the same input is unchanged.
  • Help wanted: needs the ranged-read design from #6250.

Tests

tests/unit/ingestion/ fix-walk cache: above the old cap, only the missing commits are read.

Dominant language
Python
Stars
7.1k
Forks
756
Avg merge
21h 5m
Merged PRs (30d)
797

Getting set up

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.

More from repowise-dev/repowise

All issues in repowise-dev/repowise

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.