The bot posts reviews via the API, but never adds itself as a requested reviewer on the PR. This means:
The Reviewers sidebar shows "no reviewers" even though reviews exist
Branch protection required-reviewer rules only fire if the user is in the approvals whitelist
Users have to manually configure branch protection to see bot reviews in the sidebar
The bot should work out of the box without any branch protection setup.
Fix
Before posting a review, the bot should call:
POST /repos/{owner}/{repo}/pulls/{number}/requested_reviewers
{"reviewers": ["<own-username>"]}
This ensures the bot always appears in the Reviewers sidebar. When the review is subsequently posted, Gitea will show the approval/rejection status there.
Implementation
Add RequestReviewer(ctx, owner, repo, number, username) to gitea/client.go
The bot needs to know its own username. Either:
Fetch via GET /user with its token (one extra API call, but self-discovering)
Accept a --reviewer-name flag (explicit, no extra call)
Parse it from the token's user (if the API exposes that)
Call RequestReviewer before PostReview in the main flow
If the request fails (already requested, or self-request not allowed), log a warning and continue — it's not fatal
Acceptance criteria
Bot appears in Reviewers sidebar without any branch protection config
Works on fresh repos with no setup beyond the workflow file
Graceful degradation if the API call fails (log warning, still post review)
No extra flag required — bot discovers its own username via GET /user
## Problem
The bot posts reviews via the API, but never adds itself as a *requested reviewer* on the PR. This means:
- The Reviewers sidebar shows "no reviewers" even though reviews exist
- Branch protection required-reviewer rules only fire if the user is in the approvals whitelist
- Users have to manually configure branch protection to see bot reviews in the sidebar
The bot should work out of the box without any branch protection setup.
## Fix
Before posting a review, the bot should call:
```
POST /repos/{owner}/{repo}/pulls/{number}/requested_reviewers
{"reviewers": ["<own-username>"]}
```
This ensures the bot always appears in the Reviewers sidebar. When the review is subsequently posted, Gitea will show the approval/rejection status there.
## Implementation
1. Add `RequestReviewer(ctx, owner, repo, number, username)` to `gitea/client.go`
2. The bot needs to know its own username. Either:
- Fetch via `GET /user` with its token (one extra API call, but self-discovering)
- Accept a `--reviewer-name` flag (explicit, no extra call)
- Parse it from the token's user (if the API exposes that)
3. Call `RequestReviewer` before `PostReview` in the main flow
4. If the request fails (already requested, or self-request not allowed), log a warning and continue — it's not fatal
## Acceptance criteria
- [ ] Bot appears in Reviewers sidebar without any branch protection config
- [ ] Works on fresh repos with no setup beyond the workflow file
- [ ] Graceful degradation if the API call fails (log warning, still post review)
- [ ] No extra flag required — bot discovers its own username via `GET /user`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The bot posts reviews via the API, but never adds itself as a requested reviewer on the PR. This means:
The bot should work out of the box without any branch protection setup.
Fix
Before posting a review, the bot should call:
This ensures the bot always appears in the Reviewers sidebar. When the review is subsequently posted, Gitea will show the approval/rejection status there.
Implementation
RequestReviewer(ctx, owner, repo, number, username)togitea/client.goGET /userwith its token (one extra API call, but self-discovering)--reviewer-nameflag (explicit, no extra call)RequestReviewerbeforePostReviewin the main flowAcceptance criteria
GET /user