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 | |
Bertrand Roussel | 75a3af6 | 2018-07-13 14:27:51 +0200 | [diff] [blame] | 32 | hashtags:: List of hashtags associated with this change. |
| 33 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 34 | createdOn:: Time in seconds since the UNIX epoch when this change |
| 35 | was created. |
| 36 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 37 | lastUpdated:: Time in seconds since the UNIX epoch when this change |
| 38 | was last updated. |
| 39 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 40 | open:: Boolean indicating if the change is still open for review. |
| 41 | |
| 42 | status:: Current state of this change. |
| 43 | |
| 44 | NEW;; Change is still being reviewed. |
| 45 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 46 | MERGED;; Change has been merged to its branch. |
| 47 | |
| 48 | ABANDONED;; Change was abandoned by its owner or administrator. |
| 49 | |
Sven Selberg | 5609744 | 2017-12-19 11:03:39 +0100 | [diff] [blame] | 50 | private:: Boolean indicating if the change is |
| 51 | link:intro-user.html#private-changes[private]. |
| 52 | |
| 53 | wip:: Boolean indicating if the change is |
| 54 | link:intro-user.html#wip[work in progress]. |
| 55 | |
Bruce Zu | 6b0fd76 | 2012-10-25 16:52:00 +0800 | [diff] [blame] | 56 | comments:: All inline/file comments for this change in <<message,message attributes>>. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 57 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 58 | trackingIds:: Issue tracking system links in |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 59 | <<trackingid,trackingid attributes>>, scraped out of the commit |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 60 | message based on the server's |
| 61 | link:config-gerrit.html#trackingid[trackingid] sections. |
| 62 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 63 | currentPatchSet:: Current <<patchSet,patchSet attribute>>. |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 64 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 65 | patchSets:: All <<patchSet,patchSet attributes>> for this change. |
| 66 | |
| 67 | dependsOn:: List of changes that this change depends on in <<dependency,dependency attributes>>. |
| 68 | |
| 69 | 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] | 70 | |
James E. Blair | 3fe3d3f | 2012-07-20 17:11:37 -0700 | [diff] [blame] | 71 | submitRecords:: The <<submitRecord,submitRecord attribute>> contains |
| 72 | information about whether this change has been or can be submitted. |
| 73 | |
Mani Chandel | 72cb603 | 2013-10-17 17:12:03 +0530 | [diff] [blame] | 74 | allReviewers:: List of all reviewers in <<account,account attribute>> |
| 75 | which are added to a change. |
| 76 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 77 | [[trackingid]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 78 | == trackingid |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 79 | A link to an issue tracking system. |
| 80 | |
| 81 | system:: Name of the system. This comes straight from the |
| 82 | gerrit.config file. |
| 83 | |
| 84 | id:: Id number as scraped out of the commit message. |
| 85 | |
| 86 | [[account]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 87 | == account |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 88 | A user account. |
| 89 | |
| 90 | name:: User's full name, if configured. |
| 91 | |
| 92 | email:: User's preferred email address. |
| 93 | |
James E. Blair | f2c292e | 2011-11-08 14:52:32 -0800 | [diff] [blame] | 94 | username:: User's username, if configured. |
| 95 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 96 | [[patchSet]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 97 | == patchSet |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 98 | Refers to a specific patchset within a <<change,change>>. |
| 99 | |
| 100 | number:: The patchset number. |
| 101 | |
| 102 | revision:: Git commit for this patchset. |
| 103 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 104 | parents:: List of parent revisions. |
| 105 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 106 | ref:: Git reference pointing at the revision. This reference is |
| 107 | available through the Gerrit Code Review server's Git interface |
| 108 | for the containing change. |
| 109 | |
| 110 | uploader:: Uploader of the patch set in <<account,account attribute>>. |
| 111 | |
Bruce Zu | 1a9be5e | 2012-10-09 14:49:39 +0800 | [diff] [blame] | 112 | author:: Author of this patchset in <<account,account attribute>>. |
| 113 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 114 | createdOn:: Time in seconds since the UNIX epoch when this patchset |
| 115 | was created. |
| 116 | |
Doug Kelly | 40324a8 | 2014-05-28 10:21:52 -0500 | [diff] [blame] | 117 | kind:: Kind of change uploaded. |
Doug Kelly | 58ba206 | 2014-05-15 11:54:44 -0500 | [diff] [blame] | 118 | |
| 119 | REWORK;; Nontrivial content changes. |
| 120 | |
| 121 | TRIVIAL_REBASE;; Conflict-free merge between the new parent and the prior patch set. |
| 122 | |
David Pursehouse | 041fce1 | 2016-07-01 22:22:25 +0900 | [diff] [blame] | 123 | MERGE_FIRST_PARENT_UPDATE;; Conflict-free change of first (left) parent of a merge commit. |
| 124 | |
Zalan Blenessy | ae47686 | 2015-02-13 14:06:57 +0100 | [diff] [blame] | 125 | 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 Kelly | 58ba206 | 2014-05-15 11:54:44 -0500 | [diff] [blame] | 128 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 129 | approvals:: The <<approval,approval attribute>> granted. |
| 130 | |
Bruce Zu | 6b0fd76 | 2012-10-25 16:52:00 +0800 | [diff] [blame] | 131 | comments:: All comments for this patchset in <<patchsetcomment,patchsetComment attributes>>. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 132 | |
David Pursehouse | 5ab70e3 | 2013-05-08 05:41:50 +0100 | [diff] [blame] | 133 | files:: All changed files in this patchset in <<file,file attributes>>. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 134 | |
Bruce Zu | 1a9be5e | 2012-10-09 14:49:39 +0800 | [diff] [blame] | 135 | sizeInsertions:: Size information of insertions of this patchset. |
| 136 | |
| 137 | sizeDeletions:: Size information of deletions of this patchset. |
| 138 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 139 | [[approval]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 140 | == approval |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 141 | Records the code review approval granted to a patch set. |
| 142 | |
| 143 | type:: Internal name of the approval given. |
| 144 | |
| 145 | description:: Human readable category of the approval. |
| 146 | |
| 147 | value:: Value assigned by the approval, usually a numerical score. |
| 148 | |
Khai Do | 71b5899 | 2015-06-04 14:04:27 -0700 | [diff] [blame] | 149 | oldValue:: The previous approval score, only present if the value changed as a result of this event. |
| 150 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 151 | grantedOn:: Time in seconds since the UNIX epoch when this approval |
| 152 | was added or last updated. |
| 153 | |
| 154 | by:: Reviewer of the patch set in <<account,account attribute>>. |
| 155 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 156 | [[refUpdate]] |
Sven Selberg | a1a5d62 | 2014-11-20 10:37:29 +0900 | [diff] [blame] | 157 | == refUpdate |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 158 | Information about a ref that was updated. |
| 159 | |
| 160 | oldRev:: The old value of the ref, prior to the update. |
| 161 | |
David Pursehouse | 296b861 | 2018-03-22 09:44:15 +0900 | [diff] [blame] | 162 | newRev:: The new value the ref was updated to. Zero value (`0000000000000000000000000000000000000000`) |
| 163 | indicates that the ref was deleted. |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 164 | |
Janice Agustin | 0d74afe | 2015-05-15 10:17:08 -0400 | [diff] [blame] | 165 | refName:: Full ref name within project. |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 166 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 167 | project:: Project path in Gerrit. |
| 168 | |
James E. Blair | 3fe3d3f | 2012-07-20 17:11:37 -0700 | [diff] [blame] | 169 | [[submitRecord]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 170 | == submitRecord |
James E. Blair | 3fe3d3f | 2012-07-20 17:11:37 -0700 | [diff] [blame] | 171 | Information about the submit status of a change. |
| 172 | |
| 173 | status:: 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 | |
| 181 | labels:: This describes the state of each code review |
| 182 | <<label,label attribute>>, unless the status is RULE_ERROR. |
| 183 | |
Maxime Guerreiro | 227eb57 | 2018-02-28 14:33:18 +0100 | [diff] [blame] | 184 | requirements:: Each <<requirement>> describes what needs to be changed |
| 185 | in order for the change to be submittable. |
| 186 | |
| 187 | |
| 188 | [[requirement]] |
| 189 | == requirement |
Maxime Guerreiro | 36c9725 | 2018-04-03 17:26:28 +0000 | [diff] [blame] | 190 | Information about a requirement in order to submit a change. |
Maxime Guerreiro | 227eb57 | 2018-02-28 14:33:18 +0100 | [diff] [blame] | 191 | |
Maxime Guerreiro | 36c9725 | 2018-04-03 17:26:28 +0000 | [diff] [blame] | 192 | fallbackText:: A human readable description of the requirement. |
Maxime Guerreiro | 227eb57 | 2018-02-28 14:33:18 +0100 | [diff] [blame] | 193 | |
Maxime Guerreiro | 36c9725 | 2018-04-03 17:26:28 +0000 | [diff] [blame] | 194 | type:: Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and |
| 195 | why it was triggered. Can be seen as a class: requirements sharing the same type were created for a |
| 196 | similar reason, and the data structure will follow one set of rules. |
Maxime Guerreiro | 227eb57 | 2018-02-28 14:33:18 +0100 | [diff] [blame] | 197 | |
Maxime Guerreiro | 36c9725 | 2018-04-03 17:26:28 +0000 | [diff] [blame] | 198 | data:: (Optional) Additional key-value data linked to this requirement. This is used in templates to |
| 199 | render rich status messages. |
Maxime Guerreiro | 227eb57 | 2018-02-28 14:33:18 +0100 | [diff] [blame] | 200 | |
James E. Blair | 3fe3d3f | 2012-07-20 17:11:37 -0700 | [diff] [blame] | 201 | [[label]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 202 | == label |
James E. Blair | 3fe3d3f | 2012-07-20 17:11:37 -0700 | [diff] [blame] | 203 | Information about a code review label for a change. |
| 204 | |
| 205 | label:: The name of the label. |
| 206 | |
| 207 | status:: 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 | |
| 223 | by:: The <<account,account>> that applied the label. |
| 224 | |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 225 | [[dependency]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 226 | == dependency |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 227 | Information about a change or patchset dependency. |
| 228 | |
| 229 | id:: Change identifier. |
| 230 | |
| 231 | number:: Change number. |
| 232 | |
| 233 | revision:: Patchset revision. |
| 234 | |
| 235 | ref:: Ref name. |
| 236 | |
| 237 | isCurrentPatchSet:: If the revision is the current patchset of the change. |
| 238 | |
| 239 | [[message]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 240 | == message |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 241 | Comment added on a change by a reviewer. |
| 242 | |
| 243 | timestamp:: Time in seconds since the UNIX epoch when this comment |
| 244 | was added. |
| 245 | |
| 246 | reviewer:: The <<account,account>> that added the comment. |
| 247 | |
| 248 | message:: The comment text. |
| 249 | |
| 250 | [[patchsetcomment]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 251 | == patchsetComment |
Bruce Zu | 6b0fd76 | 2012-10-25 16:52:00 +0800 | [diff] [blame] | 252 | Comment added on a patchset by a reviewer. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 253 | |
| 254 | file:: The name of the file on which the comment was added. |
| 255 | |
| 256 | line:: The line number at which the comment was added. |
| 257 | |
| 258 | reviewer:: The <<account,account>> that added the comment. |
| 259 | |
| 260 | message:: The comment text. |
| 261 | |
David Pursehouse | 5ab70e3 | 2013-05-08 05:41:50 +0100 | [diff] [blame] | 262 | [[file]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 263 | == file |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 264 | Information about a patch on a file. |
| 265 | |
David Pursehouse | 877d493 | 2012-10-31 10:12:10 +0900 | [diff] [blame] | 266 | file:: The name of the file. If the file is renamed, the new name. |
| 267 | |
| 268 | fileOld:: The old name of the file, if the file is renamed. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 269 | |
| 270 | type:: 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 Zu | 1a9be5e | 2012-10-09 14:49:39 +0800 | [diff] [blame] | 284 | insertions:: number of insertions of this patch. |
| 285 | |
| 286 | deletions:: number of deletions of this patch. |
David Pursehouse | 6002bb2 | 2012-10-10 11:40:49 +0900 | [diff] [blame] | 287 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 288 | == SEE ALSO |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 289 | |
| 290 | * link:cmd-stream-events.html[gerrit stream-events] |
| 291 | * link:cmd-query.html[gerrit query] |
| 292 | |
| 293 | GERRIT |
| 294 | ------ |
| 295 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 296 | |
| 297 | SEARCHBOX |
| 298 | --------- |