Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add MergedAt field to PullRequestLinks #3053

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
// 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,omitmepty"`

Check failure on line 129 in github/issues.go

View workflow job for this annotation

GitHub Actions / lint

SA5008: unknown JSON option "omitmepty" (staticcheck)
}

// 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
Loading