blob: dc82ad156938defaf6e4b95cde6e7d736229b5ce [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - JSON Data
Shawn O. Pearce14760b72010-07-19 09:44:46 -07002
3Some commands produce JSON data streams intended for other
4applications to consume. The structures are documented below.
5Note that any field may be missing in the JSON messages, so consumers
6of this JSON stream should deal with that appropriately.
7
8[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08009== change
Shawn O. Pearce14760b72010-07-19 09:44:46 -070010The Gerrit change being reviewed, or that was already reviewed.
11
David Pursehouse221d4f62012-06-08 17:38:08 +090012project:: Project path in Gerrit.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070013
David Pursehouse221d4f62012-06-08 17:38:08 +090014branch:: Branch name within project.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070015
David Pursehouse221d4f62012-06-08 17:38:08 +090016topic:: Topic name specified by the uploader for this change series.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070017
18id:: Change identifier, as scraped out of the Change-Id field in
19the commit message, or as assigned by the server if it was missing.
20
David Pursehouse221d4f62012-06-08 17:38:08 +090021number:: Change number (deprecated).
Shawn O. Pearce14760b72010-07-19 09:44:46 -070022
David Pursehouse221d4f62012-06-08 17:38:08 +090023subject:: Description of change.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070024
David Pursehouse221d4f62012-06-08 17:38:08 +090025owner:: Owner in <<account,account attribute>>.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070026
David Pursehouse221d4f62012-06-08 17:38:08 +090027url:: Canonical URL to reach this change.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070028
David Pursehouse93a4ae62013-05-01 13:50:09 +090029commitMessage:: The full commit message for the change's current patch
30set.
Brad Larson0943d6e2011-10-27 19:36:27 -050031
Bertrand Roussel75a3af62018-07-13 14:27:51 +020032hashtags:: List of hashtags associated with this change.
33
David Pursehouse6002bb22012-10-10 11:40:49 +090034createdOn:: Time in seconds since the UNIX epoch when this change
35was created.
36
Shawn O. Pearce14760b72010-07-19 09:44:46 -070037lastUpdated:: Time in seconds since the UNIX epoch when this change
38was last updated.
39
Shawn O. Pearce14760b72010-07-19 09:44:46 -070040open:: Boolean indicating if the change is still open for review.
41
42status:: Current state of this change.
43
44 NEW;; Change is still being reviewed.
45
Shawn O. Pearce14760b72010-07-19 09:44:46 -070046 MERGED;; Change has been merged to its branch.
47
48 ABANDONED;; Change was abandoned by its owner or administrator.
49
Sven Selberg56097442017-12-19 11:03:39 +010050private:: Boolean indicating if the change is
51link:intro-user.html#private-changes[private].
52
53wip:: Boolean indicating if the change is
54link:intro-user.html#wip[work in progress].
55
Bruce Zu6b0fd762012-10-25 16:52:00 +080056comments:: All inline/file comments for this change in <<message,message attributes>>.
David Pursehouse6002bb22012-10-10 11:40:49 +090057
Shawn O. Pearce14760b72010-07-19 09:44:46 -070058trackingIds:: Issue tracking system links in
David Pursehouse6002bb22012-10-10 11:40:49 +090059<<trackingid,trackingid attributes>>, scraped out of the commit
Shawn O. Pearce14760b72010-07-19 09:44:46 -070060message based on the server's
61link:config-gerrit.html#trackingid[trackingid] sections.
62
Edwin Kempina19ff372012-06-14 09:04:32 +020063currentPatchSet:: Current <<patchSet,patchSet attribute>>.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070064
David Pursehouse6002bb22012-10-10 11:40:49 +090065patchSets:: All <<patchSet,patchSet attributes>> for this change.
66
67dependsOn:: List of changes that this change depends on in <<dependency,dependency attributes>>.
68
69neededBy:: List of changes that depend on this change in <<dependency,dependency attributes>>.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070070
James E. Blair3fe3d3f2012-07-20 17:11:37 -070071submitRecords:: The <<submitRecord,submitRecord attribute>> contains
72information about whether this change has been or can be submitted.
73
Mani Chandel72cb6032013-10-17 17:12:03 +053074allReviewers:: List of all reviewers in <<account,account attribute>>
75which are added to a change.
76
Shawn O. Pearce14760b72010-07-19 09:44:46 -070077[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080078== trackingid
Shawn O. Pearce14760b72010-07-19 09:44:46 -070079A link to an issue tracking system.
80
81system:: Name of the system. This comes straight from the
82gerrit.config file.
83
84id:: Id number as scraped out of the commit message.
85
86[[account]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080087== account
Shawn O. Pearce14760b72010-07-19 09:44:46 -070088A user account.
89
90name:: User's full name, if configured.
91
92email:: User's preferred email address.
93
James E. Blairf2c292e2011-11-08 14:52:32 -080094username:: User's username, if configured.
95
Edwin Kempina19ff372012-06-14 09:04:32 +020096[[patchSet]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080097== patchSet
Shawn O. Pearce14760b72010-07-19 09:44:46 -070098Refers to a specific patchset within a <<change,change>>.
99
100number:: The patchset number.
101
102revision:: Git commit for this patchset.
103
David Pursehouse6002bb22012-10-10 11:40:49 +0900104parents:: List of parent revisions.
105
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700106ref:: Git reference pointing at the revision. This reference is
107available through the Gerrit Code Review server's Git interface
108for the containing change.
109
110uploader:: Uploader of the patch set in <<account,account attribute>>.
111
Bruce Zu1a9be5e2012-10-09 14:49:39 +0800112author:: Author of this patchset in <<account,account attribute>>.
113
David Pursehouse6002bb22012-10-10 11:40:49 +0900114createdOn:: Time in seconds since the UNIX epoch when this patchset
115was created.
116
Doug Kelly40324a82014-05-28 10:21:52 -0500117kind:: Kind of change uploaded.
Doug Kelly58ba2062014-05-15 11:54:44 -0500118
119 REWORK;; Nontrivial content changes.
120
121 TRIVIAL_REBASE;; Conflict-free merge between the new parent and the prior patch set.
122
David Pursehouse041fce12016-07-01 22:22:25 +0900123 MERGE_FIRST_PARENT_UPDATE;; Conflict-free change of first (left) parent of a merge commit.
124
Zalan Blenessyae476862015-02-13 14:06:57 +0100125 NO_CODE_CHANGE;; No code changed; same tree and same parent tree.
126
127 NO_CHANGE;; No changes; same commit message, same tree and same parent tree.
Doug Kelly58ba2062014-05-15 11:54:44 -0500128
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700129approvals:: The <<approval,approval attribute>> granted.
130
Bruce Zu6b0fd762012-10-25 16:52:00 +0800131comments:: All comments for this patchset in <<patchsetcomment,patchsetComment attributes>>.
David Pursehouse6002bb22012-10-10 11:40:49 +0900132
David Pursehouse5ab70e32013-05-08 05:41:50 +0100133files:: All changed files in this patchset in <<file,file attributes>>.
David Pursehouse6002bb22012-10-10 11:40:49 +0900134
Bruce Zu1a9be5e2012-10-09 14:49:39 +0800135sizeInsertions:: Size information of insertions of this patchset.
136
137sizeDeletions:: Size information of deletions of this patchset.
138
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700139[[approval]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800140== approval
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700141Records the code review approval granted to a patch set.
142
143type:: Internal name of the approval given.
144
145description:: Human readable category of the approval.
146
147value:: Value assigned by the approval, usually a numerical score.
148
Khai Do71b58992015-06-04 14:04:27 -0700149oldValue:: The previous approval score, only present if the value changed as a result of this event.
150
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700151grantedOn:: Time in seconds since the UNIX epoch when this approval
152was added or last updated.
153
154by:: Reviewer of the patch set in <<account,account attribute>>.
155
Edwin Kempina19ff372012-06-14 09:04:32 +0200156[[refUpdate]]
Sven Selberga1a5d622014-11-20 10:37:29 +0900157== refUpdate
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500158Information about a ref that was updated.
159
160oldRev:: The old value of the ref, prior to the update.
161
David Pursehouse296b8612018-03-22 09:44:15 +0900162newRev:: The new value the ref was updated to. Zero value (`0000000000000000000000000000000000000000`)
163indicates that the ref was deleted.
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500164
Janice Agustin0d74afe2015-05-15 10:17:08 -0400165refName:: Full ref name within project.
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500166
David Pursehouse6002bb22012-10-10 11:40:49 +0900167project:: Project path in Gerrit.
168
James E. Blair3fe3d3f2012-07-20 17:11:37 -0700169[[submitRecord]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800170== submitRecord
James E. Blair3fe3d3f2012-07-20 17:11:37 -0700171Information about the submit status of a change.
172
173status:: Current submit status.
174
175 OK;; The change is ready for submission or already submitted.
176
177 NOT_READY;; The change is missing a required label.
178
179 RULE_ERROR;; An internal server error occurred preventing computation.
180
181labels:: This describes the state of each code review
182<<label,label attribute>>, unless the status is RULE_ERROR.
183
Maxime Guerreiro227eb572018-02-28 14:33:18 +0100184requirements:: Each <<requirement>> describes what needs to be changed
185in order for the change to be submittable.
186
187
188[[requirement]]
189== requirement
Maxime Guerreiro36c97252018-04-03 17:26:28 +0000190Information about a requirement in order to submit a change.
Maxime Guerreiro227eb572018-02-28 14:33:18 +0100191
Maxime Guerreiro36c97252018-04-03 17:26:28 +0000192fallbackText:: A human readable description of the requirement.
Maxime Guerreiro227eb572018-02-28 14:33:18 +0100193
Maxime Guerreiro36c97252018-04-03 17:26:28 +0000194type:: Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and
195why it was triggered. Can be seen as a class: requirements sharing the same type were created for a
196similar reason, and the data structure will follow one set of rules.
Maxime Guerreiro227eb572018-02-28 14:33:18 +0100197
Maxime Guerreiro36c97252018-04-03 17:26:28 +0000198data:: (Optional) Additional key-value data linked to this requirement. This is used in templates to
199render rich status messages.
Maxime Guerreiro227eb572018-02-28 14:33:18 +0100200
James E. Blair3fe3d3f2012-07-20 17:11:37 -0700201[[label]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800202== label
James E. Blair3fe3d3f2012-07-20 17:11:37 -0700203Information about a code review label for a change.
204
205label:: The name of the label.
206
207status:: The status of the label.
208
209 OK;; This label provides what is necessary for submission.
210
211 REJECT;; This label prevents the change from being submitted.
212
213 NEED;; The label is required for submission, but has not
214 been satisfied.
215
216 MAY;; The label may be set, but it's neither necessary for
217 submission nor does it block submission if set.
218
219 IMPOSSIBLE;; The label is required for submission, but is impossible
220 to complete. The likely cause is access has not been granted
221 correctly by the project owner or site administrator.
222
223by:: The <<account,account>> that applied the label.
224
David Pursehouse6002bb22012-10-10 11:40:49 +0900225[[dependency]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800226== dependency
David Pursehouse6002bb22012-10-10 11:40:49 +0900227Information about a change or patchset dependency.
228
229id:: Change identifier.
230
231number:: Change number.
232
233revision:: Patchset revision.
234
235ref:: Ref name.
236
237isCurrentPatchSet:: If the revision is the current patchset of the change.
238
239[[message]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800240== message
David Pursehouse6002bb22012-10-10 11:40:49 +0900241Comment added on a change by a reviewer.
242
243timestamp:: Time in seconds since the UNIX epoch when this comment
244was added.
245
246reviewer:: The <<account,account>> that added the comment.
247
248message:: The comment text.
249
250[[patchsetcomment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800251== patchsetComment
Bruce Zu6b0fd762012-10-25 16:52:00 +0800252Comment added on a patchset by a reviewer.
David Pursehouse6002bb22012-10-10 11:40:49 +0900253
254file:: The name of the file on which the comment was added.
255
256line:: The line number at which the comment was added.
257
258reviewer:: The <<account,account>> that added the comment.
259
260message:: The comment text.
261
David Pursehouse5ab70e32013-05-08 05:41:50 +0100262[[file]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800263== file
David Pursehouse6002bb22012-10-10 11:40:49 +0900264Information about a patch on a file.
265
David Pursehouse877d4932012-10-31 10:12:10 +0900266file:: The name of the file. If the file is renamed, the new name.
267
268fileOld:: The old name of the file, if the file is renamed.
David Pursehouse6002bb22012-10-10 11:40:49 +0900269
270type:: The type of change.
271
272 ADDED;; The file is being created/introduced by this patch.
273
274 MODIFIED;; The file already exists, and has updated content.
275
276 DELETED;; The file existed, but is being removed by this patch.
277
278 RENAMED;; The file is renamed.
279
280 COPIED;; The file is copied from another file.
281
282 REWRITE;; Sufficient amount of content changed to claim the file was rewritten.
283
Bruce Zu1a9be5e2012-10-09 14:49:39 +0800284insertions:: number of insertions of this patch.
285
286deletions:: number of deletions of this patch.
David Pursehouse6002bb22012-10-10 11:40:49 +0900287
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800288== SEE ALSO
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700289
290* link:cmd-stream-events.html[gerrit stream-events]
291* link:cmd-query.html[gerrit query]
292
293GERRIT
294------
295Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700296
297SEARCHBOX
298---------