Skip to content

Commit

Permalink
fix: fix failing lighthouse builds
Browse files Browse the repository at this point in the history
Signed-off-by: ankitm123 <[email protected]>
  • Loading branch information
ankitm123 committed Sep 28, 2022
1 parent 1be6c8e commit 1b997f2
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion scm/driver/azure/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func convertIssueCommentHook(src *issueCommentPullRequestHook) *scm.IssueComment
Email: src.Resource.PullRequest.CreatedBy.UniqueName,
Avatar: src.Resource.PullRequest.CreatedBy.ImageURL,
},
PullRequest: scm.PullRequest{
PullRequest: &scm.PullRequest{
Number: src.Resource.PullRequest.PullRequestID,
Title: src.Resource.PullRequest.Title,
Body: src.Resource.PullRequest.Description,
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/github/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func convertIssue(from *issue) *scm.Issue {
},
ClosedBy: closedBy,
Assignees: convertUsers(from.Assignees),
PullRequest: scm.PullRequest{
PullRequest: &scm.PullRequest{
DiffLink: from.PullRequest.DiffURL,
Link: from.PullRequest.HTMLURL,
},
Expand Down
7 changes: 4 additions & 3 deletions scm/driver/github/issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ func TestIssueSearch(t *testing.T) {
t.Error(err)
}

data, _ := json.Marshal(got)
t.Log(string(data))

_, err = json.Marshal(got)
if err != nil {
t.Error(err)
}
if diff := cmp.Diff(got, want); diff != "" {
t.Errorf("Unexpected Results")
t.Log(diff)
Expand Down
7 changes: 6 additions & 1 deletion scm/driver/github/testdata/issue_search.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"Link": "",
"Created": "0001-01-01T00:00:00Z",
"Updated": "0001-01-01T00:00:00Z"
},
"PullRequest": {
"html_url": null,
"diff_url": null,
"patch_url": null
}
}
]
]
5 changes: 5 additions & 0 deletions scm/driver/github/testdata/webhooks/issue_comment.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
"Labels": [
"bug"
],
"PullRequest": {
"html_url": null,
"diff_url": null,
"patch_url": null
},
"Closed": false,
"Locked": false,
"Author": {
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/github/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func TestWebhooks(t *testing.T) {
},
// deployment
{
name: "deployemnt",
name: "deployment",
event: "deployment",
before: "testdata/webhooks/deployment.json",
after: "testdata/webhooks/deployment.json.golden",
Expand Down
2 changes: 1 addition & 1 deletion scm/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type (
Author User
Assignees []User
ClosedBy *User
PullRequest PullRequest
PullRequest *PullRequest
Created time.Time
Updated time.Time
}
Expand Down
2 changes: 1 addition & 1 deletion scm/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (

// ErrUnknownEvent is returned when the webhook event
// is not recognized by the system.
ErrUnknownEvent = errors.New("Unknown webhook event")
ErrUnknownEvent = errors.New("unknown webhook event")
)

// WebhookKind is the kind of webhook event represented
Expand Down

0 comments on commit 1b997f2

Please sign in to comment.