"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/code.gitea.io/sdk/gitea/pull_review.go" between
gitea-1.13.1.tar.gz and gitea-1.13.2.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

pull_review.go  (gitea-1.13.1):pull_review.go  (gitea-1.13.2)
skipping to change at line 135 skipping to change at line 135
return fmt.Errorf("body is empty") return fmt.Errorf("body is empty")
} }
if opt.NewLineNum != 0 && opt.OldLineNum != 0 { if opt.NewLineNum != 0 && opt.OldLineNum != 0 {
return fmt.Errorf("old and new line num are set, cant identify th e code comment position") return fmt.Errorf("old and new line num are set, cant identify th e code comment position")
} }
return nil return nil
} }
// ListPullReviews lists all reviews of a pull request // ListPullReviews lists all reviews of a pull request
func (c *Client) ListPullReviews(owner, repo string, index int64, opt ListPullRe viewsOptions) ([]*PullReview, *Response, error) { func (c *Client) ListPullReviews(owner, repo string, index int64, opt ListPullRe viewsOptions) ([]*PullReview, *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.12.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_12_0); err != n il {
return nil, nil, err return nil, nil, err
} }
opt.setDefaults() opt.setDefaults()
rs := make([]*PullReview, 0, opt.PageSize) rs := make([]*PullReview, 0, opt.PageSize)
link, _ := url.Parse(fmt.Sprintf("/repos/%s/%s/pulls/%d/reviews", owner, repo, index)) link, _ := url.Parse(fmt.Sprintf("/repos/%s/%s/pulls/%d/reviews", owner, repo, index))
link.RawQuery = opt.ListOptions.getURLQuery().Encode() link.RawQuery = opt.ListOptions.getURLQuery().Encode()
resp, err := c.getParsedResponse("GET", link.String(), jsonHeader, nil, & rs) resp, err := c.getParsedResponse("GET", link.String(), jsonHeader, nil, & rs)
return rs, resp, err return rs, resp, err
} }
// GetPullReview gets a specific review of a pull request // GetPullReview gets a specific review of a pull request
func (c *Client) GetPullReview(owner, repo string, index, id int64) (*PullReview , *Response, error) { func (c *Client) GetPullReview(owner, repo string, index, id int64) (*PullReview , *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.12.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_12_0); err != n il {
return nil, nil, err return nil, nil, err
} }
r := new(PullReview) r := new(PullReview)
resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/pulls/% d/reviews/%d", owner, repo, index, id), jsonHeader, nil, &r) resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/pulls/% d/reviews/%d", owner, repo, index, id), jsonHeader, nil, &r)
return r, resp, err return r, resp, err
} }
// ListPullReviewComments lists all comments of a pull request review // ListPullReviewComments lists all comments of a pull request review
func (c *Client) ListPullReviewComments(owner, repo string, index, id int64) ([] *PullReviewComment, *Response, error) { func (c *Client) ListPullReviewComments(owner, repo string, index, id int64) ([] *PullReviewComment, *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.12.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_12_0); err != n il {
return nil, nil, err return nil, nil, err
} }
rcl := make([]*PullReviewComment, 0, 4) rcl := make([]*PullReviewComment, 0, 4)
link, _ := url.Parse(fmt.Sprintf("/repos/%s/%s/pulls/%d/reviews/%d/commen ts", owner, repo, index, id)) link, _ := url.Parse(fmt.Sprintf("/repos/%s/%s/pulls/%d/reviews/%d/commen ts", owner, repo, index, id))
resp, err := c.getParsedResponse("GET", link.String(), jsonHeader, nil, & rcl) resp, err := c.getParsedResponse("GET", link.String(), jsonHeader, nil, & rcl)
return rcl, resp, err return rcl, resp, err
} }
// DeletePullReview delete a specific review from a pull request // DeletePullReview delete a specific review from a pull request
func (c *Client) DeletePullReview(owner, repo string, index, id int64) (*Respons e, error) { func (c *Client) DeletePullReview(owner, repo string, index, id int64) (*Respons e, error) {
if err := c.CheckServerVersionConstraint(">=1.12.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_12_0); err != n il {
return nil, err return nil, err
} }
_, resp, err := c.getResponse("DELETE", fmt.Sprintf("/repos/%s/%s/pulls/% d/reviews/%d", owner, repo, index, id), jsonHeader, nil) _, resp, err := c.getResponse("DELETE", fmt.Sprintf("/repos/%s/%s/pulls/% d/reviews/%d", owner, repo, index, id), jsonHeader, nil)
return resp, err return resp, err
} }
// CreatePullReview create a review to an pull request // CreatePullReview create a review to an pull request
func (c *Client) CreatePullReview(owner, repo string, index int64, opt CreatePul lReviewOptions) (*PullReview, *Response, error) { func (c *Client) CreatePullReview(owner, repo string, index int64, opt CreatePul lReviewOptions) (*PullReview, *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.12.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_12_0); err != n il {
return nil, nil, err return nil, nil, err
} }
if err := opt.Validate(); err != nil { if err := opt.Validate(); err != nil {
return nil, nil, err return nil, nil, err
} }
body, err := json.Marshal(&opt) body, err := json.Marshal(&opt)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
r := new(PullReview) r := new(PullReview)
resp, err := c.getParsedResponse("POST", resp, err := c.getParsedResponse("POST",
fmt.Sprintf("/repos/%s/%s/pulls/%d/reviews", owner, repo, index), fmt.Sprintf("/repos/%s/%s/pulls/%d/reviews", owner, repo, index),
jsonHeader, bytes.NewReader(body), r) jsonHeader, bytes.NewReader(body), r)
return r, resp, err return r, resp, err
} }
// SubmitPullReview submit a pending review to an pull request // SubmitPullReview submit a pending review to an pull request
func (c *Client) SubmitPullReview(owner, repo string, index, id int64, opt Submi tPullReviewOptions) (*PullReview, *Response, error) { func (c *Client) SubmitPullReview(owner, repo string, index, id int64, opt Submi tPullReviewOptions) (*PullReview, *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.12.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_12_0); err != n il {
return nil, nil, err return nil, nil, err
} }
if err := opt.Validate(); err != nil { if err := opt.Validate(); err != nil {
return nil, nil, err return nil, nil, err
} }
body, err := json.Marshal(&opt) body, err := json.Marshal(&opt)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)