Open
Description
Much like continuous integration (travis-ci) or code quality checkers (scrutinizer), php-semver-checker-git
should integrate with github in order to provide a status report when a PR is submitted.
To do so, it appears we would need a web service to handle webhooks. Particularly, we need to handle pull request events
- https://developer.github.com/webhooks/#events
- https://developer.github.com/v3/activity/events/types/#pullrequestevent
Then php-semver-checker-git
would most likely need to call the web service when it has completed running on travis-ci
.
I think the following statuses would be sent:
https://developer.github.com/v3/repos/statuses/
{
"state": "pending",
"target_url": "travis-job-url",
"description": "Waiting for analysis to complete...",
"context": "PHP Semantic Versioning Checker"
}
{
"state": "success",
"target_url": "travis-job-url",
"description": "Initial semantic version: $initial<br/>Suggested semantic version: $suggested",
"context": "PHP Semantic Versioning Checker"
}
- Setup a web service
- Handle push events (create a status)
- Handle analysis completion event (update the initial status)
- Optional The whole analysis result could be sent such that we can display the result using our own web page and do usage analytics.
- Add an option to
php-semver-checker-git
to let the webservice know the analysis is done- Determine the repo + sha to send notification to github (see https://github.com/scrutinizer-ci/ocular for an example of how this can be done) (otherwise use
TRAVIS_COMMIT
withTRAVIS_REPO_SLUG
, see https://docs.travis-ci.com/user/environment-variables/) - Call the web service
- Determine the repo + sha to send notification to github (see https://github.com/scrutinizer-ci/ocular for an example of how this can be done) (otherwise use