This repository has been archived by the owner on Oct 8, 2020. It is now read-only.
forked from LegNeato/bugzilla-push
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
149 lines (134 loc) · 4.14 KB
/
README
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
bmo / pulse integration
=======================
notes to include in this document:
- publishes each change in bmo to pulse
- will support multiple connectors
- initially just pulse
- want to push bug metadata into an elastic-search cluster
- comments require two new hook for bugzilla 4.0
- comments are sent in a seperate message from bug meta changes
- talk about objects vs data values
- objects always contain 'id', and generally 'name'
- if an object field is no set ==> undef (eg bug:milestone)
- currently untested on bugzilla 4.2 or higher
message structure:
- always contains an "event" hash
- user: actor object
- action: "create" or "modify"
- target: name of the object the change was actioned on (eg "bug")
- time: when
- always contains an event.target hash
sample message:
{
"bug" : {
"alias" : "",
"assigned_to" : {
"id" : 13647,
"login" : "[email protected]",
"real_name" : "byron jones [:glob]"
},
"cf_blocking_191" : "",
"cf_blocking_192" : "",
"cf_blocking_20" : "",
"cf_blocking_fennec" : "",
"cf_blocking_fx" : "",
"cf_crash_signature" : "",
"cf_status_191" : "",
"cf_status_192" : "",
"cf_status_20" : "",
"cf_status_firefox5" : "",
"classification" : "Components",
"component" : {
"id" : 539,
"name" : "General"
},
"creation_time" : "2011-12-06T09:18:00",
"flags" : [],
"id" : 648667,
"keywords" : [
"regression"
],
"last_change_time" : "2011-12-06T09:44:23",
"operating_system" : "Mac OS X",
"platform" : "x86",
"priority" : "",
"product" : {
"id" : 1,
"name" : "Core"
},
"reporter" : {
"id" : 13647,
"login" : "[email protected]",
"real_name" : "byron jones [:glob]"
},
"resolution" : "",
"severity" : "normal",
"status" : {
"id" : 3,
"name" : "ASSIGNED"
},
"summary" : "test",
"target_milestone" : null,
"url" : "",
"version" : {
"id" : 355,
"name" : "unspecified"
},
"whiteboard" : ""
},
"event" : {
"action" : "modify",
"changes" : [
{
"added" : "[email protected]",
"field" : "assigned_to",
"removed" : "[email protected]",
}
],
"target" : "bug",
"time" : "2011-12-06T09:45:52",
"user" : {
"id" : 13647,
"login" : "[email protected]",
"real_name" : "byron jones [:glob]"
}
}
}
flow
- the bugzilla extension inserts messages into a 'push' table
- a daemon polls the table and calls on each connector to publish the message
- as order is important, we need to manage transient failures
poe daemon : polling 'push' table
foreach connector (connectors)
# check if a connector is backlogged
if (count(table.push_backlog[connector]) > 0)
connector.backlogged = true
else
connector.backlogged = false
# process each pending message
foreach message (table.push[oldest first])
foreach connector (connectors)
if (!connector.backlogged)
result = connector.send(message)
if (result == transient_failure)
log transient error
connector.backlogged = true
else if (result == permanant_failure)
log failure
else
log success
if (connector.backlogged)
insert into table.push_backlog[connector]
delete message from table.push
# process backlog
foreach connector (connectors)
foreach message (table.push_backlog[connector])
result = connector.send(message)
if (result == transient_failure)
log transient error
break out of foreach message loop
else if (result == permanant_failure
log failure
else
log success
delete message from table.push_backlog