-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Issue totals are wrong when filtering by team #19636
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
Comments
Yup seems to be a regression from #18916. Not really able to debug this, but if anyone wants to give a try |
Maybe it's caused by that the RepoCond is applied too early. if filterMode == models.FilterModeYourRepositories {
statsOpts.RepoCond = models.SearchRepositoryCondition(repoOpts)
}
// GetUserIssueStats needs to count all kinds of issues like YourRepositoriesCount / AssignCount / CreateCount
// however, the statsOpts.RepoCond has been limited by FilterModeYourRepositories
issueStats, err = models.GetUserIssueStats(statsOpts) |
gitea/routers/web/user/home.go Lines 601 to 604 in 0eac09e
By setting the UserID to 0 the stats for assigned / created / mention cannot work. |
Yes good catch. The overall issueStats should be independent of the filterMode 😅.
Why not? It only makes sense for 'created', as you cannot create a issue as team. But you can mention/assign a team to a issue/PR. It actually seems like providing a 'created' item here is not correct. |
- Don't use hacky solution to limit to the correct RepoID's, instead use current code to handle these limits. The existing code is more correct than the hacky solution. - Resolves go-gitea#19636
#19652 refactors the code a bit and fixes the issue. |
- Backport go-gitea#19652 - Don't use hacky solution to limit to the correct RepoID's, instead use current code to handle these limits. The existing code is more correct than the hacky solution. - Resolves go-gitea#19636
Ah, but this is not how this used to work before. With the dropdown box you can select to filter by team repositories:
|
- Don't use hacky solution to limit to the correct RepoID's, instead use current code to handle these limits. The existing code is more correct than the hacky solution. - Resolves #19636 - Add test-case
- Don't use hacky solution to limit to the correct RepoID's, instead use current code to handle these limits. The existing code is more correct than the hacky solution. - Resolves go-gitea#19636 - Add test-case
Description
The issue totals for "Assigned to you", "Created by you" and "Mentioning you" are incorrect in the statistics when filtering on team, when the current filter is "In your repositories".
When selecting another filter, they are correct:
I recently upgraded from 1.16.4 to 1.16.7, and I believe it may be a regression in #18916.
Gitea Version
1.16.7
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
No response
The text was updated successfully, but these errors were encountered: