-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.yaml
125 lines (112 loc) · 5.1 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Example configuration. This is mapped to the data class [sims.michael.gerritslackbot.model.Config]
# Incoming Webhook URL - required
# See https://api.slack.com/incoming-webhooks for details
Slack incoming webhook URL: "https://hooks.slack.example.com/services/id"
# The script buffers gerrit events as "bursts". A burst is a group of events that are followed by a minimum amount
# of time with no more events. This config option sets the buffer timeout. (optional - defaults to 15 seconds)
Event buffer timeout in seconds: 15
# Slack message configuration - required
#
# All properties are optional.
#
# - username: if null or empty Incoming Webhook configured user name will be used
# - iconUrl: if null or empty Incoming Webhook configured user icon will be used
# - gerritUrl: base Gerrit URL used to render change links in Slack notifications. If null base Gerrit url
# will be retrieved from ChangeEvent data. This can be helpful in cases when Gerrit is behind reverse http proxy
# - directMessagesEnabled: The script can send direct messages when recognized users are added as reviewers.
# To enable this, set directMessagesEnabled to true
# - mergedChangeEmoji: If this list is present and non-empty, an emoji from it will be selected for notifications
# for merged change events. Use if you want to have fun celebrating a change getting merged. :)
Slack message configuration: # required
username: "Gerrit Review Bot"
iconUrl: "http://www.example.com/icon.png"
# gerritUrl: "http://localhost:8080/gerrit"
directMessagesEnabled: false
mergedChangeEmojiList:
- ":clapping:"
- ":parrotbeer:"
- ":beers:"
- ":bomb:"
- ":animal:"
- ":badger:"
- ":homerscream:"
- ":squirrel:"
- ":success:"
- ":arrrggghhh:"
- ":aw_yeah:"
- ":blondesassyparrot:"
- ":borat:"
- ":bowdown:"
- ":celebrate:"
- ":dancing-penguin:"
- ":dancing_penguin:"
- ":dancingfood:"
- ":headbang2:"
# Gerrit stream configuration - required
#
# - SSH host (required)
# - port is ssh port. Can be omitted in which case default 22 port will be used
# - username - Gerrit username allowed to subscribe to stream-events (required)
# - privateKeyLocations is a list of paths to SSH private keys to use, which can be
# omitted if your ssh_config file provides the necessary details.
Gerrit stream configuration:
host: "gerrit.example.com"
port: 22
username: "username"
privateKeyLocations:
- "/home/gerrit-slack-bot/.ssh/gerrit_service_rsa"
# Maps gerrit usernames to Slack usernames. This is used to describe events and additionally is required for
# direct messages for reviewer added events.
Gerrit to Slack username mappings:
"gerrit_username": "slack_username"
# List of event matchers - required
#
# This is a list of matcher definitions for gerrit stream events. Each item in the list has the following properties:
# - project - regular expression to match on any part of project (match is case-insensitive) or "*" to match all - required
# - branch - regular expression to match on any part of branch (match is case-insensitive) or "*" to match all - required
# - subject - regular expression to match on any part of subject (match is case-insensitive) or "*" to match all - required
# - isVerificationOnly - boolean to match on comment added events that contain only verification approvals - optional
# missing or null means match both verifications and non-verifications
# Note that a verification approval that is accompanied by a code review approval is considered a "non-verification"
# for the purposes of this test
# - changeKind - boolean to match on the "kind" of patch if it is a patchset-created event - optional
# missing or null means match any change kind
# commonly used to avoid notifying for trivial rebases or no code changes
# - channel - channel to notify - optional. If missing, the event will be dropped (used for filtering unwanted events)
#
# Note that order matters... each event will be matched against each matcher in order and the first match wins.
Event matchers:
# By default no notifications will be sent without removing this matcher! It matches all events and consumes them
# without sending a notification, since the channel property is null (missing)
- project: "*"
branch: "*"
subject: "*"
# Drop all commits that start with WIP in the subject
#- project: "*"
# branch: "*"
# subject: "^WIP: "
# Drop all commits where project name starts with 'sandbox/'
#- project: "^sandbox/.*"
# branch: "*"
# subject: "*"
# Drop all commits where branch name starts with 'sandbox/'
#- project: "*"
# branch: "^sandbox/.*"
# subject: "*"
# Drop all verifications... matchers with null/missing channel consume the event without notifying
#- project: "*"
# branch: "*"
# subject: "*"
# isVerificationOnly: true
# Send all REWORK commits from feature-branch on project-one to #feature-branch-channel
#- project: "project-one"
# branch: "feature-branch"
# subject: "*"
# changeKind: "REWORK"
# channel: "#feature-branch-channel"
# Send all REWORK commits from project-two to #other-channel
#- project: "project-two"
# branch: "*"
# subject: "*"
# changeKind: "REWORK"
# channel: "#other-channel"