fix(issues): fix label bulk-load key and reduce log noise in LoadLabel - #38632
Merged
Conversation
CommentList.loadLabels keyed the result map by label.ID but looked up
by comment.ID, so every label event fell back to individual DB queries.
This caused log spam for any comment where the label was deleted, since
ToTimelineComment calls LoadLabel unconditionally for all comment types
including those with LabelID=0. Fix the map key, skip the query when
LabelID=0, demote the now rarely triggered orphaned-label log to Debug,
and fix a typo ("Commit" -> "Comment") in that message.
eliroca
marked this pull request as draft
July 25, 2026 21:03
eliroca
marked this pull request as ready for review
July 25, 2026 21:35
wxiaoguang
reviewed
Jul 26, 2026
wxiaoguang
approved these changes
Jul 26, 2026
wxiaoguang
reviewed
Jul 26, 2026
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
bircni
approved these changes
Jul 26, 2026
bircni
enabled auto-merge (squash)
July 26, 2026 11:50
silverwind
pushed a commit
that referenced
this pull request
Jul 26, 2026
#38632) (#38643) Backport #38632 by @eliroca CommentList.loadLabels keyed the result map by label.ID but looked up by comment.ID, so every label event fell back to individual DB queries. This caused log spam for any comment where the label was deleted, since ToTimelineComment calls LoadLabel unconditionally for all comment types including those with LabelID=0. Fix the map key, skip the query when LabelID=0, demote the now rarely triggered orphaned-label log to Debug, and fix a typo ("Commit" -> "Comment") in that message. Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Elisei Roca <eroca@suse.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Jul 27, 2026
* 'main' of https://github.com/go-gitea/gitea: (55 commits) fix(actions): use base branch ref for pull_request_target context (go-gitea#38636) fix(actions): skip already-approved runs in `ApproveRuns` (go-gitea#38653) fix(api): accept fully-qualified refs in contents API (go-gitea#38650) [skip ci] Updated translations via Crowdin chore(build): upload release to Cloudflare R2 (go-gitea#38635) ci: match `# renovate:` markers that trail the value (go-gitea#38640) feat: admin impersonates a user (go-gitea#38614) refactor: git patch apply (go-gitea#38637) fix: orgmode render include path (go-gitea#38642) fix(actions): cancel tasks immediately when the runner stopped reporting (go-gitea#38616) fix(issues): fix label bulk-load key and reduce log noise in LoadLabel (go-gitea#38632) fix(ui): avoid layout shifts in `overflow-menu` and repo filter (go-gitea#37818) chore: generate codemirror languages from `linguist-languages` package (go-gitea#38624) [skip ci] Updated translations via Crowdin fix(actions): improve runner list status sorting, labels and task job links (go-gitea#38586) fix(actions): correctness and hardening fixes (go-gitea#38518) chore: remove goreportcard badge (go-gitea#38630) fix(repo): prevent double-write redirect collisions on dependency errors, fix ui (go-gitea#38627) fix(deps): update module github.com/getkin/kin-openapi to v0.144.0 [security] (go-gitea#38623) chore: update and relax revive naming rules (go-gitea#38615) ...
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Jul 27, 2026
* main: (55 commits) fix(actions): use base branch ref for pull_request_target context (go-gitea#38636) fix(actions): skip already-approved runs in `ApproveRuns` (go-gitea#38653) fix(api): accept fully-qualified refs in contents API (go-gitea#38650) [skip ci] Updated translations via Crowdin chore(build): upload release to Cloudflare R2 (go-gitea#38635) ci: match `# renovate:` markers that trail the value (go-gitea#38640) feat: admin impersonates a user (go-gitea#38614) refactor: git patch apply (go-gitea#38637) fix: orgmode render include path (go-gitea#38642) fix(actions): cancel tasks immediately when the runner stopped reporting (go-gitea#38616) fix(issues): fix label bulk-load key and reduce log noise in LoadLabel (go-gitea#38632) fix(ui): avoid layout shifts in `overflow-menu` and repo filter (go-gitea#37818) chore: generate codemirror languages from `linguist-languages` package (go-gitea#38624) [skip ci] Updated translations via Crowdin fix(actions): improve runner list status sorting, labels and task job links (go-gitea#38586) fix(actions): correctness and hardening fixes (go-gitea#38518) chore: remove goreportcard badge (go-gitea#38630) fix(repo): prevent double-write redirect collisions on dependency errors, fix ui (go-gitea#38627) fix(deps): update module github.com/getkin/kin-openapi to v0.144.0 [security] (go-gitea#38623) chore: update and relax revive naming rules (go-gitea#38615) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CommentList.loadLabels keyed the result map by label.ID but looked up by comment.ID, so every label event fell back to individual DB queries.
This caused log spam for any comment where the label was deleted, since ToTimelineComment calls LoadLabel unconditionally for all comment types including those with LabelID=0.
Fix the map key, skip the query when LabelID=0, demote the now rarely triggered orphaned-label log to Debug, and fix a typo ("Commit" -> "Comment") in that message.