From 761f5dc422859496aa32580a6f885ccefbda2d1d Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 15 Dec 2020 09:54:08 +0100 Subject: [PATCH 1/3] Add Ref to Issue structs --- gitea/issue.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gitea/issue.go b/gitea/issue.go index 0b0824f..185192a 100644 --- a/gitea/issue.go +++ b/gitea/issue.go @@ -39,6 +39,7 @@ type Issue struct { OriginalAuthorID int64 `json:"original_author_id"` Title string `json:"title"` Body string `json:"body"` + Ref string `json:"ref"` Labels []*Label `json:"labels"` Milestone *Milestone `json:"milestone"` // deprecated @@ -173,7 +174,9 @@ func (c *Client) GetIssue(owner, repo string, index int64) (*Issue, *Response, e type CreateIssueOption struct { Title string `json:"title"` Body string `json:"body"` - // username of assignee + Ref string `json:"ref"` + // deprecated + // TODO: rm on sdk 0.15.0 Assignee string `json:"assignee"` Assignees []string `json:"assignees"` Deadline *time.Time `json:"due_date"` @@ -210,8 +213,11 @@ func (c *Client) CreateIssue(owner, repo string, opt CreateIssueOption) (*Issue, // EditIssueOption options for editing an issue type EditIssueOption struct { - Title string `json:"title"` - Body *string `json:"body"` + Title string `json:"title"` + Body *string `json:"body"` + Ref *string `json:"ref"` + // deprecated + // TODO: rm on sdk 0.15.0 Assignee *string `json:"assignee"` Assignees []string `json:"assignees"` Milestone *int64 `json:"milestone"` -- 2.40.1 From 94168d759cfb5553b5917c96c3fe4859634382ec Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 15 Dec 2020 10:10:01 +0100 Subject: [PATCH 2/3] Add TEST --- gitea/issue_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitea/issue_test.go b/gitea/issue_test.go index 547eef8..a9c7736 100644 --- a/gitea/issue_test.go +++ b/gitea/issue_test.go @@ -59,11 +59,13 @@ func editIssues(t *testing.T, c *Client) { Title: "Edited", Body: OptionalString("123 test and go"), State: &state, + Ref: OptionalString("master"), }) assert.NoError(t, err) assert.EqualValues(t, issue.ID, issueNew.ID) assert.EqualValues(t, "123 test and go", issueNew.Body) assert.EqualValues(t, "Edited", issueNew.Title) + assert.EqualValues(t, "master", issueNew.Ref) } func listIssues(t *testing.T, c *Client) { -- 2.40.1