Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Approvals are dismissed when new commits are pushed #27114

Closed
jpraet opened this issue Sep 18, 2023 · 8 comments · Fixed by #28498
Closed

Approvals are dismissed when new commits are pushed #27114

jpraet opened this issue Sep 18, 2023 · 8 comments · Fixed by #28498
Labels

Comments

@jpraet
Copy link
Member

jpraet commented Sep 18, 2023

Description

With #25882, if

image

is set on the branch protection, approvals get dismissed when new commits are added.

I am not sure if it was the actual intent of this branch protection to actively "Dismiss" the review.

Previously, this option already caused stale approvals to be ignored towards the PR approval count, which seems sufficient?

gitea/models/issues/pull.go

Lines 837 to 839 in a50d9af

if protectBranch.DismissStaleApprovals {
sess = sess.And("stale = ?", false)
}

Now, the review is actually dismissed, resulting in an entry in the PR history, and an (empty) email notification.

This dismissed review is also not shown in the "Reviewers" view of the PR, whereas stale reviews are.

In my opinion actually dismissing the review because new commits are added is a bit excessive?

Gitea Version

1.20.4

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

None

@jpraet
Copy link
Member Author

jpraet commented Sep 18, 2023

The PR #9532 to mark PR reviews as stale at push and allow to dismiss stale approvals was merged in 2020.
The PR #12674 to add dismiss review feature was merged in 2021.

So I believe the term "dismiss" in the branch protection setting does not actually refer to the real "dismiss review" functionality because that didn't exist yet.

@lunny
Copy link
Member

lunny commented Sep 28, 2023

#25882 is to fix #25858 . So maybe the definition of Dismiss stale approvals is no very clear. The previous implementation will not update the dismissed column but stale column and it will be ignored when counting official approvals. But the UI is still not right.

@lunny lunny added this to the 1.20.5 milestone Sep 28, 2023
@jpraet
Copy link
Member Author

jpraet commented Sep 28, 2023

Yes, in my opinion it would have been better to update the UI description (e.g. "Ignore stale approvals") of this branch protection setting to match the implemented behavior. Instead of updating the implementation to match the description.

@lunny lunny modified the milestones: 1.20.5, 1.20.6 Oct 4, 2023
@delvh delvh removed this from the 1.20.6 milestone Nov 25, 2023
@jpraet
Copy link
Member Author

jpraet commented Dec 5, 2023

Dismissing the stale approval reviews also has the following unwanted side effects:

  • if a review was requested from the author of the stale approval, it does not revert to the "review requested" state
  • it is not possible for the PR author to re-request a review from the author of the stale approval

@wderoey
Copy link

wderoey commented Dec 5, 2023

Agreeing with @jpraet ; simply ignoring a stale approval suffices. Dismissing a review completely when new commits are added is not a behavior you wish to make automatic. So i am pro updating the UI description to "Ignore stale approvals" and reverting the implemented behaviour to update the stale column and ignore the approval when counting official approvals (not updating the dismiss column).

@jpraet
Copy link
Member Author

jpraet commented Dec 17, 2023

Would a PR that reverts to the old behavior and clarifies the UI description be accepted?

Or would a PR that adds a new "Ignore stale approvals" branch protection setting be preferred? That way, both options are supported.

@lunny
Copy link
Member

lunny commented Dec 17, 2023

I would like the second option.

jpraet added a commit to jpraet/gitea that referenced this issue Dec 18, 2023
jpraet added a commit to jpraet/gitea that referenced this issue Dec 19, 2023
jpraet added a commit to jpraet/gitea that referenced this issue Dec 23, 2023
jpraet added a commit to jpraet/gitea that referenced this issue Dec 29, 2023
jpraet added a commit to jpraet/gitea that referenced this issue Jan 6, 2024
jpraet added a commit to jpraet/gitea that referenced this issue Jan 7, 2024
GiteaBot added a commit to jpraet/gitea that referenced this issue Jan 14, 2024
GiteaBot added a commit to jpraet/gitea that referenced this issue Jan 14, 2024
GiteaBot added a commit to jpraet/gitea that referenced this issue Jan 14, 2024
GiteaBot added a commit to jpraet/gitea that referenced this issue Jan 14, 2024
GiteaBot added a commit to jpraet/gitea that referenced this issue Jan 15, 2024
GiteaBot added a commit to jpraet/gitea that referenced this issue Jan 15, 2024
GiteaBot added a commit to jpraet/gitea that referenced this issue Jan 15, 2024
GiteaBot added a commit to jpraet/gitea that referenced this issue Jan 15, 2024
GiteaBot added a commit to jpraet/gitea that referenced this issue Jan 15, 2024
lunny pushed a commit that referenced this issue Jan 15, 2024
Fixes #27114.

* In Gitea 1.12 (#9532), a "dismiss stale approvals" branch protection
setting was introduced, for ignoring stale reviews when verifying the
approval count of a pull request.
* In Gitea 1.14 (#12674), the "dismiss review" feature was added.
* This caused confusion with users (#25858), as "dismiss" now means 2
different things.
* In Gitea 1.20 (#25882), the behavior of the "dismiss stale approvals"
branch protection was modified to actually dismiss the stale review.

For some users this new behavior of dismissing the stale reviews is not
desirable.

So this PR reintroduces the old behavior as a new "ignore stale
approvals" branch protection setting.

---------

Co-authored-by: delvh <dev.lh@web.de>
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this issue Jan 17, 2024
…28498)

Fixes go-gitea#27114.

* In Gitea 1.12 (go-gitea#9532), a "dismiss stale approvals" branch protection
setting was introduced, for ignoring stale reviews when verifying the
approval count of a pull request.
* In Gitea 1.14 (go-gitea#12674), the "dismiss review" feature was added.
* This caused confusion with users (go-gitea#25858), as "dismiss" now means 2
different things.
* In Gitea 1.20 (go-gitea#25882), the behavior of the "dismiss stale approvals"
branch protection was modified to actually dismiss the stale review.

For some users this new behavior of dismissing the stale reviews is not
desirable.

So this PR reintroduces the old behavior as a new "ignore stale
approvals" branch protection setting.

---------

Co-authored-by: delvh <dev.lh@web.de>
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
…28498)

Fixes go-gitea#27114.

* In Gitea 1.12 (go-gitea#9532), a "dismiss stale approvals" branch protection
setting was introduced, for ignoring stale reviews when verifying the
approval count of a pull request.
* In Gitea 1.14 (go-gitea#12674), the "dismiss review" feature was added.
* This caused confusion with users (go-gitea#25858), as "dismiss" now means 2
different things.
* In Gitea 1.20 (go-gitea#25882), the behavior of the "dismiss stale approvals"
branch protection was modified to actually dismiss the stale review.

For some users this new behavior of dismissing the stale reviews is not
desirable.

So this PR reintroduces the old behavior as a new "ignore stale
approvals" branch protection setting.

---------

Co-authored-by: delvh <dev.lh@web.de>
Copy link

github-actions bot commented Mar 1, 2024

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants