Skip to content

Commit 62fe8d0

Browse files
removed some uncesserary changes to testdata
1 parent 1950225 commit 62fe8d0

8 files changed

+73
-132
lines changed

github/payload.go

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@ type CheckPullRequest struct {
3131
type CheckRunPayload struct {
3232
Action string `json:"action"`
3333
CheckRun struct {
34-
ID int64 `json:"id"`
35-
NodeID string `json:"node_id"`
36-
Name string `json:"name"`
37-
HeadSHA string `json:"head_sha"`
38-
Status string `json:"status"`
39-
Conclusion string `json:"conclusion"`
40-
URL string `json:"url"`
41-
HtmlURL string `json:"html_url"`
42-
StarterAt time.Time `json:"started_at"`
43-
CompletedAt time.Time `json:"completed_at"`
44-
DetailsURL string `json:"details_url"`
45-
ExternalID string `json:"external_id"`
34+
ID int64 `json:"id"`
35+
NodeID string `json:"node_id"`
36+
Name string `json:"name"`
37+
HeadSHA string `json:"head_sha"`
38+
Status string `json:"status"`
39+
Conclusion *string `json:"conclusion"`
40+
URL string `json:"url"`
41+
HtmlURL string `json:"html_url"`
42+
StarterAt time.Time `json:"started_at"`
43+
CompletedAt *time.Time `json:"completed_at"`
44+
DetailsURL string `json:"details_url"`
45+
ExternalID string `json:"external_id"`
4646
Output struct {
47-
Title string `json:"title"`
48-
Summary string `json:"summary"`
49-
Text string `json:"text"`
50-
AnnotationsCount int64 `json:"annotations_count"`
51-
AnnotationsURL string `json:"annotations_url"`
47+
Title *string `json:"title"`
48+
Summary *string `json:"summary"`
49+
Text *string `json:"text"`
50+
AnnotationsCount int64 `json:"annotations_count"`
51+
AnnotationsURL string `json:"annotations_url"`
5252
} `json:"output"`
5353
CheckSuite struct {
5454
ID int64 `json:"id"`
5555
NodeID string `json:"node_id"`
5656
HeadBranch string `json:"head_branch"`
5757
HeadSHA string `json:"head_sha"`
5858
Status string `json:"status"`
59-
Conclusion string `json:"conclusion"`
59+
Conclusion *string `json:"conclusion"`
6060
URL string `json:"url"`
6161
Before string `json:"before"`
6262
After string `json:"after"`
@@ -82,7 +82,7 @@ type CheckSuitePayload struct {
8282
HeadBranch string `json:"head_branch"`
8383
HeadSHA string `json:"head_sha"`
8484
Status string `json:"status"`
85-
Conclusion string `json:"conclusion"`
85+
Conclusion *string `json:"conclusion"`
8686
URL string `json:"url"`
8787
Before string `json:"before"`
8888
After string `json:"after"`
@@ -654,7 +654,7 @@ type PullRequestReviewPayload struct {
654654
CommitID string `json:"commit_id"`
655655
AuthorAssociation string `json:"author_association"`
656656
User User `json:"user"`
657-
Body string `json:"body"`
657+
Body *string `json:"body"`
658658
SubmittedAt time.Time `json:"submitted_at"`
659659
State string `json:"state"`
660660
HTMLURL string `json:"html_url"`
@@ -705,7 +705,8 @@ type PullRequestReviewCommentPayload struct {
705705
Href string `json:"href"`
706706
} `json:"pull_request"`
707707
} `json:"_links"`
708-
InReplyToID int64 `json:"in_reply_to_id"` //TODO this is not in the unmodified payload example on github docs
708+
//TODO this is not in the payload example on github docs
709+
// InReplyToID int64 `json:"in_reply_to_id"`
709710
PullRequestReviewID int64 `json:"pull_request_review_id"`
710711
} `json:"comment"`
711712
PullRequest ReviewPullRequest `json:"pull_request"`

scrape/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func main() {
117117
collected := collect()
118118
fmt.Printf("Found %s examle payloads. \n", len(collected))
119119
root, _ := os.Getwd()
120-
folder := path.Join(root, "tmp")
120+
folder := path.Join(root, "testdata/github")
121121
if _, err := os.Stat(folder); os.IsNotExist(err) {
122122
os.Mkdir(folder, 0777)
123123
}

testdata/github/check-run.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"id": 128620228,
55
"node_id": "MDg6Q2hlY2tSdW4xMjg2MjAyMjg=",
66
"head_sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821",
7-
"external_id": "123",
7+
"external_id": "",
88
"url": "https://api.github.com/repos/Codertocat/Hello-World/check-runs/128620228",
99
"html_url": "https://github.com/Codertocat/Hello-World/runs/128620228",
1010
"details_url": "https://octocoders.io",
1111
"status": "queued",
12-
"conclusion": "success",
12+
"conclusion": null,
1313
"started_at": "2019-05-15T15:21:12Z",
14-
"completed_at": "2019-05-15T15:21:12Z",
14+
"completed_at": null,
1515
"output": {
16-
"title": "title",
17-
"summary": "summary",
18-
"text": "some text",
16+
"title": null,
17+
"summary": null,
18+
"text": null,
1919
"annotations_count": 0,
2020
"annotations_url": "https://api.github.com/repos/Codertocat/Hello-World/check-runs/128620228/annotations"
2121
},
@@ -26,7 +26,7 @@
2626
"head_branch": "changes",
2727
"head_sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821",
2828
"status": "queued",
29-
"conclusion": "success",
29+
"conclusion": null,
3030
"url": "https://api.github.com/repos/Codertocat/Hello-World/check-suites/118578147",
3131
"before": "6113728f27ae82c7b1a177c8d03f9e96e0adf246",
3232
"after": "ec26c3e57ca3a959ca5aad62de7213c562f8c821",
@@ -105,7 +105,9 @@
105105
"team_discussions": "write",
106106
"vulnerability_alerts": "read"
107107
},
108-
"events": []
108+
"events": [
109+
110+
]
109111
},
110112
"created_at": "2019-05-15T15:20:31Z",
111113
"updated_at": "2019-05-15T15:20:31Z"
@@ -160,7 +162,9 @@
160162
"team_discussions": "write",
161163
"vulnerability_alerts": "read"
162164
},
163-
"events": []
165+
"events": [
166+
167+
]
164168
},
165169
"pull_requests": [
166170
{
@@ -215,7 +219,7 @@
215219
"site_admin": false
216220
},
217221
"html_url": "https://github.com/Codertocat/Hello-World",
218-
"description": "test",
222+
"description": null,
219223
"fork": false,
220224
"url": "https://api.github.com/repos/Codertocat/Hello-World",
221225
"forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks",
@@ -276,7 +280,7 @@
276280
"archived": false,
277281
"disabled": false,
278282
"open_issues_count": 2,
279-
"license": "licence",
283+
"license": null,
280284
"forks": 1,
281285
"open_issues": 2,
282286
"watchers": 0,

testdata/github/check-suite.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@
8585
"team_discussions": "write",
8686
"vulnerability_alerts": "read"
8787
},
88-
"events": []
88+
"events": [
89+
90+
]
8991
},
9092
"created_at": "2019-05-15T15:20:31Z",
9193
"updated_at": "2019-05-15T15:21:14Z",
@@ -133,7 +135,7 @@
133135
"site_admin": false
134136
},
135137
"html_url": "https://github.com/Codertocat/Hello-World",
136-
"description": "desc",
138+
"description": null,
137139
"fork": false,
138140
"url": "https://api.github.com/repos/Codertocat/Hello-World",
139141
"forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks",

