-
Notifications
You must be signed in to change notification settings - Fork 27
WIP: Add a feature to support checks of the GitHub issue tracker #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
baldeosinghm
wants to merge
48
commits into
master
Choose a base branch
from
issue-76-getissues
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
7114c67
Issues.py- basic code for grabbing issues
9494740
Issues.py prints out all issues' content
c3cb382
Looking at issue comments
4753520
Collecting usernames
2ad387b
Update issues.py
7dcdd58
added specific issue tracker
6298e97
Functions for number of issues and comments made
f4d5c9c
Merge branch 'issue-76-getissues' of github.com:GatorEducator/gatorgr…
9f29417
Added command line functionality for issues and commits
b65108b
Added error handling
77083ef
Changed what issues.py returns to invoke
9f4bf30
Test cases for issues.py
2594bb0
Added PyGithub to Pipfile
4d33917
Attempt to get code to pass travis
4651faf
Updated files to try and pass travis
fcbf2b8
Fixed flake8 issue
9cf379a
Added public repo token for tests
dc900e2
Split key cause I hope it will work
66a75a3
This will work this time
4c52294
Another commit to get this to pass
055ac56
Split Token into 2 parts to pass Travis CI
429dc6a
Merge branch 'issue-76-getissues' of github.com:GatorEducator/gatorgr…
41e7347
Made code in issues.py more uniform
aef913b
Added --state argument for issues
2811aeb
Merge branch 'master' into issue-76-getissues
7e20c67
Relock file
2d674ff
added test case for orchestrate.check_issues()
quigley-c 573fce4
added test for orchestrate.check_issue_comments
quigley-c 69fd9b1
added whitespace after token fragment definition
quigley-c f313094
fixed pylint line-break errors in arguments, orchestrate, and invoke
quigley-c 33dc3d9
re-added quotations in docstring
quigley-c 8333a14
fixed indentation warning in arguments for flake8
quigley-c 3890804
fixed binary operator flake8 errors in arguments.py
quigley-c 4d97d42
add test case to invoke.py
yeej2 676baa9
testing travis
yeej2 eb033b3
reformat test_invoke.py
yeej2 680d598
reformat files for travis
yeej2 a5e0e80
reformat files for travis
yeej2 772a616
lint files for travis
yeej2 f4fe1e2
added pylint disable to invoke.py
yeej2 2f53c3d
Finish test cases for invoke.py
yeej2 e847e78
add test cover for arguments.py
yeej2 ea774f0
add test case for line 251 in arguements.py
yeej2 20e6d54
add test for is_valid_state in arguments.py
yeej2 5ac4157
Finish code coverage for arguments.py
yeej2 6647bdd
fix code coverage
yeej2 53a297a
Fix test cases in test_issues
yeej2 2739097
Merge branch 'master' into issue-76-getissues
Michionlion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains hidden or 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 hidden or 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 hidden or 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,45 @@ | ||
| """Get issues from the Github issue tracker and performs checks on them""" | ||
|
|
||
| from github import Github | ||
| from github.GithubException import UnknownObjectException, BadCredentialsException | ||
|
|
||
|
|
||
| def check_issues_made(token, repo, name, expected, issue_state): | ||
| """Returns the number of issues that the given user has made""" | ||
| # github access | ||
| g = Github(token) | ||
| # gets the repo | ||
| try: | ||
| repo = g.get_repo(repo) | ||
| except BadCredentialsException: | ||
| return False, 0, -1 | ||
| except UnknownObjectException: | ||
| return False, 0, -2 | ||
| issues_made = 0 | ||
| for issue in repo.get_issues(state=issue_state): | ||
| if issue.user.login == name and issue.pull_request is None: | ||
| issues_made += 1 | ||
| if issues_made >= expected: | ||
| return True, issues_made, 0 | ||
| return issues_made >= expected, issues_made, 0 | ||
|
|
||
|
|
||
| def check_comments_made(token, repo, name, expected, issue_state): | ||
| """Returns the number of comments that the given user has made""" | ||
| # github access | ||
| g = Github(token) | ||
| # gets the repo | ||
| try: | ||
| repo = g.get_repo(repo) | ||
| except BadCredentialsException: | ||
| return False, 0, -1 | ||
| except UnknownObjectException: | ||
| return False, 0, -2 | ||
| comments_made = 0 | ||
| for issue in repo.get_issues(state=issue_state): | ||
| for comment in issue.get_comments(): | ||
| if comment.user.login == name and issue.pull_request is None: | ||
| comments_made += 1 | ||
| if comments_made >= expected: | ||
| return True, comments_made, 0 | ||
| return comments_made >= expected, comments_made, 0 |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list is likely not correct -- there are not 6 different ways to call the check, right? These need to validate the combinations of arguments. How do you combine
--nameand--issue, for instance?