- Notifications
You must be signed in to change notification settings - Fork9
codeclimate/codeclimate-services
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A collection of classes, each responsible for integrating one external servicewith the Code Climate system.
Services define#receive_<event>
methods for any events they are interestedin. These methods will be invoked with@payload
set to a hash of data aboutthe event being handled.
The structure of this data is described below. Note that there may be additionalkeys not listed here.
Attributes common to all event types:
{"repo_name":String,"details_url":String}
Event name:coverage
Event-specific attributes:
{"covered_percent":Float,"previous_covered_percent":Float,"covered_percent_delta":Float,"compare_url":String}
Event name:quality
Event-specific attributes:
{"constant_name":String,"rating":String,// "A", "B", "C", etc"previous_rating":String,"remediation_cost":Float,"previous_remediation_cost":Float,"compare_url":String}
Event name:vulnerability
Event-specific attributes:
{"warning_type":String,"vulnerabilities":[{"warning_type":String,"location":String},{// ...}]}
Note: The reason for the top-levelwarning_type
attribute is for when thelist of vulnerabilities are of mixed warning types. In this case, the top-levelattribute can be used in any messaging.
Event name:pull_request
Event-specific attributes:
{"state":String,// "pending", or "success""github_slug":String,// user/repo"number":String,"commit_sha":String,}
Event name:pull_request_coverage
Event-specific attributes:
{"state":String,// "pending", "success", or "failure""github_slug":String,// user/repo"number":String,"commit_sha":String,"covered_percent_delta":Float,}
The following are not fully implemented yet.
snapshot
To add a new integration, you'll need to create a newService
subclass. Pleaseuse existing services as an example:
- Chat service examples:hipchat,campfire
- Issue tracker examples:github_issues,lighthouse
Ensure that your class implements#receive_test
. It must handle any exceptionsand always return a hash of{ ok: true|false, message: "String (HTML ok)" }
.Example.
When you open your PR, please include an image for your service.
- Bump the version on
lib/cc/services/version
- A gem owner developer should run the following: (check owners herehttps://rubygems.org/gems/codeclimate-services)
bundle installgem build codeclimate-services.gemspecgem push codeclimate-services-<VERSION>.gemgit tag v<VERSION>git push origin master --tags
See LICENSE.txt. This incorporates code from bugsnag-notification-plugins andgithub-services, both MIT licensed.
About
Code Climate services
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.