Skip to content

fix(pull): allow re-request after stale review request - #38721

Open
lunny wants to merge 1 commit into
go-gitea:mainfrom
lunny:lunny/fix-review-rerequest-upstream
Open

fix(pull): allow re-request after stale review request#38721
lunny wants to merge 1 commit into
go-gitea:mainfrom
lunny:lunny/fix-review-rerequest-upstream

Conversation

@lunny

@lunny lunny commented Jul 30, 2026

Copy link
Copy Markdown
Member

What changed

  • Determine review-request idempotency from the reviewer's latest meaningful review by ID, including comment reviews.
  • Lazily replace stale review-request rows when a newer comment, approval, or rejection exists.
  • Preserve the existing lookup semantics for removing review requests and for closed or merged pull request guards.
  • Add regression coverage for idempotency, stale request recovery, comment-only history, and closed pull request behavior.

Why

Legacy or imported data can contain an old ReviewTypeRequest row alongside a newer ReviewTypeComment row. The sidebar treats the newer comment as the current state, while AddReviewRequest previously ignored comments and silently returned after finding the stale request. As a result, re-requesting a review appeared to do nothing.

This change repairs the inconsistent state through the normal application path without requiring a migration or a doctor command.

Verification

  • go test ./models/issues/...
  • go test ./models/...
  • go test ./services/issue/...
  • go build ./...
  • go vet ./models/issues/...
  • make fmt
  • git diff --check

make lint-go could not complete because the local go-critic ruleguard loader panics while loading fmt. The same panic reproduces on the unmodified base commit.


Generated by Codet

Co-authored-by: Codet <codet@noreply.gitea.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 30, 2026
@github-actions github-actions Bot added topic/pr Issues related to pull requests type/bug labels Jul 30, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 1 This PR needs approval from one additional maintainer to be merged. topic/pr Issues related to pull requests type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants