Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 437e318240 | |||
| 2e2fcbabfc |
@@ -2,9 +2,9 @@ package github
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|||||||
+5
-2
@@ -197,8 +197,10 @@ func (c *Client) ListReviews(ctx context.Context, owner, repo string, number int
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we just fetched page maxPages and it was full (the short-page break
|
// Truncation detection: this runs on the final allowed iteration
|
||||||
// above didn't fire), more reviews likely exist beyond our limit.
|
// (page == maxPages) only when the page was full (the len < perPage
|
||||||
|
// early-break above didn't fire). A full final page means additional
|
||||||
|
// reviews likely exist beyond our pagination limit.
|
||||||
if page == maxPages {
|
if page == maxPages {
|
||||||
truncated = true
|
truncated = true
|
||||||
}
|
}
|
||||||
@@ -221,6 +223,7 @@ func (c *Client) DeleteReview(ctx context.Context, owner, repo string, number in
|
|||||||
reqURL := fmt.Sprintf("%s/repos/%s/%s/pulls/%d/reviews/%d",
|
reqURL := fmt.Sprintf("%s/repos/%s/%s/pulls/%d/reviews/%d",
|
||||||
c.baseURL, url.PathEscape(owner), url.PathEscape(repo), number, reviewID)
|
c.baseURL, url.PathEscape(owner), url.PathEscape(repo), number, reviewID)
|
||||||
|
|
||||||
|
// nil body: the GitHub DELETE endpoint for reviews requires no request body.
|
||||||
_, err := c.doRequestWithBody(ctx, http.MethodDelete, reqURL, nil)
|
_, err := c.doRequestWithBody(ctx, http.MethodDelete, reqURL, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
var apiErr *APIError
|
var apiErr *APIError
|
||||||
|
|||||||
Reference in New Issue
Block a user