]> source.dussan.org Git - gitea.git/commitdiff
Expose resolver via API (#15167)
authorsotho <alex@segv.de>
Sat, 27 Mar 2021 23:37:51 +0000 (00:37 +0100)
committerGitHub <noreply@github.com>
Sat, 27 Mar 2021 23:37:51 +0000 (00:37 +0100)
* Expose resolver via API

integrations/api_pull_review_test.go
modules/convert/pull_review.go
modules/structs/pull_review.go
templates/swagger/v1_json.tmpl

index 8be194602fc3d818d4add2269fb7805dfb010c17..19b05d545b0b7e8714ca2c97f7764925d5b1f644 100644 (file)
@@ -66,7 +66,7 @@ func TestAPIPullReview(t *testing.T) {
        var reviewComments []*api.PullReviewComment
        DecodeJSON(t, resp, &reviewComments)
        assert.Len(t, reviewComments, 1)
-       assert.EqualValues(t, "Ghost", reviewComments[0].Reviewer.UserName)
+       assert.EqualValues(t, "Ghost", reviewComments[0].Poster.UserName)
        assert.EqualValues(t, "a review from a deleted user", reviewComments[0].Body)
        assert.EqualValues(t, comment.ID, reviewComments[0].ID)
        assert.EqualValues(t, comment.UpdatedUnix, reviewComments[0].Updated.Unix())
index 18c6c8e58c871c18dac01c7f4f18424a8457e6fe..b461b27b5abb07f9d8e481f2e9b9cce8c28c50f0 100644 (file)
@@ -86,7 +86,8 @@ func ToPullReviewCommentList(review *models.Review, doer *models.User) ([]*api.P
                                apiComment := &api.PullReviewComment{
                                        ID:           comment.ID,
                                        Body:         comment.Content,
-                                       Reviewer:     ToUser(comment.Poster, doer),
+                                       Poster:       ToUser(comment.Poster, doer),
+                                       Resolver:     ToUser(comment.ResolveDoer, doer),
                                        ReviewID:     review.ID,
                                        Created:      comment.CreatedUnix.AsTime(),
                                        Updated:      comment.UpdatedUnix.AsTime(),
index 261d00fde87863524703bed6322d0ad115f90ef8..6544604acbaed57171eeece735ceff705edb43a6 100644 (file)
@@ -49,7 +49,8 @@ type PullReview struct {
 type PullReviewComment struct {
        ID       int64  `json:"id"`
        Body     string `json:"body"`
-       Reviewer *User  `json:"user"`
+       Poster   *User  `json:"user"`
+       Resolver *User  `json:"resolver"`
        ReviewID int64  `json:"pull_request_review_id"`
 
        // swagger:strfmt date-time
index 120d020958e53c1fb6ee68734801a35d82251f74..10f016f4f49df4af5f02be974453e0ae83ecb886 100644 (file)
           "type": "string",
           "x-go-name": "HTMLPullURL"
         },
+        "resolver": {
+          "$ref": "#/definitions/User"
+        },
         "updated_at": {
           "type": "string",
           "format": "date-time",