Add Incremental Reviews on Synchronize Events
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- github, typescript
Direção de pesquisa
Start with packages/core/src/review/diff-cache.ts and trace how review jobs obtain diffs and how ReviewGitProvider.getCompareDiff is used. Then inspect the synchronize job flow, review settings, dashboard job details, and related tests named by the work breakdown. Done means incremental reviews use the commit delta with a full diff fallback, preserve existing full-review behavior, show the reviewed commit range, and cover the listed paths across supported backends.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
When a developer pushes a new commit to an open PR (synchronize event), Codra re-fetches the entire base-to-head PR diff and re-reviews every changed file from scratch. On a large PR with many files, this burns the full token budget and several minutes of wall-clock time, even if only a single file changed in the new commit.
This parent issue tracks adding optional incremental reviews. See sub-issues for each implementation step.
Work Breakdown
- Sub-issue: Add
review.incrementalschema setting and document it - Sub-issue: Store and resolve
previousCommitShafor synchronize jobs - Sub-issue: Add
getIncrementalDiffFilesto diff-cache.ts - Sub-issue: Wire incremental path in the review phase and add fallback logic
- Sub-issue: Show reviewed commit range in dashboard job details
Current Behavior
In packages/core/src/review/diff-cache.ts:
rawDiff = await github.getPullRequestDiff(job.owner, job.repo, job.prNumber);
This always fetches the full PR diff (base to head), regardless of how many files changed in the latest push. The existing getCompareDiff method on ReviewGitProvider already supports commit-to-commit comparison but is only used for the dashboard diff viewer, never for review execution.
Proposed Behavior
When review.incremental: true is set:
- On
synchronize, resolvepreviousCommitShafrom the most recently completed job on the same PR - Fetch
github.getCompareDiff(owner, repo, previousCommitSha, newHeadSha)to get only the commit-delta diff - Run the LLM review only on files in the incremental diff
- Retain PR-level context (title, description, existing finding fingerprints) for the summary
- Use the existing
loadSuppressedFingerprintsmechanism to avoid re-posting identical findings - Fall back to full PR diff if
previousCommitShais not available
Done When
-
review.incremental: truetriggers commit-delta diff fetching onsynchronizeevents - Only files changed between the previous and new commit are sent to LLM review
- Falls back to full PR diff gracefully when no previous commit SHA is available
- Existing auto-triggered and mention-triggered full reviews continue to work unchanged
- Job details in the dashboard show the reviewed commit range for incremental jobs
- Tests cover incremental path, full-diff fallback, and superseded-job resumption
- Any backend changes work in both Cloudflare Workers and Node/Docker
-
npm run typecheck,npm test, andnpm run lintall pass
- Linguagem predominante
- TypeScript
- Estrelas
- 125
- Forks
- 23
- Merge médio
- 2d 13h
- PRs com merge (30d)
- 12
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de devarshishimpi/codra
-
bug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
devarshishimpi/codra#178 ·
Mantenedores costumam responder em até 1 dia
-
bug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
devarshishimpi/codra#176 ·
Mantenedores costumam responder em até 1 dia
-
enhancement good first issue
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
devarshishimpi/codra#186 ·
Mantenedores costumam responder em até 1 dia
-
enhancement good first issue
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
devarshishimpi/codra#185 ·
Mantenedores costumam responder em até 1 dia
-
enhancement good first issue
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 58/100
devarshishimpi/codra#184 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de devarshishimpi/codra
Issues semelhantes
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 83/100
gofish-graphics/gofish-graphics#1384 ·
Mantenedores costumam responder em até 1 dia
-
adapter bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
Olanetsoft/agent-lookout#353 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
vicharanashala/vibe#1542 ·
Mantenedores costumam responder em até 1 dia
-
bug chore P2 size:XS
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
josephfung/curia#2666 ·
Mantenedores costumam responder em até 1 dia
-
area: batch
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
inabagumi/shinju-date#7294 ·
Mantenedores costumam responder em até 1 dia