mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
fix(pr): review decision ignores comment reviews, paged review list, pending review comments hidden, team request names (follow gh)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
19 files changed
+258
-50
No files matched your search
@@ -97,10 +97,15 @@ func (s Reviews) changeRequests(ctx context.Context, n int64, changes ReviewRequ
|
||||
return nil
|
||||
}
|
||||
|
||||
// CheckRequestTeams verifies that every named team exists in the repository's organization.
|
||||
// CheckRequestTeams verifies that every named team exists in the repository's organization. Gitea
|
||||
// lets only organization members list teams, though outside collaborators and the pull request
|
||||
// author may request reviews; when the lookup is forbidden the server checks the names, as for gh.
|
||||
func (s Reviews) CheckRequestTeams(ctx context.Context, names []string) error {
|
||||
owner, _, _ := strings.Cut(s.Repository, "/")
|
||||
_, isOrg, err := organization(ctx, s.Client, owner)
|
||||
if IsForbidden(err) {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -108,6 +113,9 @@ func (s Reviews) CheckRequestTeams(ctx context.Context, names []string) error {
|
||||
return errors.New("team reviews require an organization repository")
|
||||
}
|
||||
teams, err := (Teams{Client: s.Client}).ByName(ctx, owner)
|
||||
if IsForbidden(err) {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user