Skip to content

Open issue count not updated when closing through commits/PR merges #10536

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

Closed
1 of 7 tasks
bkraul opened this issue Feb 28, 2020 · 3 comments · Fixed by #12900
Closed
1 of 7 tasks

Open issue count not updated when closing through commits/PR merges #10536

bkraul opened this issue Feb 28, 2020 · 3 comments · Fixed by #12900
Labels
Milestone

Comments

@bkraul
Copy link

bkraul commented Feb 28, 2020

Description

Issue count indicators are not being properly updated when the issues are closed via commit messages or PR merges.

Steps to reproduce:

  • Create a new issue.
  • Add a commit to the project wit the Closes #... instruction.
  • Push the commit.
  • The issue will close as expected.
  • The count of open issues will not be updated and you will still see the count as if the issue had not been closed.
  • Restarting (recreating the docker container) updates the count.
    ...

Screenshots

Issue created:

image

Committing and pushing the change:

image

Issue closes, but count is not updated:

image
image

This issue appears related to #10360, and was supposed to have been fixed by #10364 but it seems it is not.

lynxplay added a commit to lynxplay/gitea that referenced this issue Feb 29, 2020
This commit fixes the bug that a repositories open issue value is not
updated when an issue is closed through a commit that references such
issue.

More specifically, creating an issue on a repository with currently 0
open bugs lead to the repository showing one open issue.
Closing such issue through a commit onto the branch this issue was
targetting would close the issue correctly but failed to update the
issue counter in the repositories header. Hence the repository would
show one open issue while the open issue list remains empty.

As this commit is a response to go-gitea#10536, more information about the
bug can be aquired there.

Fixes go-gitea#10536.
@solaristhesun
Copy link

Please fix this. It makes me mad :/

@lunny lunny added the type/bug label Apr 17, 2020
@lunny lunny added this to the 1.11.5 milestone Apr 17, 2020
@lunny lunny modified the milestones: 1.11.5, 1.11.6 May 1, 2020
zeripath added a commit to zeripath/gitea that referenced this issue May 6, 2020
When closing issues through commits create the comment after
the issue is closed rather than before. This ensures that the
repo issue num is correctly updated.

Fix go-gitea#11308
Fix go-gitea#10536

Signed-off-by: Andrew Thornton <[email protected]>
@techknowlogick techknowlogick modified the milestones: 1.11.6, 1.11.7 Jun 3, 2020
@lafriks lafriks modified the milestones: 1.11.7, 1.12.1, 1.12.2 Jun 18, 2020
@lafriks lafriks modified the milestones: 1.12.2, 1.12.3 Jul 11, 2020
@techknowlogick techknowlogick modified the milestones: 1.12.3, 1.12.4 Jul 28, 2020
@lunny lunny modified the milestones: 1.12.4, 1.12.5 Sep 4, 2020
@zeripath
Copy link
Contributor

zeripath commented Sep 19, 2020

OK it looks to me like the correct values are calculated but then they are incorrectly overwritten by another call to update repository...

@zeripath
Copy link
Contributor

// Change repository empty status and update last updated time.
if err := models.UpdateRepository(repo, false); err != nil {
return fmt.Errorf("UpdateRepository: %v", err)
}

Updates all the columns of the repository - overwriting the updated values.

zeripath added a commit to zeripath/gitea that referenced this issue Sep 19, 2020
We should only update is_empty, default_branch and updated time columns
during commitRepoAction and not update other columns as we risk
overwriting incorrect information.

Fix go-gitea#11823
Fix go-gitea#10536

Signed-off-by: Andrew Thornton <[email protected]>
techknowlogick added a commit that referenced this issue Sep 20, 2020
We should only update is_empty, default_branch and updated time columns
during commitRepoAction and not update other columns as we risk
overwriting incorrect information.

Fix #11823
Fix #10536

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
zeripath added a commit to zeripath/gitea that referenced this issue Sep 20, 2020
Backport go-gitea#12900

We should only update is_empty, default_branch and updated time columns
during commitRepoAction and not update other columns as we risk
overwriting incorrect information.

Fix go-gitea#11823
Fix go-gitea#10536

Signed-off-by: Andrew Thornton <[email protected]>
lunny pushed a commit that referenced this issue Sep 21, 2020
Backport #12900

We should only update is_empty, default_branch and updated time columns
during commitRepoAction and not update other columns as we risk
overwriting incorrect information.

Fix #11823
Fix #10536

Signed-off-by: Andrew Thornton <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.