This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace github library with graphql (#33)
* Replace github library with graphql Signed-off-by: Anna Jung (VMware) <[email protected]> * Add support for rate limit and other known external responses Signed-off-by: Anna Jung (VMware) <[email protected]>
- Loading branch information
Anna
authored
Feb 22, 2022
1 parent
41779a7
commit b134e8c
Showing
14 changed files
with
1,112 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Copyright 2021 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Copyright 2021 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
query PullRequests($owner: String!, $repo: String!, $cursor: String) { | ||
repository(owner: $owner, name: $repo) { | ||
name | ||
pullRequests(first: 100, after: $cursor) { | ||
nodes { | ||
number | ||
title | ||
author { | ||
login | ||
} | ||
url | ||
state | ||
body | ||
additions | ||
deletions | ||
comments(first: 100) { | ||
totalCount | ||
nodes { | ||
author { | ||
login | ||
} | ||
createdAt | ||
body | ||
updatedAt | ||
reactions(first: 100) { | ||
nodes { | ||
content | ||
createdAt | ||
user { | ||
login | ||
} | ||
} | ||
} | ||
} | ||
} | ||
commits { | ||
totalCount | ||
} | ||
createdAt | ||
closedAt | ||
merged | ||
mergedAt | ||
mergedBy { | ||
login | ||
} | ||
reviews(first: 100) { | ||
totalCount | ||
nodes { | ||
author { | ||
login | ||
} | ||
createdAt | ||
body | ||
updatedAt | ||
} | ||
} | ||
updatedAt | ||
} | ||
pageInfo { | ||
endCursor | ||
hasNextPage | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Copyright 2021 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
query PullRequests($owner: String!, $repo: String!, $cursor: String) { | ||
repository(owner: $owner, name: $repo) { | ||
name | ||
pullRequests(first: 100, after: $cursor) { | ||
nodes { | ||
number | ||
title | ||
author { | ||
login | ||
} | ||
url | ||
state | ||
body | ||
additions | ||
deletions | ||
comments(first: 100) { | ||
totalCount | ||
nodes { | ||
author { | ||
login | ||
} | ||
createdAt | ||
body | ||
updatedAt | ||
} | ||
} | ||
commits { | ||
totalCount | ||
} | ||
createdAt | ||
closedAt | ||
merged | ||
mergedAt | ||
mergedBy { | ||
login | ||
} | ||
reviews(first: 100) { | ||
totalCount | ||
nodes { | ||
author { | ||
login | ||
} | ||
createdAt | ||
body | ||
updatedAt | ||
} | ||
} | ||
updatedAt | ||
} | ||
pageInfo { | ||
endCursor | ||
hasNextPage | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2021 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
query ($owner: String!, $cursor: String) { | ||
organization(login: $owner) { | ||
repositories(first: 100, after: $cursor) { | ||
nodes { | ||
name | ||
} | ||
pageInfo { | ||
endCursor | ||
hasNextPage | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
requests>=2.26.0 | ||
pandas>=1.3.2 | ||
PyGithub>=1.55 | ||
argparse>=1.4.0 | ||
numpy>=1.19.5 | ||
nltk>=3.6.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Copyright 2021 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
49 changes: 49 additions & 0 deletions
49
tests/resources/pr_post_processing_with_reactions_example.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"Number": 1, | ||
"Title": "test-title", | ||
"User": "test-author-login", | ||
"URL": "test-url", | ||
"State": "MERGED", | ||
"Body": "test-body", | ||
"Additions": 2, | ||
"Deletions": 3, | ||
"Comments_Num": 1, | ||
"Commits_Num": 1, | ||
"Created_At": "2000-01-01T01:01:01Z", | ||
"Closed_At": "2000-01-01T01:01:01Z", | ||
"Merged": "True", | ||
"Merged_At": "2000-01-01T01:01:01Z", | ||
"Merged_By": "test-merged-by", | ||
"Review_Comments_Num": 4, | ||
"Updated_At": "2000-01-01T01:01:01Z", | ||
"Comments": [ | ||
{ | ||
"Created_At": "2000-01-01T01:01:01Z", | ||
"User": "test-comment-user", | ||
"Body": "test-comment", | ||
"Updated_At": "2000-01-01T01:01:01Z", | ||
"Reactions": [ | ||
{ | ||
"Content": "test-content", | ||
"Created_At": "2000-01-01T01:01:01Z", | ||
"User": "test-reaction-user" | ||
} | ||
] | ||
} | ||
], | ||
"Review_Comments": [ | ||
{ | ||
"Created_At": "2000-01-01T01:01:01Z", | ||
"User": "test-review-user", | ||
"Body": "test-body", | ||
"Updated_At": "2000-01-01T01:01:01Z", | ||
"Reactions": [ | ||
{ | ||
"Content": "test-content", | ||
"Created_At": "2000-01-01T01:01:01Z", | ||
"User": "test-reaction-user" | ||
} | ||
] | ||
} | ||
] | ||
} |
35 changes: 35 additions & 0 deletions
35
tests/resources/pr_post_processing_without_reactions_example.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"Number": 1, | ||
"Title": "test-title", | ||
"User": "test-author-login", | ||
"URL": "test-url", | ||
"State": "MERGED", | ||
"Body": "test-body", | ||
"Additions": 2, | ||
"Deletions": 3, | ||
"Comments_Num": 1, | ||
"Commits_Num": 1, | ||
"Created_At": "2000-01-01T01:01:01Z", | ||
"Closed_At": "2000-01-01T01:01:01Z", | ||
"Merged": "True", | ||
"Merged_At": "2000-01-01T01:01:01Z", | ||
"Merged_By": "test-merged-by", | ||
"Review_Comments_Num": 4, | ||
"Updated_At": "2000-01-01T01:01:01Z", | ||
"Comments": [ | ||
{ | ||
"Created_At": "2000-01-01T01:01:01Z", | ||
"User": "test-comment-user", | ||
"Body": "test-comment", | ||
"Updated_At": "2000-01-01T01:01:01Z" | ||
} | ||
], | ||
"Review_Comments": [ | ||
{ | ||
"Created_At": "2000-01-01T01:01:01Z", | ||
"User": "test-review-user", | ||
"Body": "test-body", | ||
"Updated_At": "2000-01-01T01:01:01Z" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"number": 1, | ||
"title": "test-title", | ||
"author": { | ||
"login": "test-author-login" | ||
}, | ||
"url": "test-url", | ||
"state": "MERGED", | ||
"body": "test-body", | ||
"additions": 2, | ||
"deletions": 3, | ||
"comments": { | ||
"totalCount": 1, | ||
"nodes": [ | ||
{ | ||
"author": { | ||
"login": "test-comment-user" | ||
}, | ||
"createdAt": "2000-01-01T01:01:01Z", | ||
"body": "test-comment", | ||
"updatedAt": "2000-01-01T01:01:01Z", | ||
"reactions": { | ||
"nodes": [ | ||
{ | ||
"content": "test-content", | ||
"createdAt": "2000-01-01T01:01:01Z", | ||
"user": { | ||
"login": "test-reaction-user" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"commits": { | ||
"totalCount": 1 | ||
}, | ||
"createdAt": "2000-01-01T01:01:01Z", | ||
"closedAt": "2000-01-01T01:01:01Z", | ||
"merged": "True", | ||
"mergedAt": "2000-01-01T01:01:01Z", | ||
"mergedBy": { | ||
"login": "test-merged-by" | ||
}, | ||
"reviews": { | ||
"totalCount": 4, | ||
"nodes": [ | ||
{ | ||
"author": { | ||
"login": "test-review-user" | ||
}, | ||
"createdAt": "2000-01-01T01:01:01Z", | ||
"body": "test-body", | ||
"updatedAt": "2000-01-01T01:01:01Z", | ||
"reactions": { | ||
"nodes": [ | ||
{ | ||
"content": "test-content", | ||
"createdAt": "2000-01-01T01:01:01Z", | ||
"user": { | ||
"login": "test-reaction-user" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"updatedAt": "2000-01-01T01:01:01Z" | ||
} |
Oops, something went wrong.