Skip to content

feat(review): support multi-repo workspace reviews#543

Open
Oscar-Silva wants to merge 6 commits into
backnotprop:mainfrom
Oscar-Silva:feat/review-workspace-multi-repo
Open

feat(review): support multi-repo workspace reviews#543
Oscar-Silva wants to merge 6 commits into
backnotprop:mainfrom
Oscar-Silva:feat/review-workspace-multi-repo

Conversation

@Oscar-Silva
Copy link
Copy Markdown

@Oscar-Silva Oscar-Silva commented Apr 11, 2026

Problem

Plannotator's code review currently requires a git repository as the working directory. For teams working with poly-repo microservices architectures, there's no way to review changes across multiple repos in a single session — each repo needs its own review tab, feedback is fragmented, and the workflow doesn't match how developers actually work (navigating a parent directory with multiple independent services).

Issue #527 captured this gap: users want to run plannotator review from a non-git parent directory and have it automatically discover and review all nested repos with local changes.

Solution

This PR adds multi-repo workspace review — Plannotator can now operate from a non-git parent directory, auto-discover nested git repositories, and present a unified review session covering all repos.

How it works:

  1. User runs plannotator review from a non-git parent (e.g., ~/projects/ containing svc-a/, svc-b/, infra/)
  2. Plannotator detects all nested git repos with local changes
  3. Review UI shows a repo selector — repos with changes are pre-selected
  4. Feedback, diff switching, file-content lookups, staging, and agent operations are all repo-aware
  5. Workspace-level review feedback covers all repos in one output

Scope:

  • Added buildWorkspaceLocalRepos() and buildWorkspacePRRepos() for repo discovery
  • Made diff switching, file-content lookups, staging, and agent path routing repo-aware
  • Added in-app workspace repo controls (selector, per-repo diffs)
  • Full test coverage: workspace discovery, duplicate repo paths, export/file tree/search behavior, non-git root detection
  • Backward compatible: single-repo git workflow unchanged

Test plan

  • bun test packages/server/review-workspace.test.ts packages/server/vcs.test.ts packages/review-editor/utils/exportFeedback.workspace.test.ts packages/review-editor/utils/buildFileTree.workspace.test.ts packages/review-editor/utils/reviewSearch.workspace.test.ts
  • bun run --cwd apps/review build && bun run build:hook && bun run build:opencode
  • Manual OpenCode workspace review from a non-git parent directory with multiple nested repos
  • Verify repo selector appears in the review UI and repos with local changes are selected by default
  • Verify repo-specific diff switching and workspace review feedback work correctly
  • Rebased on latest main (May 9, 2026)

Files changed

File Change
packages/server/review-workspace.ts New: repo discovery and workspace state management
packages/shared/review-workspace.ts New: shared workspace types
packages/server/vcs.ts Add VCS-agnostic repo detection
packages/server/shared-handlers.ts Wire workspace repos into review server
packages/server/claude-review.ts Repo-aware agent prompts
packages/server/codex-review.ts Repo-aware agent prompts
apps/hook/server/index.ts Hook entry: workspace vs single-repo branching
Plus 5 test files Regression coverage for workspace discovery, export, file tree, search, and agent jobs

Closes #527

- Fix race condition in label generation by pre-computing labels sequentially
- Fix rewritePatchLine to support quoted paths and rename/copy headers
- Add separator between aggregated patches to avoid invalid diffs
- Normalize input paths in resolveWorkspaceFilePath
- Add timeout to PR discovery (15s) to prevent server hangs
- Fix PATCH /api/workspace/repo to rollback state on failure via applyRepoMutation
- Validate body.source runtime (must be 'local' or 'pr')
- Snapshot active repo in agent jobs at launch to prevent race in onJobComplete
- Prevent double-prefixing of agent findings when paths are already prefixed
- Fix frontend findWorkspaceRepoForPath to use longest-prefix matching
- Fix shared types: diffType uses DiffType, platformUser is string | null
@Oscar-Silva
Copy link
Copy Markdown
Author

👋 @backnotprop — this PR has been rebased on latest main and is ready for review. It implements the multi-repo workspace review feature requested in #527.

TL;DR: Lets plannotator review discover and review all nested repos with local changes from a non-git parent directory — ideal for poly-repo microservices setups where devs work across multiple services at once.

All tests pass and the build is clean. Would love your eyes on this when you have a moment!

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.

Feature Request: Make review support multiple repos

1 participant