summaryrefslogtreecommitdiffstats
path: root/Documentation/cmd-stream-events.txt
blob: 6da0ef02429b82a6d85762a5487dd1f0c835a94f (plain)
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
gerrit stream-events
====================

NAME
----
gerrit stream-events - Monitor events occurring in real time

SYNOPSIS
--------
[verse]
'ssh' -p <port> <host> 'gerrit stream-events'

DESCRIPTION
-----------

Provides a portal into the major events occurring on the server,
outputing activity data in real-time to the client.  Events are
filtered by the caller's access permissions, ensuring the caller
only receives events for changes they can view on the web, or in
the project repository.

Event output is in JSON, one event per line.

ACCESS
------
Caller must be a member of the privileged 'Administrators' group,
or have been granted
link:access-control.html#capability_streamEvents[the 'Stream Events' global capability].

SCRIPTING
---------
This command is intended to be used in scripts.

EXAMPLES
--------

====
  $ ssh -p 29418 review.example.com gerrit stream-events
  {"type":"comment-added",change:{"project":"tools/gerrit", ...}, ...}
  {"type":"comment-added",change:{"project":"tools/gerrit", ...}, ...}
====

SCHEMA
------
The JSON messages consist of nested objects referencing the *change*,
*patchSet*, *account* involved, and other attributes as appropriate.
The currently supported message types are *patchset-created*,
*draft-published*, *change-abandoned*, *change-restored*,
*change-merged*, *merge-failed*, *comment-added*, *ref-updated* and
*reviewer-added*.

Note that any field may be missing in the JSON messages, so consumers of
this JSON stream should deal with that appropriately.

Events
~~~~~~
Patchset Created
^^^^^^^^^^^^^^^^
type:: "patchset-created"

change:: link:json.html#change[change attribute]

patchSet:: link:json.html#patchSet[patchSet attribute]

uploader:: link:json.html#account[account attribute]

Draft Published
^^^^^^^^^^^^^^^
type:: "draft-published"

change:: link:json.html#change[change attribute]

patchset:: link:json.html#patchSet[patchset attribute]

uploader:: link:json.html#account[account attribute]

Change Abandoned
^^^^^^^^^^^^^^^^
type:: "change-abandoned"

change:: link:json.html#change[change attribute]

patchSet:: link:json.html#patchSet[patchSet attribute]

abandoner:: link:json.html#account[account attribute]

reason:: Reason for abandoning the change.

Change Restored
^^^^^^^^^^^^^^^
type:: "change-restored"

change:: link:json.html#change[change attribute]

patchSet:: link:json.html#patchSet[patchSet attribute]

restorer:: link:json.html#account[account attribute]

reason:: Reason for restoring the change.

Change Merged
^^^^^^^^^^^^^
type:: "change-merged"

change:: link:json.html#change[change attribute]

patchSet:: link:json.html#patchSet[patchSet attribute]

submitter:: link:json.html#account[account attribute]

Merge Failed
^^^^^^^^^^^^
type:: "merge-failed"

change:: link:json.html#change[change attribute]

patchSet:: link:json.html#patchSet[patchSet attribute]

submitter:: link:json.html#account[account attribute]

reason:: Reason that the merge failed.

Comment Added
^^^^^^^^^^^^^
type:: "comment-added"

change:: link:json.html#change[change attribute]

patchSet:: link:json.html#patchSet[patchSet attribute]

author:: link:json.html#account[account attribute]

approvals:: All link:json.html#approval[approval attributes] granted.

comment:: Comment text author had written

Ref Updated
^^^^^^^^^^^
type:: "ref-updated"

submitter:: link:json.html#account[account attribute]

refUpdate:: link:json.html#refUpdate[refUpdate attribute]

Reviewer Added
^^^^^^^^^^^^^^
type:: "reviewer-added"

change:: link:json.html#change[change attribute]

patchset:: link:json.html#patchSet[patchset attribute]

reviewer:: link:json.html#account[account attribute]


SEE ALSO
--------

* link:json.html[JSON Data Formats]
* link:access-control.html[Access Controls]

GERRIT
------
Part of link:index.html[Gerrit Code Review]