testdata/github/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"type": "User",
4141
"site_admin": false
4242
},
43-
"disabled": false,
4443
"private": false,
4544
"html_url": "https://github.com/Codertocat/Hello-World",
4645
"description": null,
@@ -102,6 +101,7 @@
102101
"forks_count": 0,
103102
"mirror_url": null,
104103
"archived": false,
104+
"disabled": false,
105105
"open_issues_count": 1,
106106
"license": null,
107107
"forks": 0,

testdata/github/pull-request-review-comment.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"comment": {
44
"url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments/284312630",
55
"pull_request_review_id": 237895671,
6-
"in_reply_to_id": 456545654,
76
"id": 284312630,
87
"node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4NDMxMjYzMA==",
98
"diff_hunk": "@@ -1 +1 @@\n-# Hello-World",
@@ -89,10 +88,18 @@
8988
"merged_at": null,
9089
"merge_commit_sha": "c4295bd74fb0f4fda03689c3df3f2803b658fd85",
9190
"assignee": null,
92-
"assignees": [],
93-
"requested_reviewers": [],
94-
"requested_teams": [],
95-
"labels": [],
91+
"assignees": [
92+
93+
],
94+
"requested_reviewers": [
95+
96+
],
97+
"requested_teams": [
98+
99+
],
100+
"labels": [
101+
102+
],
96103
"milestone": null,
97104
"commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits",
98105
"review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments",

testdata/github/pull-request-review.json

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"type": "User",
2424
"site_admin": false
2525
},
26-
"body": "this is awesome",
26+
"body": null,
2727
"commit_id": "ec26c3e57ca3a959ca5aad62de7213c562f8c821",
2828
"submitted_at": "2019-05-15T15:20:38Z",
2929
"state": "commented",
@@ -78,24 +78,18 @@
7878
"merged_at": null,
7979
"merge_commit_sha": "c4295bd74fb0f4fda03689c3df3f2803b658fd85",
8080
"assignee": null,
81-
"assignees": [],
82-
"requested_reviewers": [],
81+
"assignees": [
82+
83+
],
84+
"requested_reviewers": [
85+
86+
],
8387
"requested_teams": [
84-
{
85-
"name": "go-team",
86-
"id": 123456,
87-
"node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=",
88-
"slug": "go-team",
89-
"description": "test team",
90-
"privacy": "i dont know",
91-
"url": "https://api.github.com/users/Codertocat",
92-
"html_url": "https://github.com/Codertocat",
93-
"members_url": "http???",
94-
"repositories_url": "http???",
95-
"permission": "???"
96-
}
88+
89+
],
90+
"labels": [
91+
9792
],
98-
"labels": [],
9993
"milestone": null,
10094
"commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits",
10195
"review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments",

testdata/github/pull-request.json

Lines changed: 7 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -39,86 +39,19 @@
3939
"closed_at": null,
4040
"merged_at": null,
4141
"merge_commit_sha": null,
42-
"assignee": {
43-
"login": "Codertocat6",
44-
"id": 21031067,
45-
"node_id": "MDQ6VXNlcjIxMDMxMDY3",
46-
"avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
47-
"gravatar_id": "",
48-
"url": "https://api.github.com/users/Codertocat",
49-
"html_url": "https://github.com/Codertocat",
50-
"followers_url": "https://api.github.com/users/Codertocat/followers",
51-
"following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
52-
"gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
53-
"starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
54-
"subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
55-
"organizations_url": "https://api.github.com/users/Codertocat/orgs",
56-
"repos_url": "https://api.github.com/users/Codertocat/repos",
57-
"events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
58-
"received_events_url": "https://api.github.com/users/Codertocat/received_events",
59-
"type": "User",
60-
"site_admin": false
61-
},
42+
"assignee": null,
6243
"assignees": [
63-
{
64-
"login": "Codertocat8",
65-
"id": 21031067,
66-
"node_id": "MDQ6VXNlcjIxMDMxMDY3",
67-
"avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
68-
"gravatar_id": "",
69-
"url": "https://api.github.com/users/Codertocat",
70-
"html_url": "https://github.com/Codertocat",
71-
"followers_url": "https://api.github.com/users/Codertocat/followers",
72-
"following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
73-
"gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
74-
"starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
75-
"subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
76-
"organizations_url": "https://api.github.com/users/Codertocat/orgs",
77-
"repos_url": "https://api.github.com/users/Codertocat/repos",
78-
"events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
79-
"received_events_url": "https://api.github.com/users/Codertocat/received_events",
80-
"type": "User",
81-
"site_admin": false
82-
}
44+
8345
],
8446
"requested_reviewers": [
85-
{
86-
"login": "Codertocat5",
87-
"id": 21031067,
88-
"node_id": "MDQ6VXNlcjIxMDMxMDY3",
89-
"avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
90-
"gravatar_id": "",
91-
"url": "https://api.github.com/users/Codertocat",
92-
"html_url": "https://github.com/Codertocat",
93-
"followers_url": "https://api.github.com/users/Codertocat/followers",
94-
"following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
95-
"gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
96-
"starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
97-
"subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
98-
"organizations_url": "https://api.github.com/users/Codertocat/orgs",
99-
"repos_url": "https://api.github.com/users/Codertocat/repos",
100-
"events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
101-
"received_events_url": "https://api.github.com/users/Codertocat/received_events",
102-
"type": "User",
103-
"site_admin": false
104-
}
47+
10548
],
10649
"requested_teams": [
107-
{
108-
"name": "go-team",
109-
"id": 123456,
110-
"node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=",
111-
"slug": "go-team",
112-
"description": "test team",
113-
"privacy": "i dont know",
114-
"url": "https://api.github.com/users/Codertocat",
115-
"html_url": "https://github.com/Codertocat",
116-
"members_url": "http???",
117-
"repositories_url": "http???",
118-
"permission": "???"
119-
}
50+
51+
],
52+
"labels": [
53+
12054
],
121-
"labels": [],
12255
"milestone": null,
12356
"commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits",
12457
"review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments",

0 commit comments

Comments
 (0)