1
1
# Code Climate Services
2
2
3
+ A collection of classes, each responsible for integrating one external service
4
+ with the Code Climate system.
5
+
6
+ ## Overview
7
+
8
+ Services define ` #receive_<event> ` methods for any events they are interested
9
+ in. These methods will be invoked with ` @payload ` set to a hash of data about
10
+ the event being handled.
11
+
12
+ The structure of this data is described below. Note that there may be additional
13
+ keys not listed here.
14
+
3
15
## Events
4
16
5
17
Attributes common to all event types:
@@ -61,6 +73,10 @@ Event-specific attributes:
61
73
}
62
74
```
63
75
76
+ * Note* : The reason for the top-level ` warning_type ` attribute is for when the
77
+ list of vulnerabilities are of mixed warning types. In this case, the top-level
78
+ attribute can be used in any messaging.
79
+
64
80
### Pull Request
65
81
66
82
Event name: ` pull_request `
@@ -80,9 +96,23 @@ Event-specific attributes:
80
96
81
97
The following are not fully implemented yet.
82
98
83
- * : issue
84
- * : unit
85
- * : snapshot
99
+ * ` snapshot `
100
+
101
+ ## Contributing
102
+
103
+ To add a new integration, you'll need to create a new ` Service ` subclass. Please
104
+ use existing services as an example:
105
+
106
+ - Chat service examples: ` hipchat ` , ` campfire `
107
+ - Issue tracker examples: ` github_issues ` , ` lighthouse `
108
+
109
+ Ensure that your class implements ` #receive_test ` . It must handle any exceptions
110
+ and always return a hash of ` { ok: true|false, message: "String (HTML ok)" } ` .
111
+
112
+ When you open your PR, please include an image for your service.
113
+ [ Example] [ service_avatar ] .
114
+
115
+ [ service_avatar ] : https://codeclimate.com/assets/integration_icons/campfire-9f0475f77133a3ff5267972436dead60.png
86
116
87
117
## License
88
118
0 commit comments