feat(review): scope reviews by pull request#261
Open
Vaibhaav-Tiwari wants to merge 6 commits into
Open
Conversation
Collaborator
Author
|
@copilot resolve the merge conflicts in this pull request |
Copilot stopped work on behalf of
Vaibhaav-Tiwari due to an error
June 16, 2026 19:16
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Collaborator
Author
|
@copilot resolve the merge conflicts in this pull request |
Copilot stopped work on behalf of
Vaibhaav-Tiwari due to an error
June 16, 2026 19:47
# Conflicts: # backend/internal/review/review_test.go # backend/internal/storage/sqlite/store/review_store.go # backend/internal/storage/sqlite/store/review_store_test.go
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Resolve conflicts from review work that landed on main since this PR opened (#337 worker-notification + github_review_id, #333-style migration renumbering, failed-run retry idempotency). - migrations: renumber 0014_review_per_pr.sql -> 0018 (0014-0017 now taken on main); fold main's 'status != failed' exclusion into the new PR-scoped review_run unique index so failed passes stay retryable per (session, pr, sha). - queries/gen: keep PR-scoped GetReviewRunBySessionPRAndSHA but add main's github_review_id column to it and to ListReviewRunsBySessionAndPR; regenerate via sqlc so all review_run rows map through one reviewRunFromRow. - review.Engine.Trigger: keep main's record-before-launch + failed-retry semantics, layer the PR's prURL scoping on top (workerPR/GetReviewBySessionAndPR/ PR-scoped idempotency lookup). - service Manager: combine Trigger(prURL) + List(prURL) with Submit(githubReviewID). - controllers reviews_test.go: unify the two add/add files into one controllers_test package with a single fake satisfying the merged Manager. - review_test.go: adapt main's failed-run/retry tests to the PR's multi-review fakeStore shape and prURL signature. - frontend: regenerate schema.ts; SessionInspector reviews fallback now sets targets: [].
The merge resolution inadvertently committed package-lock drift from a local npm install (platform-specific @emnapi optional deps), breaking npm ci. The merged package.json matches main exactly, so restore main's lock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The PR's review.ReviewTarget / reviewsvc.ReviewTarget tripped revive's exported-stutter rule (pre-existing on the branch, surfaced by the lint CI job). Rename to review.Target / reviewsvc.Target; the HTTP DTO ReviewTargetResponse is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Re-apply per-PR review scoping on top of #377 (reviews refactor: Submit + nudge delivery moved to the service/lifecycle layer, supersede semantics, delivered_at, context aliased to stdctx in the engine). - migrations: renumber 0018_review_per_pr.sql -> 0019 (collided with #377's new 0018_review_run_delivered_at.sql). The per-PR migration recreates only the review table, so review_run.delivered_at survives. - engine review.go: rebuilt on #377's structure; re-applied prURL scoping to Trigger/List/workerPR/upsertReview and the Store interface (GetReviewBySessionAndPR, GetReviewRunBySessionPRAndSHA, ListReviewsBySession, ListReviewRunsBySessionAndPR), restored the per-PR List targets, and PR-scoped SupersedeStaleRunningReviewRuns so triggering one PR no longer supersedes another PR's in-flight run. - service review.go auto-merged cleanly: #377's Store/Reducer/delivery with the PR's prURL Manager signatures. - queries/gen: keep PR-scoped run lookups, carry #377's delivered_at column on all run selects; add pr_url to SupersedeStaleRunningReviewRuns; sqlc-regenerated. - engine review_test.go: reconciled main's supersede tests to the multi-PR fakeStore shape (reviews[] + PRURL) and prURL Trigger signature. - frontend: regenerated openapi.yaml/schema.ts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
(session_id, pr_url)so one workspace session can review multiple PRs independently.prUrlselection on review list/trigger APIs; single-PR sessions keep the existing no-selector behavior.Credibility check
Issue #253 is credible on current
origin/main: review storage was unique bysession_id, while PR storage and workspace sessions allow multiple PRs per session. Two details in the issue were stale: the migration is0012_add_review_tables.sqlon main, not0011, andListPRsBySessionis already deterministic byupdated_at DESC. The core problem remained: review trigger still silently collapsed multi-PR sessions unless PR identity became explicit.Tests
go test -count=1 ./internal/review ./internal/storage/sqlite/store ./internal/httpd/...go test -count=1 ./internal/service/review ./internal/daemonnpm --prefix frontend run typecheckgo test ./...was also attempted twice, but timed out after 3 and 5 minutes without emitting a failure in this environment.Closes #253