diff --git a/CHANGELOG.md b/CHANGELOG.md index c4d5799..b6de41f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,12 @@ first. For more complete details see ## Versions -### latest (not yet released) +### 0.5.0 + +**WARNING**: This release includes breaking changes. + +* [BREAKING CHANGE] The SetReview function was returning the wrong + entity type. (#40) ### 0.4.0 diff --git a/changes.go b/changes.go index 7af90fc..81450e2 100644 --- a/changes.go +++ b/changes.go @@ -149,6 +149,14 @@ type ReviewInfo struct { Labels map[string]int `json:"labels"` } +// ReviewResult entity contains information regarding the updates that were +// made to a review. +type ReviewResult struct { + ReviewInfo + Reviewers map[string]AddReviewerResult `json:"reviewers,omitempty"` + Ready bool `json:"ready,omitempty"` +} + // TopicInput entity contains information for setting a topic. type TopicInput struct { Topic string `json:"topic,omitempty"` diff --git a/changes_reviewer.go b/changes_reviewer.go index 05b703d..7199e16 100644 --- a/changes_reviewer.go +++ b/changes_reviewer.go @@ -18,7 +18,9 @@ type SuggestedReviewerInfo struct { // AddReviewerResult entity describes the result of adding a reviewer to a change. type AddReviewerResult struct { + Input string `json:"input,omitempty"` Reviewers []ReviewerInfo `json:"reviewers,omitempty"` + CCS []ReviewerInfo `json:"ccs,omitempty"` Error string `json:"error,omitempty"` Confirm bool `json:"confirm,omitempty"` } diff --git a/changes_revision.go b/changes_revision.go index 69f671d..66be63f 100644 --- a/changes_revision.go +++ b/changes_revision.go @@ -343,7 +343,7 @@ func (s *ChangesService) ListFilesReviewed(changeID, revisionID string) (*[]File // The review must be provided in the request body as a ReviewInput entity. // // Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-review -func (s *ChangesService) SetReview(changeID, revisionID string, input *ReviewInput) (*ReviewInfo, *Response, error) { +func (s *ChangesService) SetReview(changeID, revisionID string, input *ReviewInput) (*ReviewResult, *Response, error) { u := fmt.Sprintf("changes/%s/revisions/%s/review", changeID, revisionID) req, err := s.client.NewRequest("POST", u, input) @@ -351,7 +351,7 @@ func (s *ChangesService) SetReview(changeID, revisionID string, input *ReviewInp return nil, nil, err } - v := new(ReviewInfo) + v := new(ReviewResult) resp, err := s.client.Do(req, v) if err != nil { return nil, resp, err