blob: 3624b3fa4770a74200d82f659c3ca2d3ee672ba8 [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
David Pursehouse6002bb22012-10-10 11:40:49 +090032createdOn:: Time in seconds since the UNIX epoch when this change
33was created.
34
Shawn O. Pearce14760b72010-07-19 09:44:46 -070035lastUpdated:: Time in seconds since the UNIX epoch when this change
36was last updated.
37
38sortKey:: Internal key used to sort changes, based on lastUpdated.
39
40open:: 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
David Pursehouse981b0162013-02-21 17:27:49 +090046 DRAFT;; Change is a draft change that only consists of draft patchsets.
47
Shawn O. Pearce14760b72010-07-19 09:44:46 -070048 SUBMITTED;; Change has been submitted and is in the merge queue.
49 It may be waiting for one or more dependencies.
50
51 MERGED;; Change has been merged to its branch.
52
53 ABANDONED;; Change was abandoned by its owner or administrator.
54
Bruce Zu6b0fd762012-10-25 16:52:00 +080055comments:: All inline/file comments for this change in <<message,message attributes>>.
David Pursehouse6002bb22012-10-10 11:40:49 +090056
Shawn O. Pearce14760b72010-07-19 09:44:46 -070057trackingIds:: Issue tracking system links in
David Pursehouse6002bb22012-10-10 11:40:49 +090058<<trackingid,trackingid attributes>>, scraped out of the commit
Shawn O. Pearce14760b72010-07-19 09:44:46 -070059message based on the server's
60link:config-gerrit.html#trackingid[trackingid] sections.
61
Edwin Kempina19ff372012-06-14 09:04:32 +020062currentPatchSet:: Current <<patchSet,patchSet attribute>>.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070063
David Pursehouse6002bb22012-10-10 11:40:49 +090064patchSets:: All <<patchSet,patchSet attributes>> for this change.
65
66dependsOn:: List of changes that this change depends on in <<dependency,dependency attributes>>.
67
68neededBy:: List of changes that depend on this change in <<dependency,dependency attributes>>.
Shawn O. Pearce14760b72010-07-19 09:44:46 -070069
James E. Blair3fe3d3f2012-07-20 17:11:37 -070070submitRecords:: The <<submitRecord,submitRecord attribute>> contains
71information about whether this change has been or can be submitted.
72
Mani Chandel72cb6032013-10-17 17:12:03 +053073allReviewers:: List of all reviewers in <<account,account attribute>>
74which are added to a change.
75
Shawn O. Pearce14760b72010-07-19 09:44:46 -070076[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080077== trackingid
Shawn O. Pearce14760b72010-07-19 09:44:46 -070078A link to an issue tracking system.
79
80system:: Name of the system. This comes straight from the
81gerrit.config file.
82
83id:: Id number as scraped out of the commit message.
84
85[[account]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080086== account
Shawn O. Pearce14760b72010-07-19 09:44:46 -070087A user account.
88
89name:: User's full name, if configured.
90
91email:: User's preferred email address.
92
James E. Blairf2c292e2011-11-08 14:52:32 -080093username:: User's username, if configured.
94
Edwin Kempina19ff372012-06-14 09:04:32 +020095[[patchSet]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080096== patchSet
Shawn O. Pearce14760b72010-07-19 09:44:46 -070097Refers to a specific patchset within a <<change,change>>.
98
99number:: The patchset number.
100
101revision:: Git commit for this patchset.
102
David Pursehouse6002bb22012-10-10 11:40:49 +0900103parents:: List of parent revisions.
104
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700105ref:: Git reference pointing at the revision. This reference is
106available through the Gerrit Code Review server's Git interface
107for the containing change.
108
109uploader:: Uploader of the patch set in <<account,account attribute>>.
110
Bruce Zu1a9be5e2012-10-09 14:49:39 +0800111author:: Author of this patchset in <<account,account attribute>>.
112
David Pursehouse6002bb22012-10-10 11:40:49 +0900113createdOn:: Time in seconds since the UNIX epoch when this patchset
114was created.
115
Christian Aistleitnerca504282013-06-18 01:09:33 +0200116isDraft:: Whether or not the patch set is a draft patch set.
117
Doug Kelly40324a82014-05-28 10:21:52 -0500118kind:: Kind of change uploaded.
Doug Kelly58ba2062014-05-15 11:54:44 -0500119
120 REWORK;; Nontrivial content changes.
121
122 TRIVIAL_REBASE;; Conflict-free merge between the new parent and the prior patch set.
123
124 NO_CODE_CHANGE;; No code changed; same tree and same parents.
125
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700126approvals:: The <<approval,approval attribute>> granted.
127
Bruce Zu6b0fd762012-10-25 16:52:00 +0800128comments:: All comments for this patchset in <<patchsetcomment,patchsetComment attributes>>.
David Pursehouse6002bb22012-10-10 11:40:49 +0900129
David Pursehouse5ab70e32013-05-08 05:41:50 +0100130files:: All changed files in this patchset in <<file,file attributes>>.
David Pursehouse6002bb22012-10-10 11:40:49 +0900131
Bruce Zu1a9be5e2012-10-09 14:49:39 +0800132sizeInsertions:: Size information of insertions of this patchset.
133
134sizeDeletions:: Size information of deletions of this patchset.
135
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700136[[approval]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800137== approval
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700138Records the code review approval granted to a patch set.
139
140type:: Internal name of the approval given.
141
142description:: Human readable category of the approval.
143
144value:: Value assigned by the approval, usually a numerical score.
145
146grantedOn:: Time in seconds since the UNIX epoch when this approval
147was added or last updated.
148
149by:: Reviewer of the patch set in <<account,account attribute>>.
150
Edwin Kempina19ff372012-06-14 09:04:32 +0200151[[refUpdate]]
152refUpdate
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500153--------
154Information about a ref that was updated.
155
156oldRev:: The old value of the ref, prior to the update.
157
158newRev:: The new value the ref was updated to.
159
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500160refName:: Ref name within project.
161
David Pursehouse6002bb22012-10-10 11:40:49 +0900162project:: Project path in Gerrit.
163
James E. Blair3fe3d3f2012-07-20 17:11:37 -0700164[[submitRecord]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800165== submitRecord
James E. Blair3fe3d3f2012-07-20 17:11:37 -0700166Information about the submit status of a change.
167
168status:: Current submit status.
169
170 OK;; The change is ready for submission or already submitted.
171
172 NOT_READY;; The change is missing a required label.
173
174 RULE_ERROR;; An internal server error occurred preventing computation.
175
176labels:: This describes the state of each code review
177<<label,label attribute>>, unless the status is RULE_ERROR.
178
179[[label]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800180== label
James E. Blair3fe3d3f2012-07-20 17:11:37 -0700181Information about a code review label for a change.
182
183label:: The name of the label.
184
185status:: The status of the label.
186
187 OK;; This label provides what is necessary for submission.
188
189 REJECT;; This label prevents the change from being submitted.
190
191 NEED;; The label is required for submission, but has not
192 been satisfied.
193
194 MAY;; The label may be set, but it's neither necessary for
195 submission nor does it block submission if set.
196
197 IMPOSSIBLE;; The label is required for submission, but is impossible
198 to complete. The likely cause is access has not been granted
199 correctly by the project owner or site administrator.
200
201by:: The <<account,account>> that applied the label.
202
David Pursehouse6002bb22012-10-10 11:40:49 +0900203[[dependency]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800204== dependency
David Pursehouse6002bb22012-10-10 11:40:49 +0900205Information about a change or patchset dependency.
206
207id:: Change identifier.
208
209number:: Change number.
210
211revision:: Patchset revision.
212
213ref:: Ref name.
214
215isCurrentPatchSet:: If the revision is the current patchset of the change.
216
217[[message]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800218== message
David Pursehouse6002bb22012-10-10 11:40:49 +0900219Comment added on a change by a reviewer.
220
221timestamp:: Time in seconds since the UNIX epoch when this comment
222was added.
223
224reviewer:: The <<account,account>> that added the comment.
225
226message:: The comment text.
227
228[[patchsetcomment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800229== patchsetComment
Bruce Zu6b0fd762012-10-25 16:52:00 +0800230Comment added on a patchset by a reviewer.
David Pursehouse6002bb22012-10-10 11:40:49 +0900231
232file:: The name of the file on which the comment was added.
233
234line:: The line number at which the comment was added.
235
236reviewer:: The <<account,account>> that added the comment.
237
238message:: The comment text.
239
David Pursehouse5ab70e32013-05-08 05:41:50 +0100240[[file]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800241== file
David Pursehouse6002bb22012-10-10 11:40:49 +0900242Information about a patch on a file.
243
David Pursehouse877d4932012-10-31 10:12:10 +0900244file:: The name of the file. If the file is renamed, the new name.
245
246fileOld:: The old name of the file, if the file is renamed.
David Pursehouse6002bb22012-10-10 11:40:49 +0900247
248type:: The type of change.
249
250 ADDED;; The file is being created/introduced by this patch.
251
252 MODIFIED;; The file already exists, and has updated content.
253
254 DELETED;; The file existed, but is being removed by this patch.
255
256 RENAMED;; The file is renamed.
257
258 COPIED;; The file is copied from another file.
259
260 REWRITE;; Sufficient amount of content changed to claim the file was rewritten.
261
Bruce Zu1a9be5e2012-10-09 14:49:39 +0800262insertions:: number of insertions of this patch.
263
264deletions:: number of deletions of this patch.
David Pursehouse6002bb22012-10-10 11:40:49 +0900265
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800266== SEE ALSO
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700267
268* link:cmd-stream-events.html[gerrit stream-events]
269* link:cmd-query.html[gerrit query]
270
271GERRIT
272------
273Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700274
275SEARCHBOX
276---------