Skip to content

Comments

Fix CODEOWNERS review request attribution using comment metadata#36348

Merged
wxiaoguang merged 9 commits intogo-gitea:mainfrom
bimakw:fix/36333-codeowners-attribution
Jan 16, 2026
Merged

Fix CODEOWNERS review request attribution using comment metadata#36348
wxiaoguang merged 9 commits intogo-gitea:mainfrom
bimakw:fix/36333-codeowners-attribution

Conversation

@bimakw
Copy link
Contributor

@bimakw bimakw commented Jan 11, 2026

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.

Fixes #36333

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

This approach:

  • Keeps the actual doer (PR author) intact for permission/audit purposes
  • Allows UI to display "CODEOWNERS requested review" when metadata is present
  • More general design that can support other special doer names in the future

Changes

  • models/issues/comment.go: Add SpecialDoerName field to CommentMetaData and CreateCommentOptions
  • models/issues/review.go: Update AddReviewRequest and AddTeamReviewRequest to set metadata when isCodeOwners=true
  • models/issues/review_test.go: Add test case for metadata verification

Testing

  • go build passes
  • go test passes for TestAddReviewRequest

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 11, 2026
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files labels Jan 11, 2026
@wxiaoguang
Copy link
Contributor

It is an abuse of "Ghost" user. "Ghost" user means that there was a user, but it has been deleted.

@bimakw
Copy link
Contributor Author

bimakw commented Jan 11, 2026

Makes sense. Was thinking of adding something like CodeOwnersUser (similar to ActionsUser), would that work?

@wxiaoguang
Copy link
Contributor

Makes sense. Was thinking of adding something like CodeOwnersUser (similar to ActionsUser), would that work?

I believe it needs a general "gitea system account" at the moment (#30205 (comment))

Keeping adding new "system accounts" causes problems for end users who might already have users with the same names (#30205 (comment))

But other maintainers might not agree with me.

@bimakw
Copy link
Contributor Author

bimakw commented Jan 12, 2026

Thanks for the feedback @wxiaoguang. I understand the concern about Ghost user semantics - you're right that Ghost user represents deleted accounts, not system automation.

Regarding the general system account approach, I looked at the discussion in #30205. As @lunny pointed out, system bot accounts with [bot] prefix and no profile page are visually distinct from regular users, so name collision shouldn't be an issue in practice.

I'd like to propose following the exact same pattern as ActionsUser:

const (
    CodeOwnersUserID    int64 = -3
    CodeOwnersUserName        = "gitea-codeowners"
    CodeOwnersUserEmail       = "codeowners@gitea.io"
)

func NewCodeOwnersUser() *User {
    return &User{
        ID:               CodeOwnersUserID,
        Name:             CodeOwnersUserName,
        LowerName:        CodeOwnersUserName,
        IsActive:         true,
        FullName:         "Gitea CODEOWNERS",
        Email:            CodeOwnersUserEmail,
        KeepEmailPrivate: true,
        LoginName:        CodeOwnersUserName,
        Type:             UserTypeBot,
        Visibility:       structs.VisibleTypePublic,
    }
}

Plus add "gitea-codeowners" to reservedUsernames.

This approach is:

  • Consistent with existing patterns (ActionsUser)
  • Semantically correct (CODEOWNERS attribution, not Actions)
  • Minimal in scope

Would this approach work, or would you prefer to wait for the broader general system account discussion to conclude first?

@wxiaoguang
Copy link
Contributor

so name collision shouldn't be an issue in practice.

It doesn't answer the question: what if the user's Gitea instance already has a user named gitea-codeowners


I am against for "keeping adding a lot of reserved usernames", the more you add, the more potential conflicts will be.

@wxiaoguang
Copy link
Contributor

As @lunny pointed out, system bot accounts with [bot] prefix and no profile page are visually distinct from regular users, so name collision shouldn't be an issue in practice.

He doesn't answer the question either. As long as you added a new reserved username, there will be conflict. No matter [bot] prefix is added or not.

In practice, GitHub's "dependabot" occupies that name too.

@lunny
Copy link
Member

lunny commented Jan 12, 2026

As @lunny pointed out, system bot accounts with [bot] prefix and no profile page are visually distinct from regular users, so name collision shouldn't be an issue in practice.

He doesn't answer the question either. As long as you added a new reserved username, there will be conflict. No matter [bot] prefix is added or not.

In practice, GitHub's "dependabot" occupies that name too.

In GitHub’s implementation, https://github.com/dependabot is an organization, while the dependabot[bot] account is a separate entity that represents the GitHub App. These two are distinct and do not conflict with each other.

@wxiaoguang
Copy link
Contributor

In GitHub’s implementation, https://github.com/dependabot is an organization, while the dependabot[bot] account is a separate entity that represents the GitHub App. These two are distinct and do not conflict with each other.

Because dependabot[bot] works for dependabot[org], literally they are the same thing for the same purpose.

But your design: it only introduces conflicts:

  • User has its project-workflows user or org.
  • Gitea has its project-workflows reserved bot name.

They are different things, and it only makes the system more messy when you introduce more potential conflicting names.

@wxiaoguang
Copy link
Contributor

Again: OK, that's your choice to keep introducing fragile designs and confusing end users. If you believe it's right, I won't block.

You can use your power to push and merge.

@lunny
Copy link
Member

lunny commented Jan 12, 2026

In GitHub’s implementation, @dependabot is an organization, while the dependabot[bot] account is a separate entity that represents the GitHub App. These two are distinct and do not conflict with each other.

Because dependabot[bot] works for dependabot[org], literally they are the same thing for the same purpose.

But your design: it only introduces conflicts:

  • User has its project-workflows user or org.
  • Gitea has its project-workflows reserved bot name.

They are different things, and it only makes the system more messy when you introduce more potential conflicting names.

In GitHub’s implementation, the dependabot[bot] account is automatically created when the app is installed and it seems all APP instances created by the same APP share the same name. It is completely unrelated to the dependabot organization.

The dependabot organization is optional—users may choose to create it or not—and there is no functional relationship between the two beyond the similarity in their names.

I’m simply pointing out how GitHub has implemented this.

@wxiaoguang
Copy link
Contributor

I’m simply pointing out how GitHub has implemented this.

What if a user would like to search the PRs created by the real "dependabot" user? And how to search the PRs created by "dependabot" bot?

GitHub never uses "dependabot" as the "user name"

@lunny
Copy link
Member

lunny commented Jan 12, 2026

I’m simply pointing out how GitHub has implemented this.

What if a user would like to search the PRs created by the real "dependabot" user? And how to search the PRs created by "dependabot" bot?

GitHub never uses "dependabot" as the "user name"

Github never use dependabot as a user name because dependabot was registered as an organization. If another APP's name was registered as a user name, there will be a confusing. There will be xxx [bot] and xxx at the same time and they are unrelated.

I guess there are two tables in Github's implementation, one is user, another is apps. All names in the apps have a label [bot] and names from user will not. And both kinds of users could be listed in the pull request authors list or other necessary places.

@wxiaoguang
Copy link
Contributor

I guess there are two tables in Github's implementation ...

Please propose a complete and feasible design in Gitea, that's what I am always asking for.

And show how to search PRs for real "dependabot" user, search PRs for bot "dependabot" app.

@bimakw bimakw force-pushed the fix/36333-codeowners-attribution branch from 7c6ea04 to 0a224ec Compare January 12, 2026 07:39
@bimakw
Copy link
Contributor Author

bimakw commented Jan 12, 2026

Replaced GhostUser with dedicated CodeOwnersUser following the same pattern as ActionsUser:

  • ID: -3
  • Name: gitea-codeowners
  • Type: UserTypeBot

This addresses the concern that "Ghost user means deleted user" while maintaining proper semantic attribution for CODEOWNERS-triggered review requests.

Changes:

  • Added CodeOwnersUser constants and functions in models/user/user_system.go
  • Added to reservedUsernames and systemUserNewFuncs
  • Updated services/issue/pull.go to use NewCodeOwnersUser()
  • Updated template to check IsCodeOwners() instead of IsGhost()
  • Updated tests

@bimakw
Copy link
Contributor Author

bimakw commented Jan 12, 2026

@lunny Ready for review when you have time.

@lunny
Copy link
Member

lunny commented Jan 12, 2026

I don’t think we need a system bot user here. It’s only used for comments and doesn’t involve any permission design. The comment itself can simply be adjusted to something like:
xxx was requested to review due to changes in xxx file.

@bimakw bimakw force-pushed the fix/36333-codeowners-attribution branch 2 times, most recently from 0d65a67 to 9d13f9d Compare January 13, 2026 08:05
@bimakw bimakw force-pushed the fix/36333-codeowners-attribution branch 2 times, most recently from 0a7a0b4 to 6fab32d Compare January 15, 2026 16:05
@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 Jan 15, 2026
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 16, 2026

Oh no, please don't force push. https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#maintaining-open-prs

I made many necessary changes, please revert to my commits

@bimakw bimakw force-pushed the fix/36333-codeowners-attribution branch from 92bfde3 to 9a64acf Compare January 16, 2026 02:54
@wxiaoguang wxiaoguang marked this pull request as draft January 16, 2026 02:55
bimakw and others added 5 commits January 16, 2026 15:31
Revised implementation based on maintainer feedback. Instead of
introducing a new system user (CodeOwnersUser), this uses CommentMetaData
to mark CODEOWNERS-triggered review requests.

Changes:
- Removed CodeOwnersUser system user (ID -3)
- Added IsCodeOwnersReviewRequest field to CommentMetaData
- Created AddCodeOwnersReviewRequest/AddCodeOwnersTeamReviewRequest
  functions that set the metadata flag
- Updated template to check CommentMetaData instead of Poster
- Message now shows "X was requested to review due to CODEOWNERS rules"

This approach is simpler and doesn't require adding a new system user
just for comment attribution.

Fixes go-gitea#36333
Address reviewer feedback:
- Rename IsCodeOwnersReviewRequest to SpecialDoerName for more general usage
- Simplify tests by adding one case to existing TestAddReviewRequest
- Remove separate test functions for CODEOWNERS scenarios
@bimakw bimakw force-pushed the fix/36333-codeowners-attribution branch from 9a64acf to 92895d0 Compare January 16, 2026 08:31
@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 Jan 16, 2026
@wxiaoguang wxiaoguang marked this pull request as ready for review January 16, 2026 10:08
@wxiaoguang wxiaoguang added the type/enhancement An improvement of existing functionality label Jan 16, 2026
@wxiaoguang wxiaoguang added this to the 1.26.0 milestone Jan 16, 2026
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
@wxiaoguang wxiaoguang enabled auto-merge (squash) January 16, 2026 14:25
@wxiaoguang wxiaoguang merged commit 65422fd into go-gitea:main Jan 16, 2026
24 checks passed
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 21, 2026
* giteaofficial/main: (27 commits)
  Allow foreachref parse max tokens from 4*64KB to 4MB (go-gitea#36414)
  Refactor git command context & pipeline (go-gitea#36406)
  Fix missing repository id when migrating release attachments (go-gitea#36389)
  [skip ci] Updated translations via Crowdin
  Refactor git command stderr handling (go-gitea#36402)
  Some refactors about GetMergeBase (go-gitea#36186)
  Refactor git command stdio pipe (go-gitea#36393)
  fix: typos in comments (go-gitea#36394)
  add support for archive-upload rpc (go-gitea#36391)
  Hide delete directory button for mirror or archive repository and disable the menu item if user have no permission (go-gitea#36384)
  Fix CODEOWNERS review request attribution using comment metadata (go-gitea#36348)
  Update JS and PY deps (go-gitea#36383)
  Add ability to download subpath archive (go-gitea#36371)
  Fix bug on notification read (go-gitea#36339)
  Add chunked transfer encoding support for LFS uploads (go-gitea#36380)
  Migrate to `import.meta.env` and clean up types and eslint (go-gitea#36362)
  Rename CSS variables and improve colorblind themes (go-gitea#36353)
  Indicate when only optional checks failed (go-gitea#36367)
  Release attachments must belong to the intended repo (go-gitea#36347)
  Fix permission check on org project operations (go-gitea#36318)
  ...
ZPascal added a commit to ZPascal/gitea that referenced this pull request Jan 22, 2026
# This is the 1st commit message:

feat: Add max-parallel implementation inside the Gitea server

# This is the commit message go-gitea#2:

fix: Remove MatrixID and Capacity functionality

# This is the commit message go-gitea#3:

Fix incorrect text content detection (go-gitea#36364)

Fix go-gitea#36325
# This is the commit message go-gitea#4:

clean watches when make a repository private and check permission when send release emails (go-gitea#36319)

# This is the commit message go-gitea#5:

Fix bug when compare in the pull request (go-gitea#36363)

The pull request comparison should not use `direct compare`.
# This is the commit message go-gitea#6:

Fix permission check on org project operations (go-gitea#36318)

# This is the commit message go-gitea#7:

Release attachments must belong to the intended repo (go-gitea#36347)

# This is the commit message go-gitea#8:

Indicate when only optional checks failed (go-gitea#36367)

Currently it's not clear that you can merge a PR when only optional
checks failed:

<img width="922" height="447" alt="Screenshot 2026-01-14 at 4 08 17 pm"
src="https://github.com/user-attachments/assets/e11670c7-5ab9-42d7-af09-2d8a8fd532d3"
/>

This PR changes the text to say "Some optional checks failed" when only
optional checks failed:

<img width="922" height="443" alt="Screenshot 2026-01-14 at 3 59 08 pm"
src="https://github.com/user-attachments/assets/9ea69b13-38d6-4cfc-b4f7-952eff58e546"
/>

When a required check fails it'll still say "Some checks failed":

<img width="928" height="343" alt="Screenshot 2026-01-14 at 3 59 20 pm"
src="https://github.com/user-attachments/assets/d3764a95-9737-4482-851e-d3406b1e4d76"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
# This is the commit message go-gitea#9:

Rename CSS variables and improve colorblind themes (go-gitea#36353)

Followup go-gitea#36215, rename the
variables for consistency with existing vars and change green to value
of `--color-blue` in the relevant color blind themes:

<img width="1305" height="303" alt="image"
src="https://github.com/user-attachments/assets/3d131ab7-99ab-4b03-93ab-715ce0030b08"
/>

The blue coloring also matched GitHub:

<img width="1313" height="393" alt="image"
src="https://github.com/user-attachments/assets/f97e35b2-4ff4-49b0-841f-ffd49a02e03d"
/>

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
# This is the commit message go-gitea#10:

Migrate to `import.meta.env` and clean up types and eslint (go-gitea#36362)

`import.meta.env` is supported in both vitest and webpack [as of
recent](webpack/webpack#19996), so replace all
previous use of `process.env` with it. Current usage is limited to test
files, I've also verified it works in actual frontend code.

`webpack/module` is added to typescript types which includes the
definition for `import.meta.env`. I've also made the eslint globals more
precise. Finally, `__webpack_public_path__` is removed from our type
definitions because `webpack/module` also provides it.
# This is the commit message go-gitea#11:

Add chunked transfer encoding support for LFS uploads (go-gitea#36380)

Enable chunked transfer encoding for Git LFS uploads by adding
Transfer-Encoding: chunked header to upload action responses. This
prevents large file uploads (100+ MB) from being blocked by reverse
proxies like Cloudflare that buffer non-chunked requests.

Fix go-gitea#22233

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
# This is the commit message go-gitea#12:

Fix bug on notification read (go-gitea#36339)

When a user has been revoked permission to access a repository, the
related notification could still be visited. But the repository's
information should not be leaked any more.
# This is the commit message go-gitea#13:

Add ability to download subpath archive (go-gitea#36371)

closes: go-gitea#4478

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
# This is the commit message go-gitea#14:

Update JS and PY deps (go-gitea#36383)

- Update JS and PY dependencies
- Workaround stylelint/stylelint#8893 by
moving the stylint config file to JS
- Regenerate SVGs
- Bump to python 3.14 in devcontainer and actions
- Verified `@github/text-expander-element`
- Removed obsolete type stub
# This is the commit message go-gitea#15:

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

Fixes go-gitea#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 is the commit message go-gitea#16:

Hide delete directory button for mirror or archive repository and disable the menu item if user have no permission (go-gitea#36384)

# This is the commit message go-gitea#17:

add support for archive-upload rpc (go-gitea#36391)

Add support for fetching archives with `git archive --remote <repo-url>`

closes: go-gitea#23425

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

# This is the commit message go-gitea#18:

fix: typos in comments (go-gitea#36394)

# This is the commit message go-gitea#19:

Refactor git command stdio pipe (go-gitea#36393)

And remove the incorrect `ensureValidGitRepository`
# This is the commit message go-gitea#20:

Some refactors about GetMergeBase (go-gitea#36186)

Maybe fix go-gitea#32018

- Use `gitrepo.GetMergeBase` method instead of other two
implementations.
- Add `FetchRemoteCommit` so that we don't need to add many `remote` to
the git repository to avoid possible git lock conflicts. A lock will
start when invoke the function, it will be invoked when cross-repository
comparing. The head repository will fetch the base repository's base
commit id. In most situations, it should lock the fork repositories so
that it should not become a bottleneck.
- Improve `GetCompareInfo` to remove unnecessarily adding remote.
- Remove unnecessary parameters of `SignMerge`.
# This is the commit message go-gitea#21:

Refactor git command stderr handling (go-gitea#36402)

And clean up legacy fragile & incorrect logic
# This is the commit message go-gitea#22:

[skip ci] Updated translations via Crowdin

# This is the commit message go-gitea#23:

Fix missing repository id when migrating release attachments (go-gitea#36389)

This PR fixes missed repo_id on the migration of attachments to Gitea.
It also provides a doctor check to fix the dirty data on the database.

Refactor git command context & pipeline (go-gitea#36406)

Less and simpler code, fewer bugs

Allow foreachref parse max tokens from 4*64KB to 4MB (go-gitea#36414)

Fix go-gitea#36408

---------

Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

Update material-icon-theme to v5.31.0 (go-gitea#36427)

Update chroma to v2.23.0 (go-gitea#36423)

Fix markdown newline handling during IME composition (go-gitea#36421)

### Summary

Fix incorrect newline handling in markdown editor when using IME input.

### Details

While composing text with an IME, pressing Enter should not trigger
markdown indentation logic.
This change skips indentation handling during composition by checking
`e.isComposing`.

This prevents unexpected line breaks and formatting issues for CJK
users.

[skip ci] Updated translations via Crowdin

Fix typos: unknow -> unknown, pktLineTypeUnknow -> pktLineTypeUnknown (go-gitea#36419)

Fix issue filter menu layout (go-gitea#36426)

Fix go-gitea#36420

Fix spelling (go-gitea#36399)

Signed-off-by: Thomas Beutlich <115483027+thbeu@users.noreply.github.com>

Refactor git command stdio pipe (go-gitea#36422)

Most potential deadlock problems should have been fixed, and new code is
unlikely to cause new problems with the new design.

Also raise the minimum Git version required to 2.6.0 (released in 2015)

Remove `node-check` and `go-check`, support node prerelease versions (go-gitea#36382)

1. Remove those checks for the sake of build performance and because go
and node will fail anyways if their versions are incorrect.
3. Support pre-release Node version for determining NODE_VARS.
2. Update to the chinese READMEs to mention `pnpm` which is already
present in english README.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

fix: Adjust the unittests

fix: Lint issues

fix: Adjust the swagger config
blender-it pushed a commit to blender/gitea that referenced this pull request Feb 6, 2026
…ment metadata (go-gitea#36348)

Fixes go-gitea#36333

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.

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>
Co-authored-by: Bart van der Braak <bart@blender.org>
blender-it pushed a commit to blender/gitea that referenced this pull request Feb 13, 2026
…ment metadata (go-gitea#36348)

Fixes go-gitea#36333

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.

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>
Co-authored-by: Bart van der Braak <bart@blender.org>
blender-it pushed a commit to blender/gitea that referenced this pull request Feb 17, 2026
…ment metadata (go-gitea#36348)

Fixes go-gitea#36333

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.

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>
Co-authored-by: Bart van der Braak <bart@blender.org>
blender-it pushed a commit to blender/gitea that referenced this pull request Feb 17, 2026
…ment metadata (go-gitea#36348)

Fixes go-gitea#36333

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.

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>
Co-authored-by: Bart van der Braak <bart@blender.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When reviewers are automatically added via CODEOWNERS rules, it is presented as an action by the PR author

4 participants