Giter VIP home page Giter VIP logo

codeclimate-services's Introduction

Code Climate Services

A collection of classes, each responsible for integrating one external service with the Code Climate system.

Overview

Services define #receive_<event> methods for any events they are interested in. These methods will be invoked with @payload set to a hash of data about the event being handled.

The structure of this data is described below. Note that there may be additional keys not listed here.

Events

Attributes common to all event types:

{
  "repo_name": String,
  "details_url": String
}

Coverage

Event name: coverage

Event-specific attributes:

{
  "covered_percent": Float,
  "previous_covered_percent": Float,
  "covered_percent_delta": Float,
  "compare_url": String
}

Quality

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
}

Vulnerability

Event name: vulnerability

Event-specific attributes:

{
  "warning_type": String,
  "vulnerabilities": [{
    "warning_type": String,
    "location": String
  }, {
    // ...
  }]
}

Note: The reason for the top-level warning_type attribute is for when the list of vulnerabilities are of mixed warning types. In this case, the top-level attribute can be used in any messaging.

Pull Request

Event name: pull_request

Event-specific attributes:

{
  "state": String, // "pending", or "success"
  "github_slug": String, // user/repo
  "number": String,
  "commit_sha": String,
}

Other Events

The following are not fully implemented yet.

  • snapshot

Contributing

To add a new integration, you'll need to create a new Service subclass. Please use existing services as an example:

Ensure that your class implements #receive_test. It must handle any exceptions and 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. Example.

License

See LICENSE.txt. This incorporates code from bugsnag-notification-plugins and github-services, both MIT licensed.

codeclimate-services's People

Contributors

brynary avatar jonathancadepowers avatar mrb avatar noahd1 avatar pbrisbin avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.