-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add '!ListPRs' command for GitHub #13
Add '!ListPRs' command for GitHub #13
Conversation
- Enabled Travis testing - Added a "setup.py" - Updated the Docker config - Added tests for Slack sending - Fixed a bug in the quoted argument parsing to support multiple quoted strings. - Full tests for `bot_components/slack_comm.py`
Test support
Hello @apolikamixitos : Can you rebase off of the latest |
d383b3e
to
4df8aac
Compare
…aying tables as attachments)
4df8aac
to
1aa3fb6
Compare
assignee = pr['assignee']['login'] if pr['assignee'] is not None else '-' | ||
rows.append([pr['number'],pr['title'], pr['user']['login'], assignee,pr['state'].title()]) | ||
# Done: | ||
send_raw(data["channel"], text="Repository: *{}* \n\n```{}```".format(reponame, tabulate(rows, headers=headers, tablefmt='orgtbl'))) |
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.
I'm curious to see what this will look like. I typically send messages as attachments so I can use Markdown for formatting. However, this is perfectly fine.
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.
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.
Neat!
'Accept': GITHUB_VERSION | ||
} | ||
|
||
api_part = 'repos/{}/{}/pulls?state={}'.format(org, repo, state) |
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 is a paginated API. Should we only list the default number?
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.
I think for a first version we can go with the default limit, and since the practical usage will be usually just to quick check the most recent PRs (open, closed).
For advanced usage, the user might be interested to perform his actions on the Github search engine directly ...
Add '!ListPRs' command to list pull requests in a repo.
Reorganized the Dockerfile for quick builds
Add 'send_raw' to send raw messages instead of attachments based ones (issues with displaying large tables with attachments)