mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-19 15:14:40 +09:00
When a member of a CODEOWNERS team approves or rejects a pull request, `SubmitReview` removes the team's review request. On the next push, `PullRequestCodeOwnersReview` finds no request for that team and adds it again, so every team member except the author gets a new "Requested to review" mail. This happens even when the push doesn't change the PR's diff (for example, merging the base branch into the PR branch) and the approval is still valid. Individual code owners don't have this problem: they are skipped when they already have a review. This PR applies the same rule to teams. A team is not requested again while one of its members has an approve or reject review on the PR that hasn't been dismissed. If that review is dismissed (for example by "Dismiss stale approvals"), the team is requested again as before. Testing: `TestPullView_CodeOwnerTeamAnsweredByMember` creates an org repo with `README.md @org3/team1`, opens a PR, and checks three things: the team is requested; after a member approves, a code owner pass (what a push runs) doesn't request the team again; after the approval is dismissed, the team is requested again. The test fails without the change. `make lint-backend` and the `TestPull*` integration tests pass locally on SQLite. AI disclosure: I used Claude to help trace the cause and draft the change, test and description. I reviewed and tested it myself and can explain every line. Fixes #34884. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>