Skip to content

fix(agent): count only dispatchable files reviewed#482

Merged
lizhengfeng101 merged 1 commit into
alibaba:mainfrom
ousamabenyounes:fix/issue-480
Jul 24, 2026
Merged

fix(agent): count only dispatchable files reviewed#482
lizhengfeng101 merged 1 commit into
alibaba:mainfrom
ousamabenyounes:fix/issue-480

Conversation

@ousamabenyounes

@ousamabenyounes ousamabenyounes commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Makes files_reviewed report the number of dispatchable files instead of the raw retained diff slice length. Deleted diffs remain available through Diffs() for context and line resolution, but they are no longer counted as reviewed files.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)

Test verification (RED → GREEN)

RED on upstream-base behavior with the new regression test:

--- FAIL: TestAgentFilesReviewedCountsDispatchableDiffs (0.02s)
    coverage_test.go:78: FilesReviewed() = 3, want 2
FAIL
FAIL	github.com/open-code-review/open-code-review/internal/agent	0.027s

GREEN after the fix:

ok  	github.com/open-code-review/open-code-review/internal/agent	0.016s

Full local Go CI replay in golang:1.26.5:

gofmt -s -l .
go mod tidy && git diff --exit-code -- go.mod go.sum
go vet ./...
go test -v -race -count=1 -coverprofile=coverage.out ./...
Total coverage: 81.5%
go build -o /dev/null ./cmd/opencodereview

Cross-compile check started in golang:1.26.5 and built linux/arm64, darwin/amd64, darwin/arm64, and windows/amd64; the final target was blocked by runner disk exhaustion while compiling dependencies (no space left on device).

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA

Related Issues

Fixes #480

@CLAassistant

CLAassistant commented Jul 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: No comments generated. Looks good to me.

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizhengfeng101
lizhengfeng101 merged commit e07a75e into alibaba:main Jul 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make files_reviewed count dispatchable files and reconcile it with preview

3 participants