Skip to content

Conversation

@wesm
Copy link
Collaborator

@wesm wesm commented Jan 29, 2026

Summary

Adds batch fixing of unaddressed reviews. Instead of manually looking up job IDs, you can now run:

roborev fix --unaddressed              # fix all unaddressed jobs on the current branch
roborev fix --unaddressed --branch main  # fix unaddressed jobs on a specific branch
roborev fix --unaddressed --all-branches # fix unaddressed jobs across all branches
roborev fix --unaddressed --newest-first # process newest jobs first (default is oldest first)

Jobs are processed oldest first by default so fixes are applied chronologically.

What changed

CLI (cmd/roborev/fix.go):

  • New flags: --unaddressed, --branch, --all-branches, --newest-first
  • When --unaddressed is set, queries the daemon for all completed-but-unaddressed jobs scoped to the current repo and branch, then runs the normal fix flow on each

Storage (internal/storage/jobs.go):

  • Refactored ListJobs to use functional options (WithGitRef, WithBranch, WithAddressed) instead of a variadic string parameter, making it easier to add new filters

Daemon API (internal/daemon/server.go):

  • /api/jobs now accepts branch and addressed query parameters

Test plan

  • go test ./... passes
  • Flag validation: all invalid flag combinations produce clear errors
  • Discovery: no jobs found, jobs found with correct processing count, branch filter passthrough, server error handling
  • Ordering: oldest-first default, newest-first with flag
  • Storage: branch and addressed filters at the DB level
  • API: branch and addressed query params at the HTTP level

🤖 Generated with Claude Code

wesm and others added 4 commits January 29, 2026 15:11
Allow `roborev fix --unaddressed` to discover and fix all unaddressed
completed jobs for the current repo, defaulting to the current branch.
Use --branch to override or --all-branches to include all branches.

Refactors ListJobs to use functional options (WithGitRef, WithBranch,
WithAddressed) instead of variadic string args. Adds branch and
addressed query params to the daemon API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- TestFixCmdFlagValidation: validates all flag constraint errors
- TestRunFixUnaddressed: tests discovery flow (no jobs, found jobs,
  branch filter passthrough, server error)
- TestListJobsWithBranchAndAddressedFilters: storage-level filter tests
- TestHandleListJobsAddressedFilter: API-level addressed/branch params

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Return error from os.Getwd() instead of silently falling back to
  all-branches behavior (#3420.1)
- Track review/address call counts in unaddressed test to verify
  all discovered jobs are actually processed (#3421.2)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Default ordering for --unaddressed is now oldest first so fixes
are applied chronologically. Use --newest-first to reverse this.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@wesm wesm merged commit 6974ddc into main Jan 29, 2026
7 checks passed
@wesm wesm deleted the fix-unaddressed branch January 29, 2026 22:11
@wesm
Copy link
Collaborator Author

wesm commented Jan 29, 2026

Like a champ

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.

2 participants