Fix CODEOWNERS review request attribution using comment metadata (#36348)

Fixes #36333

## Problem

When CODEOWNERS automatically assigns reviewers to a pull request, the
timeline incorrectly shows the PR author as the one who requested the
review (e.g., "PR_AUTHOR requested review from CODE_OWNER"). This is
misleading since the action was triggered automatically by CODEOWNERS
rules, not by the PR author.

## Solution

Store CODEOWNERS attribution in comment metadata instead of changing the
doer user:
- Add `SpecialDoerName` field to `CommentMetaData` struct (value:
`"CODEOWNERS"` for CODEOWNERS-triggered requests)
- Pass `isCodeOwners=true` to `AddReviewRequest` and
`AddTeamReviewRequest` functions
- Template can check this metadata to show appropriate attribution
message

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Gregorius Bima Kharisma Wicaksana
2026-01-16 21:52:57 +07:00
committed by GitHub
parent 49edbbbc2e
commit 65422fde4d
14 changed files with 89 additions and 65 deletions

View File

@@ -469,19 +469,6 @@ a.label,
box-shadow: 1px 1px 0 0 var(--color-secondary);
}
.ui.comments .comment .text {
margin: 0;
}
.ui.comments .comment .text,
.ui.comments .comment .author {
color: var(--color-text);
}
.ui.comments .comment a.author:hover {
color: var(--color-primary);
}
.ui.comments .comment .metadata {
color: var(--color-text-light-2);
}
@@ -562,6 +549,7 @@ img.ui.avatar,
color: var(--color-purple) !important;
}
/* it is different from tw-text-black: this one changes in dark theme */
.text.black {
color: var(--color-text) !important;
}