Skip to content

Commit

Permalink
Add missing fields to the checksuite event (#3278)
Browse files Browse the repository at this point in the history
Fixes: #3277.
  • Loading branch information
prnvbn authored Sep 21, 2024
1 parent 2359251 commit ba86215
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 18 deletions.
5 changes: 4 additions & 1 deletion github/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ type CheckSuite struct {
PullRequests []*PullRequest `json:"pull_requests,omitempty"`

// The following fields are only populated by Webhook events.
HeadCommit *Commit `json:"head_commit,omitempty"`
HeadCommit *Commit `json:"head_commit,omitempty"`
LatestCheckRunsCount *int64 `json:"latest_check_runs_count,omitempty"`
Rerequstable *bool `json:"rerequestable,omitempty"`
RunsRerequstable *bool `json:"runs_rerequestable,omitempty"`
}

func (c CheckRun) String() string {
Expand Down
8 changes: 7 additions & 1 deletion github/checks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,9 @@ func Test_CheckSuiteMarshal(t *testing.T) {
HeadCommit: &Commit{
SHA: String("s"),
},
LatestCheckRunsCount: Int64(1),
Rerequstable: Bool(true),
RunsRerequstable: Bool(true),
}

w := fmt.Sprintf(`{
Expand Down Expand Up @@ -949,7 +952,10 @@ func Test_CheckSuiteMarshal(t *testing.T) {
],
"head_commit": {
"sha": "s"
}
},
"latest_check_runs_count": 1,
"rerequestable": true,
"runs_rerequestable": true
}`, ts, ts)

testJSONMarshal(t, &c, w)
Expand Down
24 changes: 24 additions & 0 deletions github/github-accessors.go

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

30 changes: 30 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.

35 changes: 19 additions & 16 deletions github/github-stringify_test.go

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

0 comments on commit ba86215

Please sign in to comment.