Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - JSON Data |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 2 | |
| 3 | Some commands produce JSON data streams intended for other |
| 4 | applications to consume. The structures are documented below. |
| 5 | Note that any field may be missing in the JSON messages, so consumers |
| 6 | of this JSON stream should deal with that appropriately. |
| 7 | |
| 8 | [[change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 9 | == change |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 10 | The Gerrit change being reviewed, or that was already reviewed. |
| 11 | |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 12 | project:: Project path in Gerrit. |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 13 | |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 14 | branch:: Branch name within project. |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 15 | |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 16 | topic:: Topic name specified by the uploader for this change series. |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 17 | |
| 18 | id:: Change identifier, as scraped out of the Change-Id field in |
| 19 | the commit message, or as assigned by the server if it was missing. |
| 20 | |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 21 | number:: Change number (deprecated). |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 22 | |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 23 | subject:: Description of change. |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 24 | |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 25 | owner:: Owner in <<account,account attribute>>. |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 26 | |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 27 | url:: Canonical URL to reach this change. |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 28 | |
David Pursehouse | 93a4ae6 | 2013-05-01 13:50:09 +0900 | [diff] [blame] | 29 | commitMessage:: The full commit message for the change's current patch |
| 30 | set. |
Brad Larson | 0943d6e | 2011-10-27 19:36:27 -0500 | [diff] [blame] | 31 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 32 | createdOn:: Time in seconds since the UNIX epoch when this change |
| 33 | was created. |
| 34 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 35 | lastUpdated:: Time in seconds since the UNIX epoch when this change |
| 36 | was last updated. |
| 37 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 38 | open:: Boolean indicating if the change is still open for review. |
| 39 | |
| 40 | status:: Current state of this change. |
| 41 | |
| 42 | NEW;; Change is still being reviewed. |
| 43 | |
David Pursehouse | 981b016 | 2013-02-21 17:27:49 +0900 | [diff] [blame] | 44 | DRAFT;; Change is a draft change that only consists of draft patchsets. |
| 45 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 46 | SUBMITTED;; Change has been submitted and is in the merge queue. |
| 47 | It may be waiting for one or more dependencies. |
| 48 | |
| 49 | MERGED;; Change has been merged to its branch. |
| 50 | |
| 51 | ABANDONED;; Change was abandoned by its owner or administrator. |
| 52 | |
Bruce Zu | 6b0fd76 | 2012-10-25 16:52:00 +0800 | [diff] [blame] | 53 | comments:: All inline/file comments for this change in <<message,message attributes>>. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 54 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 55 | trackingIds:: Issue tracking system links in |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 56 | <<trackingid,trackingid attributes>>, scraped out of the commit |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 57 | message based on the server's |
| 58 | link:config-gerrit.html#trackingid[trackingid] sections. |
| 59 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 60 | currentPatchSet:: Current <<patchSet,patchSet attribute>>. |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 61 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 62 | patchSets:: All <<patchSet,patchSet attributes>> for this change. |
| 63 | |
| 64 | dependsOn:: List of changes that this change depends on in <<dependency,dependency attributes>>. |
| 65 | |
| 66 | neededBy:: List of changes that depend on this change in <<dependency,dependency attributes>>. |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 67 | |
James E. Blair | 3fe3d3f | 2012-07-20 17:11:37 -0700 | [diff] [blame] | 68 | submitRecords:: The <<submitRecord,submitRecord attribute>> contains |
| 69 | information about whether this change has been or can be submitted. |
| 70 | |
Mani Chandel | 72cb603 | 2013-10-17 17:12:03 +0530 | [diff] [blame] | 71 | allReviewers:: List of all reviewers in <<account,account attribute>> |
| 72 | which are added to a change. |
| 73 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 74 | [[trackingid]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 75 | == trackingid |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 76 | A link to an issue tracking system. |
| 77 | |
| 78 | system:: Name of the system. This comes straight from the |
| 79 | gerrit.config file. |
| 80 | |
| 81 | id:: Id number as scraped out of the commit message. |
| 82 | |
| 83 | [[account]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 84 | == account |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 85 | A user account. |
| 86 | |
| 87 | name:: User's full name, if configured. |
| 88 | |
| 89 | email:: User's preferred email address. |
| 90 | |
James E. Blair | f2c292e | 2011-11-08 14:52:32 -0800 | [diff] [blame] | 91 | username:: User's username, if configured. |
| 92 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 93 | [[patchSet]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 94 | == patchSet |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 95 | Refers to a specific patchset within a <<change,change>>. |
| 96 | |
| 97 | number:: The patchset number. |
| 98 | |
| 99 | revision:: Git commit for this patchset. |
| 100 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 101 | parents:: List of parent revisions. |
| 102 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 103 | ref:: Git reference pointing at the revision. This reference is |
| 104 | available through the Gerrit Code Review server's Git interface |
| 105 | for the containing change. |
| 106 | |
| 107 | uploader:: Uploader of the patch set in <<account,account attribute>>. |
| 108 | |
Bruce Zu | 1a9be5e | 2012-10-09 14:49:39 +0800 | [diff] [blame] | 109 | author:: Author of this patchset in <<account,account attribute>>. |
| 110 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 111 | createdOn:: Time in seconds since the UNIX epoch when this patchset |
| 112 | was created. |
| 113 | |
Christian Aistleitner | ca50428 | 2013-06-18 01:09:33 +0200 | [diff] [blame] | 114 | isDraft:: Whether or not the patch set is a draft patch set. |
| 115 | |
Doug Kelly | 40324a8 | 2014-05-28 10:21:52 -0500 | [diff] [blame] | 116 | kind:: Kind of change uploaded. |
Doug Kelly | 58ba206 | 2014-05-15 11:54:44 -0500 | [diff] [blame] | 117 | |
| 118 | REWORK;; Nontrivial content changes. |
| 119 | |
| 120 | TRIVIAL_REBASE;; Conflict-free merge between the new parent and the prior patch set. |
| 121 | |
| 122 | NO_CODE_CHANGE;; No code changed; same tree and same parents. |
| 123 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 124 | approvals:: The <<approval,approval attribute>> granted. |
| 125 | |
Bruce Zu | 6b0fd76 | 2012-10-25 16:52:00 +0800 | [diff] [blame] | 126 | comments:: All comments for this patchset in <<patchsetcomment,patchsetComment attributes>>. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 127 | |
David Pursehouse | 5ab70e3 | 2013-05-08 05:41:50 +0100 | [diff] [blame] | 128 | files:: All changed files in this patchset in <<file,file attributes>>. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 129 | |
Bruce Zu | 1a9be5e | 2012-10-09 14:49:39 +0800 | [diff] [blame] | 130 | sizeInsertions:: Size information of insertions of this patchset. |
| 131 | |
| 132 | sizeDeletions:: Size information of deletions of this patchset. |
| 133 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 134 | [[approval]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 135 | == approval |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 136 | Records the code review approval granted to a patch set. |
| 137 | |
| 138 | type:: Internal name of the approval given. |
| 139 | |
| 140 | description:: Human readable category of the approval. |
| 141 | |
| 142 | value:: Value assigned by the approval, usually a numerical score. |
| 143 | |
| 144 | grantedOn:: Time in seconds since the UNIX epoch when this approval |
| 145 | was added or last updated. |
| 146 | |
| 147 | by:: Reviewer of the patch set in <<account,account attribute>>. |
| 148 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 149 | [[refUpdate]] |
Sven Selberg | a1a5d62 | 2014-11-20 10:37:29 +0900 | [diff] [blame] | 150 | == refUpdate |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 151 | Information about a ref that was updated. |
| 152 | |
| 153 | oldRev:: The old value of the ref, prior to the update. |
| 154 | |
| 155 | newRev:: The new value the ref was updated to. |
| 156 | |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 157 | refName:: Ref name within project. |
| 158 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 159 | project:: Project path in Gerrit. |
| 160 | |
James E. Blair | 3fe3d3f | 2012-07-20 17:11:37 -0700 | [diff] [blame] | 161 | [[submitRecord]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 162 | == submitRecord |
James E. Blair | 3fe3d3f | 2012-07-20 17:11:37 -0700 | [diff] [blame] | 163 | Information about the submit status of a change. |
| 164 | |
| 165 | status:: Current submit status. |
| 166 | |
| 167 | OK;; The change is ready for submission or already submitted. |
| 168 | |
| 169 | NOT_READY;; The change is missing a required label. |
| 170 | |
| 171 | RULE_ERROR;; An internal server error occurred preventing computation. |
| 172 | |
| 173 | labels:: This describes the state of each code review |
| 174 | <<label,label attribute>>, unless the status is RULE_ERROR. |
| 175 | |
| 176 | [[label]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 177 | == label |
James E. Blair | 3fe3d3f | 2012-07-20 17:11:37 -0700 | [diff] [blame] | 178 | Information about a code review label for a change. |
| 179 | |
| 180 | label:: The name of the label. |
| 181 | |
| 182 | status:: The status of the label. |
| 183 | |
| 184 | OK;; This label provides what is necessary for submission. |
| 185 | |
| 186 | REJECT;; This label prevents the change from being submitted. |
| 187 | |
| 188 | NEED;; The label is required for submission, but has not |
| 189 | been satisfied. |
| 190 | |
| 191 | MAY;; The label may be set, but it's neither necessary for |
| 192 | submission nor does it block submission if set. |
| 193 | |
| 194 | IMPOSSIBLE;; The label is required for submission, but is impossible |
| 195 | to complete. The likely cause is access has not been granted |
| 196 | correctly by the project owner or site administrator. |
| 197 | |
| 198 | by:: The <<account,account>> that applied the label. |
| 199 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 200 | [[dependency]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 201 | == dependency |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 202 | Information about a change or patchset dependency. |
| 203 | |
| 204 | id:: Change identifier. |
| 205 | |
| 206 | number:: Change number. |
| 207 | |
| 208 | revision:: Patchset revision. |
| 209 | |
| 210 | ref:: Ref name. |
| 211 | |
| 212 | isCurrentPatchSet:: If the revision is the current patchset of the change. |
| 213 | |
| 214 | [[message]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 215 | == message |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 216 | Comment added on a change by a reviewer. |
| 217 | |
| 218 | timestamp:: Time in seconds since the UNIX epoch when this comment |
| 219 | was added. |
| 220 | |
| 221 | reviewer:: The <<account,account>> that added the comment. |
| 222 | |
| 223 | message:: The comment text. |
| 224 | |
| 225 | [[patchsetcomment]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 226 | == patchsetComment |
Bruce Zu | 6b0fd76 | 2012-10-25 16:52:00 +0800 | [diff] [blame] | 227 | Comment added on a patchset by a reviewer. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 228 | |
| 229 | file:: The name of the file on which the comment was added. |
| 230 | |
| 231 | line:: The line number at which the comment was added. |
| 232 | |
| 233 | reviewer:: The <<account,account>> that added the comment. |
| 234 | |
| 235 | message:: The comment text. |
| 236 | |
David Pursehouse | 5ab70e3 | 2013-05-08 05:41:50 +0100 | [diff] [blame] | 237 | [[file]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 238 | == file |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 239 | Information about a patch on a file. |
| 240 | |
David Pursehouse | 877d493 | 2012-10-31 10:12:10 +0900 | [diff] [blame] | 241 | file:: The name of the file. If the file is renamed, the new name. |
| 242 | |
| 243 | fileOld:: The old name of the file, if the file is renamed. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 244 | |
| 245 | type:: The type of change. |
| 246 | |
| 247 | ADDED;; The file is being created/introduced by this patch. |
| 248 | |
| 249 | MODIFIED;; The file already exists, and has updated content. |
| 250 | |
| 251 | DELETED;; The file existed, but is being removed by this patch. |
| 252 | |
| 253 | RENAMED;; The file is renamed. |
| 254 | |
| 255 | COPIED;; The file is copied from another file. |
| 256 | |
| 257 | REWRITE;; Sufficient amount of content changed to claim the file was rewritten. |
| 258 | |
Bruce Zu | 1a9be5e | 2012-10-09 14:49:39 +0800 | [diff] [blame] | 259 | insertions:: number of insertions of this patch. |
| 260 | |
| 261 | deletions:: number of deletions of this patch. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 262 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 263 | == SEE ALSO |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 264 | |
| 265 | * link:cmd-stream-events.html[gerrit stream-events] |
| 266 | * link:cmd-query.html[gerrit query] |
| 267 | |
| 268 | GERRIT |
| 269 | ------ |
| 270 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 271 | |
| 272 | SEARCHBOX |
| 273 | --------- |