Skip to content

Commit

Permalink
Change PushEvent.Pusher type to CommitAuthor (google#2999)
Browse files Browse the repository at this point in the history
Fixes: google#2998.
  • Loading branch information
caseyduquettesc authored and gmlewis committed Dec 19, 2023
1 parent b0181bb commit c7a9ad7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion github/event_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ type PushEvent struct {
Compare *string `json:"compare,omitempty"`
Repo *PushEventRepository `json:"repository,omitempty"`
HeadCommit *HeadCommit `json:"head_commit,omitempty"`
Pusher *User `json:"pusher,omitempty"`
Pusher *CommitAuthor `json:"pusher,omitempty"`
Sender *User `json:"sender,omitempty"`
Installation *Installation `json:"installation,omitempty"`

Expand Down
24 changes: 9 additions & 15 deletions github/event_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3777,14 +3777,11 @@ func TestPushEvent_Marshal(t *testing.T) {
Compare: String("a"),
Repo: &PushEventRepository{ID: Int64(1)},
HeadCommit: &HeadCommit{ID: String("id")},
Pusher: &User{
Login: String("l"),
ID: Int64(1),
NodeID: String("n"),
URL: String("u"),
ReposURL: String("r"),
EventsURL: String("e"),
AvatarURL: String("a"),
Pusher: &CommitAuthor{
Login: String("l"),
Date: &Timestamp{referenceTime},
Name: String("n"),
Email: String("e"),
},
Sender: &User{
Login: String("l"),
Expand Down Expand Up @@ -3937,13 +3934,10 @@ func TestPushEvent_Marshal(t *testing.T) {
"id": "id"
},
"pusher": {
"login": "l",
"id": 1,
"node_id": "n",
"avatar_url": "a",
"url": "u",
"events_url": "e",
"repos_url": "r"
"date": ` + referenceTimeStr + `,
"name": "n",
"email": "e",
"username": "l"
},
"sender": {
"login": "l",
Expand Down
2 changes: 1 addition & 1 deletion github/github-accessors.go

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

4 changes: 2 additions & 2 deletions github/github-stringify_test.go

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

6 changes: 2 additions & 4 deletions github/repos_hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,8 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) {
Organization: &Organization{
ID: Int64(22),
},
Pusher: &User{
Pusher: &CommitAuthor{
Login: String("[email protected]"),
ID: Int64(112),
},
Repo: &PushEventRepository{
ID: Int64(321),
Expand Down Expand Up @@ -421,8 +420,7 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) {
"id" : 22
},
"pusher":{
"login": "[email protected]",
"id": 112
"username": "[email protected]"
},
"repository":{
"id": 321,
Expand Down

0 comments on commit c7a9ad7

Please sign in to comment.