Skip to content

Commit

Permalink
Add MergedAt field to PullRequestLinks (#3053)
Browse files Browse the repository at this point in the history
Fixes: #3052.
  • Loading branch information
tatsuhiro-t authored Jan 19, 2024
1 parent e9f5269 commit e7a3cc7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
8 changes: 8 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions github/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ type IssueListOptions struct {
// PullRequestLinks object is added to the Issue object when it's an issue included
// in the IssueCommentEvent webhook payload, if the webhook is fired by a comment on a PR.
type PullRequestLinks struct {
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
DiffURL *string `json:"diff_url,omitempty"`
PatchURL *string `json:"patch_url,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
DiffURL *string `json:"diff_url,omitempty"`
PatchURL *string `json:"patch_url,omitempty"`
MergedAt *Timestamp `json:"merged_at,omitempty"`
}

// List the issues for the authenticated user. If all is true, list issues
Expand Down
4 changes: 3 additions & 1 deletion github/issues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,15 @@ func TestPullRequestLinks_Marshal(t *testing.T) {
HTMLURL: String("hurl"),
DiffURL: String("durl"),
PatchURL: String("purl"),
MergedAt: &Timestamp{referenceTime},
}

want := `{
"url": "url",
"html_url": "hurl",
"diff_url": "durl",
"patch_url": "purl"
"patch_url": "purl",
"merged_at": ` + referenceTimeStr + `
}`

testJSONMarshal(t, u, want)
Expand Down

0 comments on commit e7a3cc7

Please # to comment.