Skip to content
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 Coveralls support with new /coveralls endpoint #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

snarfed
Copy link
Contributor

@snarfed snarfed commented May 18, 2016

Coveralls (http://coveralls.io/) can send a webhook when it has new coverage data for a change: https://coveralls.zendesk.com/hc/en-us/articles/201774895-Notifications

this adds support for that with a new /coveralls endpoint. it's mostly the same as the /hook/... endpoint, and reuses most of the code, but looks up the GitHub PR based on the commit hash.

it also mildly refactors GithubBot.process_hook a bit to allow unset build_id, since Coveralls doesn't send one in its webhook.

Coveralls (http://coveralls.io/) can send a webhook when it has new coverage data for a change: https://coveralls.zendesk.com/hc/en-us/articles/201774895-Notifications

this adds support for that with a new /coveralls endpoint. it's mostly the same as the /hook/... endpoint, and reuses most of the code, but looks up the GitHub PR based on the commit hash.

it also mildly refactors GithubBot.process_hook a bit to allow unset build_id, since Coveralls doesn't send one in its webhook.
@app.route('/hook/<pull_request_id>/<path:object_key>')
def hook_view(pull_request_id, object_key):
repo_name = request.args.get('repo_name')
def hook(args):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a general hook function now, it might make sense to move it into a file in helpers, keeping this file only for route definitions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! will do.

* move hook helper to helpers/update.py
* expect lang query param in coveralls endpoint
* style and error handling fixes
@snarfed
Copy link
Contributor Author

snarfed commented May 31, 2016

thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants