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

Fix issue comment number #30556

Merged
merged 22 commits into from
Dec 30, 2024
Merged

Conversation

lunny
Copy link
Member

@lunny lunny commented Apr 18, 2024

Fix #22419

Only comments with types CommentTypeComment and CommentTypeReview will be counted as conversations of the pull request. CommentTypeReview was missed in the previous implementation.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 18, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 18, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Apr 18, 2024
@silverwind silverwind added the backport/v1.22 This PR should be backported to Gitea 1.22 label Apr 18, 2024
@silverwind
Copy link
Member

silverwind commented Apr 19, 2024

How much work would it be to add a migration that fixes the counts on existing issues? Would probably be a long-running migration on big instances, right?

Also, not sure if such a migration would be backportable at all as it would likely skip migration numbers (a design flaw in the migration system).

@lunny
Copy link
Member Author

lunny commented Apr 19, 2024

How much work would it be to add a migration that fixes the counts on existing issues? Would probably be a long-running migration on big instances, right?

Yes, so I don't think the migration is necessary. The number will be corrected when next comment created/updated.

Also, not sure if such a migration would be backportable at all as it would likely skip migration numbers (a design flaw in the migration system).

@silverwind
Copy link
Member

Yeah it's not really a requirement from me, more like a "nice to have" but likely too complicated with the migration backport to really be justified.

@silverwind
Copy link
Member

Willing to approve this without migration once you fix the tests :)

models/issues/comment.go Outdated Show resolved Hide resolved
models/repo.go Outdated Show resolved Hide resolved
@lunny lunny removed the backport/v1.22 This PR should be backported to Gitea 1.22 label Dec 25, 2024
@lunny lunny added this to the 1.24.0 milestone Dec 25, 2024
@lunny lunny force-pushed the lunny/fix_issue_comment_num branch from ee21b92 to 9c4d250 Compare December 28, 2024 05:13
@lunny lunny marked this pull request as ready for review December 28, 2024 05:38
@lunny lunny added the backport/v1.23 This PR should be backported to Gitea 1.23 label Dec 28, 2024
models/repo.go Outdated Show resolved Hide resolved
models/repo.go Outdated Show resolved Hide resolved
@lunny lunny requested review from wxiaoguang and yp05327 December 30, 2024 02:39
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 30, 2024
@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 Dec 30, 2024
@wxiaoguang
Copy link
Contributor

CI failure is related

models/repo.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 30, 2024
@lunny lunny merged commit a54cc05 into go-gitea:main Dec 30, 2024
26 checks passed
@lunny lunny deleted the lunny/fix_issue_comment_num branch December 30, 2024 22:35
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Dec 30, 2024
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Dec 30, 2024
lunny added a commit that referenced this pull request Dec 30, 2024
Backport #30556 by @lunny

Fix #22419

Only comments with types `CommentTypeComment` and `CommentTypeReview`
will be counted as conversations of the pull request.
`CommentTypeReview` was missed in the previous implementation.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Dec 31, 2024
* giteaofficial/main:
  Fix issue comment number (go-gitea#30556)
  Fix duplicate co-author in squashed merge commit messages (go-gitea#33020)
  Merge updatecommentattachment functions (go-gitea#33044)
  Move SetMerged to service layer (go-gitea#33045)
  Remove aws go sdk package dependency (go-gitea#33029)
  Fix settings not being loaded at CLI (go-gitea#26402)
  Refactor fixture loading for testing (go-gitea#33024)
  Use gitrepo.GetTreePathLatestCommit to get file lastest commit instead from latest commit cache (go-gitea#32987)
  Fix bug automerge cannot be chosed when there is only 1 merge style (go-gitea#33040)
  use `-s -w` ldflags for release artifacts (go-gitea#33041)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/v1.23 This PR should be backported to Gitea 1.23 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source code line's comments are not taken into account on Pull Requests page
6 participants