Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - /changes/ REST API |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 2 | |
| 3 | This page describes the change related REST endpoints. |
| 4 | Please also take note of the general information on the |
| 5 | link:rest-api.html[REST API]. |
| 6 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7 | [[change-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8 | == Change Endpoints |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 9 | |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 10 | [[create-change]] |
| 11 | === Create Change |
| 12 | -- |
David Pursehouse | a92d2e9 | 2017-08-03 06:03:47 +0000 | [diff] [blame] | 13 | 'POST /changes/' |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 14 | -- |
| 15 | |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 16 | The change input link:#change-input[ChangeInput] entity must be provided in the |
| 17 | request body. |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 18 | |
Edwin Kempin | 088eeb9a | 2018-01-25 08:39:41 +0100 | [diff] [blame] | 19 | To create a change the calling user must be allowed to |
| 20 | link:access-control.html#category_push_review[upload to code review]. |
| 21 | |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 22 | .Request |
| 23 | ---- |
Paladox none | 4bac195 | 2017-08-03 00:09:25 +0000 | [diff] [blame] | 24 | POST /changes/ HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 25 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 26 | |
| 27 | { |
| 28 | "project" : "myProject", |
| 29 | "subject" : "Let's support 100% Gerrit workflow direct in browser", |
| 30 | "branch" : "master", |
| 31 | "topic" : "create-change-in-browser", |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 32 | "status" : "NEW" |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 33 | } |
| 34 | ---- |
| 35 | |
| 36 | As response a link:#change-info[ChangeInfo] entity is returned that describes |
| 37 | the resulting change. |
| 38 | |
| 39 | .Response |
| 40 | ---- |
Paladox none | 4bac195 | 2017-08-03 00:09:25 +0000 | [diff] [blame] | 41 | HTTP/1.1 201 OK |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 42 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 43 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 44 | |
| 45 | )]}' |
| 46 | { |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 47 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 48 | "project": "myProject", |
| 49 | "branch": "master", |
| 50 | "topic": "create-change-in-browser", |
| 51 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 52 | "subject": "Let's support 100% Gerrit workflow direct in browser", |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 53 | "status": "NEW", |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 54 | "created": "2014-05-05 07:15:44.639000000", |
| 55 | "updated": "2014-05-05 07:15:44.639000000", |
| 56 | "mergeable": true, |
| 57 | "insertions": 0, |
| 58 | "deletions": 0, |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 59 | "_number": 4711, |
| 60 | "owner": { |
| 61 | "name": "John Doe" |
| 62 | } |
| 63 | } |
| 64 | ---- |
| 65 | |
Edwin Kempin | 7620274 | 2013-02-15 13:51:50 +0100 | [diff] [blame] | 66 | [[list-changes]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 67 | === Query Changes |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 68 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 69 | 'GET /changes/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 70 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 71 | |
Saša Živkov | dd80402 | 2014-06-23 16:44:03 +0200 | [diff] [blame] | 72 | Queries changes visible to the caller. The |
| 73 | link:user-search.html#_search_operators[query string] must be provided |
| 74 | by the `q` parameter. The `n` parameter can be used to limit the |
| 75 | returned results. |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 76 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 77 | As result a list of link:#change-info[ChangeInfo] entries is returned. |
| 78 | The change output is sorted by the last update time, most recently |
| 79 | updated to oldest updated. |
| 80 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 81 | Query for open changes of watched projects: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 82 | |
| 83 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 84 | ---- |
Edwin Kempin | 2091edb | 2013-01-23 19:07:38 +0100 | [diff] [blame] | 85 | GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 86 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 87 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 88 | .Response |
| 89 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 90 | HTTP/1.1 200 OK |
| 91 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 92 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 93 | |
| 94 | )]}' |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 95 | [ |
| 96 | { |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 97 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 98 | "project": "demo", |
| 99 | "branch": "master", |
| 100 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 101 | "subject": "One change", |
| 102 | "status": "NEW", |
| 103 | "created": "2012-07-17 07:18:30.854000000", |
| 104 | "updated": "2012-07-17 07:19:27.766000000", |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 105 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 106 | "insertions": 26, |
| 107 | "deletions": 10, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 108 | "_number": 1756, |
| 109 | "owner": { |
| 110 | "name": "John Doe" |
| 111 | }, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 112 | }, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 113 | { |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 114 | "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 115 | "project": "demo", |
| 116 | "branch": "master", |
| 117 | "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 118 | "subject": "Another change", |
| 119 | "status": "NEW", |
| 120 | "created": "2012-07-17 07:18:30.884000000", |
| 121 | "updated": "2012-07-17 07:18:30.885000000", |
| 122 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 123 | "insertions": 12, |
| 124 | "deletions": 18, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 125 | "_number": 1757, |
| 126 | "owner": { |
| 127 | "name": "John Doe" |
| 128 | }, |
| 129 | "_more_changes": true |
| 130 | } |
| 131 | ] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 132 | ---- |
| 133 | |
Sebastian Schuberth | 02bafe0 | 2016-01-20 21:38:11 +0100 | [diff] [blame] | 134 | If the number of changes matching the query exceeds either the internal |
| 135 | limit or a supplied `n` query parameter, the last change object has a |
David Pursehouse | 025ea3e | 2014-09-03 10:47:34 +0900 | [diff] [blame] | 136 | `_more_changes: true` JSON field set. |
| 137 | |
| 138 | The `S` or `start` query parameter can be supplied to skip a number |
| 139 | of changes from the list. |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 140 | |
Matthias Sohn | 0b2bf61 | 2020-12-24 00:15:32 +0100 | [diff] [blame^] | 141 | Administrators can use the `skip-visibility` query parameter to skip visibility filtering. |
| 142 | This can be used to ensure that no changes are missed e.g. when querying for changes which |
| 143 | need to be reindexed. Without this parameter query results the user has no permission to read |
| 144 | are filtered out. REST requests with the skip-visibility option are rejected when the current |
| 145 | user doesn't have the ADMINISTRATE_SERVER capability. |
| 146 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 147 | Clients are allowed to specify more than one query by setting the `q` |
| 148 | parameter multiple times. In this case the result is an array of |
| 149 | arrays, one per query in the same order the queries were given in. |
| 150 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 151 | .Query for the 25 most recent open changes of the projects that you watch |
| 152 | **** |
| 153 | get::/changes/?q=status:open+is:watched&n=25 |
| 154 | **** |
| 155 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 156 | Query that retrieves changes for a user's dashboard: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 157 | |
| 158 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 159 | ---- |
| 160 | GET /changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 161 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 162 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 163 | .Response |
| 164 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 165 | HTTP/1.1 200 OK |
| 166 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 167 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 168 | |
| 169 | )]}' |
| 170 | [ |
| 171 | [ |
| 172 | { |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 173 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 174 | "project": "demo", |
| 175 | "branch": "master", |
| 176 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 177 | "subject": "One change", |
| 178 | "status": "NEW", |
| 179 | "created": "2012-07-17 07:18:30.854000000", |
| 180 | "updated": "2012-07-17 07:19:27.766000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 181 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 182 | "insertions": 4, |
| 183 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 184 | "_number": 1756, |
| 185 | "owner": { |
| 186 | "name": "John Doe" |
| 187 | }, |
| 188 | "labels": { |
| 189 | "Verified": {}, |
| 190 | "Code-Review": {} |
| 191 | } |
| 192 | } |
| 193 | ], |
| 194 | [], |
| 195 | [] |
| 196 | ] |
| 197 | ---- |
| 198 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 199 | .Query the changes for your user dashboard |
| 200 | **** |
| 201 | get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS |
| 202 | **** |
| 203 | |
David Pursehouse | 2cf2843 | 2016-08-21 23:20:08 +0900 | [diff] [blame] | 204 | [[query-options]] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 205 | Additional fields can be obtained by adding `o` parameters, each |
| 206 | option requires more database lookups and slows down the query |
| 207 | response time to the client so they are generally disabled by |
| 208 | default. Optional fields are: |
| 209 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 210 | [[labels]] |
| 211 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 212 | * `LABELS`: a summary of each label required for submit, and |
| 213 | approvers that have granted (or rejected) with that label. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 214 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 215 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 216 | [[detailed-labels]] |
| 217 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 218 | * `DETAILED_LABELS`: detailed label information, including numeric |
Dave Borowitz | 992ddd7 | 2013-02-13 11:53:17 -0800 | [diff] [blame] | 219 | values of all existing approvals, recognized label values, values |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 220 | permitted to be set by the current user, all reviewers by state, and |
| 221 | reviewers that may be removed by the current user. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 222 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 223 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 224 | [[current-revision]] |
| 225 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 226 | * `CURRENT_REVISION`: describe the current revision (patch set) |
| 227 | of the change, including the commit SHA-1 and URLs to fetch from. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 228 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 229 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 230 | [[all-revisions]] |
| 231 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 232 | * `ALL_REVISIONS`: describe all revisions, not just current. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 233 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 234 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 235 | [[download-commands]] |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 236 | -- |
| 237 | * `DOWNLOAD_COMMANDS`: include the `commands` field in the |
| 238 | link:#fetch-info[FetchInfo] for revisions. Only valid when the |
| 239 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
| 240 | -- |
| 241 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 242 | [[current-commit]] |
| 243 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 244 | * `CURRENT_COMMIT`: parse and output all header fields from the |
David Pursehouse | 98006e8 | 2013-10-02 10:15:52 +0900 | [diff] [blame] | 245 | commit object, including message. Only valid when the |
| 246 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 247 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 248 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 249 | [[all-commits]] |
| 250 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 251 | * `ALL_COMMITS`: parse and output all header fields from the |
| 252 | output revisions. If only `CURRENT_REVISION` was requested |
| 253 | then only the current revision's commit data will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 254 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 255 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 256 | [[current-files]] |
| 257 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 258 | * `CURRENT_FILES`: list files modified by the commit and magic files, |
| 259 | including basic line counts inserted/deleted per file. Only valid |
| 260 | when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 261 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 262 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 263 | [[all-files]] |
| 264 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 265 | * `ALL_FILES`: list files modified by the commit and magic files, |
| 266 | including basic line counts inserted/deleted per file. If only the |
| 267 | `CURRENT_REVISION` was requested then only that commit's modified |
| 268 | files will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 269 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 270 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 271 | [[detailed-accounts]] |
| 272 | -- |
Edwin Kempin | 4a00e22 | 2013-10-16 14:34:24 +0200 | [diff] [blame] | 273 | * `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username` |
| 274 | fields when referencing accounts. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 275 | -- |
Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 276 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 277 | [[reviewer-updates]] |
| 278 | -- |
| 279 | * `REVIEWER_UPDATES`: include updates to reviewers set as |
| 280 | link:#review-update-info[ReviewerUpdateInfo] entities. |
| 281 | -- |
| 282 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 283 | [[messages]] |
| 284 | -- |
| 285 | * `MESSAGES`: include messages associated with the change. |
| 286 | -- |
| 287 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 288 | [[actions]] |
| 289 | -- |
| 290 | * `CURRENT_ACTIONS`: include information on available actions |
Stefan Beller | 09cd95d | 2015-02-12 13:40:23 -0800 | [diff] [blame] | 291 | for the change and its current revision. Ignored if the caller |
| 292 | is not authenticated. |
| 293 | -- |
| 294 | |
| 295 | [[change-actions]] |
| 296 | -- |
| 297 | * `CHANGE_ACTIONS`: include information on available |
| 298 | change actions for the change. Ignored if the caller |
| 299 | is not authenticated. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 300 | -- |
| 301 | |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 302 | [[reviewed]] |
| 303 | -- |
Dave Borowitz | 86669b3 | 2015-05-27 14:56:10 -0700 | [diff] [blame] | 304 | * `REVIEWED`: include the `reviewed` field if all of the following are |
| 305 | true: |
Ardo Septama | 505f9ad | 2016-12-06 16:28:00 +0100 | [diff] [blame] | 306 | - the change is open |
| 307 | - the caller is authenticated |
| 308 | - the caller has commented on the change more recently than the last update |
Dave Borowitz | 86669b3 | 2015-05-27 14:56:10 -0700 | [diff] [blame] | 309 | from the change owner, i.e. this change would show up in the results of |
| 310 | link:user-search.html#reviewedby[reviewedby:self]. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 311 | -- |
| 312 | |
Han-Wen Nienhuys | 19de6cd | 2018-01-16 13:15:38 +0100 | [diff] [blame] | 313 | [[skip_mergeable]] |
| 314 | -- |
| 315 | * `SKIP_MERGEABLE`: skip the `mergeable` field in |
| 316 | link:#change-info[ChangeInfo]. For fast moving projects, this field must |
| 317 | be recomputed often, which is slow for projects with big trees. |
Patrick Hiesel | db8df48 | 2019-01-24 10:11:23 +0100 | [diff] [blame] | 318 | + |
David Pursehouse | ec17692 | 2019-02-05 12:31:29 +0900 | [diff] [blame] | 319 | When link:config-gerrit.html#change.api.excludeMergeableInChangeInfo[ |
| 320 | `change.api.excludeMergeableInChangeInfo`] is set in the `gerrit.config`, |
| 321 | the `mergeable` field will always be omitted and `SKIP_MERGEABLE` has no |
| 322 | effect. |
| 323 | + |
| 324 | A change's mergeability can be requested separately by calling the |
| 325 | link:#get-mergeable[get-mergeable] endpoint. |
Alice Kober-Sotzek | a19fd75 | 2018-01-19 15:31:46 +0100 | [diff] [blame] | 326 | -- |
Gal Paikin | 3a2aa01 | 2019-06-21 18:30:01 +0200 | [diff] [blame] | 327 | [[skip_diffstat]] |
| 328 | -- |
| 329 | * `SKIP_DIFFSTAT`: skip the 'insertions' and 'deletions' field in link:#change-info[ChangeInfo]. |
| 330 | For large trees, their computation may be expensive. |
| 331 | -- |
Han-Wen Nienhuys | 19de6cd | 2018-01-16 13:15:38 +0100 | [diff] [blame] | 332 | |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 333 | [[submittable]] |
| 334 | -- |
Jonathan Nieder | ad5240f | 2016-10-04 11:03:23 -0700 | [diff] [blame] | 335 | * `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo], |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 336 | which can be used to tell if the change is reviewed and ready for submit. |
| 337 | -- |
| 338 | |
Khai Do | 2a23ec8 | 2014-09-19 16:33:02 -0700 | [diff] [blame] | 339 | [[web-links]] |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 340 | -- |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 341 | * `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo], |
| 342 | therefore only valid in combination with `CURRENT_COMMIT` or |
| 343 | `ALL_COMMITS`. |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 344 | -- |
| 345 | |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 346 | [[check]] |
| 347 | -- |
| 348 | * `CHECK`: include potential problems with the change. |
| 349 | -- |
| 350 | |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 351 | [[commit-footers]] |
| 352 | -- |
| 353 | * `COMMIT_FOOTERS`: include the full commit message with |
| 354 | Gerrit-specific commit footers in the |
| 355 | link:#revision-info[RevisionInfo]. |
Yuxuan 'fishy' Wang | 16baf21 | 2015-05-05 16:49:55 -0700 | [diff] [blame] | 356 | -- |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 357 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 358 | [[push-certificates]] |
| 359 | -- |
| 360 | * `PUSH_CERTIFICATES`: include push certificate information in the |
| 361 | link:#revision-info[RevisionInfo]. Ignored if signed push is not |
| 362 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the |
| 363 | server. |
| 364 | -- |
| 365 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 366 | [[tracking-ids]] |
| 367 | -- |
| 368 | * `TRACKING_IDS`: include references to external tracking systems |
| 369 | as link:#tracking-id-info[TrackingIdInfo]. |
| 370 | -- |
| 371 | |
Martin Fick | b186cd7 | 2018-12-02 23:34:23 -0700 | [diff] [blame] | 372 | [[no-limit]] |
| 373 | -- |
| 374 | * `NO-LIMIT`: Return all results |
| 375 | -- |
| 376 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 377 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 378 | ---- |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 379 | GET /changes/?q=97&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES&o=DOWNLOAD_COMMANDS HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 380 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 381 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 382 | .Response |
| 383 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 384 | HTTP/1.1 200 OK |
| 385 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 386 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 387 | |
| 388 | )]}' |
| 389 | [ |
| 390 | { |
David Pursehouse | c3be6ad | 2014-07-18 12:03:06 +0900 | [diff] [blame] | 391 | "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 392 | "project": "gerrit", |
| 393 | "branch": "master", |
| 394 | "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 395 | "subject": "Use an EventBus to manage star icons", |
| 396 | "status": "NEW", |
| 397 | "created": "2012-04-25 00:52:25.580000000", |
| 398 | "updated": "2012-04-25 00:52:25.586000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 399 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 400 | "insertions": 16, |
| 401 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 402 | "_number": 97, |
| 403 | "owner": { |
| 404 | "name": "Shawn Pearce" |
| 405 | }, |
| 406 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", |
| 407 | "revisions": { |
| 408 | "184ebe53805e102605d11f6b143486d15c23a09c": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 409 | "kind": "REWORK", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 410 | "_number": 1, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 411 | "ref": "refs/changes/97/97/1", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 412 | "fetch": { |
| 413 | "git": { |
| 414 | "url": "git://localhost/gerrit", |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 415 | "ref": "refs/changes/97/97/1", |
| 416 | "commands": { |
| 417 | "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 418 | "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 419 | "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 420 | "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1" |
| 421 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 422 | }, |
| 423 | "http": { |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 424 | "url": "http://myuser@127.0.0.1:8080/gerrit", |
| 425 | "ref": "refs/changes/97/97/1", |
| 426 | "commands": { |
| 427 | "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 428 | "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 429 | "Format-Patch": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 430 | "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1" |
| 431 | } |
| 432 | }, |
| 433 | "ssh": { |
| 434 | "url": "ssh://myuser@*:29418/gerrit", |
| 435 | "ref": "refs/changes/97/97/1", |
| 436 | "commands": { |
| 437 | "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 438 | "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 439 | "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 440 | "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1" |
| 441 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 442 | } |
| 443 | }, |
| 444 | "commit": { |
| 445 | "parents": [ |
| 446 | { |
| 447 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 448 | "subject": "Migrate contributor agreements to All-Projects." |
| 449 | } |
| 450 | ], |
| 451 | "author": { |
| 452 | "name": "Shawn O. Pearce", |
| 453 | "email": "sop@google.com", |
| 454 | "date": "2012-04-24 18:08:08.000000000", |
| 455 | "tz": -420 |
| 456 | }, |
| 457 | "committer": { |
| 458 | "name": "Shawn O. Pearce", |
| 459 | "email": "sop@google.com", |
| 460 | "date": "2012-04-24 18:08:08.000000000", |
| 461 | "tz": -420 |
| 462 | }, |
| 463 | "subject": "Use an EventBus to manage star icons", |
| 464 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 465 | }, |
| 466 | "files": { |
| 467 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 468 | "lines_deleted": 8, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 469 | "size_delta": -412, |
| 470 | "size": 7782 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 471 | }, |
| 472 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 473 | "lines_inserted": 1, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 474 | "size_delta": 23, |
| 475 | "size": 6762 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 476 | }, |
| 477 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { |
| 478 | "lines_inserted": 11, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 479 | "lines_deleted": 19, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 480 | "size_delta": -298, |
| 481 | "size": 47023 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 482 | }, |
| 483 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { |
| 484 | "lines_inserted": 23, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 485 | "lines_deleted": 20, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 486 | "size_delta": 132, |
| 487 | "size": 17727 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 488 | }, |
| 489 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { |
| 490 | "status": "D", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 491 | "lines_deleted": 139, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 492 | "size_delta": -5512, |
| 493 | "size": 13098 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 494 | }, |
| 495 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { |
| 496 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 497 | "lines_inserted": 204, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 498 | "size_delta": 8345, |
| 499 | "size": 8345 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 500 | }, |
| 501 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 502 | "lines_deleted": 9, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 503 | "size_delta": -343, |
| 504 | "size": 5385 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 505 | } |
| 506 | } |
| 507 | } |
| 508 | } |
| 509 | } |
| 510 | ] |
| 511 | ---- |
| 512 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 513 | [[get-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 514 | === Get Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 515 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 516 | 'GET /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 517 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 518 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 519 | Retrieves a change. |
| 520 | |
Dave Borowitz | 0314f73 | 2013-10-03 09:34:30 -0700 | [diff] [blame] | 521 | Additional fields can be obtained by adding `o` parameters, each |
| 522 | option requires more database lookups and slows down the query |
| 523 | response time to the client so they are generally disabled by |
| 524 | default. Fields are described in link:#list-changes[Query Changes]. |
| 525 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 526 | .Request |
| 527 | ---- |
| 528 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 529 | ---- |
| 530 | |
| 531 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 532 | describes the change. |
| 533 | |
| 534 | .Response |
| 535 | ---- |
| 536 | HTTP/1.1 200 OK |
| 537 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 538 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 539 | |
| 540 | )]}' |
| 541 | { |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 542 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 543 | "project": "myProject", |
| 544 | "branch": "master", |
| 545 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 546 | "subject": "Implementing Feature X", |
| 547 | "status": "NEW", |
| 548 | "created": "2013-02-01 09:59:32.126000000", |
| 549 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 550 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 551 | "insertions": 34, |
| 552 | "deletions": 101, |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 553 | "_number": 3965, |
| 554 | "owner": { |
| 555 | "name": "John Doe" |
| 556 | } |
| 557 | } |
| 558 | ---- |
| 559 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 560 | [[get-change-detail]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 561 | === Get Change Detail |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 562 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 563 | 'GET /changes/link:#change-id[\{change-id\}]/detail' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 564 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 565 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 566 | Retrieves a change with link:#labels[labels], link:#detailed-labels[ |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 567 | detailed labels], link:#detailed-accounts[detailed accounts], |
| 568 | link:#reviewer-updates[reviewer updates], and link:#messages[messages]. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 569 | |
Shawn Pearce | 7f3dccf | 2013-07-06 19:24:29 -0700 | [diff] [blame] | 570 | Additional fields can be obtained by adding `o` parameters, each |
| 571 | option requires more database lookups and slows down the query |
| 572 | response time to the client so they are generally disabled by |
| 573 | default. Fields are described in link:#list-changes[Query Changes]. |
| 574 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 575 | .Request |
| 576 | ---- |
| 577 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0 |
| 578 | ---- |
| 579 | |
| 580 | As response a link:#change-info[ChangeInfo] entity is returned that |
Khai Do | ad63201 | 2014-06-22 08:29:57 -0700 | [diff] [blame] | 581 | describes the change. This response will contain all votes for each |
| 582 | label and include one combined vote. The combined label vote is |
| 583 | calculated in the following order (from highest to lowest): |
| 584 | REJECTED > APPROVED > DISLIKED > RECOMMENDED. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 585 | |
| 586 | .Response |
| 587 | ---- |
| 588 | HTTP/1.1 200 OK |
| 589 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 590 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 591 | |
| 592 | )]}' |
| 593 | { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 594 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 595 | "project": "myProject", |
| 596 | "branch": "master", |
| 597 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 598 | "subject": "Implementing Feature X", |
| 599 | "status": "NEW", |
| 600 | "created": "2013-02-01 09:59:32.126000000", |
| 601 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 602 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 603 | "insertions": 126, |
| 604 | "deletions": 11, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 605 | "_number": 3965, |
| 606 | "owner": { |
| 607 | "_account_id": 1000096, |
| 608 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 609 | "email": "john.doe@example.com", |
| 610 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 611 | }, |
| 612 | "labels": { |
| 613 | "Verified": { |
| 614 | "all": [ |
| 615 | { |
| 616 | "value": 0, |
| 617 | "_account_id": 1000096, |
| 618 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 619 | "email": "john.doe@example.com", |
| 620 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 621 | }, |
| 622 | { |
| 623 | "value": 0, |
| 624 | "_account_id": 1000097, |
| 625 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 626 | "email": "jane.roe@example.com", |
| 627 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 628 | } |
| 629 | ], |
| 630 | "values": { |
| 631 | "-1": "Fails", |
| 632 | " 0": "No score", |
| 633 | "+1": "Verified" |
| 634 | } |
| 635 | }, |
| 636 | "Code-Review": { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 637 | "disliked": { |
| 638 | "_account_id": 1000096, |
| 639 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 640 | "email": "john.doe@example.com", |
| 641 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 642 | }, |
| 643 | "all": [ |
| 644 | { |
| 645 | "value": -1, |
| 646 | "_account_id": 1000096, |
| 647 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 648 | "email": "john.doe@example.com", |
| 649 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 650 | }, |
| 651 | { |
| 652 | "value": 1, |
| 653 | "_account_id": 1000097, |
| 654 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 655 | "email": "jane.roe@example.com", |
| 656 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 657 | } |
| 658 | ] |
| 659 | "values": { |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame] | 660 | "-2": "This shall not be merged", |
| 661 | "-1": "I would prefer this is not merged as is", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 662 | " 0": "No score", |
| 663 | "+1": "Looks good to me, but someone else must approve", |
| 664 | "+2": "Looks good to me, approved" |
| 665 | } |
| 666 | } |
| 667 | }, |
| 668 | "permitted_labels": { |
| 669 | "Verified": [ |
| 670 | "-1", |
| 671 | " 0", |
| 672 | "+1" |
| 673 | ], |
| 674 | "Code-Review": [ |
| 675 | "-2", |
| 676 | "-1", |
| 677 | " 0", |
| 678 | "+1", |
| 679 | "+2" |
| 680 | ] |
| 681 | }, |
| 682 | "removable_reviewers": [ |
| 683 | { |
| 684 | "_account_id": 1000096, |
| 685 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 686 | "email": "john.doe@example.com", |
| 687 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 688 | }, |
| 689 | { |
| 690 | "_account_id": 1000097, |
| 691 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 692 | "email": "jane.roe@example.com", |
| 693 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 694 | } |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 695 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 696 | "reviewers": { |
| 697 | "REVIEWER": [ |
| 698 | { |
| 699 | "_account_id": 1000096, |
| 700 | "name": "John Doe", |
| 701 | "email": "john.doe@example.com", |
| 702 | "username": "jdoe" |
| 703 | }, |
| 704 | { |
| 705 | "_account_id": 1000097, |
| 706 | "name": "Jane Roe", |
| 707 | "email": "jane.roe@example.com", |
| 708 | "username": "jroe" |
| 709 | } |
| 710 | ] |
| 711 | }, |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 712 | "reviewer_updates": [ |
| 713 | { |
| 714 | "state": "REVIEWER", |
| 715 | "reviewer": { |
| 716 | "_account_id": 1000096, |
| 717 | "name": "John Doe", |
| 718 | "email": "john.doe@example.com", |
| 719 | "username": "jdoe" |
| 720 | }, |
| 721 | "updated_by": { |
| 722 | "_account_id": 1000096, |
| 723 | "name": "John Doe", |
| 724 | "email": "john.doe@example.com", |
| 725 | "username": "jdoe" |
| 726 | }, |
| 727 | "updated": "2016-07-21 20:12:39.000000000" |
| 728 | }, |
| 729 | { |
| 730 | "state": "REMOVED", |
| 731 | "reviewer": { |
| 732 | "_account_id": 1000096, |
| 733 | "name": "John Doe", |
| 734 | "email": "john.doe@example.com", |
| 735 | "username": "jdoe" |
| 736 | }, |
| 737 | "updated_by": { |
| 738 | "_account_id": 1000096, |
| 739 | "name": "John Doe", |
| 740 | "email": "john.doe@example.com", |
| 741 | "username": "jdoe" |
| 742 | }, |
| 743 | "updated": "2016-07-21 20:12:33.000000000" |
| 744 | }, |
| 745 | { |
| 746 | "state": "CC", |
| 747 | "reviewer": { |
| 748 | "_account_id": 1000096, |
| 749 | "name": "John Doe", |
| 750 | "email": "john.doe@example.com", |
| 751 | "username": "jdoe" |
| 752 | }, |
| 753 | "updated_by": { |
| 754 | "_account_id": 1000096, |
| 755 | "name": "John Doe", |
| 756 | "email": "john.doe@example.com", |
| 757 | "username": "jdoe" |
| 758 | }, |
| 759 | "updated": "2016-03-23 21:34:02.419000000", |
| 760 | }, |
| 761 | ], |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 762 | "messages": [ |
| 763 | { |
| 764 | "id": "YH-egE", |
| 765 | "author": { |
| 766 | "_account_id": 1000096, |
| 767 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 768 | "email": "john.doe@example.com", |
| 769 | "username": "jdoe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 770 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 771 | "date": "2013-03-23 21:34:02.419000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 772 | "message": "Patch Set 1:\n\nThis is the first message.", |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 773 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 774 | }, |
| 775 | { |
| 776 | "id": "WEEdhU", |
| 777 | "author": { |
| 778 | "_account_id": 1000097, |
| 779 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 780 | "email": "jane.roe@example.com", |
| 781 | "username": "jroe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 782 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 783 | "date": "2013-03-23 21:36:52.332000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 784 | "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.", |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 785 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 786 | } |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 787 | ] |
| 788 | } |
| 789 | ---- |
| 790 | |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 791 | [[create-merge-patch-set-for-change]] |
| 792 | === Create Merge Patch Set For Change |
| 793 | -- |
| 794 | 'POST /changes/link:#change-id[\{change-id\}]/merge' |
| 795 | -- |
| 796 | |
| 797 | Update an existing change by using a |
| 798 | link:#merge-patch-set-input[MergePatchSetInput] entity. |
| 799 | |
| 800 | Gerrit will create a merge commit based on the information of |
| 801 | MergePatchSetInput and add a new patch set to the change corresponding |
| 802 | to the new merge commit. |
| 803 | |
| 804 | .Request |
| 805 | ---- |
| 806 | POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0 |
| 807 | Content-Type: application/json; charset=UTF-8 |
| 808 | |
| 809 | { |
| 810 | "subject": "Merge dev_branch into master", |
| 811 | "merge": { |
David Pursehouse | f4fb104 | 2018-03-18 23:03:46 +0900 | [diff] [blame] | 812 | "source": "refs/changes/34/1234/1" |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 813 | } |
| 814 | } |
| 815 | ---- |
| 816 | |
| 817 | As response a link:#change-info[ChangeInfo] entity with current revision is |
| 818 | returned that describes the resulting change. |
| 819 | |
| 820 | .Response |
| 821 | ---- |
| 822 | HTTP/1.1 200 OK |
| 823 | Content-Disposition: attachment |
| 824 | Content-Type: application/json; charset=UTF-8 |
| 825 | |
| 826 | )]}' |
| 827 | { |
| 828 | "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 829 | "project": "test", |
| 830 | "branch": "master", |
| 831 | "hashtags": [], |
| 832 | "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 833 | "subject": "Merge dev_branch into master", |
| 834 | "status": "NEW", |
| 835 | "created": "2016-09-23 18:08:53.238000000", |
| 836 | "updated": "2016-09-23 18:09:25.934000000", |
| 837 | "submit_type": "MERGE_IF_NECESSARY", |
| 838 | "mergeable": true, |
| 839 | "insertions": 5, |
| 840 | "deletions": 0, |
| 841 | "_number": 72, |
| 842 | "owner": { |
| 843 | "_account_id": 1000000 |
| 844 | }, |
| 845 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822" |
| 846 | } |
| 847 | ---- |
| 848 | |
| 849 | [[set-message]] |
| 850 | === Set Commit Message |
| 851 | -- |
| 852 | 'PUT /changes/link:#change-id[\{change-id\}]/message' |
| 853 | -- |
| 854 | |
| 855 | Creates a new patch set with a new commit message. |
| 856 | |
| 857 | The new commit message must be provided in the request body inside a |
Han-Wen Nienhuys | 098580a | 2019-07-24 20:17:41 +0200 | [diff] [blame] | 858 | link:#commit-message-input[CommitMessageInput] entity. If a Change-Id |
| 859 | footer is specified, it must match the current Change-Id footer. If |
| 860 | the Change-Id footer is absent, the current Change-Id is added to the |
| 861 | message. |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 862 | |
| 863 | .Request |
| 864 | ---- |
| 865 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0 |
| 866 | Content-Type: application/json; charset=UTF-8 |
| 867 | |
| 868 | { |
| 869 | "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n" |
| 870 | } |
| 871 | ---- |
| 872 | |
| 873 | .Notifications |
| 874 | |
| 875 | An email will be sent using the "newpatchset" template. |
| 876 | |
| 877 | [options="header",cols="1,1"] |
| 878 | |============================= |
| 879 | |WIP State |Default |
| 880 | |Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers |
| 881 | |Work in progress|owner |
| 882 | |============================= |
| 883 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 884 | [[get-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 885 | === Get Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 886 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 887 | 'GET /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 888 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 889 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 890 | Retrieves the topic of a change. |
| 891 | |
| 892 | .Request |
| 893 | ---- |
| 894 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 895 | ---- |
| 896 | |
| 897 | .Response |
| 898 | ---- |
| 899 | HTTP/1.1 200 OK |
| 900 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 901 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 902 | |
| 903 | )]}' |
| 904 | "Documentation" |
| 905 | ---- |
| 906 | |
| 907 | If the change does not have a topic an empty string is returned. |
| 908 | |
| 909 | [[set-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 910 | === Set Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 911 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 912 | 'PUT /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 913 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 914 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 915 | Sets the topic of a change. |
| 916 | |
| 917 | The new topic must be provided in the request body inside a |
Patrick Hiesel | 4aa1456 | 2018-06-19 15:07:50 +0200 | [diff] [blame] | 918 | link:#topic-input[TopicInput] entity. Any leading or trailing whitespace |
| 919 | in the topic name will be removed. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 920 | |
| 921 | .Request |
| 922 | ---- |
| 923 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 924 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 925 | |
| 926 | { |
| 927 | "topic": "Documentation" |
| 928 | } |
| 929 | ---- |
| 930 | |
| 931 | As response the new topic is returned. |
| 932 | |
| 933 | .Response |
| 934 | ---- |
| 935 | HTTP/1.1 200 OK |
| 936 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 937 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 938 | |
| 939 | )]}' |
| 940 | "Documentation" |
| 941 | ---- |
| 942 | |
| 943 | If the topic was deleted the response is "`204 No Content`". |
| 944 | |
| 945 | [[delete-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 946 | === Delete Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 947 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 948 | 'DELETE /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 949 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 950 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 951 | Deletes the topic of a change. |
| 952 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 953 | .Request |
| 954 | ---- |
| 955 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 956 | ---- |
| 957 | |
| 958 | .Response |
| 959 | ---- |
| 960 | HTTP/1.1 204 No Content |
| 961 | ---- |
| 962 | |
Sven Selberg | 273a4aa | 2016-09-21 16:28:10 +0200 | [diff] [blame] | 963 | [[get-assignee]] |
| 964 | === Get Assignee |
| 965 | -- |
| 966 | 'GET /changes/link:#change-id[\{change-id\}]/assignee' |
| 967 | -- |
| 968 | |
| 969 | Retrieves the account of the user assigned to a change. |
| 970 | |
| 971 | .Request |
| 972 | ---- |
| 973 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0 |
| 974 | ---- |
| 975 | |
| 976 | As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity |
| 977 | describing the assigned account is returned. |
| 978 | |
| 979 | .Response |
| 980 | ---- |
| 981 | HTTP/1.1 200 OK |
| 982 | Content-Disposition: attachment |
| 983 | Content-Type: application/json; charset=UTF-8 |
| 984 | |
| 985 | )]}' |
| 986 | { |
| 987 | "_account_id": 1000096, |
| 988 | "name": "John Doe", |
| 989 | "email": "john.doe@example.com", |
| 990 | "username": "jdoe" |
| 991 | } |
| 992 | ---- |
| 993 | |
| 994 | If the change has no assignee the response is "`204 No Content`". |
| 995 | |
| 996 | [[get-past-assignees]] |
| 997 | === Get Past Assignees |
| 998 | -- |
| 999 | 'GET /changes/link:#change-id[\{change-id\}]/past_assignees' |
| 1000 | -- |
| 1001 | |
| 1002 | Returns a list of every user ever assigned to a change, in the order in which |
| 1003 | they were first assigned. |
| 1004 | |
| 1005 | .Request |
| 1006 | ---- |
| 1007 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/past_assignees HTTP/1.0 |
| 1008 | ---- |
| 1009 | |
| 1010 | As a response a list of link:rest-api-accounts.html#account-info[AccountInfo] |
| 1011 | entities is returned. |
| 1012 | |
| 1013 | .Response |
| 1014 | ---- |
| 1015 | HTTP/1.1 200 OK |
| 1016 | Content-Disposition: attachment |
| 1017 | Content-Type: application/json; charset=UTF-8 |
| 1018 | |
| 1019 | )]}' |
| 1020 | [ |
| 1021 | { |
| 1022 | "_account_id": 1000051, |
| 1023 | "name": "Jane Doe", |
| 1024 | "email": "jane.doe@example.com", |
| 1025 | "username": "janed" |
| 1026 | }, |
| 1027 | { |
| 1028 | "_account_id": 1000096, |
| 1029 | "name": "John Doe", |
| 1030 | "email": "john.doe@example.com", |
| 1031 | "username": "jdoe" |
| 1032 | } |
| 1033 | ] |
| 1034 | |
| 1035 | ---- |
| 1036 | |
| 1037 | |
| 1038 | [[set-assignee]] |
| 1039 | === Set Assignee |
| 1040 | -- |
| 1041 | 'PUT /changes/link:#change-id[\{change-id\}]/assignee' |
| 1042 | -- |
| 1043 | |
| 1044 | Sets the assignee of a change. |
| 1045 | |
| 1046 | The new assignee must be provided in the request body inside a |
| 1047 | link:#assignee-input[AssigneeInput] entity. |
| 1048 | |
| 1049 | .Request |
| 1050 | ---- |
| 1051 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0 |
| 1052 | Content-Type: application/json; charset=UTF-8 |
| 1053 | |
| 1054 | { |
| 1055 | "assignee": "jdoe" |
| 1056 | } |
| 1057 | ---- |
| 1058 | |
| 1059 | As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity |
| 1060 | describing the assigned account is returned. |
| 1061 | |
| 1062 | .Response |
| 1063 | ---- |
| 1064 | HTTP/1.1 200 OK |
| 1065 | Content-Disposition: attachment |
| 1066 | Content-Type: application/json; charset=UTF-8 |
| 1067 | |
| 1068 | )]}' |
| 1069 | { |
| 1070 | "_account_id": 1000096, |
| 1071 | "name": "John Doe", |
| 1072 | "email": "john.doe@example.com", |
| 1073 | "username": "jdoe" |
| 1074 | } |
| 1075 | ---- |
| 1076 | |
| 1077 | [[delete-assignee]] |
| 1078 | === Delete Assignee |
| 1079 | -- |
| 1080 | 'DELETE /changes/link:#change-id[\{change-id\}]/assignee' |
| 1081 | -- |
| 1082 | |
| 1083 | Deletes the assignee of a change. |
| 1084 | |
| 1085 | |
| 1086 | .Request |
| 1087 | ---- |
| 1088 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0 |
| 1089 | ---- |
| 1090 | |
| 1091 | As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity |
| 1092 | describing the account of the deleted assignee is returned. |
| 1093 | |
| 1094 | .Response |
| 1095 | ---- |
| 1096 | HTTP/1.1 200 OK |
| 1097 | Content-Disposition: attachment |
| 1098 | Content-Type: application/json; charset=UTF-8 |
| 1099 | |
| 1100 | )]}' |
| 1101 | { |
| 1102 | "_account_id": 1000096, |
| 1103 | "name": "John Doe", |
| 1104 | "email": "john.doe@example.com", |
| 1105 | "username": "jdoe" |
| 1106 | } |
| 1107 | ---- |
| 1108 | |
| 1109 | If the change had no assignee the response is "`204 No Content`". |
| 1110 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 1111 | [[get-pure-revert]] |
| 1112 | === Get Pure Revert |
| 1113 | -- |
| 1114 | 'GET /changes/link:#change-id[\{change-id\}]/pure_revert' |
| 1115 | -- |
| 1116 | |
| 1117 | Check if the given change is a pure revert of the change it references in `revertOf`. |
| 1118 | Optionally, the query parameter `o` can be passed in to specify a commit (SHA1 in |
| 1119 | 40 digit hex representation) to check against. It takes precedence over `revertOf`. |
| 1120 | If the change has no reference in `revertOf`, the parameter is mandatory. |
| 1121 | |
| 1122 | As response a link:#pure-revert-info[PureRevertInfo] entity is returned. |
| 1123 | |
| 1124 | .Request |
| 1125 | ---- |
| 1126 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0 |
| 1127 | ---- |
| 1128 | |
| 1129 | .Response |
| 1130 | ---- |
| 1131 | HTTP/1.1 200 OK |
| 1132 | Content-Disposition: attachment |
| 1133 | Content-Type: application/json; charset=UTF-8 |
| 1134 | |
| 1135 | )]}' |
| 1136 | { |
| 1137 | "is_pure_revert" : false |
| 1138 | } |
| 1139 | ---- |
| 1140 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1141 | [[abandon-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1142 | === Abandon Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1143 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1144 | 'POST /changes/link:#change-id[\{change-id\}]/abandon' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1145 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1146 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1147 | Abandons a change. |
| 1148 | |
| 1149 | The request body does not need to include a link:#abandon-input[ |
| 1150 | AbandonInput] entity if no review comment is added. |
| 1151 | |
| 1152 | .Request |
| 1153 | ---- |
| 1154 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0 |
| 1155 | ---- |
| 1156 | |
| 1157 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1158 | describes the abandoned change. |
| 1159 | |
| 1160 | .Response |
| 1161 | ---- |
| 1162 | HTTP/1.1 200 OK |
| 1163 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1164 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1165 | |
| 1166 | )]}' |
| 1167 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1168 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1169 | "project": "myProject", |
| 1170 | "branch": "master", |
| 1171 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1172 | "subject": "Implementing Feature X", |
| 1173 | "status": "ABANDONED", |
| 1174 | "created": "2013-02-01 09:59:32.126000000", |
| 1175 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1176 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1177 | "insertions": 3, |
| 1178 | "deletions": 310, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1179 | "_number": 3965, |
| 1180 | "owner": { |
| 1181 | "name": "John Doe" |
| 1182 | } |
| 1183 | } |
| 1184 | ---- |
| 1185 | |
| 1186 | If the change cannot be abandoned because the change state doesn't |
| 1187 | allow abandoning of the change, the response is "`409 Conflict`" and |
| 1188 | the error message is contained in the response body. |
| 1189 | |
| 1190 | .Response |
| 1191 | ---- |
| 1192 | HTTP/1.1 409 Conflict |
| 1193 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1194 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1195 | |
| 1196 | change is merged |
| 1197 | ---- |
| 1198 | |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1199 | .Notifications |
| 1200 | |
| 1201 | An email will be sent using the "abandon" template. The notify handling is ALL. |
| 1202 | Notifications are suppressed on WIP changes that have never started review. |
| 1203 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1204 | [options="header",cols="1,2"] |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1205 | |============================= |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1206 | |WIP State |notify=ALL |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1207 | |Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1208 | |Work in progress|not sent |
| 1209 | |Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1210 | |============================= |
| 1211 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1212 | [[restore-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1213 | === Restore Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1214 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1215 | 'POST /changes/link:#change-id[\{change-id\}]/restore' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1216 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1217 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1218 | Restores a change. |
| 1219 | |
| 1220 | The request body does not need to include a link:#restore-input[ |
| 1221 | RestoreInput] entity if no review comment is added. |
| 1222 | |
| 1223 | .Request |
| 1224 | ---- |
| 1225 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0 |
| 1226 | ---- |
| 1227 | |
| 1228 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1229 | describes the restored change. |
| 1230 | |
| 1231 | .Response |
| 1232 | ---- |
| 1233 | HTTP/1.1 200 OK |
| 1234 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1235 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1236 | |
| 1237 | )]}' |
| 1238 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1239 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1240 | "project": "myProject", |
| 1241 | "branch": "master", |
| 1242 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1243 | "subject": "Implementing Feature X", |
| 1244 | "status": "NEW", |
| 1245 | "created": "2013-02-01 09:59:32.126000000", |
| 1246 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1247 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1248 | "insertions": 2, |
| 1249 | "deletions": 13, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1250 | "_number": 3965, |
| 1251 | "owner": { |
| 1252 | "name": "John Doe" |
| 1253 | } |
| 1254 | } |
| 1255 | ---- |
| 1256 | |
| 1257 | If the change cannot be restored because the change state doesn't |
| 1258 | allow restoring the change, the response is "`409 Conflict`" and |
| 1259 | the error message is contained in the response body. |
| 1260 | |
| 1261 | .Response |
| 1262 | ---- |
| 1263 | HTTP/1.1 409 Conflict |
| 1264 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1265 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1266 | |
| 1267 | change is new |
| 1268 | ---- |
| 1269 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1270 | [[rebase-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1271 | === Rebase Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1272 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1273 | 'POST /changes/link:#change-id[\{change-id\}]/rebase' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1274 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1275 | |
| 1276 | Rebases a change. |
| 1277 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1278 | Optionally, the parent revision can be changed to another patch set through the |
| 1279 | link:#rebase-input[RebaseInput] entity. |
| 1280 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1281 | .Request |
| 1282 | ---- |
| 1283 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1284 | Content-Type: application/json;charset=UTF-8 |
| 1285 | |
| 1286 | { |
| 1287 | "base" : "1234", |
| 1288 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1289 | ---- |
| 1290 | |
| 1291 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1292 | describes the rebased change. Information about the current patch set |
| 1293 | is included. |
| 1294 | |
| 1295 | .Response |
| 1296 | ---- |
| 1297 | HTTP/1.1 200 OK |
| 1298 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1299 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1300 | |
| 1301 | )]}' |
| 1302 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1303 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1304 | "project": "myProject", |
| 1305 | "branch": "master", |
| 1306 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1307 | "subject": "Implement Feature X", |
| 1308 | "status": "NEW", |
| 1309 | "created": "2013-02-01 09:59:32.126000000", |
| 1310 | "updated": "2013-02-21 11:16:36.775000000", |
| 1311 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1312 | "insertions": 33, |
| 1313 | "deletions": 9, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1314 | "_number": 4799, |
| 1315 | "owner": { |
| 1316 | "name": "John Doe" |
| 1317 | }, |
| 1318 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 1319 | "revisions": { |
| 1320 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1321 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1322 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 1323 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1324 | "fetch": { |
| 1325 | "http": { |
| 1326 | "url": "http://gerrit:8080/myProject", |
| 1327 | "ref": "refs/changes/99/4799/2" |
| 1328 | } |
| 1329 | }, |
| 1330 | "commit": { |
| 1331 | "parents": [ |
| 1332 | { |
| 1333 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 1334 | "subject": "Implement Feature A" |
| 1335 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 1336 | ], |
| 1337 | "author": { |
| 1338 | "name": "John Doe", |
| 1339 | "email": "john.doe@example.com", |
| 1340 | "date": "2013-05-07 15:21:27.000000000", |
| 1341 | "tz": 120 |
| 1342 | }, |
| 1343 | "committer": { |
| 1344 | "name": "Gerrit Code Review", |
| 1345 | "email": "gerrit-server@example.com", |
| 1346 | "date": "2013-05-07 15:35:43.000000000", |
| 1347 | "tz": 120 |
| 1348 | }, |
| 1349 | "subject": "Implement Feature X", |
| 1350 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1351 | } |
| 1352 | } |
| 1353 | } |
| 1354 | ---- |
| 1355 | |
| 1356 | If the change cannot be rebased, e.g. due to conflicts, the response is |
| 1357 | "`409 Conflict`" and the error message is contained in the response |
| 1358 | body. |
| 1359 | |
| 1360 | .Response |
| 1361 | ---- |
| 1362 | HTTP/1.1 409 Conflict |
| 1363 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1364 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1365 | |
| 1366 | The change could not be rebased due to a path conflict during merge. |
| 1367 | ---- |
| 1368 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1369 | [[move-change]] |
| 1370 | === Move Change |
| 1371 | -- |
| 1372 | 'POST /changes/link:#change-id[\{change-id\}]/move' |
| 1373 | -- |
| 1374 | |
| 1375 | Move a change. |
| 1376 | |
| 1377 | The destination branch must be provided in the request body inside a |
| 1378 | link:#move-input[MoveInput] entity. |
| 1379 | |
| 1380 | .Request |
| 1381 | ---- |
| 1382 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0 |
| 1383 | Content-Type: application/json; charset=UTF-8 |
| 1384 | |
| 1385 | { |
| 1386 | "destination_branch" : "release-branch" |
| 1387 | } |
| 1388 | |
| 1389 | ---- |
| 1390 | |
| 1391 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1392 | describes the moved change. |
| 1393 | |
| 1394 | .Response |
| 1395 | ---- |
| 1396 | HTTP/1.1 200 OK |
| 1397 | Content-Disposition: attachment |
| 1398 | Content-Type: application/json; charset=UTF-8 |
| 1399 | |
| 1400 | )]}' |
| 1401 | { |
| 1402 | "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1403 | "project": "myProject", |
| 1404 | "branch": "release-branch", |
| 1405 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1406 | "subject": "Implementing Feature X", |
| 1407 | "status": "NEW", |
| 1408 | "created": "2013-02-01 09:59:32.126000000", |
| 1409 | "updated": "2013-02-21 11:16:36.775000000", |
| 1410 | "mergeable": true, |
| 1411 | "insertions": 2, |
| 1412 | "deletions": 13, |
| 1413 | "_number": 3965, |
| 1414 | "owner": { |
| 1415 | "name": "John Doe" |
| 1416 | } |
| 1417 | } |
| 1418 | ---- |
| 1419 | |
Changcheng Xiao | 6dc9042 | 2017-08-09 10:21:58 +0200 | [diff] [blame] | 1420 | Note that this endpoint will not update the change's parents, which is |
| 1421 | different from the link:#cherry-pick[cherry-pick] endpoint. |
| 1422 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1423 | If the change cannot be moved because the change state doesn't |
| 1424 | allow moving the change, the response is "`409 Conflict`" and |
| 1425 | the error message is contained in the response body. |
| 1426 | |
| 1427 | .Response |
| 1428 | ---- |
| 1429 | HTTP/1.1 409 Conflict |
| 1430 | Content-Disposition: attachment |
| 1431 | Content-Type: text/plain; charset=UTF-8 |
| 1432 | |
| 1433 | change is merged |
| 1434 | ---- |
| 1435 | |
| 1436 | If the change cannot be moved because the user doesn't have |
| 1437 | abandon permission on the change or upload permission on the destination, |
| 1438 | the response is "`409 Conflict`" and the error message is contained in the |
| 1439 | response body. |
| 1440 | |
| 1441 | .Response |
| 1442 | ---- |
| 1443 | HTTP/1.1 409 Conflict |
| 1444 | Content-Disposition: attachment |
| 1445 | Content-Type: text/plain; charset=UTF-8 |
| 1446 | |
| 1447 | move not permitted |
| 1448 | ---- |
| 1449 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1450 | [[revert-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1451 | === Revert Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1452 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1453 | 'POST /changes/link:#change-id[\{change-id\}]/revert' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1454 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1455 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1456 | Reverts a change. |
| 1457 | |
| 1458 | The request body does not need to include a link:#revert-input[ |
| 1459 | RevertInput] entity if no review comment is added. |
| 1460 | |
| 1461 | .Request |
| 1462 | ---- |
Michael Zhou | 1027049 | 2016-03-24 22:35:40 -0400 | [diff] [blame] | 1463 | POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1464 | ---- |
| 1465 | |
| 1466 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1467 | describes the reverting change. |
| 1468 | |
| 1469 | .Response |
| 1470 | ---- |
| 1471 | HTTP/1.1 200 OK |
| 1472 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1473 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1474 | |
| 1475 | )]}' |
| 1476 | { |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1477 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1478 | "project": "myProject", |
| 1479 | "branch": "master", |
| 1480 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1481 | "subject": "Revert \"Implementing Feature X\"", |
| 1482 | "status": "NEW", |
| 1483 | "created": "2013-02-01 09:59:32.126000000", |
| 1484 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1485 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1486 | "insertions": 6, |
| 1487 | "deletions": 4, |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1488 | "_number": 3965, |
| 1489 | "owner": { |
| 1490 | "name": "John Doe" |
| 1491 | } |
| 1492 | } |
| 1493 | ---- |
| 1494 | |
| 1495 | If the change cannot be reverted because the change state doesn't |
| 1496 | allow reverting the change, the response is "`409 Conflict`" and |
| 1497 | the error message is contained in the response body. |
| 1498 | |
| 1499 | .Response |
| 1500 | ---- |
| 1501 | HTTP/1.1 409 Conflict |
| 1502 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1503 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1504 | |
| 1505 | change is new |
| 1506 | ---- |
| 1507 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1508 | [[submit-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1509 | === Submit Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1510 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1511 | 'POST /changes/link:#change-id[\{change-id\}]/submit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1512 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1513 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1514 | Submits a change. |
| 1515 | |
| 1516 | The request body only needs to include a link:#submit-input[ |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 1517 | SubmitInput] entity if submitting on behalf of another user. |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1518 | |
| 1519 | .Request |
| 1520 | ---- |
| 1521 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1522 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1523 | |
| 1524 | { |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 1525 | "on_behalf_of": 1001439 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1526 | } |
| 1527 | ---- |
| 1528 | |
| 1529 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1530 | describes the submitted/merged change. |
| 1531 | |
| 1532 | .Response |
| 1533 | ---- |
| 1534 | HTTP/1.1 200 OK |
| 1535 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1536 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1537 | |
| 1538 | )]}' |
| 1539 | { |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1540 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1541 | "project": "myProject", |
| 1542 | "branch": "master", |
| 1543 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1544 | "subject": "Implementing Feature X", |
| 1545 | "status": "MERGED", |
| 1546 | "created": "2013-02-01 09:59:32.126000000", |
| 1547 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 1548 | "submitted": "2013-02-21 11:16:36.615000000", |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1549 | "_number": 3965, |
| 1550 | "owner": { |
| 1551 | "name": "John Doe" |
| 1552 | } |
| 1553 | } |
| 1554 | ---- |
| 1555 | |
| 1556 | If the change cannot be submitted because the submit rule doesn't allow |
| 1557 | submitting the change, the response is "`409 Conflict`" and the error |
| 1558 | message is contained in the response body. |
| 1559 | |
| 1560 | .Response |
| 1561 | ---- |
| 1562 | HTTP/1.1 409 Conflict |
| 1563 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1564 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1565 | |
| 1566 | blocked by Verified |
| 1567 | ---- |
| 1568 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 1569 | [[submitted-together]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1570 | === Changes Submitted Together |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1571 | -- |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1572 | 'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES' |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1573 | -- |
| 1574 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1575 | Computes list of all changes which are submitted when |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1576 | link:#submit-change[Submit] is called for this change, |
Stefan Beller | 460f354 | 2015-07-20 14:10:41 -0700 | [diff] [blame] | 1577 | including the current change itself. |
| 1578 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1579 | The list consists of: |
| 1580 | |
| 1581 | * The given change. |
| 1582 | * If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 1583 | is enabled, include all open changes with the same topic. |
| 1584 | * For each change whose submit type is not CHERRY_PICK, include unmerged |
| 1585 | ancestors targeting the same branch. |
| 1586 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1587 | As a special case, the list is empty if this change would be |
| 1588 | submitted by itself (without other changes). |
| 1589 | |
| 1590 | .Request |
| 1591 | ---- |
| 1592 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0 |
| 1593 | Content-Type: application/json; charset=UTF-8 |
| 1594 | ---- |
| 1595 | |
| 1596 | As a response a link:#submitted-together-info[SubmittedTogetherInfo] |
| 1597 | entity is returned that describes what would happen if the change were |
| 1598 | submitted. This response contains a list of changes and a count of |
| 1599 | changes that are not visible to the caller that are part of the set of |
| 1600 | changes to be merged. |
| 1601 | |
| 1602 | The listed changes use the same format as in |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1603 | link:#list-changes[Query Changes] with the |
| 1604 | link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`], |
Patrick Hiesel | 6fbbdaa | 2018-04-05 15:10:13 +0200 | [diff] [blame] | 1605 | link:#current-revision[`CURRENT_REVISION`],and |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 1606 | link:#submittable[`SUBMITTABLE`] options set. |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1607 | |
Shawn Pearce | 8080c3d | 2016-09-19 19:15:04 -0700 | [diff] [blame] | 1608 | Standard link:#query-options[formatting options] can be specified |
| 1609 | with the `o` parameter, as well as the `submitted_together` specific |
| 1610 | option `NON_VISIBLE_CHANGES`. |
| 1611 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1612 | .Response |
| 1613 | ---- |
| 1614 | HTTP/1.1 200 OK |
| 1615 | Content-Disposition: attachment |
| 1616 | Content-Type: application/json; charset=UTF-8 |
| 1617 | |
| 1618 | )]}' |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1619 | { |
| 1620 | "changes": [ |
| 1621 | { |
| 1622 | "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 1623 | "project": "gerrit", |
| 1624 | "branch": "master", |
| 1625 | "hashtags": [], |
| 1626 | "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 1627 | "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes", |
| 1628 | "status": "NEW", |
| 1629 | "created": "2015-05-01 15:39:57.979000000", |
| 1630 | "updated": "2015-05-20 19:25:21.592000000", |
| 1631 | "mergeable": true, |
| 1632 | "insertions": 303, |
| 1633 | "deletions": 210, |
| 1634 | "_number": 1779, |
| 1635 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1636 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1637 | }, |
| 1638 | "labels": { |
| 1639 | "Code-Review": { |
| 1640 | "approved": { |
| 1641 | "_account_id": 1000000 |
| 1642 | }, |
| 1643 | "all": [ |
| 1644 | { |
| 1645 | "value": 2, |
| 1646 | "date": "2015-05-20 19:25:21.592000000", |
| 1647 | "_account_id": 1000000 |
| 1648 | } |
| 1649 | ], |
| 1650 | "values": { |
| 1651 | "-2": "This shall not be merged", |
| 1652 | "-1": "I would prefer this is not merged as is", |
| 1653 | " 0": "No score", |
| 1654 | "+1": "Looks good to me, but someone else must approve", |
| 1655 | "+2": "Looks good to me, approved" |
| 1656 | }, |
| 1657 | "default_value": 0 |
| 1658 | }, |
| 1659 | "Verified": { |
| 1660 | "approved": { |
| 1661 | "_account_id": 1000000 |
| 1662 | }, |
| 1663 | "all": [ |
| 1664 | { |
| 1665 | "value": 1, |
| 1666 | "date": "2015-05-20 19:25:21.592000000", |
| 1667 | "_account_id": 1000000 |
| 1668 | } |
| 1669 | ], |
| 1670 | "values": { |
| 1671 | "-1": "Fails", |
| 1672 | " 0": "No score", |
| 1673 | "+1": "Verified" |
| 1674 | }, |
| 1675 | "default_value": 0 |
| 1676 | } |
| 1677 | }, |
| 1678 | "permitted_labels": { |
| 1679 | "Code-Review": [ |
| 1680 | "-2", |
| 1681 | "-1", |
| 1682 | " 0", |
| 1683 | "+1", |
| 1684 | "+2" |
| 1685 | ], |
| 1686 | "Verified": [ |
| 1687 | "-1", |
| 1688 | " 0", |
| 1689 | "+1" |
| 1690 | ] |
| 1691 | }, |
| 1692 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 1693 | { |
| 1694 | "_account_id": 1000000 |
| 1695 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1696 | ], |
| 1697 | "reviewers": { |
| 1698 | "REVIEWER": [ |
| 1699 | { |
| 1700 | "_account_id": 1000000 |
| 1701 | } |
| 1702 | ] |
| 1703 | }, |
| 1704 | "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379", |
| 1705 | "revisions": { |
| 1706 | "9adb9f4c7b40eeee0646e235de818d09164d7379": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1707 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1708 | "_number": 1, |
| 1709 | "created": "2015-05-01 15:39:57.979000000", |
| 1710 | "uploader": { |
| 1711 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1712 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1713 | "ref": "refs/changes/79/1779/1", |
| 1714 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1715 | } |
| 1716 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1717 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1718 | { |
| 1719 | "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 1720 | "project": "gerrit", |
| 1721 | "branch": "master", |
| 1722 | "hashtags": [], |
| 1723 | "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 1724 | "subject": "AbstractSubmoduleSubscription: Split up createSubscription", |
| 1725 | "status": "NEW", |
| 1726 | "created": "2015-05-01 15:39:57.979000000", |
| 1727 | "updated": "2015-05-20 19:25:21.546000000", |
| 1728 | "mergeable": true, |
| 1729 | "insertions": 15, |
| 1730 | "deletions": 6, |
| 1731 | "_number": 1780, |
| 1732 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1733 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1734 | }, |
| 1735 | "labels": { |
| 1736 | "Code-Review": { |
| 1737 | "approved": { |
| 1738 | "_account_id": 1000000 |
| 1739 | }, |
| 1740 | "all": [ |
| 1741 | { |
| 1742 | "value": 2, |
| 1743 | "date": "2015-05-20 19:25:21.546000000", |
| 1744 | "_account_id": 1000000 |
| 1745 | } |
| 1746 | ], |
| 1747 | "values": { |
| 1748 | "-2": "This shall not be merged", |
| 1749 | "-1": "I would prefer this is not merged as is", |
| 1750 | " 0": "No score", |
| 1751 | "+1": "Looks good to me, but someone else must approve", |
| 1752 | "+2": "Looks good to me, approved" |
| 1753 | }, |
| 1754 | "default_value": 0 |
| 1755 | }, |
| 1756 | "Verified": { |
| 1757 | "approved": { |
| 1758 | "_account_id": 1000000 |
| 1759 | }, |
| 1760 | "all": [ |
| 1761 | { |
| 1762 | "value": 1, |
| 1763 | "date": "2015-05-20 19:25:21.546000000", |
| 1764 | "_account_id": 1000000 |
| 1765 | } |
| 1766 | ], |
| 1767 | "values": { |
| 1768 | "-1": "Fails", |
| 1769 | " 0": "No score", |
| 1770 | "+1": "Verified" |
| 1771 | }, |
| 1772 | "default_value": 0 |
| 1773 | } |
| 1774 | }, |
| 1775 | "permitted_labels": { |
| 1776 | "Code-Review": [ |
| 1777 | "-2", |
| 1778 | "-1", |
| 1779 | " 0", |
| 1780 | "+1", |
| 1781 | "+2" |
| 1782 | ], |
| 1783 | "Verified": [ |
| 1784 | "-1", |
| 1785 | " 0", |
| 1786 | "+1" |
| 1787 | ] |
| 1788 | }, |
| 1789 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 1790 | { |
| 1791 | "_account_id": 1000000 |
| 1792 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1793 | ], |
| 1794 | "reviewers": { |
| 1795 | "REVIEWER": [ |
| 1796 | { |
| 1797 | "_account_id": 1000000 |
| 1798 | } |
| 1799 | ] |
| 1800 | }, |
| 1801 | "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4", |
| 1802 | "revisions": { |
| 1803 | "1bd7c12a38854a2c6de426feec28800623f492c4": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1804 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1805 | "_number": 1, |
| 1806 | "created": "2015-05-01 15:39:57.979000000", |
| 1807 | "uploader": { |
| 1808 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1809 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1810 | "ref": "refs/changes/80/1780/1", |
| 1811 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1812 | } |
| 1813 | } |
| 1814 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1815 | ], |
| 1816 | "non_visible_changes": 0 |
| 1817 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1818 | ---- |
| 1819 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1820 | If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then |
| 1821 | instead of a link:#submitted-together-info[SubmittedTogetherInfo] |
| 1822 | entity, the response is a list of changes, or a 403 response with a |
| 1823 | message if the set of changes to be submitted with this change |
| 1824 | includes changes the caller cannot read. |
| 1825 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1826 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 1827 | [[delete-change]] |
| 1828 | === Delete Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1829 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1830 | 'DELETE /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1831 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1832 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 1833 | Deletes a change. |
| 1834 | |
Paladox none | 580ae0e | 2017-02-12 18:15:48 +0000 | [diff] [blame] | 1835 | New or abandoned changes can be deleted by their owner if the user is granted |
| 1836 | the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission, |
| 1837 | otherwise only by administrators. |
| 1838 | |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1839 | .Request |
| 1840 | ---- |
| 1841 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1842 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1843 | ---- |
| 1844 | |
| 1845 | .Response |
| 1846 | ---- |
| 1847 | HTTP/1.1 204 No Content |
| 1848 | ---- |
| 1849 | |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1850 | [[get-included-in]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1851 | === Get Included In |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1852 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1853 | 'GET /changes/link:#change-id[\{change-id\}]/in' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1854 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1855 | |
| 1856 | Retrieves the branches and tags in which a change is included. As result |
| 1857 | an link:#included-in-info[IncludedInInfo] entity is returned. |
| 1858 | |
| 1859 | .Request |
| 1860 | ---- |
| 1861 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0 |
| 1862 | ---- |
| 1863 | |
| 1864 | .Response |
| 1865 | ---- |
| 1866 | HTTP/1.1 200 OK |
| 1867 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1868 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1869 | |
| 1870 | )]}' |
| 1871 | { |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1872 | "branches": [ |
| 1873 | "master" |
| 1874 | ], |
| 1875 | "tags": [] |
| 1876 | } |
| 1877 | ---- |
| 1878 | |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 1879 | [[index-change]] |
| 1880 | === Index Change |
| 1881 | -- |
| 1882 | 'POST /changes/link:#change-id[\{change-id\}]/index' |
| 1883 | -- |
| 1884 | |
| 1885 | Adds or updates the change in the secondary index. |
| 1886 | |
| 1887 | .Request |
| 1888 | ---- |
| 1889 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0 |
| 1890 | ---- |
| 1891 | |
| 1892 | .Response |
| 1893 | ---- |
| 1894 | HTTP/1.1 204 No Content |
| 1895 | ---- |
| 1896 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 1897 | [[list-change-comments]] |
| 1898 | === List Change Comments |
| 1899 | -- |
| 1900 | 'GET /changes/link:#change-id[\{change-id\}]/comments' |
| 1901 | -- |
| 1902 | |
| 1903 | Lists the published comments of all revisions of the change. |
| 1904 | |
| 1905 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 1906 | entries. The entries in the map are sorted by file path, and the |
| 1907 | comments for each path are sorted by patch set number. Each comment has |
| 1908 | the `patch_set` and `author` fields set. |
| 1909 | |
| 1910 | .Request |
| 1911 | ---- |
| 1912 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0 |
| 1913 | ---- |
| 1914 | |
| 1915 | .Response |
| 1916 | ---- |
| 1917 | HTTP/1.1 200 OK |
| 1918 | Content-Disposition: attachment |
| 1919 | Content-Type: application/json; charset=UTF-8 |
| 1920 | |
| 1921 | )]}' |
| 1922 | { |
| 1923 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1924 | { |
| 1925 | "patch_set": 1, |
| 1926 | "id": "TvcXrmjM", |
| 1927 | "line": 23, |
| 1928 | "message": "[nit] trailing whitespace", |
| 1929 | "updated": "2013-02-26 15:40:43.986000000" |
| 1930 | "author": { |
| 1931 | "_account_id": 1000096, |
| 1932 | "name": "John Doe", |
| 1933 | "email": "john.doe@example.com" |
| 1934 | } |
| 1935 | }, |
| 1936 | { |
| 1937 | "patch_set": 2, |
| 1938 | "id": "TveXwFiA", |
| 1939 | "line": 49, |
| 1940 | "in_reply_to": "TfYX-Iuo", |
| 1941 | "message": "Done", |
| 1942 | "updated": "2013-02-26 15:40:45.328000000" |
| 1943 | "author": { |
| 1944 | "_account_id": 1000097, |
| 1945 | "name": "Jane Roe", |
| 1946 | "email": "jane.roe@example.com" |
| 1947 | } |
| 1948 | } |
| 1949 | ] |
| 1950 | } |
| 1951 | ---- |
| 1952 | |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 1953 | [[list-change-robot-comments]] |
| 1954 | === List Change Robot Comments |
| 1955 | -- |
| 1956 | 'GET /changes/link:#change-id[\{change-id\}]/robotcomments' |
| 1957 | -- |
| 1958 | |
| 1959 | Lists the robot comments of all revisions of the change. |
| 1960 | |
| 1961 | Return a map that maps the file path to a list of |
| 1962 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 1963 | map are sorted by file path. |
| 1964 | |
| 1965 | .Request |
| 1966 | ---- |
| 1967 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0 |
| 1968 | ---- |
| 1969 | |
| 1970 | .Response |
| 1971 | ---- |
| 1972 | HTTP/1.1 200 OK |
| 1973 | Content-Disposition: attachment |
| 1974 | Content-Type: application/json; charset=UTF-8 |
| 1975 | |
| 1976 | )]}' |
| 1977 | { |
| 1978 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1979 | { |
| 1980 | "id": "TvcXrmjM", |
| 1981 | "line": 23, |
| 1982 | "message": "unused import", |
| 1983 | "updated": "2016-02-26 15:40:43.986000000", |
| 1984 | "author": { |
| 1985 | "_account_id": 1000110, |
| 1986 | "name": "Code Analyzer", |
| 1987 | "email": "code.analyzer@example.com" |
| 1988 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 1989 | "robot_id": "importChecker", |
| 1990 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 1991 | }, |
| 1992 | { |
| 1993 | "id": "TveXwFiA", |
| 1994 | "line": 49, |
| 1995 | "message": "wrong indention", |
| 1996 | "updated": "2016-02-26 15:40:45.328000000", |
| 1997 | "author": { |
| 1998 | "_account_id": 1000110, |
| 1999 | "name": "Code Analyzer", |
| 2000 | "email": "code.analyzer@example.com" |
| 2001 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 2002 | "robot_id": "styleChecker", |
| 2003 | "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2004 | } |
| 2005 | ] |
| 2006 | } |
| 2007 | ---- |
| 2008 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2009 | [[list-change-drafts]] |
| 2010 | === List Change Drafts |
| 2011 | -- |
| 2012 | 'GET /changes/link:#change-id[\{change-id\}]/drafts' |
| 2013 | -- |
| 2014 | |
| 2015 | Lists the draft comments of all revisions of the change that belong to |
| 2016 | the calling user. |
| 2017 | |
| 2018 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 2019 | entries. The entries in the map are sorted by file path, and the |
| 2020 | comments for each path are sorted by patch set number. Each comment has |
| 2021 | the `patch_set` field set, and no `author`. |
| 2022 | |
| 2023 | .Request |
| 2024 | ---- |
| 2025 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0 |
| 2026 | ---- |
| 2027 | |
| 2028 | .Response |
| 2029 | ---- |
| 2030 | HTTP/1.1 200 OK |
| 2031 | Content-Disposition: attachment |
| 2032 | Content-Type: application/json; charset=UTF-8 |
| 2033 | |
| 2034 | )]}' |
| 2035 | { |
| 2036 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2037 | { |
| 2038 | "patch_set": 1, |
| 2039 | "id": "TvcXrmjM", |
| 2040 | "line": 23, |
| 2041 | "message": "[nit] trailing whitespace", |
| 2042 | "updated": "2013-02-26 15:40:43.986000000" |
| 2043 | }, |
| 2044 | { |
| 2045 | "patch_set": 2, |
| 2046 | "id": "TveXwFiA", |
| 2047 | "line": 49, |
| 2048 | "in_reply_to": "TfYX-Iuo", |
| 2049 | "message": "Done", |
| 2050 | "updated": "2013-02-26 15:40:45.328000000" |
| 2051 | } |
| 2052 | ] |
| 2053 | } |
| 2054 | ---- |
| 2055 | |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2056 | [[check-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2057 | === Check Change |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2058 | -- |
| 2059 | 'GET /changes/link:#change-id[\{change-id\}]/check' |
| 2060 | -- |
| 2061 | |
| 2062 | Performs consistency checks on the change, and returns a |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2063 | link:#change-info[ChangeInfo] entity with the `problems` field set to a |
| 2064 | list of link:#problem-info[ProblemInfo] entities. |
| 2065 | |
| 2066 | Depending on the type of problem, some fields not marked optional may be |
| 2067 | missing from the result. At least `id`, `project`, `branch`, and |
| 2068 | `_number` will be present. |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2069 | |
| 2070 | .Request |
| 2071 | ---- |
| 2072 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2073 | ---- |
| 2074 | |
| 2075 | .Response |
| 2076 | ---- |
| 2077 | HTTP/1.1 200 OK |
| 2078 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2079 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2080 | |
| 2081 | )]}' |
| 2082 | { |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2083 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2084 | "project": "myProject", |
| 2085 | "branch": "master", |
| 2086 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2087 | "subject": "Implementing Feature X", |
| 2088 | "status": "NEW", |
| 2089 | "created": "2013-02-01 09:59:32.126000000", |
| 2090 | "updated": "2013-02-21 11:16:36.775000000", |
| 2091 | "mergeable": true, |
| 2092 | "insertions": 34, |
| 2093 | "deletions": 101, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2094 | "_number": 3965, |
| 2095 | "owner": { |
| 2096 | "name": "John Doe" |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2097 | }, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2098 | "problems": [ |
| 2099 | { |
| 2100 | "message": "Current patch set 1 not found" |
| 2101 | } |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2102 | ] |
| 2103 | } |
| 2104 | ---- |
| 2105 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2106 | [[fix-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2107 | === Fix Change |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2108 | -- |
| 2109 | 'POST /changes/link:#change-id[\{change-id\}]/check' |
| 2110 | -- |
| 2111 | |
| 2112 | Performs consistency checks on the change as with link:#check-change[GET |
| 2113 | /check], and additionally fixes any problems that can be fixed |
| 2114 | automatically. The returned field values reflect any fixes. |
| 2115 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 2116 | Some fixes have options controlling their behavior, which can be set in the |
| 2117 | link:#fix-input[FixInput] entity body. |
| 2118 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2119 | Only the change owner, a project owner, or an administrator may fix changes. |
| 2120 | |
| 2121 | .Request |
| 2122 | ---- |
| 2123 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2124 | ---- |
| 2125 | |
| 2126 | .Response |
| 2127 | ---- |
| 2128 | HTTP/1.1 200 OK |
| 2129 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2130 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2131 | |
| 2132 | )]}' |
| 2133 | { |
| 2134 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2135 | "project": "myProject", |
| 2136 | "branch": "master", |
| 2137 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2138 | "subject": "Implementing Feature X", |
| 2139 | "status": "MERGED", |
| 2140 | "created": "2013-02-01 09:59:32.126000000", |
| 2141 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 2142 | "submitted": "2013-02-21 11:16:36.615000000", |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2143 | "mergeable": true, |
| 2144 | "insertions": 34, |
| 2145 | "deletions": 101, |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2146 | "_number": 3965, |
| 2147 | "owner": { |
| 2148 | "name": "John Doe" |
| 2149 | }, |
| 2150 | "problems": [ |
| 2151 | { |
| 2152 | "message": "Current patch set 2 not found" |
| 2153 | }, |
| 2154 | { |
| 2155 | "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW", |
| 2156 | "status": FIXED, |
| 2157 | "outcome": "Marked change as merged" |
| 2158 | } |
| 2159 | ] |
| 2160 | } |
| 2161 | ---- |
| 2162 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2163 | [[set-work-in-pogress]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2164 | === Set Work-In-Progress |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2165 | -- |
| 2166 | 'POST /changes/link:#change-id[\{change-id\}]/wip' |
| 2167 | -- |
| 2168 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2169 | Marks the change as not ready for review yet. Changes may only be marked not |
| 2170 | ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2171 | |
| 2172 | The request body does not need to include a |
| 2173 | link:#work-in-progress-input[WorkInProgressInput] entity if no review comment |
| 2174 | is added. Actions that create a new patch set in a WIP change default to |
| 2175 | notifying *OWNER* instead of *ALL*. |
| 2176 | |
| 2177 | .Request |
| 2178 | ---- |
| 2179 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0 |
| 2180 | Content-Type: application/json; charset=UTF-8 |
| 2181 | |
| 2182 | { |
| 2183 | "message": "Refactoring needs to be done before we can proceed here." |
| 2184 | } |
| 2185 | ---- |
| 2186 | |
| 2187 | .Response |
| 2188 | ---- |
| 2189 | HTTP/1.1 200 OK |
| 2190 | ---- |
| 2191 | |
| 2192 | [[set-ready-for-review]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2193 | === Set Ready-For-Review |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2194 | -- |
| 2195 | 'POST /changes/link:#change-id[\{change-id\}]/ready' |
| 2196 | -- |
| 2197 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2198 | Marks the change as ready for review (set WIP property to false). Changes may |
| 2199 | only be marked ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2200 | |
| 2201 | Activates notifications of reviewer. The request body does not need |
| 2202 | to include a link:#work-in-progress-input[WorkInProgressInput] entity |
| 2203 | if no review comment is added. |
| 2204 | |
| 2205 | .Request |
| 2206 | ---- |
| 2207 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0 |
| 2208 | Content-Type: application/json;charset=UTF-8 |
| 2209 | |
| 2210 | { |
| 2211 | "message": "Refactoring is done." |
| 2212 | } |
| 2213 | |
| 2214 | ---- |
| 2215 | |
| 2216 | .Response |
| 2217 | ---- |
| 2218 | HTTP/1.1 200 OK |
| 2219 | ---- |
| 2220 | |
David Pursehouse | 7c5c3a5 | 2017-04-10 11:37:23 +0900 | [diff] [blame] | 2221 | [[mark-private]] |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2222 | === Mark Private |
| 2223 | -- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2224 | 'POST /changes/link:#change-id[\{change-id\}]/private' |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2225 | -- |
| 2226 | |
Patrick Hiesel | 707e61a | 2019-02-13 18:28:48 +0100 | [diff] [blame] | 2227 | Marks the change to be private. Only open changes can be marked private. |
| 2228 | Changes may only be marked private by the owner or site administrators. |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2229 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2230 | A message can be specified in the request body inside a |
| 2231 | link:#private-input[PrivateInput] entity. |
| 2232 | |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2233 | .Request |
| 2234 | ---- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2235 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2236 | Content-Type: application/json; charset=UTF-8 |
| 2237 | |
| 2238 | { |
| 2239 | "message": "After this security fix has been released we can make it public now." |
| 2240 | } |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2241 | ---- |
| 2242 | |
| 2243 | .Response |
| 2244 | ---- |
| 2245 | HTTP/1.1 201 Created |
| 2246 | ---- |
| 2247 | |
| 2248 | If the change was already private the response is "`200 OK`". |
| 2249 | |
| 2250 | [[unmark-private]] |
| 2251 | === Unmark Private |
| 2252 | -- |
| 2253 | 'DELETE /changes/link:#change-id[\{change-id\}]/private' |
| 2254 | -- |
| 2255 | |
| 2256 | Marks the change to be non-private. Note users can only unmark own private |
| 2257 | changes. |
| 2258 | |
| 2259 | .Request |
| 2260 | ---- |
| 2261 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2262 | ---- |
| 2263 | |
| 2264 | .Response |
| 2265 | ---- |
| 2266 | HTTP/1.1 204 No Content |
| 2267 | ---- |
| 2268 | |
| 2269 | If the change was already not private, the response is "`409 Conflict`". |
| 2270 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 2271 | A message can be specified in the request body inside a |
| 2272 | link:#private-input[PrivateInput] entity. Historically, this method allowed |
| 2273 | a body in the DELETE, but that behavior is |
| 2274 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 2275 | In this case, use a POST request instead: |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2276 | |
| 2277 | .Request |
| 2278 | ---- |
| 2279 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0 |
| 2280 | Content-Type: application/json; charset=UTF-8 |
| 2281 | |
| 2282 | { |
| 2283 | "message": "This is a security fix that must not be public." |
| 2284 | } |
| 2285 | ---- |
| 2286 | |
David Pursehouse | d656fa8 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 2287 | [[ignore]] |
| 2288 | === Ignore |
| 2289 | -- |
| 2290 | 'PUT /changes/link:#change-id[\{change-id\}]/ignore' |
| 2291 | -- |
| 2292 | |
| 2293 | Marks a change as ignored. The change will not be shown in the incoming |
David Pursehouse | aa51cba | 2018-07-09 11:02:17 +0900 | [diff] [blame] | 2294 | reviews dashboard, and email notifications will be suppressed. Ignoring |
| 2295 | a change does not cause the change's "updated" timestamp to be modified, |
| 2296 | and the owner is not notified. |
David Pursehouse | d656fa8 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 2297 | |
| 2298 | .Request |
| 2299 | ---- |
| 2300 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ignore HTTP/1.0 |
| 2301 | ---- |
| 2302 | |
| 2303 | [[unignore]] |
| 2304 | === Unignore |
| 2305 | -- |
| 2306 | 'PUT /changes/link:#change-id[\{change-id\}]/unignore' |
| 2307 | -- |
| 2308 | |
| 2309 | Un-marks a change as ignored. |
| 2310 | |
| 2311 | .Request |
| 2312 | ---- |
| 2313 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unignore HTTP/1.0 |
| 2314 | ---- |
| 2315 | |
Edwin Kempin | ceb673e | 2017-10-01 12:29:05 +0200 | [diff] [blame] | 2316 | [[mark-as-reviewed]] |
| 2317 | === Mark as Reviewed |
| 2318 | -- |
| 2319 | 'PUT /changes/link:#change-id[\{change-id\}]/reviewed' |
| 2320 | -- |
| 2321 | |
| 2322 | Marks a change as reviewed. |
| 2323 | |
| 2324 | This allows users to "de-highlight" changes in their dashboard until a new |
| 2325 | patch set is uploaded. |
| 2326 | |
| 2327 | This differs from the link:#ignore[ignore] endpoint, which will mute |
| 2328 | emails and hide the change from dashboard completely until it is |
| 2329 | link:#unignore[unignored] again. |
| 2330 | |
| 2331 | |
| 2332 | .Request |
| 2333 | ---- |
| 2334 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewed HTTP/1.0 |
| 2335 | ---- |
| 2336 | |
| 2337 | [[mark-as-unreviewed]] |
| 2338 | === Mark as Unreviewed |
| 2339 | -- |
| 2340 | 'PUT /changes/link:#change-id[\{change-id\}]/unreviewed' |
| 2341 | -- |
| 2342 | |
| 2343 | Marks a change as unreviewed. |
| 2344 | |
| 2345 | This allows users to "highlight" changes in their dashboard |
| 2346 | |
| 2347 | .Request |
| 2348 | ---- |
| 2349 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unreviewed HTTP/1.0 |
| 2350 | ---- |
| 2351 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2352 | [[get-hashtags]] |
| 2353 | === Get Hashtags |
| 2354 | -- |
| 2355 | 'GET /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2356 | -- |
| 2357 | |
| 2358 | Gets the hashtags associated with a change. |
| 2359 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2360 | .Request |
| 2361 | ---- |
| 2362 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2363 | ---- |
| 2364 | |
| 2365 | As response the change's hashtags are returned as a list of strings. |
| 2366 | |
| 2367 | .Response |
| 2368 | ---- |
| 2369 | HTTP/1.1 200 OK |
| 2370 | Content-Disposition: attachment |
| 2371 | Content-Type: application/json; charset=UTF-8 |
| 2372 | |
| 2373 | )]}' |
| 2374 | [ |
| 2375 | "hashtag1", |
| 2376 | "hashtag2" |
| 2377 | ] |
| 2378 | ---- |
| 2379 | |
| 2380 | [[set-hashtags]] |
| 2381 | === Set Hashtags |
| 2382 | -- |
| 2383 | 'POST /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2384 | -- |
| 2385 | |
| 2386 | Adds and/or removes hashtags from a change. |
| 2387 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2388 | The hashtags to add or remove must be provided in the request body inside a |
| 2389 | link:#hashtags-input[HashtagsInput] entity. |
| 2390 | |
| 2391 | .Request |
| 2392 | ---- |
| 2393 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2394 | Content-Type: application/json; charset=UTF-8 |
| 2395 | |
| 2396 | { |
| 2397 | "add" : [ |
| 2398 | "hashtag3" |
| 2399 | ], |
| 2400 | "remove" : [ |
| 2401 | "hashtag2" |
| 2402 | ] |
| 2403 | } |
| 2404 | ---- |
| 2405 | |
| 2406 | As response the change's hashtags are returned as a list of strings. |
| 2407 | |
| 2408 | .Response |
| 2409 | ---- |
| 2410 | HTTP/1.1 200 OK |
| 2411 | Content-Disposition: attachment |
| 2412 | Content-Type: application/json; charset=UTF-8 |
| 2413 | |
| 2414 | )]}' |
| 2415 | [ |
| 2416 | "hashtag1", |
| 2417 | "hashtag3" |
| 2418 | ] |
| 2419 | ---- |
| 2420 | |
Changcheng Xiao | 7fb7329 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2421 | [[list-change-messages]] |
| 2422 | === List Change Messages |
| 2423 | -- |
| 2424 | 'GET /changes/link:#change-id[\{change-id\}]/messages' |
| 2425 | -- |
| 2426 | |
| 2427 | Lists all the messages of a change including link:#detailed-accounts[detailed account information]. |
| 2428 | |
| 2429 | .Request |
| 2430 | ---- |
| 2431 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages |
| 2432 | ---- |
| 2433 | |
| 2434 | As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned. |
| 2435 | |
| 2436 | .Response |
| 2437 | ---- |
| 2438 | HTTP/1.1 200 OK |
| 2439 | Content-Disposition: attachment |
| 2440 | Content-Type: application/json; charset=UTF-8 |
| 2441 | |
| 2442 | )]}' |
| 2443 | [ |
| 2444 | { |
| 2445 | "id": "YH-egE", |
| 2446 | "author": { |
| 2447 | "_account_id": 1000096, |
| 2448 | "name": "John Doe", |
| 2449 | "email": "john.doe@example.com", |
| 2450 | "username": "jdoe" |
| 2451 | }, |
| 2452 | "date": "2013-03-23 21:34:02.419000000", |
| 2453 | "message": "Patch Set 1:\n\nThis is the first message.", |
| 2454 | "_revision_number": 1 |
| 2455 | }, |
| 2456 | { |
| 2457 | "id": "WEEdhU", |
| 2458 | "author": { |
| 2459 | "_account_id": 1000097, |
| 2460 | "name": "Jane Roe", |
| 2461 | "email": "jane.roe@example.com", |
| 2462 | "username": "jroe" |
| 2463 | }, |
| 2464 | "date": "2013-03-23 21:36:52.332000000", |
| 2465 | "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.", |
| 2466 | "_revision_number": 1 |
| 2467 | } |
| 2468 | ] |
| 2469 | ---- |
David Pursehouse | c32050d | 2017-08-25 16:27:47 +0900 | [diff] [blame] | 2470 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 2471 | [[get-change-message]] |
| 2472 | === Get Change Message |
| 2473 | |
| 2474 | Retrieves a change message including link:#detailed-accounts[detailed account information]. |
| 2475 | |
| 2476 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2477 | 'GET /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 2478 | -- |
| 2479 | |
| 2480 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned. |
| 2481 | |
| 2482 | .Response |
| 2483 | ---- |
| 2484 | HTTP/1.1 200 OK |
| 2485 | Content-Disposition: attachment |
| 2486 | Content-Type: application/json; charset=UTF-8 |
| 2487 | |
| 2488 | )]}' |
| 2489 | { |
| 2490 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 2491 | "author": { |
| 2492 | "_account_id": 1000096, |
| 2493 | "name": "John Doe", |
| 2494 | "email": "john.doe@example.com", |
| 2495 | "username": "jdoe" |
| 2496 | }, |
| 2497 | "date": "2013-03-23 21:34:02.419000000", |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2498 | "message": "a change message", |
| 2499 | "_revision_number": 1 |
| 2500 | } |
| 2501 | ---- |
| 2502 | |
| 2503 | [[delete-change-message]] |
| 2504 | === Delete Change Message |
| 2505 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2506 | 'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' + |
| 2507 | 'POST /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]/delete' |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2508 | -- |
| 2509 | |
| 2510 | Deletes a change message by replacing the change message with a new message, |
| 2511 | which contains the name of the user who deleted the change message and the |
| 2512 | reason why it was deleted. The reason can be provided in the request body as a |
| 2513 | link:#delete-change-message-input[DeleteChangeMessageInput] entity. |
| 2514 | |
| 2515 | Note that only users with the |
| 2516 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 2517 | global capability are permitted to delete a change message. |
| 2518 | |
| 2519 | To delete a change message, send a DELETE request: |
| 2520 | |
| 2521 | .Request |
| 2522 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2523 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2524 | ---- |
| 2525 | |
| 2526 | To provide a reason for the deletion, use a POST request: |
| 2527 | |
| 2528 | .Request |
| 2529 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2530 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2531 | Content-Type: application/json; charset=UTF-8 |
| 2532 | |
| 2533 | { |
| 2534 | "reason": "spam" |
| 2535 | } |
| 2536 | ---- |
| 2537 | |
| 2538 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned that |
| 2539 | describes the updated change message. |
| 2540 | |
| 2541 | .Response |
| 2542 | ---- |
| 2543 | HTTP/1.1 200 OK |
| 2544 | Content-Disposition: attachment |
| 2545 | Content-Type: application/json; charset=UTF-8 |
| 2546 | |
| 2547 | )]}' |
| 2548 | { |
| 2549 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 2550 | "author": { |
| 2551 | "_account_id": 1000096, |
| 2552 | "name": "John Doe", |
| 2553 | "email": "john.doe@example.com", |
| 2554 | "username": "jdoe" |
| 2555 | }, |
| 2556 | "date": "2013-03-23 21:34:02.419000000", |
| 2557 | "message": "Change message removed by: Administrator\nReason: spam", |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 2558 | "_revision_number": 1 |
| 2559 | } |
| 2560 | ---- |
Gustaf Lundh | e8647c6 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 2561 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2562 | [[edit-endpoints]] |
| 2563 | == Change Edit Endpoints |
| 2564 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2565 | [[get-edit-detail]] |
| 2566 | === Get Change Edit Details |
| 2567 | -- |
| 2568 | 'GET /changes/link:#change-id[\{change-id\}]/edit |
| 2569 | -- |
| 2570 | |
| 2571 | Retrieves a change edit details. |
| 2572 | |
| 2573 | .Request |
| 2574 | ---- |
| 2575 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 2576 | ---- |
| 2577 | |
| 2578 | As response an link:#edit-info[EditInfo] entity is returned that |
| 2579 | describes the change edit, or "`204 No Content`" when change edit doesn't |
| 2580 | exist for this change. Change edits are stored on special branches and there |
| 2581 | can be max one edit per user per change. Edits aren't tracked in the database. |
David Ostrovsky | 5d98e34 | 2014-08-01 09:23:28 +0200 | [diff] [blame] | 2582 | When request parameter `list` is provided the response also includes the file |
| 2583 | list. When `base` request parameter is provided the file list is computed |
David Ostrovsky | 5562fe5 | 2014-08-12 22:36:27 +0200 | [diff] [blame] | 2584 | against this base revision. When request parameter `download-commands` is |
| 2585 | provided fetch info map is also included. |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2586 | |
| 2587 | .Response |
| 2588 | ---- |
| 2589 | HTTP/1.1 200 OK |
| 2590 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2591 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2592 | |
| 2593 | )]}' |
| 2594 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2595 | "commit": { |
| 2596 | "parents": [ |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2597 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2598 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2599 | } |
| 2600 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2601 | "author": { |
| 2602 | "name": "Shawn O. Pearce", |
| 2603 | "email": "sop@google.com", |
| 2604 | "date": "2012-04-24 18:08:08.000000000", |
| 2605 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2606 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2607 | "committer": { |
| 2608 | "name": "Shawn O. Pearce", |
| 2609 | "email": "sop@google.com", |
| 2610 | "date": "2012-04-24 18:08:08.000000000", |
| 2611 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2612 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2613 | "subject": "Use an EventBus to manage star icons", |
| 2614 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2615 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2616 | "base_patch_set_number": 1, |
| 2617 | "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3", |
| 2618 | "ref": "refs/users/01/1000001/edit-76482/1" |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2619 | } |
| 2620 | ---- |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 2621 | |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 2622 | [[put-edit-file]] |
| 2623 | === Change file content in Change Edit |
| 2624 | -- |
| 2625 | 'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile |
| 2626 | -- |
| 2627 | |
| 2628 | Put content of a file to a change edit. |
| 2629 | |
| 2630 | .Request |
| 2631 | ---- |
| 2632 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 2633 | ---- |
| 2634 | |
| 2635 | When change edit doesn't exist for this change yet it is created. When file |
| 2636 | content isn't provided, it is wiped out for that file. As response |
| 2637 | "`204 No Content`" is returned. |
| 2638 | |
| 2639 | .Response |
| 2640 | ---- |
| 2641 | HTTP/1.1 204 No Content |
| 2642 | ---- |
| 2643 | |
Gal Paikin | 68d217b | 2019-10-07 21:01:22 +0200 | [diff] [blame] | 2644 | When the change edit is a no-op, for example when providing the same file |
| 2645 | content that the file already has, '409 no changes were made' is returned. |
| 2646 | |
| 2647 | .Response |
| 2648 | ---- |
| 2649 | HTTP/1.1 409 no changes were made |
| 2650 | ---- |
| 2651 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2652 | [[post-edit]] |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2653 | === Restore file content or rename files in Change Edit |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2654 | -- |
| 2655 | 'POST /changes/link:#change-id[\{change-id\}]/edit |
| 2656 | -- |
| 2657 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2658 | Creates empty change edit, restores file content or renames files in change |
| 2659 | edit. The request body needs to include a |
| 2660 | link:#change-edit-input[ChangeEditInput] entity when a file within change |
| 2661 | edit should be restored or old and new file names to rename a file. |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2662 | |
| 2663 | .Request |
| 2664 | ---- |
| 2665 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2666 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2667 | |
| 2668 | { |
David Ostrovsky | bd12e17 | 2014-08-21 23:08:15 +0200 | [diff] [blame] | 2669 | "restore_path": "foo" |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2670 | } |
| 2671 | ---- |
| 2672 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2673 | or for rename: |
| 2674 | |
| 2675 | .Request |
| 2676 | ---- |
| 2677 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 2678 | Content-Type: application/json; charset=UTF-8 |
| 2679 | |
| 2680 | { |
| 2681 | "old_path": "foo", |
| 2682 | "new_path": "bar" |
| 2683 | } |
| 2684 | ---- |
| 2685 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2686 | When change edit doesn't exist for this change yet it is created. When path |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2687 | and restore flag are provided in request body, this file is restored. When |
| 2688 | old and new file names are provided, the file is renamed. As response |
| 2689 | "`204 No Content`" is returned. |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2690 | |
| 2691 | .Response |
| 2692 | ---- |
| 2693 | HTTP/1.1 204 No Content |
| 2694 | ---- |
| 2695 | |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 2696 | [[put-change-edit-message]] |
| 2697 | === Change commit message in Change Edit |
| 2698 | -- |
| 2699 | 'PUT /changes/link:#change-id[\{change-id\}]/edit:message |
| 2700 | -- |
| 2701 | |
| 2702 | Modify commit message. The request body needs to include a |
| 2703 | link:#change-edit-message-input[ChangeEditMessageInput] |
| 2704 | entity. |
| 2705 | |
| 2706 | .Request |
| 2707 | ---- |
| 2708 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2709 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 2710 | |
| 2711 | { |
| 2712 | "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444" |
| 2713 | } |
| 2714 | ---- |
| 2715 | |
| 2716 | If a change edit doesn't exist for this change yet, it is created. As |
| 2717 | response "`204 No Content`" is returned. |
| 2718 | |
| 2719 | .Response |
| 2720 | ---- |
| 2721 | HTTP/1.1 204 No Content |
| 2722 | ---- |
| 2723 | |
David Ostrovsky | 2830c29 | 2014-08-01 02:24:31 +0200 | [diff] [blame] | 2724 | [[delete-edit-file]] |
| 2725 | === Delete file in Change Edit |
| 2726 | -- |
| 2727 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile' |
| 2728 | -- |
| 2729 | |
| 2730 | Deletes a file from a change edit. This deletes the file from the repository |
| 2731 | completely. This is not the same as reverting or restoring a file to its |
| 2732 | previous contents. |
| 2733 | |
| 2734 | .Request |
| 2735 | ---- |
| 2736 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 2737 | ---- |
| 2738 | |
| 2739 | When change edit doesn't exist for this change yet it is created. |
| 2740 | |
| 2741 | .Response |
| 2742 | ---- |
| 2743 | HTTP/1.1 204 No Content |
| 2744 | ---- |
| 2745 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2746 | [[get-edit-file]] |
| 2747 | === Retrieve file content from Change Edit |
| 2748 | -- |
| 2749 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile |
| 2750 | -- |
| 2751 | |
| 2752 | Retrieves content of a file from a change edit. |
| 2753 | |
| 2754 | .Request |
| 2755 | ---- |
| 2756 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 2757 | ---- |
| 2758 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 2759 | The content of the file is returned as text encoded inside base64. |
| 2760 | The Content-Type header will always be `text/plain` reflecting the |
| 2761 | outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header |
| 2762 | can be examined to find the server detected content type of the file. |
| 2763 | |
| 2764 | When the specified file was deleted in the change edit |
| 2765 | "`204 No Content`" is returned. |
| 2766 | |
| 2767 | If only the content type is required, callers should use HEAD to |
| 2768 | avoid downloading the encoded file contents. |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2769 | |
Michael Zhou | 551ad0c | 2016-04-26 01:21:42 -0400 | [diff] [blame] | 2770 | If the `base` parameter is set to true, the returned content is from the |
| 2771 | revision that the edit is based on. |
| 2772 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2773 | .Response |
| 2774 | ---- |
| 2775 | HTTP/1.1 200 OK |
| 2776 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2777 | Content-Type: text/plain; charset=ISO-8859-1 |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2778 | X-FYI-Content-Encoding: base64 |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 2779 | X-FYI-Content-Type: text/xml |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2780 | |
| 2781 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
| 2782 | ---- |
| 2783 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 2784 | Alternatively, if the only value of the Accept request header is |
| 2785 | `application/json` the content is returned as JSON string and |
| 2786 | `X-FYI-Content-Encoding` is set to `json`. |
| 2787 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 2788 | [[get-edit-meta-data]] |
| 2789 | === Retrieve meta data of a file from Change Edit |
| 2790 | -- |
| 2791 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta |
| 2792 | -- |
| 2793 | |
| 2794 | Retrieves meta data of a file from a change edit. Currently only |
| 2795 | web links are returned. |
| 2796 | |
| 2797 | .Request |
| 2798 | ---- |
| 2799 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0 |
| 2800 | ---- |
| 2801 | |
| 2802 | This REST endpoint retrieves additional information for a file in a |
| 2803 | change edit. As result an link:#edit-file-info[EditFileInfo] entity is |
| 2804 | returned. |
| 2805 | |
| 2806 | .Response |
| 2807 | ---- |
| 2808 | HTTP/1.1 200 OK |
| 2809 | Content-Disposition: attachment |
| 2810 | Content-Type: application/json; charset=UTF-8 |
| 2811 | |
| 2812 | )]}' |
| 2813 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2814 | "web_links": [ |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 2815 | { |
| 2816 | "show_on_side_by_side_diff_view": true, |
| 2817 | "name": "side-by-side preview diff", |
| 2818 | "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png", |
| 2819 | "url": "#/x/xdocs/c/42/1..0/README.md", |
| 2820 | "target": "_self" |
| 2821 | }, |
| 2822 | { |
| 2823 | "show_on_unified_diff_view": true, |
| 2824 | "name": "unified preview diff", |
| 2825 | "image_url": "plugins/xdocs/static/unifiedDiffPreview.png", |
| 2826 | "url": "#/x/xdocs/c/42/1..0/README.md,unified", |
| 2827 | "target": "_self" |
| 2828 | } |
| 2829 | ]} |
| 2830 | ---- |
| 2831 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 2832 | [[get-edit-message]] |
| 2833 | === Retrieve commit message from Change Edit or current patch set of the change |
| 2834 | -- |
| 2835 | 'GET /changes/link:#change-id[\{change-id\}]/edit:message |
| 2836 | -- |
| 2837 | |
David Ostrovsky | 25ad15e | 2014-12-15 21:18:59 +0100 | [diff] [blame] | 2838 | Retrieves commit message from change edit. |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 2839 | |
David Ostrovsky | 0ee0bb2 | 2016-05-31 22:47:47 +0200 | [diff] [blame] | 2840 | If the `base` parameter is set to true, the returned message is from the |
| 2841 | revision that the edit is based on. |
| 2842 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 2843 | .Request |
| 2844 | ---- |
| 2845 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
| 2846 | ---- |
| 2847 | |
| 2848 | The commit message is returned as base64 encoded string. |
| 2849 | |
| 2850 | .Response |
| 2851 | ---- |
| 2852 | HTTP/1.1 200 OK |
| 2853 | |
| 2854 | VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz |
| 2855 | M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg== |
| 2856 | ---- |
| 2857 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 2858 | Alternatively, if the only value of the Accept request header is |
| 2859 | `application/json` the commit message is returned as JSON string: |
| 2860 | |
| 2861 | .Response |
| 2862 | ---- |
| 2863 | HTTP/1.1 200 OK |
| 2864 | |
| 2865 | )]}' |
| 2866 | "Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n" |
| 2867 | ---- |
| 2868 | |
| 2869 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 2870 | [[publish-edit]] |
| 2871 | === Publish Change Edit |
| 2872 | -- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 2873 | 'POST /changes/link:#change-id[\{change-id\}]/edit:publish |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 2874 | -- |
| 2875 | |
| 2876 | Promotes change edit to a regular patch set. |
| 2877 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 2878 | Options can be provided in the request body as a |
| 2879 | link:#publish-change-edit-input[PublishChangeEditInput] entity. |
| 2880 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 2881 | .Request |
| 2882 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 2883 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0 |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 2884 | Content-Type: application/json; charset=UTF-8 |
| 2885 | |
| 2886 | { |
| 2887 | "notify": "NONE" |
| 2888 | } |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 2889 | ---- |
| 2890 | |
| 2891 | As response "`204 No Content`" is returned. |
| 2892 | |
| 2893 | .Response |
| 2894 | ---- |
| 2895 | HTTP/1.1 204 No Content |
| 2896 | ---- |
| 2897 | |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 2898 | [[rebase-edit]] |
| 2899 | === Rebase Change Edit |
| 2900 | -- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 2901 | 'POST /changes/link:#change-id[\{change-id\}]/edit:rebase |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 2902 | -- |
| 2903 | |
| 2904 | Rebases change edit on top of latest patch set. |
| 2905 | |
| 2906 | .Request |
| 2907 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 2908 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0 |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 2909 | ---- |
| 2910 | |
| 2911 | When change was rebased on top of latest patch set, response |
David Pursehouse | 56fbc08 | 2015-05-19 16:33:03 +0900 | [diff] [blame] | 2912 | "`204 No Content`" is returned. When change edit is already |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 2913 | based on top of the latest patch set, the response |
| 2914 | "`409 Conflict`" is returned. |
| 2915 | |
| 2916 | .Response |
| 2917 | ---- |
| 2918 | HTTP/1.1 204 No Content |
| 2919 | ---- |
| 2920 | |
David Ostrovsky | 8e75f50 | 2014-08-10 00:36:31 +0200 | [diff] [blame] | 2921 | [[delete-edit]] |
| 2922 | === Delete Change Edit |
| 2923 | -- |
| 2924 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit' |
| 2925 | -- |
| 2926 | |
| 2927 | Deletes change edit. |
| 2928 | |
| 2929 | .Request |
| 2930 | ---- |
| 2931 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 2932 | ---- |
| 2933 | |
| 2934 | As response "`204 No Content`" is returned. |
| 2935 | |
| 2936 | .Response |
| 2937 | ---- |
| 2938 | HTTP/1.1 204 No Content |
| 2939 | ---- |
| 2940 | |
Edwin Kempin | 9a9f1c0 | 2017-01-02 15:10:49 +0100 | [diff] [blame] | 2941 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 2942 | [[reviewer-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2943 | == Reviewer Endpoints |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 2944 | |
| 2945 | [[list-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2946 | === List Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2947 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2948 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2949 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2950 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 2951 | Lists the reviewers of a change. |
| 2952 | |
| 2953 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 2954 | |
| 2955 | .Request |
| 2956 | ---- |
| 2957 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0 |
| 2958 | ---- |
| 2959 | |
| 2960 | .Response |
| 2961 | ---- |
| 2962 | HTTP/1.1 200 OK |
| 2963 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2964 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 2965 | |
| 2966 | )]}' |
| 2967 | [ |
| 2968 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 2969 | "approvals": { |
| 2970 | "Verified": "+1", |
| 2971 | "Code-Review": "+2" |
| 2972 | }, |
| 2973 | "_account_id": 1000096, |
| 2974 | "name": "John Doe", |
| 2975 | "email": "john.doe@example.com" |
| 2976 | }, |
| 2977 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 2978 | "approvals": { |
| 2979 | "Verified": " 0", |
| 2980 | "Code-Review": "-1" |
| 2981 | }, |
| 2982 | "_account_id": 1000097, |
| 2983 | "name": "Jane Roe", |
| 2984 | "email": "jane.roe@example.com" |
| 2985 | } |
| 2986 | ] |
| 2987 | ---- |
| 2988 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 2989 | [[suggest-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2990 | === Suggest Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2991 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 2992 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2993 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 2994 | |
| 2995 | Suggest the reviewers for a given query `q` and result limit `n`. If result |
| 2996 | limit is not passed, then the default 10 is used. |
| 2997 | |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 2998 | This REST endpoint only suggests accounts that |
| 2999 | |
| 3000 | * are active |
| 3001 | * can see the change |
| 3002 | * are visible to the calling user |
| 3003 | * are not already reviewer on the change |
| 3004 | * don't own the change |
| 3005 | |
Edwin Kempin | ec02a55 | 2019-08-27 09:30:15 +0200 | [diff] [blame] | 3006 | Groups can be excluded from the results by specifying the 'exclude-groups' |
| 3007 | request parameter: |
| 3008 | |
| 3009 | -- |
| 3010 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups' |
| 3011 | -- |
Patrick Hiesel | c79ae0e | 2017-06-28 14:50:53 +0200 | [diff] [blame] | 3012 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3013 | As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned. |
| 3014 | |
| 3015 | .Request |
| 3016 | ---- |
| 3017 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0 |
| 3018 | ---- |
| 3019 | |
| 3020 | .Response |
| 3021 | ---- |
| 3022 | HTTP/1.1 200 OK |
| 3023 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3024 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3025 | |
| 3026 | )]}' |
| 3027 | [ |
| 3028 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3029 | "account": { |
| 3030 | "_account_id": 1000097, |
| 3031 | "name": "Jane Roe", |
| 3032 | "email": "jane.roe@example.com" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3033 | }, |
| 3034 | "count": 1 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3035 | }, |
| 3036 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3037 | "group": { |
| 3038 | "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279", |
| 3039 | "name": "Joiner" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3040 | }, |
| 3041 | "count": 5 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3042 | } |
| 3043 | ] |
| 3044 | ---- |
| 3045 | |
Edwin Kempin | 0ca3f72 | 2019-08-27 09:43:31 +0200 | [diff] [blame] | 3046 | To suggest CCs `reviewer-state=CC` can be specified as additional URL |
| 3047 | parameter. This includes existing reviewers in the result, but excludes |
| 3048 | existing CCs. |
| 3049 | |
| 3050 | -- |
| 3051 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC' |
| 3052 | -- |
| 3053 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3054 | [[get-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3055 | === Get Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3056 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3057 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3058 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3059 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3060 | Retrieves a reviewer of a change. |
| 3061 | |
| 3062 | As response a link:#reviewer-info[ReviewerInfo] entity is returned that |
| 3063 | describes the reviewer. |
| 3064 | |
| 3065 | .Request |
| 3066 | ---- |
| 3067 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0 |
| 3068 | ---- |
| 3069 | |
| 3070 | .Response |
| 3071 | ---- |
| 3072 | HTTP/1.1 200 OK |
| 3073 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3074 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3075 | |
| 3076 | )]}' |
| 3077 | { |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3078 | "approvals": { |
| 3079 | "Verified": "+1", |
| 3080 | "Code-Review": "+2" |
| 3081 | }, |
| 3082 | "_account_id": 1000096, |
| 3083 | "name": "John Doe", |
| 3084 | "email": "john.doe@example.com" |
| 3085 | } |
| 3086 | ---- |
| 3087 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3088 | [[add-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3089 | === Add Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3090 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3091 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3092 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3093 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3094 | Adds one user or all members of one group as reviewer to the change. |
| 3095 | |
| 3096 | The reviewer to be added to the change must be provided in the request |
| 3097 | body as a link:#reviewer-input[ReviewerInput] entity. |
| 3098 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3099 | Users can be moved from reviewer to CC and vice versa. This means if a |
| 3100 | user is added as CC that is already a reviewer on the change, the |
| 3101 | reviewer state of that user is updated to CC. If a user that is already |
| 3102 | a CC on the change is added as reviewer, the reviewer state of that |
| 3103 | user is updated to reviewer. |
| 3104 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3105 | .Request |
| 3106 | ---- |
| 3107 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3108 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3109 | |
| 3110 | { |
| 3111 | "reviewer": "john.doe@example.com" |
| 3112 | } |
| 3113 | ---- |
| 3114 | |
| 3115 | As response an link:#add-reviewer-result[AddReviewerResult] entity is |
| 3116 | returned that describes the newly added reviewers. |
| 3117 | |
| 3118 | .Response |
| 3119 | ---- |
| 3120 | HTTP/1.1 200 OK |
| 3121 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3122 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3123 | |
| 3124 | )]}' |
| 3125 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3126 | "input": "john.doe@example.com", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3127 | "reviewers": [ |
| 3128 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3129 | "_account_id": 1000096, |
| 3130 | "name": "John Doe", |
| 3131 | "email": "john.doe@example.com" |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3132 | "approvals": { |
| 3133 | "Verified": " 0", |
| 3134 | "Code-Review": " 0" |
| 3135 | }, |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3136 | } |
| 3137 | ] |
| 3138 | } |
| 3139 | ---- |
| 3140 | |
| 3141 | If a group is specified, adding the group members as reviewers is an |
| 3142 | atomic operation. This means if an error is returned, none of the |
| 3143 | members are added as reviewer. |
| 3144 | |
| 3145 | If a group with many members is added as reviewer a confirmation may be |
| 3146 | required. |
| 3147 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3148 | If a group is added as CC and members of this group are already |
| 3149 | reviewers on the change, these members stay reviewers on the change |
| 3150 | (they are not downgraded to CC). However if a group is added as |
| 3151 | reviewer, all group members become reviewer of the change, even if they |
| 3152 | have been added as CC before. |
| 3153 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3154 | .Request |
| 3155 | ---- |
| 3156 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3157 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3158 | |
| 3159 | { |
| 3160 | "reviewer": "MyProjectVerifiers" |
| 3161 | } |
| 3162 | ---- |
| 3163 | |
| 3164 | .Response |
| 3165 | ---- |
| 3166 | HTTP/1.1 200 OK |
| 3167 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3168 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3169 | |
| 3170 | )]}' |
| 3171 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3172 | "input": "MyProjectVerifiers", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3173 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 3174 | "confirm": true |
| 3175 | } |
| 3176 | ---- |
| 3177 | |
| 3178 | To confirm the addition of the reviewers, resend the request with the |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3179 | `confirmed` flag being set. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3180 | |
| 3181 | .Request |
| 3182 | ---- |
| 3183 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3184 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3185 | |
| 3186 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3187 | "input": "MyProjectVerifiers", |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3188 | "confirmed": true |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3189 | } |
| 3190 | ---- |
| 3191 | |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 3192 | If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set |
| 3193 | for the project, reviewers and CCs are not required to have a Gerrit account. If you POST |
| 3194 | an email address of a reviewer or CC then, they will be added to the change even if they |
| 3195 | don't have a Gerrit account. |
| 3196 | |
| 3197 | If this option is disabled, the request would fail with `400 Bad Request` if the email |
| 3198 | address can't be resolved to an active Gerrit account. |
| 3199 | |
| 3200 | Note that the name is optional so both "un.registered@reviewer.com" and |
| 3201 | "John Doe <un.registered@reviewer.com>" are valid inputs. |
| 3202 | |
| 3203 | Reviewers without Gerrit accounts can only be added on changes visible to anonymous users. |
| 3204 | |
| 3205 | .Request |
| 3206 | ---- |
| 3207 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 3208 | Content-Type: application/json; charset=UTF-8 |
| 3209 | |
| 3210 | { |
| 3211 | "reviewer": "John Doe <un.registered@reviewer.com>" |
| 3212 | } |
| 3213 | ---- |
| 3214 | |
| 3215 | .Response |
| 3216 | ---- |
| 3217 | HTTP/1.1 200 OK |
| 3218 | Content-Disposition: attachment |
| 3219 | Content-Type: application/json; charset=UTF-8 |
| 3220 | |
| 3221 | )]}' |
| 3222 | { |
| 3223 | "input": "John Doe <un.registered@reviewer.com>" |
| 3224 | } |
| 3225 | ---- |
| 3226 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3227 | .Notifications |
| 3228 | |
| 3229 | An email will be sent using the "newchange" template. |
| 3230 | |
| 3231 | [options="header",cols="1,1,1"] |
| 3232 | |============================= |
| 3233 | |WIP State |Default|notify=ALL |
| 3234 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 3235 | |Work in progress|not sent|owner, reviewers, CCs |
| 3236 | |============================= |
| 3237 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3238 | [[delete-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3239 | === Delete Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3240 | -- |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3241 | 'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' + |
| 3242 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/delete' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3243 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3244 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3245 | Deletes a reviewer from a change. |
| 3246 | |
| 3247 | .Request |
| 3248 | ---- |
| 3249 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0 |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3250 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3251 | ---- |
| 3252 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3253 | Options can be provided in the request body as a |
| 3254 | link:#delete-reviewer-input[DeleteReviewerInput] entity. |
| 3255 | Historically, this method allowed a body in the DELETE, but that behavior is |
| 3256 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 3257 | In this case, use a POST request instead: |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3258 | |
| 3259 | .Request |
| 3260 | ---- |
| 3261 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3262 | Content-Type: application/json; charset=UTF-8 |
| 3263 | |
| 3264 | { |
| 3265 | "notify": "NONE" |
| 3266 | } |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3267 | ---- |
| 3268 | |
| 3269 | .Response |
| 3270 | ---- |
| 3271 | HTTP/1.1 204 No Content |
| 3272 | ---- |
| 3273 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 3274 | .Notifications |
| 3275 | |
| 3276 | An email will be sent using the "deleteReviewer" template. If deleting the |
| 3277 | reviewer resulted in one or more approvals being removed, then the deleted |
| 3278 | reviewer will also receive a notification (unless notify=NONE). |
| 3279 | |
| 3280 | [options="header",cols="1,5"] |
| 3281 | |============================= |
| 3282 | |WIP State |Default Recipients |
| 3283 | |Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers |
| 3284 | |Work in progress|notify=NONE: deleted reviewer (if voted) |
| 3285 | |============================= |
| 3286 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3287 | [[list-votes]] |
| 3288 | === List Votes |
| 3289 | -- |
| 3290 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 3291 | -- |
| 3292 | |
| 3293 | Lists the votes for a specific reviewer of the change. |
| 3294 | |
| 3295 | .Request |
| 3296 | ---- |
Edwin Kempin | 314f10a | 2016-07-11 11:39:05 +0200 | [diff] [blame] | 3297 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0 |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3298 | ---- |
| 3299 | |
| 3300 | As result a map is returned that maps the label name to the label value. |
| 3301 | The entries in the map are sorted by label name. |
| 3302 | |
| 3303 | .Response |
| 3304 | ---- |
| 3305 | HTTP/1.1 200 OK |
| 3306 | Content-Disposition: attachment |
| 3307 | Content-Type: application/json;charset=UTF-8 |
| 3308 | |
| 3309 | )]}' |
| 3310 | { |
| 3311 | "Code-Review": -1, |
| 3312 | "Verified": 1 |
| 3313 | "Work-In-Progress": 1, |
| 3314 | } |
| 3315 | ---- |
| 3316 | |
| 3317 | [[delete-vote]] |
| 3318 | === Delete Vote |
| 3319 | -- |
Edwin Kempin | 5488dc1 | 2016-08-29 11:13:31 +0200 | [diff] [blame] | 3320 | 'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' + |
Edwin Kempin | 32a7c53 | 2016-06-22 07:58:32 +0200 | [diff] [blame] | 3321 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete' |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3322 | -- |
| 3323 | |
| 3324 | Deletes a single vote from a change. Note, that even when the last vote of |
| 3325 | a reviewer is removed the reviewer itself is still listed on the change. |
| 3326 | |
| 3327 | .Request |
| 3328 | ---- |
| 3329 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0 |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 3330 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 3331 | ---- |
| 3332 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3333 | Options can be provided in the request body as a |
| 3334 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 3335 | Historically, this method allowed a body in the DELETE, but that behavior is |
| 3336 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 3337 | In this case, use a POST request instead: |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 3338 | |
| 3339 | .Request |
| 3340 | ---- |
| 3341 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 3342 | Content-Type: application/json; charset=UTF-8 |
| 3343 | |
| 3344 | { |
| 3345 | "notify": "NONE" |
| 3346 | } |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3347 | ---- |
| 3348 | |
| 3349 | .Response |
| 3350 | ---- |
| 3351 | HTTP/1.1 204 No Content |
| 3352 | ---- |
| 3353 | |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 3354 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3355 | [[revision-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3356 | == Revision Endpoints |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3357 | |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3358 | [[get-commit]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3359 | === Get Commit |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3360 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3361 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3362 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3363 | |
| 3364 | Retrieves a parsed commit of a revision. |
| 3365 | |
| 3366 | .Request |
| 3367 | ---- |
| 3368 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0 |
| 3369 | ---- |
| 3370 | |
| 3371 | As response a link:#commit-info[CommitInfo] entity is returned that |
| 3372 | describes the revision. |
| 3373 | |
| 3374 | .Response |
| 3375 | ---- |
| 3376 | HTTP/1.1 200 OK |
| 3377 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3378 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3379 | |
| 3380 | )]}' |
| 3381 | { |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 3382 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3383 | "parents": [ |
| 3384 | { |
| 3385 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 3386 | "subject": "Migrate contributor agreements to All-Projects." |
| 3387 | } |
| 3388 | ], |
| 3389 | "author": { |
| 3390 | "name": "Shawn O. Pearce", |
| 3391 | "email": "sop@google.com", |
| 3392 | "date": "2012-04-24 18:08:08.000000000", |
| 3393 | "tz": -420 |
| 3394 | }, |
| 3395 | "committer": { |
| 3396 | "name": "Shawn O. Pearce", |
| 3397 | "email": "sop@google.com", |
| 3398 | "date": "2012-04-24 18:08:08.000000000", |
| 3399 | "tz": -420 |
| 3400 | }, |
| 3401 | "subject": "Use an EventBus to manage star icons", |
| 3402 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 3403 | } |
| 3404 | ---- |
| 3405 | |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 3406 | Adding query parameter `links` (for example `/changes/.../commit?links`) |
| 3407 | returns a link:#commit-info[CommitInfo] with the additional field `web_links`. |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3408 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 3409 | [[get-description]] |
| 3410 | === Get Description |
| 3411 | -- |
| 3412 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 3413 | -- |
| 3414 | |
| 3415 | Retrieves the description of a patch set. |
| 3416 | |
| 3417 | .Request |
| 3418 | ---- |
| 3419 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 3420 | ---- |
| 3421 | |
| 3422 | .Response |
| 3423 | ---- |
| 3424 | HTTP/1.1 200 OK |
| 3425 | Content-Disposition: attachment |
| 3426 | Content-Type: application/json; charset=UTF-8 |
| 3427 | |
| 3428 | )]}' |
| 3429 | "Added Documentation" |
| 3430 | ---- |
| 3431 | |
| 3432 | If the patch set does not have a description an empty string is returned. |
| 3433 | |
| 3434 | [[set-description]] |
| 3435 | === Set Description |
| 3436 | -- |
| 3437 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 3438 | -- |
| 3439 | |
| 3440 | Sets the description of a patch set. |
| 3441 | |
| 3442 | The new description must be provided in the request body inside a |
| 3443 | link:#description-input[DescriptionInput] entity. |
| 3444 | |
| 3445 | .Request |
| 3446 | ---- |
| 3447 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 3448 | Content-Type: application/json; charset=UTF-8 |
| 3449 | |
| 3450 | { |
| 3451 | "description": "Added Documentation" |
| 3452 | } |
| 3453 | ---- |
| 3454 | |
| 3455 | As response the new description is returned. |
| 3456 | |
| 3457 | .Response |
| 3458 | ---- |
| 3459 | HTTP/1.1 200 OK |
| 3460 | Content-Disposition: attachment |
| 3461 | Content-Type: application/json; charset=UTF-8 |
| 3462 | |
| 3463 | )]}' |
| 3464 | "Added Documentation" |
| 3465 | ---- |
| 3466 | |
Edwin Kempin | 0f22944 | 2016-09-09 13:06:12 +0200 | [diff] [blame] | 3467 | [[get-merge-list]] |
| 3468 | === Get Merge List |
| 3469 | -- |
| 3470 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist' |
| 3471 | -- |
| 3472 | |
| 3473 | Returns the list of commits that are being integrated into a target |
| 3474 | branch by a merge commit. By default the first parent is assumed to be |
| 3475 | uninteresting. By using the `parent` option another parent can be set |
| 3476 | as uninteresting (parents are 1-based). |
| 3477 | |
| 3478 | The list of commits is returned as a list of |
| 3479 | link:#commit-info[CommitInfo] entities. Web links are only included if |
| 3480 | the `links` option was set. |
| 3481 | |
| 3482 | .Request |
| 3483 | ---- |
| 3484 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0 |
| 3485 | ---- |
| 3486 | |
| 3487 | .Response |
| 3488 | ---- |
| 3489 | HTTP/1.1 200 OK |
| 3490 | Content-Disposition: attachment |
| 3491 | Content-Type: application/json; charset=UTF-8 |
| 3492 | |
| 3493 | )]}' |
| 3494 | [ |
| 3495 | { |
| 3496 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 3497 | "parents": [ |
| 3498 | { |
| 3499 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 3500 | "subject": "Migrate contributor agreements to All-Projects." |
| 3501 | } |
| 3502 | ], |
| 3503 | "author": { |
| 3504 | "name": "Shawn O. Pearce", |
| 3505 | "email": "sop@google.com", |
| 3506 | "date": "2012-04-24 18:08:08.000000000", |
| 3507 | "tz": -420 |
| 3508 | }, |
| 3509 | "committer": { |
| 3510 | "name": "Shawn O. Pearce", |
| 3511 | "email": "sop@google.com", |
| 3512 | "date": "2012-04-24 18:08:08.000000000", |
| 3513 | "tz": -420 |
| 3514 | }, |
| 3515 | "subject": "Use an EventBus to manage star icons", |
| 3516 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 3517 | } |
| 3518 | ] |
| 3519 | ---- |
| 3520 | |
Stefan Beller | c725966 | 2015-02-12 17:23:05 -0800 | [diff] [blame] | 3521 | [[get-revision-actions]] |
| 3522 | === Get Revision Actions |
| 3523 | -- |
| 3524 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions' |
| 3525 | -- |
| 3526 | |
| 3527 | Retrieves revision link:#action-info[actions] of the revision of a change. |
| 3528 | |
| 3529 | .Request |
| 3530 | ---- |
| 3531 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0 |
| 3532 | ---- |
| 3533 | |
| 3534 | .Response |
| 3535 | ---- |
| 3536 | HTTP/1.1 200 OK |
| 3537 | Content-Disposition: attachment |
| 3538 | Content-Type: application/json; charset=UTF-8 |
| 3539 | |
| 3540 | )]}' |
| 3541 | |
| 3542 | { |
| 3543 | "submit": { |
| 3544 | "method": "POST", |
| 3545 | "label": "Submit", |
| 3546 | "title": "Submit patch set 1 into master", |
| 3547 | "enabled": true |
| 3548 | }, |
| 3549 | "cherrypick": { |
| 3550 | "method": "POST", |
| 3551 | "label": "Cherry Pick", |
| 3552 | "title": "Cherry pick change to a different branch", |
| 3553 | "enabled": true |
| 3554 | } |
| 3555 | } |
| 3556 | ---- |
| 3557 | |
| 3558 | The response is a flat map of possible revision actions mapped to their |
| 3559 | link:#action-info[ActionInfo]. |
| 3560 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3561 | [[get-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3562 | === Get Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3563 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3564 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3565 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3566 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3567 | Retrieves a review of a revision. |
| 3568 | |
| 3569 | .Request |
| 3570 | ---- |
| 3571 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 3572 | ---- |
| 3573 | |
| 3574 | As response a link:#change-info[ChangeInfo] entity with |
| 3575 | link:#detailed-labels[detailed labels] and link:#detailed-accounts[ |
| 3576 | detailed accounts] is returned that describes the review of the |
| 3577 | revision. The revision for which the review is retrieved is contained |
| 3578 | in the `revisions` field. In addition the `current_revision` field is |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 3579 | set if the revision for which the review is retrieved is the current |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3580 | revision of the change. Please note that the returned labels are always |
| 3581 | for the current patch set. |
| 3582 | |
| 3583 | .Response |
| 3584 | ---- |
| 3585 | HTTP/1.1 200 OK |
| 3586 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3587 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3588 | |
| 3589 | )]}' |
| 3590 | { |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3591 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 3592 | "project": "myProject", |
| 3593 | "branch": "master", |
| 3594 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 3595 | "subject": "Implementing Feature X", |
| 3596 | "status": "NEW", |
| 3597 | "created": "2013-02-01 09:59:32.126000000", |
| 3598 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3599 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 3600 | "insertions": 34, |
| 3601 | "deletions": 45, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3602 | "_number": 3965, |
| 3603 | "owner": { |
| 3604 | "_account_id": 1000096, |
| 3605 | "name": "John Doe", |
| 3606 | "email": "john.doe@example.com" |
| 3607 | }, |
| 3608 | "labels": { |
| 3609 | "Verified": { |
| 3610 | "all": [ |
| 3611 | { |
| 3612 | "value": 0, |
| 3613 | "_account_id": 1000096, |
| 3614 | "name": "John Doe", |
| 3615 | "email": "john.doe@example.com" |
| 3616 | }, |
| 3617 | { |
| 3618 | "value": 0, |
| 3619 | "_account_id": 1000097, |
| 3620 | "name": "Jane Roe", |
| 3621 | "email": "jane.roe@example.com" |
| 3622 | } |
| 3623 | ], |
| 3624 | "values": { |
| 3625 | "-1": "Fails", |
| 3626 | " 0": "No score", |
| 3627 | "+1": "Verified" |
| 3628 | } |
| 3629 | }, |
| 3630 | "Code-Review": { |
| 3631 | "all": [ |
| 3632 | { |
| 3633 | "value": -1, |
| 3634 | "_account_id": 1000096, |
| 3635 | "name": "John Doe", |
| 3636 | "email": "john.doe@example.com" |
| 3637 | }, |
| 3638 | { |
| 3639 | "value": 1, |
| 3640 | "_account_id": 1000097, |
| 3641 | "name": "Jane Roe", |
| 3642 | "email": "jane.roe@example.com" |
| 3643 | } |
| 3644 | ] |
| 3645 | "values": { |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame] | 3646 | "-2": "This shall not be merged", |
| 3647 | "-1": "I would prefer this is not merged as is", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3648 | " 0": "No score", |
| 3649 | "+1": "Looks good to me, but someone else must approve", |
| 3650 | "+2": "Looks good to me, approved" |
| 3651 | } |
| 3652 | } |
| 3653 | }, |
| 3654 | "permitted_labels": { |
| 3655 | "Verified": [ |
| 3656 | "-1", |
| 3657 | " 0", |
| 3658 | "+1" |
| 3659 | ], |
| 3660 | "Code-Review": [ |
| 3661 | "-2", |
| 3662 | "-1", |
| 3663 | " 0", |
| 3664 | "+1", |
| 3665 | "+2" |
| 3666 | ] |
| 3667 | }, |
| 3668 | "removable_reviewers": [ |
| 3669 | { |
| 3670 | "_account_id": 1000096, |
| 3671 | "name": "John Doe", |
| 3672 | "email": "john.doe@example.com" |
| 3673 | }, |
| 3674 | { |
| 3675 | "_account_id": 1000097, |
| 3676 | "name": "Jane Roe", |
| 3677 | "email": "jane.roe@example.com" |
| 3678 | } |
| 3679 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 3680 | "reviewers": { |
| 3681 | "REVIEWER": [ |
| 3682 | { |
| 3683 | "_account_id": 1000096, |
| 3684 | "name": "John Doe", |
| 3685 | "email": "john.doe@example.com" |
| 3686 | }, |
| 3687 | { |
| 3688 | "_account_id": 1000097, |
| 3689 | "name": "Jane Roe", |
| 3690 | "email": "jane.roe@example.com" |
| 3691 | } |
| 3692 | ] |
| 3693 | }, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3694 | "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 3695 | "revisions": { |
| 3696 | "674ac754f91e64a0efb8087e59a176484bd534d1": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 3697 | "kind": "REWORK", |
| 3698 | "_number": 2, |
| 3699 | "ref": "refs/changes/65/3965/2", |
| 3700 | "fetch": { |
| 3701 | "http": { |
| 3702 | "url": "http://gerrit/myProject", |
| 3703 | "ref": "refs/changes/65/3965/2" |
| 3704 | } |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3705 | } |
| 3706 | } |
| 3707 | } |
| 3708 | } |
| 3709 | ---- |
| 3710 | |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3711 | [[get-related-changes]] |
| 3712 | === Get Related Changes |
| 3713 | -- |
| 3714 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related' |
| 3715 | -- |
| 3716 | |
| 3717 | Retrieves related changes of a revision. Related changes are changes that either |
| 3718 | depend on, or are dependencies of the revision. |
| 3719 | |
| 3720 | .Request |
| 3721 | ---- |
| 3722 | GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0 |
| 3723 | ---- |
| 3724 | |
| 3725 | As result a link:#related-changes-info[RelatedChangesInfo] entity is returned |
| 3726 | describing the related changes. |
| 3727 | |
| 3728 | .Response |
| 3729 | ---- |
| 3730 | HTTP/1.1 200 OK |
| 3731 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3732 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3733 | |
| 3734 | )]}' |
| 3735 | { |
| 3736 | "changes": [ |
| 3737 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 3738 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3739 | "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5", |
| 3740 | "commit": { |
| 3741 | "commit": "78847477532e386f5a2185a4e8c90b2509e354e3", |
| 3742 | "parents": [ |
| 3743 | { |
| 3744 | "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e" |
| 3745 | } |
| 3746 | ], |
| 3747 | "author": { |
| 3748 | "name": "David Ostrovsky", |
| 3749 | "email": "david@ostrovsky.org", |
| 3750 | "date": "2014-07-12 15:04:24.000000000", |
| 3751 | "tz": 120 |
| 3752 | }, |
| 3753 | "subject": "Remove Solr" |
| 3754 | }, |
| 3755 | "_change_number": 58478, |
| 3756 | "_revision_number": 2, |
| 3757 | "_current_revision_number": 2 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 3758 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3759 | }, |
| 3760 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 3761 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3762 | "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774", |
| 3763 | "commit": { |
| 3764 | "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe", |
| 3765 | "parents": [ |
| 3766 | { |
| 3767 | "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad" |
| 3768 | } |
| 3769 | ], |
| 3770 | "author": { |
| 3771 | "name": "David Pursehouse", |
| 3772 | "email": "david.pursehouse@sonymobile.com", |
| 3773 | "date": "2014-06-24 02:01:28.000000000", |
| 3774 | "tz": 540 |
| 3775 | }, |
| 3776 | "subject": "Add support for secondary index with Elasticsearch" |
| 3777 | }, |
| 3778 | "_change_number": 58081, |
| 3779 | "_revision_number": 10, |
| 3780 | "_current_revision_number": 10 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 3781 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3782 | } |
| 3783 | ] |
| 3784 | } |
| 3785 | ---- |
| 3786 | |
| 3787 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3788 | [[set-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3789 | === Set Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3790 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3791 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3792 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3793 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3794 | Sets a review on a revision, optionally also publishing draft comments, setting |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 3795 | labels, adding reviewers or CCs, and modifying the work in progress property. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3796 | |
| 3797 | The review must be provided in the request body as a |
| 3798 | link:#review-input[ReviewInput] entity. |
| 3799 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3800 | A review cannot be set on a change edit. Trying to post a review for a |
| 3801 | change edit fails with `409 Conflict`. |
| 3802 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3803 | Here is an example of using this method to set labels: |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3804 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3805 | .Request |
| 3806 | ---- |
| 3807 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3808 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3809 | |
| 3810 | { |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 3811 | "tag": "jenkins", |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3812 | "message": "Some nits need to be fixed.", |
| 3813 | "labels": { |
| 3814 | "Code-Review": -1 |
| 3815 | }, |
| 3816 | "comments": { |
| 3817 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 3818 | { |
| 3819 | "line": 23, |
| 3820 | "message": "[nit] trailing whitespace" |
| 3821 | }, |
| 3822 | { |
| 3823 | "line": 49, |
| 3824 | "message": "[nit] s/conrtol/control" |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 3825 | }, |
| 3826 | { |
| 3827 | "range": { |
| 3828 | "start_line": 50, |
| 3829 | "start_character": 0, |
| 3830 | "end_line": 55, |
| 3831 | "end_character": 20 |
| 3832 | }, |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 3833 | "message": "Incorrect indentation" |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3834 | } |
| 3835 | ] |
| 3836 | } |
| 3837 | } |
| 3838 | ---- |
| 3839 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 3840 | As response a link:#review-result[ReviewResult] entity is returned that |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3841 | describes the applied labels and any added reviewers (e.g. yourself, |
| 3842 | if you set a label but weren't previously a reviewer on this CL). |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3843 | |
| 3844 | .Response |
| 3845 | ---- |
| 3846 | HTTP/1.1 200 OK |
| 3847 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3848 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3849 | |
| 3850 | )]}' |
| 3851 | { |
| 3852 | "labels": { |
| 3853 | "Code-Review": -1 |
| 3854 | } |
| 3855 | } |
| 3856 | ---- |
| 3857 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3858 | It is also possible to add one or more reviewers or CCs |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3859 | to a change simultaneously with a review: |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3860 | |
| 3861 | .Request |
| 3862 | ---- |
| 3863 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 3864 | Content-Type: application/json; charset=UTF-8 |
| 3865 | |
| 3866 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3867 | "message": "I don't have context here. Jane and maybe John and the project leads should take a look.", |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3868 | "reviewers": [ |
| 3869 | { |
| 3870 | "reviewer": "jane.roe@example.com" |
| 3871 | }, |
| 3872 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3873 | "reviewer": "john.doe@example.com", |
| 3874 | "state": "CC" |
| 3875 | } |
| 3876 | { |
| 3877 | "reviewer": "MyProjectVerifiers", |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3878 | } |
| 3879 | ] |
| 3880 | } |
| 3881 | ---- |
| 3882 | |
| 3883 | Each element of the `reviewers` list is an instance of |
| 3884 | link:#reviewer-input[ReviewerInput]. The corresponding result of |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3885 | adding each reviewer will be returned in a map of inputs to |
| 3886 | link:#add-reviewer-result[AddReviewerResult]s. |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3887 | |
| 3888 | .Response |
| 3889 | ---- |
| 3890 | HTTP/1.1 200 OK |
| 3891 | Content-Disposition: attachment |
| 3892 | Content-Type: application/json; charset=UTF-8 |
| 3893 | |
| 3894 | )]}' |
| 3895 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3896 | "reviewers": { |
| 3897 | "jane.roe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3898 | "input": "jane.roe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3899 | "reviewers": [ |
| 3900 | { |
| 3901 | "_account_id": 1000097, |
| 3902 | "name": "Jane Roe", |
| 3903 | "email": "jane.roe@example.com" |
| 3904 | "approvals": { |
| 3905 | "Verified": " 0", |
| 3906 | "Code-Review": " 0" |
| 3907 | }, |
| 3908 | }, |
| 3909 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3910 | }, |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3911 | "john.doe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3912 | "input": "john.doe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3913 | "ccs": [ |
| 3914 | { |
| 3915 | "_account_id": 1000096, |
| 3916 | "name": "John Doe", |
| 3917 | "email": "john.doe@example.com" |
| 3918 | "approvals": { |
| 3919 | "Verified": " 0", |
| 3920 | "Code-Review": " 0" |
| 3921 | }, |
| 3922 | } |
| 3923 | ] |
| 3924 | }, |
| 3925 | "MyProjectVerifiers": { |
| 3926 | "input": "MyProjectVerifiers", |
| 3927 | "reviewers": [ |
| 3928 | { |
| 3929 | "_account_id": 1000098, |
| 3930 | "name": "Alice Ansel", |
| 3931 | "email": "alice.ansel@example.com" |
| 3932 | "approvals": { |
| 3933 | "Verified": " 0", |
| 3934 | "Code-Review": " 0" |
| 3935 | }, |
| 3936 | }, |
| 3937 | { |
| 3938 | "_account_id": 1000099, |
| 3939 | "name": "Bob Bollard", |
| 3940 | "email": "bob.bollard@example.com" |
| 3941 | "approvals": { |
| 3942 | "Verified": " 0", |
| 3943 | "Code-Review": " 0" |
| 3944 | }, |
| 3945 | }, |
| 3946 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3947 | } |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3948 | } |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3949 | } |
| 3950 | ---- |
| 3951 | |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 3952 | If there are any errors returned for reviewers, the entire review request will |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3953 | be rejected with `400 Bad Request`. None of the entries will have the |
| 3954 | `reviewers` or `ccs` field set, and those which specifically failed will have |
| 3955 | the `errors` field set containing details of why they failed. |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 3956 | |
| 3957 | .Error Response |
| 3958 | ---- |
| 3959 | HTTP/1.1 400 Bad Request |
| 3960 | Content-Disposition: attachment |
| 3961 | Content-Type: application/json; charset=UTF-8 |
| 3962 | |
| 3963 | )]}' |
| 3964 | { |
| 3965 | "reviewers": { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3966 | "jane.roe@example.com": { |
| 3967 | "input": "jane.roe@example.com", |
| 3968 | "error": "Account of jane.roe@example.com is inactive." |
| 3969 | }, |
| 3970 | "john.doe@example.com": { |
| 3971 | "input": "john.doe@example.com" |
| 3972 | }, |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 3973 | "MyProjectVerifiers": { |
| 3974 | "input": "MyProjectVerifiers", |
| 3975 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 3976 | "confirm": true |
| 3977 | } |
| 3978 | } |
| 3979 | } |
| 3980 | ---- |
| 3981 | |
Dave Borowitz | d2e4145 | 2017-10-26 08:06:23 -0400 | [diff] [blame] | 3982 | [[set-review-notifications]] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 3983 | .Notifications |
| 3984 | |
| 3985 | An email will be sent using the "comment" template. |
| 3986 | |
| 3987 | If the top-level notify property is null or not set, then notification behavior |
| 3988 | depends on whether the change is WIP, whether it has started review, and whether |
| 3989 | the tag property is null. |
| 3990 | |
| 3991 | NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*. |
| 3992 | Use the notify property of the top-level link:#review-input[ReviewInput] instead. |
| 3993 | |
| 3994 | For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS |
| 3995 | watchers*. |
| 3996 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 3997 | [options="header",cols="2,1,1,2,2"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 3998 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 3999 | |WIP State |Review Started|Tag Given|Default |notify=ALL |
| 4000 | |Ready for review|N/A |N/A |everyone|everyone |
| 4001 | |Work in progress|no |no |not sent|everyone |
| 4002 | |Work in progress|no |yes |owner |everyone |
| 4003 | |Work in progress|yes |no |everyone|everyone |
| 4004 | |Work in progress|yes |yes |owner |everyone |
| 4005 | |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4006 | |============================= |
| 4007 | |
| 4008 | If reviewers are added, then a second email will be sent using the "newchange" |
| 4009 | template. The notification logic for this email is the same as for |
| 4010 | link:#add-reviewer[Add Reviewer]. |
| 4011 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4012 | [options="header",cols="1,1,1"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4013 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4014 | |WIP State |Default |notify=ALL |
| 4015 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 4016 | |Work in progress|not sent |owner, reviewers, CCs |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4017 | |============================= |
| 4018 | |
| 4019 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4020 | [[rebase-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4021 | === Rebase Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4022 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4023 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4024 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4025 | |
| 4026 | Rebases a revision. |
| 4027 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4028 | Optionally, the parent revision can be changed to another patch set through the |
| 4029 | link:#rebase-input[RebaseInput] entity. |
| 4030 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4031 | .Request |
| 4032 | ---- |
| 4033 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4034 | Content-Type: application/json;charset=UTF-8 |
| 4035 | |
| 4036 | { |
| 4037 | "base" : "1234", |
| 4038 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4039 | ---- |
| 4040 | |
| 4041 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 4042 | describes the rebased change. Information about the current patch set |
| 4043 | is included. |
| 4044 | |
| 4045 | .Response |
| 4046 | ---- |
| 4047 | HTTP/1.1 200 OK |
| 4048 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4049 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4050 | |
| 4051 | )]}' |
| 4052 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4053 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4054 | "project": "myProject", |
| 4055 | "branch": "master", |
| 4056 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4057 | "subject": "Implement Feature X", |
| 4058 | "status": "NEW", |
| 4059 | "created": "2013-02-01 09:59:32.126000000", |
| 4060 | "updated": "2013-02-21 11:16:36.775000000", |
| 4061 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 4062 | "insertions": 21, |
| 4063 | "deletions": 21, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4064 | "_number": 4799, |
| 4065 | "owner": { |
| 4066 | "name": "John Doe" |
| 4067 | }, |
| 4068 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 4069 | "revisions": { |
| 4070 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 4071 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4072 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 4073 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4074 | "fetch": { |
| 4075 | "http": { |
| 4076 | "url": "http://gerrit:8080/myProject", |
| 4077 | "ref": "refs/changes/99/4799/2" |
| 4078 | } |
| 4079 | }, |
| 4080 | "commit": { |
| 4081 | "parents": [ |
| 4082 | { |
| 4083 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 4084 | "subject": "Implement Feature A" |
| 4085 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 4086 | ], |
| 4087 | "author": { |
| 4088 | "name": "John Doe", |
| 4089 | "email": "john.doe@example.com", |
| 4090 | "date": "2013-05-07 15:21:27.000000000", |
| 4091 | "tz": 120 |
| 4092 | }, |
| 4093 | "committer": { |
| 4094 | "name": "Gerrit Code Review", |
| 4095 | "email": "gerrit-server@example.com", |
| 4096 | "date": "2013-05-07 15:35:43.000000000", |
| 4097 | "tz": 120 |
| 4098 | }, |
| 4099 | "subject": "Implement Feature X", |
| 4100 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4101 | } |
| 4102 | } |
| 4103 | } |
| 4104 | ---- |
| 4105 | |
| 4106 | If the revision cannot be rebased, e.g. due to conflicts, the response is |
| 4107 | "`409 Conflict`" and the error message is contained in the response |
| 4108 | body. |
| 4109 | |
| 4110 | .Response |
| 4111 | ---- |
| 4112 | HTTP/1.1 409 Conflict |
| 4113 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4114 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4115 | |
| 4116 | The change could not be rebased due to a path conflict during merge. |
| 4117 | ---- |
| 4118 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4119 | [[submit-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4120 | === Submit Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4121 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4122 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4123 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4124 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4125 | Submits a revision. |
| 4126 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4127 | .Request |
| 4128 | ---- |
| 4129 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4130 | ---- |
| 4131 | |
| 4132 | As response a link:#submit-info[SubmitInfo] entity is returned that |
| 4133 | describes the status of the submitted change. |
| 4134 | |
| 4135 | .Response |
| 4136 | ---- |
| 4137 | HTTP/1.1 200 OK |
| 4138 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4139 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4140 | |
| 4141 | )]}' |
| 4142 | { |
| 4143 | "status": "MERGED" |
| 4144 | } |
| 4145 | ---- |
| 4146 | |
| 4147 | If the revision cannot be submitted, e.g. because the submit rule |
| 4148 | doesn't allow submitting the revision or the revision is not the |
| 4149 | current revision, the response is "`409 Conflict`" and the error |
| 4150 | message is contained in the response body. |
| 4151 | |
| 4152 | .Response |
| 4153 | ---- |
| 4154 | HTTP/1.1 409 Conflict |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4155 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4156 | |
| 4157 | "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision" |
| 4158 | ---- |
| 4159 | |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4160 | [[get-patch]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4161 | === Get Patch |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4162 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4163 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4164 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4165 | |
| 4166 | Gets the formatted patch for one revision. |
| 4167 | |
| 4168 | .Request |
| 4169 | ---- |
| 4170 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0 |
| 4171 | ---- |
| 4172 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4173 | The formatted patch is returned as text encoded inside base64: |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4174 | |
| 4175 | .Response |
| 4176 | ---- |
| 4177 | HTTP/1.1 200 OK |
| 4178 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4179 | Content-Type: text/plain; charset=ISO-8859-1 |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4180 | X-FYI-Content-Encoding: base64 |
| 4181 | X-FYI-Content-Type: application/mbox |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4182 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4183 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4184 | ---- |
| 4185 | |
David Ostrovsky | 973f38b | 2013-08-22 00:24:51 -0700 | [diff] [blame] | 4186 | Adding query parameter `zip` (for example `/changes/.../patch?zip`) |
| 4187 | returns the patch as a single file inside of a ZIP archive. Clients |
| 4188 | can expand the ZIP to obtain the plain text patch, avoiding the |
| 4189 | need for a base64 decoding step. This option implies `download`. |
| 4190 | |
| 4191 | Query parameter `download` (e.g. `/changes/.../patch?download`) |
| 4192 | will suggest the browser save the patch as `commitsha1.diff.base64`, |
| 4193 | for later processing by command line tools. |
| 4194 | |
Kasper Nilsson | 8144807 | 2016-10-17 15:04:33 -0700 | [diff] [blame] | 4195 | If the `path` parameter is set, the returned content is a diff of the single |
| 4196 | file that the path refers to. |
| 4197 | |
Stefan Beller | dfa1ef3 | 2016-09-16 12:20:02 -0700 | [diff] [blame] | 4198 | [[submit-preview]] |
Edwin Kempin | 807eb4b | 2016-10-18 15:49:41 +0200 | [diff] [blame] | 4199 | === Submit Preview |
Stefan Beller | dfa1ef3 | 2016-09-16 12:20:02 -0700 | [diff] [blame] | 4200 | -- |
| 4201 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit' |
| 4202 | -- |
| 4203 | Gets a file containing thin bundles of all modified projects if this |
| 4204 | change was submitted. The bundles are named `${ProjectName}.git`. |
| 4205 | Each thin bundle contains enough to construct the state in which a project would |
| 4206 | be in if this change were submitted. The base of the thin bundles are the |
| 4207 | current target branches, so to make use of this call in a non-racy way, first |
| 4208 | get the bundles and then fetch all projects contained in the bundle. |
| 4209 | (This assumes no non-fastforward pushes). |
| 4210 | |
| 4211 | You need to give a parameter '?format=zip' or '?format=tar' to specify the |
Stefan Beller | 3e58674 | 2016-10-05 15:23:22 -0700 | [diff] [blame] | 4212 | format for the outer container. It is always possible to use tgz, even if |
| 4213 | tgz is not in the list of allowed archive formats. |
Stefan Beller | dfa1ef3 | 2016-09-16 12:20:02 -0700 | [diff] [blame] | 4214 | |
| 4215 | To make good use of this call, you would roughly need code as found at: |
| 4216 | ---- |
| 4217 | $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh |
| 4218 | ---- |
| 4219 | .Request |
| 4220 | ---- |
| 4221 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0 |
| 4222 | ---- |
| 4223 | |
| 4224 | .Response |
| 4225 | ---- |
| 4226 | HTTP/1.1 200 OK |
| 4227 | Date: Tue, 13 Sep 2016 19:13:46 GMT |
| 4228 | Content-Disposition: attachment; filename="submit-preview-147.zip" |
| 4229 | X-Content-Type-Options: nosniff |
| 4230 | Cache-Control: no-cache, no-store, max-age=0, must-revalidate |
| 4231 | Pragma: no-cache |
| 4232 | Expires: Mon, 01 Jan 1990 00:00:00 GMT |
| 4233 | Content-Type: application/x-zip |
| 4234 | Transfer-Encoding: chunked |
| 4235 | |
| 4236 | [binary stuff] |
| 4237 | ---- |
| 4238 | |
| 4239 | In case of an error, the response is not a zip file but a regular json response, |
| 4240 | containing only the error message: |
| 4241 | |
| 4242 | .Response |
| 4243 | ---- |
| 4244 | HTTP/1.1 200 OK |
| 4245 | Content-Disposition: attachment |
| 4246 | Content-Type: application/json; charset=UTF-8 |
| 4247 | |
| 4248 | )]}' |
| 4249 | "Anonymous users cannot submit" |
| 4250 | ---- |
| 4251 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4252 | [[get-mergeable]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4253 | === Get Mergeable |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4254 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4255 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4256 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4257 | |
| 4258 | Gets the method the server will use to submit (merge) the change and |
| 4259 | an indicator if the change is currently mergeable. |
| 4260 | |
| 4261 | .Request |
| 4262 | ---- |
| 4263 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0 |
| 4264 | ---- |
| 4265 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 4266 | As response a link:#mergeable-info[MergeableInfo] entity is returned. |
| 4267 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4268 | .Response |
| 4269 | ---- |
| 4270 | HTTP/1.1 200 OK |
| 4271 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4272 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4273 | |
| 4274 | )]}' |
| 4275 | { |
| 4276 | submit_type: "MERGE_IF_NECESSARY", |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 4277 | strategy: "recursive", |
| 4278 | mergeable: true |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4279 | } |
| 4280 | ---- |
| 4281 | |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4282 | If the `other-branches` parameter is specified, the mergeability will also be |
Zhen Chen | 6729b63 | 2016-11-11 17:32:32 -0800 | [diff] [blame] | 4283 | checked for all other branches which are listed in the |
| 4284 | link:config-project-config.html#branchOrder-section[branchOrder] section in the |
| 4285 | project.config file. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4286 | |
| 4287 | .Request |
| 4288 | ---- |
| 4289 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0 |
| 4290 | ---- |
| 4291 | |
| 4292 | The response will then contain a list of all other branches where this changes |
| 4293 | could merge cleanly. |
| 4294 | |
| 4295 | .Response |
| 4296 | ---- |
| 4297 | HTTP/1.1 200 OK |
| 4298 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4299 | Content-Type: application/json; charset=UTF-8 |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4300 | |
| 4301 | )]}' |
| 4302 | { |
| 4303 | submit_type: "MERGE_IF_NECESSARY", |
| 4304 | mergeable: true, |
| 4305 | mergeable_into: [ |
| 4306 | "refs/heads/stable-2.7", |
| 4307 | "refs/heads/stable-2.8", |
| 4308 | ] |
| 4309 | } |
| 4310 | ---- |
| 4311 | |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4312 | [[get-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4313 | === Get Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4314 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4315 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4316 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4317 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4318 | Gets the method the server will use to submit (merge) the change. |
| 4319 | |
| 4320 | .Request |
| 4321 | ---- |
| 4322 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0 |
| 4323 | ---- |
| 4324 | |
| 4325 | .Response |
| 4326 | ---- |
| 4327 | HTTP/1.1 200 OK |
| 4328 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4329 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4330 | |
| 4331 | )]}' |
| 4332 | "MERGE_IF_NECESSARY" |
| 4333 | ---- |
| 4334 | |
| 4335 | [[test-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4336 | === Test Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4337 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4338 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4339 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4340 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4341 | Tests the submit_type Prolog rule in the project, or the one given. |
| 4342 | |
| 4343 | Request body may be either the Prolog code as `text/plain` or a |
| 4344 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 4345 | may be set to `SKIP` to bypass parent project filters while testing |
| 4346 | a project-specific rule. |
| 4347 | |
| 4348 | .Request |
| 4349 | ---- |
| 4350 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0 |
David Pursehouse | 4d7f991 | 2020-06-18 13:02:56 +0900 | [diff] [blame] | 4351 | Content-Type: text/plain; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4352 | |
| 4353 | submit_type(cherry_pick). |
| 4354 | ---- |
| 4355 | |
| 4356 | .Response |
| 4357 | ---- |
| 4358 | HTTP/1.1 200 OK |
| 4359 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4360 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4361 | |
| 4362 | )]}' |
Shawn Pearce | 7076f4e | 2013-08-20 22:11:51 -0700 | [diff] [blame] | 4363 | "CHERRY_PICK" |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4364 | ---- |
| 4365 | |
| 4366 | [[test-submit-rule]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4367 | === Test Submit Rule |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4368 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4369 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4370 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4371 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4372 | Tests the submit_rule Prolog rule in the project, or the one given. |
| 4373 | |
| 4374 | Request body may be either the Prolog code as `text/plain` or a |
| 4375 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 4376 | may be set to `SKIP` to bypass parent project filters while testing |
| 4377 | a project-specific rule. |
| 4378 | |
| 4379 | .Request |
| 4380 | ---- |
Shawn Pearce | a3cce71 | 2014-03-21 08:16:11 -0700 | [diff] [blame] | 4381 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0 |
David Pursehouse | 4d7f991 | 2020-06-18 13:02:56 +0900 | [diff] [blame] | 4382 | Content-Type: text/plain; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4383 | |
| 4384 | submit_rule(submit(R)) :- |
| 4385 | R = label('Any-Label-Name', reject(_)). |
| 4386 | ---- |
| 4387 | |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4388 | The response is a link:#submit-record[SubmitRecord] describing the |
| 4389 | permutations that satisfy the tested submit rule. |
| 4390 | |
David Pursehouse | 87a3fb0 | 2019-10-29 16:01:27 +0900 | [diff] [blame] | 4391 | If the submit rule was a no-op, the response is "`204 No Content`". |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4392 | |
| 4393 | .Response |
| 4394 | ---- |
| 4395 | HTTP/1.1 200 OK |
| 4396 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4397 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4398 | |
| 4399 | )]}' |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4400 | { |
| 4401 | "status": "NOT_READY", |
| 4402 | "reject": { |
| 4403 | "Any-Label-Name": {} |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4404 | } |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4405 | } |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4406 | ---- |
| 4407 | |
Shawn Pearce | b42e303 | 2015-04-02 10:28:10 -0700 | [diff] [blame] | 4408 | When testing with the `curl` command line client the |
| 4409 | `--data-binary @rules.pl` flag should be used to ensure |
| 4410 | all LFs are included in the Prolog code: |
| 4411 | |
| 4412 | ---- |
| 4413 | curl -X POST \ |
| 4414 | -H 'Content-Type: text/plain; charset=UTF-8' \ |
| 4415 | --data-binary @rules.pl \ |
| 4416 | http://.../test.submit_rule |
| 4417 | ---- |
| 4418 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4419 | [[list-drafts]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 4420 | === List Revision Drafts |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4421 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4422 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4423 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4424 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4425 | Lists the draft comments of a revision that belong to the calling |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4426 | user. |
| 4427 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 4428 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 4429 | entries. The entries in the map are sorted by file path. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4430 | |
| 4431 | .Request |
| 4432 | ---- |
| 4433 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0 |
| 4434 | ---- |
| 4435 | |
| 4436 | .Response |
| 4437 | ---- |
| 4438 | HTTP/1.1 200 OK |
| 4439 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4440 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4441 | |
| 4442 | )]}' |
| 4443 | { |
| 4444 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4445 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4446 | "id": "TvcXrmjM", |
| 4447 | "line": 23, |
| 4448 | "message": "[nit] trailing whitespace", |
| 4449 | "updated": "2013-02-26 15:40:43.986000000" |
| 4450 | }, |
| 4451 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4452 | "id": "TveXwFiA", |
| 4453 | "line": 49, |
| 4454 | "in_reply_to": "TfYX-Iuo", |
| 4455 | "message": "Done", |
| 4456 | "updated": "2013-02-26 15:40:45.328000000" |
| 4457 | } |
| 4458 | ] |
| 4459 | } |
| 4460 | ---- |
| 4461 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4462 | [[create-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4463 | === Create Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4464 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4465 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4466 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4467 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4468 | Creates a draft comment on a revision. |
| 4469 | |
| 4470 | The new draft comment must be provided in the request body inside a |
| 4471 | link:#comment-input[CommentInput] entity. |
| 4472 | |
| 4473 | .Request |
| 4474 | ---- |
| 4475 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4476 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4477 | |
| 4478 | { |
| 4479 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4480 | "line": 23, |
| 4481 | "message": "[nit] trailing whitespace" |
| 4482 | } |
| 4483 | ---- |
| 4484 | |
| 4485 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4486 | describes the draft comment. |
| 4487 | |
| 4488 | .Response |
| 4489 | ---- |
| 4490 | HTTP/1.1 200 OK |
| 4491 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4492 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4493 | |
| 4494 | )]}' |
| 4495 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4496 | "id": "TvcXrmjM", |
| 4497 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4498 | "line": 23, |
| 4499 | "message": "[nit] trailing whitespace", |
| 4500 | "updated": "2013-02-26 15:40:43.986000000" |
| 4501 | } |
| 4502 | ---- |
| 4503 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4504 | [[get-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4505 | === Get Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4506 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4507 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4508 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4509 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4510 | Retrieves a draft comment of a revision that belongs to the calling |
| 4511 | user. |
| 4512 | |
| 4513 | .Request |
| 4514 | ---- |
| 4515 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 4516 | ---- |
| 4517 | |
| 4518 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4519 | describes the draft comment. |
| 4520 | |
| 4521 | .Response |
| 4522 | ---- |
| 4523 | HTTP/1.1 200 OK |
| 4524 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4525 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4526 | |
| 4527 | )]}' |
| 4528 | { |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4529 | "id": "TvcXrmjM", |
| 4530 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4531 | "line": 23, |
| 4532 | "message": "[nit] trailing whitespace", |
| 4533 | "updated": "2013-02-26 15:40:43.986000000" |
| 4534 | } |
| 4535 | ---- |
| 4536 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4537 | [[update-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4538 | === Update Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4539 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4540 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4541 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4542 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4543 | Updates a draft comment on a revision. |
| 4544 | |
| 4545 | The new draft comment must be provided in the request body inside a |
| 4546 | link:#comment-input[CommentInput] entity. |
| 4547 | |
| 4548 | .Request |
| 4549 | ---- |
| 4550 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4551 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4552 | |
| 4553 | { |
| 4554 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4555 | "line": 23, |
| 4556 | "message": "[nit] trailing whitespace" |
| 4557 | } |
| 4558 | ---- |
| 4559 | |
| 4560 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4561 | describes the draft comment. |
| 4562 | |
| 4563 | .Response |
| 4564 | ---- |
| 4565 | HTTP/1.1 200 OK |
| 4566 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4567 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4568 | |
| 4569 | )]}' |
| 4570 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4571 | "id": "TvcXrmjM", |
| 4572 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4573 | "line": 23, |
| 4574 | "message": "[nit] trailing whitespace", |
| 4575 | "updated": "2013-02-26 15:40:43.986000000" |
| 4576 | } |
| 4577 | ---- |
| 4578 | |
| 4579 | [[delete-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4580 | === Delete Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4581 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4582 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4583 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4584 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4585 | Deletes a draft comment from a revision. |
| 4586 | |
| 4587 | .Request |
| 4588 | ---- |
| 4589 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 4590 | ---- |
| 4591 | |
| 4592 | .Response |
| 4593 | ---- |
| 4594 | HTTP/1.1 204 No Content |
| 4595 | ---- |
| 4596 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4597 | [[list-comments]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 4598 | === List Revision Comments |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4599 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4600 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4601 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4602 | |
| 4603 | Lists the published comments of a revision. |
| 4604 | |
| 4605 | As result a map is returned that maps the file path to a list of |
| 4606 | link:#comment-info[CommentInfo] entries. The entries in the map are |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 4607 | sorted by file path and only include file (or inline) comments. Use |
| 4608 | the link:#get-change-detail[Get Change Detail] endpoint to retrieve |
| 4609 | the general change message (or comment). |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4610 | |
| 4611 | .Request |
| 4612 | ---- |
| 4613 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0 |
| 4614 | ---- |
| 4615 | |
| 4616 | .Response |
| 4617 | ---- |
| 4618 | HTTP/1.1 200 OK |
| 4619 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4620 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4621 | |
| 4622 | )]}' |
| 4623 | { |
| 4624 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4625 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4626 | "id": "TvcXrmjM", |
| 4627 | "line": 23, |
| 4628 | "message": "[nit] trailing whitespace", |
| 4629 | "updated": "2013-02-26 15:40:43.986000000", |
| 4630 | "author": { |
| 4631 | "_account_id": 1000096, |
| 4632 | "name": "John Doe", |
| 4633 | "email": "john.doe@example.com" |
| 4634 | } |
| 4635 | }, |
| 4636 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4637 | "id": "TveXwFiA", |
| 4638 | "line": 49, |
| 4639 | "in_reply_to": "TfYX-Iuo", |
| 4640 | "message": "Done", |
| 4641 | "updated": "2013-02-26 15:40:45.328000000", |
| 4642 | "author": { |
| 4643 | "_account_id": 1000097, |
| 4644 | "name": "Jane Roe", |
| 4645 | "email": "jane.roe@example.com" |
| 4646 | } |
| 4647 | } |
| 4648 | ] |
| 4649 | } |
| 4650 | ---- |
| 4651 | |
| 4652 | [[get-comment]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4653 | === Get Comment |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4654 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4655 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4656 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4657 | |
| 4658 | Retrieves a published comment of a revision. |
| 4659 | |
| 4660 | .Request |
| 4661 | ---- |
| 4662 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0 |
| 4663 | ---- |
| 4664 | |
| 4665 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4666 | describes the published comment. |
| 4667 | |
| 4668 | .Response |
| 4669 | ---- |
| 4670 | HTTP/1.1 200 OK |
| 4671 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4672 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4673 | |
| 4674 | )]}' |
| 4675 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4676 | "id": "TvcXrmjM", |
| 4677 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4678 | "line": 23, |
| 4679 | "message": "[nit] trailing whitespace", |
| 4680 | "updated": "2013-02-26 15:40:43.986000000", |
| 4681 | "author": { |
| 4682 | "_account_id": 1000096, |
| 4683 | "name": "John Doe", |
| 4684 | "email": "john.doe@example.com" |
| 4685 | } |
| 4686 | } |
| 4687 | ---- |
| 4688 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 4689 | [[delete-comment]] |
| 4690 | === Delete Comment |
| 4691 | -- |
| 4692 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' + |
| 4693 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete' |
| 4694 | -- |
| 4695 | |
| 4696 | Deletes a published comment of a revision. Instead of deleting the |
| 4697 | whole comment, this endpoint just replaces the comment's message |
| 4698 | with a new message, which contains the name of the user who deletes |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 4699 | the comment and the reason why it's deleted. |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 4700 | |
| 4701 | Note that only users with the |
| 4702 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 4703 | global capability are permitted to delete a comment. |
| 4704 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 4705 | Deletion reason can be provided in the request body as a |
| 4706 | link:#delete-comment-input[DeleteCommentInput] entity. |
| 4707 | Historically, this method allowed a body in the DELETE, but that behavior is |
| 4708 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 4709 | In this case, use a POST request instead: |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 4710 | |
| 4711 | .Request |
| 4712 | ---- |
| 4713 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0 |
| 4714 | Content-Type: application/json; charset=UTF-8 |
| 4715 | |
| 4716 | { |
| 4717 | "reason": "contains confidential information" |
| 4718 | } |
| 4719 | ---- |
| 4720 | |
| 4721 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4722 | describes the updated comment. |
| 4723 | |
| 4724 | .Response |
| 4725 | ---- |
| 4726 | HTTP/1.1 200 OK |
| 4727 | Content-Disposition: attachment |
| 4728 | Content-Type: application/json; charset=UTF-8 |
| 4729 | |
| 4730 | )]}' |
| 4731 | { |
| 4732 | "id": "TvcXrmjM", |
| 4733 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4734 | "line": 23, |
| 4735 | "message": "Comment removed by: Administrator; Reason: contains confidential information", |
| 4736 | "updated": "2013-02-26 15:40:43.986000000", |
| 4737 | "author": { |
| 4738 | "_account_id": 1000096, |
| 4739 | "name": "John Doe", |
| 4740 | "email": "john.doe@example.com" |
| 4741 | } |
| 4742 | } |
| 4743 | ---- |
| 4744 | |
Edwin Kempin | b050a48 | 2016-12-01 09:11:19 +0100 | [diff] [blame] | 4745 | [[list-robot-comments]] |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 4746 | === List Robot Comments |
| 4747 | -- |
| 4748 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/' |
| 4749 | -- |
| 4750 | |
| 4751 | Lists the link:config-robot-comments.html[robot comments] of a |
| 4752 | revision. |
| 4753 | |
| 4754 | As result a map is returned that maps the file path to a list of |
| 4755 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 4756 | map are sorted by file path. |
| 4757 | |
| 4758 | .Request |
| 4759 | ---- |
| 4760 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0 |
| 4761 | ---- |
| 4762 | |
| 4763 | .Response |
| 4764 | ---- |
| 4765 | HTTP/1.1 200 OK |
| 4766 | Content-Disposition: attachment |
| 4767 | Content-Type: application/json; charset=UTF-8 |
| 4768 | |
| 4769 | )]}' |
| 4770 | { |
| 4771 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4772 | { |
| 4773 | "id": "TvcXrmjM", |
| 4774 | "line": 23, |
| 4775 | "message": "unused import", |
| 4776 | "updated": "2016-02-26 15:40:43.986000000", |
| 4777 | "author": { |
| 4778 | "_account_id": 1000110, |
| 4779 | "name": "Code Analyzer", |
| 4780 | "email": "code.analyzer@example.com" |
| 4781 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 4782 | "robot_id": "importChecker", |
| 4783 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 4784 | }, |
| 4785 | { |
| 4786 | "id": "TveXwFiA", |
| 4787 | "line": 49, |
| 4788 | "message": "wrong indention", |
| 4789 | "updated": "2016-02-26 15:40:45.328000000", |
| 4790 | "author": { |
| 4791 | "_account_id": 1000110, |
| 4792 | "name": "Code Analyzer", |
| 4793 | "email": "code.analyzer@example.com" |
| 4794 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 4795 | "robot_id": "styleChecker", |
| 4796 | "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 4797 | } |
| 4798 | ] |
| 4799 | } |
| 4800 | ---- |
| 4801 | |
| 4802 | [[get-robot-comment]] |
| 4803 | === Get Robot Comment |
| 4804 | -- |
| 4805 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]' |
| 4806 | -- |
| 4807 | |
| 4808 | Retrieves a link:config-robot-comments.html[robot comment] of a |
| 4809 | revision. |
| 4810 | |
| 4811 | .Request |
| 4812 | ---- |
| 4813 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0 |
| 4814 | ---- |
| 4815 | |
| 4816 | As response a link:#robot-comment-info[RobotCommentInfo] entity is |
| 4817 | returned that describes the robot comment. |
| 4818 | |
| 4819 | .Response |
| 4820 | ---- |
| 4821 | HTTP/1.1 200 OK |
| 4822 | Content-Disposition: attachment |
| 4823 | Content-Type: application/json; charset=UTF-8 |
| 4824 | |
| 4825 | )]}' |
| 4826 | { |
| 4827 | "id": "TvcXrmjM", |
| 4828 | "line": 23, |
| 4829 | "message": "unused import", |
| 4830 | "updated": "2016-02-26 15:40:43.986000000", |
| 4831 | "author": { |
| 4832 | "_account_id": 1000110, |
| 4833 | "name": "Code Analyzer", |
| 4834 | "email": "code.analyzer@example.com" |
| 4835 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 4836 | "robot_id": "importChecker", |
| 4837 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 4838 | } |
| 4839 | ---- |
| 4840 | |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4841 | [[apply-fix]] |
| 4842 | === Apply Fix |
| 4843 | -- |
| 4844 | 'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply' |
| 4845 | -- |
| 4846 | |
| 4847 | Applies a suggested fix by creating a change edit which includes the |
| 4848 | modifications indicated by the fix suggestion. If a change edit already exists, |
| 4849 | it will be updated accordingly. A fix can only be applied if no change edit |
| 4850 | exists and the fix refers to the current patch set, or the fix refers to the |
| 4851 | patch set on which the change edit is based. |
| 4852 | |
| 4853 | .Request |
| 4854 | ---- |
| 4855 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0 |
| 4856 | ---- |
| 4857 | |
| 4858 | If the fix was successfully applied, an <<edit-info,EditInfo>> describing the |
| 4859 | resulting change edit is returned. |
| 4860 | |
| 4861 | .Response |
| 4862 | ---- |
| 4863 | HTTP/1.1 200 OK |
| 4864 | Content-Disposition: attachment |
| 4865 | Content-Type: application/json; charset=UTF-8 |
| 4866 | |
| 4867 | )]}' |
| 4868 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4869 | "commit": { |
| 4870 | "parents": [ |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4871 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4872 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4873 | } |
| 4874 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4875 | "author": { |
| 4876 | "name": "John Doe", |
| 4877 | "email": "john.doe@example.com", |
| 4878 | "date": "2013-05-07 15:21:27.000000000", |
| 4879 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4880 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4881 | "committer": { |
| 4882 | "name": "Jane Doe", |
| 4883 | "email": "jane.doe@example.com", |
| 4884 | "date": "2013-05-07 15:35:43.000000000", |
| 4885 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4886 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4887 | "subject": "Implement feature X", |
| 4888 | "message": "Implement feature X\n\nWith this feature ..." |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4889 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4890 | "base_patch_set_number": 1, |
| 4891 | "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1" |
| 4892 | "ref": "refs/users/01/1000001/edit-42622/1" |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4893 | } |
| 4894 | ---- |
| 4895 | |
| 4896 | If the application failed e.g. due to conflicts with an existing change edit, |
| 4897 | the response "`409 Conflict`" including an error message in the response body |
| 4898 | is returned. |
| 4899 | |
| 4900 | .Response |
| 4901 | ---- |
| 4902 | HTTP/1.1 409 Conflict |
| 4903 | Content-Disposition: attachment |
| 4904 | Content-Type: text/plain; charset=UTF-8 |
| 4905 | |
| 4906 | The existing change edit could not be merged with another tree. |
| 4907 | ---- |
| 4908 | |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4909 | [[list-files]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4910 | === List Files |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4911 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4912 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4913 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4914 | |
| 4915 | Lists the files that were modified, added or deleted in a revision. |
| 4916 | |
| 4917 | .Request |
| 4918 | ---- |
| 4919 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0 |
| 4920 | ---- |
| 4921 | |
Makson Lee | faf05c2 | 2018-07-26 22:42:59 +0000 | [diff] [blame] | 4922 | As result a map is returned that maps the link:#file-id[file path] to a |
| 4923 | link:#file-info[FileInfo] entry. The entries in the map are |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4924 | sorted by file path. |
| 4925 | |
| 4926 | .Response |
| 4927 | ---- |
| 4928 | HTTP/1.1 200 OK |
| 4929 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4930 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4931 | |
| 4932 | )]}' |
| 4933 | { |
| 4934 | "/COMMIT_MSG": { |
| 4935 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 4936 | "lines_inserted": 7, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 4937 | "size_delta": 551, |
| 4938 | "size": 551 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4939 | }, |
| 4940 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": { |
| 4941 | "lines_inserted": 5, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 4942 | "lines_deleted": 3, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 4943 | "size_delta": 98, |
| 4944 | "size": 23348 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4945 | } |
| 4946 | } |
| 4947 | ---- |
| 4948 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 4949 | The request parameter `reviewed` changes the response to return a list |
| 4950 | of the paths the caller has marked as reviewed. Clients that also |
| 4951 | need the FileInfo should make two requests. |
| 4952 | |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 4953 | The request parameter `q` changes the response to return a list |
| 4954 | of all files (modified or unmodified) that contain that substring |
| 4955 | in the path name. This is useful to implement suggestion services |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 4956 | finding a file by partial name. Clients that also need the FileInfo |
| 4957 | should make two requests. |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 4958 | |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 4959 | For merge commits only, the integer-valued request parameter `parent` |
| 4960 | changes the response to return a map of the files which are different |
| 4961 | in this commit compared to the given parent commit. The value is the |
Andrii Shyshkalov | 350a451 | 2019-09-23 02:26:33 -0700 | [diff] [blame] | 4962 | 1-based index of the parent's position in the commit object, |
| 4963 | with the first parent always belonging to the target branch. If not |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 4964 | specified, the response contains a map of the files different in the |
| 4965 | auto merge result. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 4966 | |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 4967 | The request parameter `base` changes the response to return a map of the |
| 4968 | files which are different in this commit compared to the given revision. The |
| 4969 | revision must correspond to a patch set in the change. |
| 4970 | |
| 4971 | The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive. |
| 4972 | That is, only one of them may be used at a time. |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 4973 | |
| 4974 | .Request |
| 4975 | ---- |
| 4976 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0 |
| 4977 | ---- |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4978 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 4979 | .Response |
| 4980 | ---- |
| 4981 | HTTP/1.1 200 OK |
| 4982 | Content-Disposition: attachment |
| 4983 | Content-Type: application/json; charset=UTF-8 |
| 4984 | |
| 4985 | )]}' |
| 4986 | [ |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 4987 | "/COMMIT_MSG", |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4988 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4989 | ] |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 4990 | ---- |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4991 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 4992 | [[get-content]] |
| 4993 | === Get Content |
| 4994 | -- |
| 4995 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content' |
| 4996 | -- |
| 4997 | |
| 4998 | Gets the content of a file from a certain revision. |
| 4999 | |
Patrick Hiesel | 38667d4 | 2017-05-02 13:12:48 +0200 | [diff] [blame] | 5000 | The optional, integer-valued `parent` parameter can be specified to request |
| 5001 | the named file from a parent commit of the specified revision. The value is |
| 5002 | the 1-based index of the parent's position in the commit object. If the |
| 5003 | parameter is omitted or the value is non-positive, the patch set is referenced. |
| 5004 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5005 | .Request |
| 5006 | ---- |
| 5007 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0 |
| 5008 | ---- |
| 5009 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5010 | The content is returned as base64 encoded string. The HTTP response |
| 5011 | Content-Type is always `text/plain`, reflecting the base64 wrapping. |
| 5012 | A Gerrit-specific `X-FYI-Content-Type` header is returned describing |
| 5013 | the server detected content type of the file. |
| 5014 | |
| 5015 | If only the content type is required, callers should use HEAD to |
| 5016 | avoid downloading the encoded file contents. |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5017 | |
| 5018 | .Response |
| 5019 | ---- |
| 5020 | HTTP/1.1 200 OK |
| 5021 | Content-Disposition: attachment |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5022 | Content-Type: text/plain; charset=ISO-8859-1 |
| 5023 | X-FYI-Content-Encoding: base64 |
| 5024 | X-FYI-Content-Type: text/xml |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5025 | |
| 5026 | Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY... |
| 5027 | ---- |
| 5028 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 5029 | Alternatively, if the only value of the Accept request header is |
| 5030 | `application/json` the content is returned as JSON string and |
| 5031 | `X-FYI-Content-Encoding` is set to `json`. |
| 5032 | |
David Pletcher | d1efb45 | 2015-09-01 17:45:55 -0700 | [diff] [blame] | 5033 | [[get-safe-content]] |
| 5034 | === Download Content |
| 5035 | -- |
| 5036 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download' |
| 5037 | -- |
| 5038 | |
| 5039 | Downloads the content of a file from a certain revision, in a safe format |
| 5040 | that poses no risk for inadvertent execution of untrusted code. |
| 5041 | |
| 5042 | If the content type is defined as safe, the binary file content is returned |
| 5043 | verbatim. If the content type is not safe, the file is stored inside a ZIP |
| 5044 | file, containing a single entry with a random, unpredictable name having the |
| 5045 | same base and suffix as the true filename. The ZIP file is returned in |
| 5046 | verbatim binary form. |
| 5047 | |
| 5048 | See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation] |
| 5049 | for information about safe file type configuration. |
| 5050 | |
| 5051 | The HTTP resource Content-Type is dependent on the file type: the |
| 5052 | applicable type for safe files, or "application/zip" for unsafe files. |
| 5053 | |
David Pletcher | ec622bf | 2015-09-18 14:30:05 -0700 | [diff] [blame] | 5054 | The optional, integer-valued `parent` parameter can be specified to request |
| 5055 | the named file from a parent commit of the specified revision. The value is |
| 5056 | the 1-based index of the parent's position in the commit object. If the |
| 5057 | parameter is omitted or the value non-positive, the patch set is referenced. |
| 5058 | |
| 5059 | Filenames are decorated with a suffix of `_new` for the current patch, |
| 5060 | `_old` for the only parent, or `_oldN` for the Nth parent of many. |
David Pletcher | d1efb45 | 2015-09-01 17:45:55 -0700 | [diff] [blame] | 5061 | |
| 5062 | .Request |
| 5063 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 5064 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0 |
David Pletcher | d1efb45 | 2015-09-01 17:45:55 -0700 | [diff] [blame] | 5065 | ---- |
| 5066 | |
| 5067 | .Response |
| 5068 | ---- |
| 5069 | HTTP/1.1 200 OK |
| 5070 | Content-Disposition: attachment; filename="logo.png" |
| 5071 | Content-Type: image/png |
| 5072 | |
| 5073 | `[binary data for logo.png]` |
| 5074 | ---- |
| 5075 | |
| 5076 | .Request |
| 5077 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 5078 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/download?suffix=new HTTP/1.0 |
David Pletcher | d1efb45 | 2015-09-01 17:45:55 -0700 | [diff] [blame] | 5079 | ---- |
| 5080 | |
| 5081 | .Response |
| 5082 | ---- |
| 5083 | HTTP/1.1 200 OK |
| 5084 | Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip" |
| 5085 | Content-Type:application/zip |
| 5086 | |
| 5087 | `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]` |
| 5088 | ---- |
| 5089 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5090 | [[get-diff]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5091 | === Get Diff |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5092 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5093 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/diff' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5094 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5095 | |
| 5096 | Gets the diff of a file from a certain revision. |
| 5097 | |
| 5098 | .Request |
| 5099 | ---- |
| 5100 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0 |
| 5101 | ---- |
| 5102 | |
| 5103 | As response a link:#diff-info[DiffInfo] entity is returned that describes the diff. |
| 5104 | |
| 5105 | .Response |
| 5106 | ---- |
| 5107 | HTTP/1.1 200 OK |
| 5108 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5109 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5110 | |
| 5111 | )] |
| 5112 | { |
| 5113 | "meta_a": { |
| 5114 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 5115 | "content_type": "text/x-java-source", |
| 5116 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5117 | }, |
| 5118 | "meta_b": { |
| 5119 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 5120 | "content_type": "text/x-java-source", |
| 5121 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5122 | }, |
| 5123 | "change_type": "MODIFIED", |
| 5124 | "diff_header": [ |
| 5125 | "diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5126 | "index 59b7670..9faf81c 100644", |
| 5127 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5128 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 5129 | ], |
| 5130 | "content": [ |
| 5131 | { |
| 5132 | "ab": [ |
| 5133 | "// Copyright (C) 2010 The Android Open Source Project", |
| 5134 | "//", |
| 5135 | "// Licensed under the Apache License, Version 2.0 (the \"License\");", |
| 5136 | "// you may not use this file except in compliance with the License.", |
| 5137 | "// You may obtain a copy of the License at", |
| 5138 | "//", |
| 5139 | "// http://www.apache.org/licenses/LICENSE-2.0", |
| 5140 | "//", |
| 5141 | "// Unless required by applicable law or agreed to in writing, software", |
| 5142 | "// distributed under the License is distributed on an \"AS IS\" BASIS,", |
| 5143 | "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", |
| 5144 | "// See the License for the specific language governing permissions and", |
| 5145 | "// limitations under the License." |
| 5146 | ] |
| 5147 | }, |
| 5148 | { |
| 5149 | "b": [ |
| 5150 | "//", |
| 5151 | "// Add some more lines in the header." |
| 5152 | ] |
| 5153 | }, |
| 5154 | { |
| 5155 | "ab": [ |
| 5156 | "", |
| 5157 | "package com.google.gerrit.server.project;", |
| 5158 | "", |
| 5159 | "import com.google.common.collect.Maps;", |
| 5160 | ... |
| 5161 | ] |
| 5162 | } |
| 5163 | ... |
| 5164 | ] |
| 5165 | } |
| 5166 | ---- |
| 5167 | |
| 5168 | If the `intraline` parameter is specified, intraline differences are included in the diff. |
| 5169 | |
| 5170 | .Request |
| 5171 | ---- |
| 5172 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/b6b9c10649b9041884046119ab794374470a1b45/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff?intraline HTTP/1.0 |
| 5173 | ---- |
| 5174 | |
| 5175 | .Response |
| 5176 | ---- |
| 5177 | HTTP/1.1 200 OK |
| 5178 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5179 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5180 | |
| 5181 | )] |
| 5182 | { |
| 5183 | "meta_a": { |
| 5184 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 5185 | "content_type": "text/x-java-source", |
| 5186 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5187 | }, |
| 5188 | "meta_b": { |
| 5189 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 5190 | "content_type": "text/x-java-source", |
| 5191 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5192 | }, |
| 5193 | "change_type": "MODIFIED", |
| 5194 | "diff_header": [ |
| 5195 | "diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5196 | "index 59b7670..9faf81c 100644", |
| 5197 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5198 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 5199 | ], |
| 5200 | "content": [ |
| 5201 | ... |
| 5202 | { |
| 5203 | "a": [ |
| 5204 | "/** Manages access control for Git references (aka branches, tags). */" |
| 5205 | ], |
| 5206 | "b": [ |
| 5207 | "/** Manages access control for the Git references (aka branches, tags). */" |
| 5208 | ], |
| 5209 | "edit_a": [], |
| 5210 | "edit_b": [ |
| 5211 | [ |
| 5212 | 31, |
| 5213 | 4 |
| 5214 | ] |
| 5215 | ] |
| 5216 | } |
| 5217 | ] |
| 5218 | } |
| 5219 | ---- |
| 5220 | |
| 5221 | The `base` parameter can be specified to control the base patch set from which the diff should |
| 5222 | be generated. |
| 5223 | |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 5224 | The integer-valued request parameter `parent` can be specified to control the |
| 5225 | parent commit number against which the diff should be generated. This is useful |
| 5226 | for supporting review of merge commits. The value is the 1-based index of the |
| 5227 | parent's position in the commit object. |
| 5228 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5229 | .Request |
| 5230 | ---- |
| 5231 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/b6b9c10649b9041884046119ab794374470a1b45/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff?base=2 HTTP/1.0 |
| 5232 | ---- |
| 5233 | |
| 5234 | .Response |
| 5235 | ---- |
| 5236 | HTTP/1.1 200 OK |
| 5237 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5238 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5239 | |
| 5240 | )] |
| 5241 | { |
| 5242 | "meta_a": { |
| 5243 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 5244 | "content_type": "text/x-java-source", |
| 5245 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5246 | }, |
| 5247 | "meta_b": { |
| 5248 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
Shawn Pearce | d62a6a9 | 2013-12-05 12:45:32 -0800 | [diff] [blame] | 5249 | "content_type": "text/x-java-source", |
| 5250 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5251 | }, |
| 5252 | "change_type": "MODIFIED", |
| 5253 | "content": [ |
| 5254 | { |
| 5255 | "skip": 578 |
| 5256 | } |
| 5257 | ] |
| 5258 | } |
| 5259 | ---- |
| 5260 | |
Edwin Kempin | 0b7c40f | 2016-02-09 17:13:23 +0100 | [diff] [blame] | 5261 | The `whitespace` parameter can be specified to control how whitespace |
| 5262 | differences are reported in the result. Valid values are `IGNORE_NONE`, |
| 5263 | `IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5264 | |
| 5265 | The `context` parameter can be specified to control the number of lines of surrounding context |
| 5266 | in the diff. Valid values are `ALL` or number of lines. |
| 5267 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 5268 | [[get-blame]] |
| 5269 | === Get Blame |
| 5270 | -- |
| 5271 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame' |
| 5272 | -- |
| 5273 | |
| 5274 | Gets the blame of a file from a certain revision. |
| 5275 | |
| 5276 | .Request |
| 5277 | ---- |
| 5278 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0 |
| 5279 | ---- |
| 5280 | |
| 5281 | As response a link:#blame-info[BlameInfo] entity is returned that describes the |
| 5282 | blame. |
| 5283 | |
| 5284 | .Response |
| 5285 | ---- |
| 5286 | HTTP/1.1 200 OK |
| 5287 | Content-Disposition: attachment |
| 5288 | Content-Type: application/json; charset=UTF-8 |
| 5289 | |
| 5290 | )] |
| 5291 | { |
| 5292 | [ |
| 5293 | { |
| 5294 | "author": "Joe Daw", |
| 5295 | "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7", |
| 5296 | "time": 1421441349, |
| 5297 | "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n", |
| 5298 | "ranges": [ |
| 5299 | { |
| 5300 | "start": 1, |
| 5301 | "end": 10 |
| 5302 | }, |
| 5303 | { |
| 5304 | "start": 16, |
| 5305 | "end": 296 |
| 5306 | } |
| 5307 | ] |
| 5308 | }, |
| 5309 | { |
| 5310 | "author": "Jane Daw", |
| 5311 | "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7", |
| 5312 | "time": 1421825421, |
| 5313 | "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n", |
| 5314 | "ranges": [ |
| 5315 | { |
| 5316 | "start": 13, |
| 5317 | "end": 13 |
| 5318 | } |
| 5319 | ] |
| 5320 | } |
| 5321 | ] |
| 5322 | } |
| 5323 | ---- |
| 5324 | |
| 5325 | The `base` parameter can be specified to control the base patch set from which |
| 5326 | the blame should be generated. |
| 5327 | |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5328 | [[set-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5329 | === Set Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5330 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5331 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5332 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5333 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5334 | Marks a file of a revision as reviewed by the calling user. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5335 | |
| 5336 | .Request |
| 5337 | ---- |
| 5338 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 5339 | ---- |
| 5340 | |
| 5341 | .Response |
| 5342 | ---- |
| 5343 | HTTP/1.1 201 Created |
| 5344 | ---- |
| 5345 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5346 | If the file was already marked as reviewed by the calling user the |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5347 | response is "`200 OK`". |
| 5348 | |
| 5349 | [[delete-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5350 | === Delete Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5351 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5352 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5353 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5354 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5355 | Deletes the reviewed flag of the calling user from a file of a revision. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5356 | |
| 5357 | .Request |
| 5358 | ---- |
| 5359 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 5360 | ---- |
| 5361 | |
| 5362 | .Response |
| 5363 | ---- |
| 5364 | HTTP/1.1 204 No Content |
| 5365 | ---- |
| 5366 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5367 | [[cherry-pick]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5368 | === Cherry Pick Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5369 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5370 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5371 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5372 | |
| 5373 | Cherry picks a revision to a destination branch. |
| 5374 | |
Changcheng Xiao | 54b6c0c | 2017-10-23 14:57:42 +0200 | [diff] [blame] | 5375 | To cherry pick a commit with no change-id associated with it, see |
| 5376 | link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit]. |
| 5377 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5378 | The commit message and destination branch must be provided in the request body inside a |
Han-Wen Nienhuys | 02272e0 | 2017-03-28 14:47:09 +0200 | [diff] [blame] | 5379 | link:#cherrypick-input[CherryPickInput] entity. If the commit message |
| 5380 | does not specify a Change-Id, a new one is picked for the destination change. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5381 | |
| 5382 | .Request |
| 5383 | ---- |
| 5384 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5385 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5386 | |
| 5387 | { |
Gustaf Lundh | 98df5b5 | 2013-05-07 19:22:13 +0100 | [diff] [blame] | 5388 | "message" : "Implementing Feature X", |
| 5389 | "destination" : "release-branch" |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5390 | } |
| 5391 | ---- |
| 5392 | |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 5393 | As response a link:#cherry-pick-change-info[CherryPickChangeInfo] |
| 5394 | entity is returned that describes the resulting cherry-pick change. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5395 | |
| 5396 | .Response |
| 5397 | ---- |
| 5398 | HTTP/1.1 200 OK |
| 5399 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5400 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5401 | |
| 5402 | )]}' |
| 5403 | { |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5404 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 5405 | "project": "myProject", |
| 5406 | "branch": "release-branch", |
| 5407 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 5408 | "subject": "Implementing Feature X", |
| 5409 | "status": "NEW", |
| 5410 | "created": "2013-02-01 09:59:32.126000000", |
| 5411 | "updated": "2013-02-21 11:16:36.775000000", |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5412 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 5413 | "insertions": 12, |
| 5414 | "deletions": 11, |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5415 | "_number": 3965, |
| 5416 | "owner": { |
| 5417 | "name": "John Doe" |
| 5418 | } |
| 5419 | } |
| 5420 | ---- |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5421 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 5422 | [[revision-reviewer-endpoints]] |
| 5423 | == Revision Reviewer Endpoints |
| 5424 | |
| 5425 | [[list-revision-reviewers]] |
| 5426 | === List Revision Reviewers |
| 5427 | -- |
| 5428 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/' |
| 5429 | -- |
| 5430 | |
| 5431 | Lists the reviewers of a revision. |
| 5432 | |
| 5433 | Please note that only the current revision is supported. |
| 5434 | |
| 5435 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 5436 | |
| 5437 | .Request |
| 5438 | ---- |
| 5439 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0 |
| 5440 | ---- |
| 5441 | |
| 5442 | .Response |
| 5443 | ---- |
| 5444 | HTTP/1.1 200 OK |
| 5445 | Content-Disposition: attachment |
| 5446 | Content-Type: application/json; charset=UTF-8 |
| 5447 | |
| 5448 | )]}' |
| 5449 | [ |
| 5450 | { |
| 5451 | "approvals": { |
| 5452 | "Verified": "+1", |
| 5453 | "Code-Review": "+2" |
| 5454 | }, |
| 5455 | "_account_id": 1000096, |
| 5456 | "name": "John Doe", |
| 5457 | "email": "john.doe@example.com" |
| 5458 | }, |
| 5459 | { |
| 5460 | "approvals": { |
| 5461 | "Verified": " 0", |
| 5462 | "Code-Review": "-1" |
| 5463 | }, |
| 5464 | "_account_id": 1000097, |
| 5465 | "name": "Jane Roe", |
| 5466 | "email": "jane.roe@example.com" |
| 5467 | } |
| 5468 | ] |
| 5469 | ---- |
| 5470 | |
| 5471 | [[list-revision-votes]] |
| 5472 | === List Revision Votes |
| 5473 | -- |
| 5474 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 5475 | -- |
| 5476 | |
| 5477 | Lists the votes for a specific reviewer of the revision. |
| 5478 | |
| 5479 | Please note that only the current revision is supported. |
| 5480 | |
| 5481 | .Request |
| 5482 | ---- |
| 5483 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0 |
| 5484 | ---- |
| 5485 | |
| 5486 | As result a map is returned that maps the label name to the label value. |
| 5487 | The entries in the map are sorted by label name. |
| 5488 | |
| 5489 | .Response |
| 5490 | ---- |
| 5491 | HTTP/1.1 200 OK |
| 5492 | Content-Disposition: attachment |
| 5493 | Content-Type: application/json;charset=UTF-8 |
| 5494 | |
| 5495 | )]}' |
| 5496 | { |
| 5497 | "Code-Review": -1, |
| 5498 | "Verified": 1, |
| 5499 | "Work-In-Progress": 1 |
| 5500 | } |
| 5501 | ---- |
| 5502 | |
| 5503 | [[delete-revision-vote]] |
| 5504 | === Delete Revision Vote |
| 5505 | -- |
| 5506 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 5507 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' + |
| 5508 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 5509 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete' |
| 5510 | -- |
| 5511 | |
| 5512 | Deletes a single vote from a revision. The deletion will be possible only |
| 5513 | if the revision is the current revision. By using this endpoint you can prevent |
| 5514 | deleting the vote (with same label) from a newer patch set by mistake. |
| 5515 | |
| 5516 | Note, that even when the last vote of a reviewer is removed the reviewer itself |
| 5517 | is still listed on the change. |
| 5518 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 5519 | .Request |
| 5520 | ---- |
| 5521 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0 |
| 5522 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 5523 | ---- |
| 5524 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 5525 | Options can be provided in the request body as a |
| 5526 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 5527 | Historically, this method allowed a body in the DELETE, but that behavior is |
| 5528 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 5529 | In this case, use a POST request instead: |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 5530 | |
| 5531 | .Request |
| 5532 | ---- |
| 5533 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 5534 | Content-Type: application/json; charset=UTF-8 |
| 5535 | |
| 5536 | { |
| 5537 | "notify": "NONE" |
| 5538 | } |
| 5539 | ---- |
| 5540 | |
| 5541 | .Response |
| 5542 | ---- |
| 5543 | HTTP/1.1 204 No Content |
| 5544 | ---- |
| 5545 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5546 | [[ids]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5547 | == IDs |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5548 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 5549 | [[account-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5550 | === link:rest-api-accounts.html#account-id[\{account-id\}] |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 5551 | -- |
| 5552 | -- |
| 5553 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5554 | [[change-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5555 | === \{change-id\} |
Patrick Hiesel | 18da045 | 2017-12-21 14:02:05 +0100 | [diff] [blame] | 5556 | Identifier that uniquely identifies one change. It contains the URL-encoded |
| 5557 | project name as well as the change number: "'$$<project>~<numericId>$$'" |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5558 | |
David Pursehouse | a592397 | 2020-02-26 09:39:38 +0900 | [diff] [blame] | 5559 | Gerrit also supports the following identifiers: |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5560 | |
| 5561 | * an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'", |
| 5562 | where for the branch the `refs/heads/` prefix can be omitted |
| 5563 | ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$") |
| 5564 | * a Change-Id if it uniquely identifies one change |
| 5565 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
Patrick Hiesel | 4d2dd18 | 2017-05-09 17:35:18 +0200 | [diff] [blame] | 5566 | * a numeric change ID ("4247") |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5567 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 5568 | [[change-message-id]] |
| 5569 | === \{change-message-id\} |
| 5570 | ID of a change message returned in a link:#change-message-info[ChangeMessageInfo]. |
| 5571 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5572 | [[comment-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5573 | === \{comment-id\} |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5574 | UUID of a published comment. |
| 5575 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5576 | [[draft-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5577 | === \{draft-id\} |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5578 | UUID of a draft comment. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5579 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 5580 | [[label-id]] |
| 5581 | === \{label-id\} |
| 5582 | The name of the label. |
| 5583 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5584 | [[file-id]] |
David Pursehouse | b10c266 | 2016-12-06 08:41:33 +0900 | [diff] [blame] | 5585 | === \{file-id\} |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5586 | The path of the file. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5587 | |
David Pursehouse | 11badbb | 2017-03-27 10:58:05 +0900 | [diff] [blame] | 5588 | The following magic paths are supported: |
| 5589 | |
| 5590 | * `/COMMIT_MSG`: |
| 5591 | + |
| 5592 | The commit message and headers with the parent commit(s), the author |
| 5593 | information and the committer information. |
| 5594 | |
| 5595 | * `/MERGE_LIST` (for merge commits only): |
| 5596 | + |
| 5597 | The list of commits that are being integrated into the destination |
| 5598 | branch by submitting the merge commit. |
| 5599 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 5600 | [[fix-id]] |
| 5601 | === \{fix-id\} |
| 5602 | UUID of a suggested fix. |
| 5603 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 5604 | [[revision-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5605 | === \{revision-id\} |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 5606 | Identifier that uniquely identifies one revision of a change. |
| 5607 | |
| 5608 | This can be: |
| 5609 | |
Shawn Pearce | 9c0722a | 2013-03-02 15:30:31 -0800 | [diff] [blame] | 5610 | * the literal `current` to name the current patch set/revision |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 5611 | * a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1") |
| 5612 | * an abbreviated commit ID that uniquely identifies one revision of the |
| 5613 | change ("674ac754"), at least 4 digits are required |
| 5614 | * a legacy numeric patch number ("1" for first patch set of the change) |
Edwin Kempin | 8cc0bab | 2016-09-15 15:53:37 +0200 | [diff] [blame] | 5615 | * "0" or the literal `edit` for a change edit |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 5616 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5617 | [[json-entities]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5618 | == JSON Entities |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5619 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 5620 | [[abandon-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5621 | === AbandonInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 5622 | The `AbandonInput` entity contains information for abandoning a change. |
| 5623 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5624 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 5625 | |============================= |
| 5626 | |Field Name ||Description |
| 5627 | |`message` |optional| |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 5628 | Message to be added as review comment to the change when abandoning the |
| 5629 | change. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 5630 | |`notify` |optional| |
Stephen Li | e5fcdf7 | 2016-08-02 11:05:11 -0700 | [diff] [blame] | 5631 | Notify handling that defines to whom email notifications should be sent after |
| 5632 | the change is abandoned. + |
| 5633 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 5634 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 5635 | |`notify_details`|optional| |
| 5636 | Additional information about whom to notify about the update as a map |
| 5637 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 5638 | |============================= |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 5639 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 5640 | [[action-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5641 | === ActionInfo |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 5642 | The `ActionInfo` entity describes a REST API call the client can |
| 5643 | make to manipulate a resource. These are frequently implemented by |
| 5644 | plugins and may be discovered at runtime. |
| 5645 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5646 | [options="header",cols="1,^1,5"] |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 5647 | |==================================== |
| 5648 | |Field Name ||Description |
| 5649 | |`method` |optional| |
| 5650 | HTTP method to use with the action. Most actions use `POST`, `PUT` |
| 5651 | or `DELETE` to cause state changes. |
| 5652 | |`label` |optional| |
| 5653 | Short title to display to a user describing the action. In the |
| 5654 | Gerrit web interface the label is used as the text on the button |
| 5655 | presented in the UI. |
| 5656 | |`title` |optional| |
| 5657 | Longer text to display describing the action. In a web UI this |
| 5658 | should be the title attribute of the element, displaying when |
| 5659 | the user hovers the mouse. |
| 5660 | |`enabled` |optional| |
| 5661 | If true the action is permitted at this time and the caller is |
| 5662 | likely allowed to execute it. This may change if state is updated |
| 5663 | at the server or permissions are modified. Not present if false. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 5664 | |==================================== |
| 5665 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5666 | [[add-reviewer-result]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5667 | === AddReviewerResult |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5668 | The `AddReviewerResult` entity describes the result of adding a |
| 5669 | reviewer to a change. |
| 5670 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5671 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5672 | |=========================== |
| 5673 | |Field Name ||Description |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 5674 | |`input` || |
| 5675 | Value of the `reviewer` field from link:#reviewer-input[ReviewerInput] |
| 5676 | set while adding the reviewer. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5677 | |`reviewers` |optional| |
| 5678 | The newly added reviewers as a list of link:#reviewer-info[ |
| 5679 | ReviewerInfo] entities. |
Logan Hanks | ee0a418 | 2016-07-06 14:39:26 -0700 | [diff] [blame] | 5680 | |`ccs` |optional| |
| 5681 | The newly CCed accounts as a list of link:#reviewer-info[ |
| 5682 | ReviewerInfo] entities. This field will only appear if the requested |
| 5683 | `state` for the reviewer was `CC` *and* NoteDb is enabled on the |
| 5684 | server. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5685 | |`error` |optional| |
| 5686 | Error message explaining why the reviewer could not be added. + |
| 5687 | If a group was specified in the input and an error is returned, it |
| 5688 | means that none of the members were added as reviewer. |
| 5689 | |`confirm` |`false` if not set| |
| 5690 | Whether adding the reviewer requires confirmation. |
| 5691 | |=========================== |
| 5692 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5693 | [[approval-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5694 | === ApprovalInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5695 | The `ApprovalInfo` entity contains information about an approval from a |
| 5696 | user for a label on a change. |
| 5697 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 5698 | `ApprovalInfo` has the same fields as |
| 5699 | link:rest-api-accounts.html#account-info[AccountInfo]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5700 | In addition `ApprovalInfo` has the following fields: |
| 5701 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5702 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5703 | |=========================== |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 5704 | |Field Name ||Description |
| 5705 | |`value` |optional| |
Dave Borowitz | a30db91 | 2013-03-22 14:20:33 -0700 | [diff] [blame] | 5706 | The vote that the user has given for the label. If present and zero, the |
| 5707 | user is permitted to vote on the label. If absent, the user is not |
| 5708 | permitted to vote on that label. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 5709 | |`permitted_voting_range` |optional| |
| 5710 | The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote |
| 5711 | on that label. If present, the user is permitted to vote on the label |
| 5712 | regarding the range values. If absent, the user is not permitted to vote |
| 5713 | on that label. |
| 5714 | |`date` |optional| |
Gustaf Lundh | 2e07d502 | 2013-05-08 17:07:42 +0100 | [diff] [blame] | 5715 | The time and date describing when the approval was made. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 5716 | |`tag` |optional| |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 5717 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 5718 | while posting the review. Votes/comments that contain `tag` with |
| 5719 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 5720 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 5721 | invocations of the REST call are required. |
Dave Borowitz | e47fe47 | 2016-09-09 13:57:14 -0400 | [diff] [blame] | 5722 | |`post_submit` |not set if `false`| |
| 5723 | If true, this vote was made after the change was submitted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5724 | |=========================== |
| 5725 | |
Sven Selberg | 273a4aa | 2016-09-21 16:28:10 +0200 | [diff] [blame] | 5726 | [[assignee-input]] |
| 5727 | === AssigneeInput |
| 5728 | The `AssigneeInput` entity contains the identity of the user to be set as assignee. |
| 5729 | |
| 5730 | [options="header",cols="1,^1,5"] |
| 5731 | |=========================== |
| 5732 | |Field Name ||Description |
| 5733 | |`assignee` || |
| 5734 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 5735 | should be added as assignee. |
| 5736 | |=========================== |
| 5737 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 5738 | [[blame-info]] |
| 5739 | === BlameInfo |
| 5740 | The `BlameInfo` entity stores the commit metadata with the row coordinates where |
| 5741 | it applies. |
| 5742 | |
| 5743 | [options="header",cols="1,6"] |
| 5744 | |=========================== |
| 5745 | |Field Name | Description |
| 5746 | |`author` | The author of the commit. |
| 5747 | |`id` | The id of the commit. |
| 5748 | |`time` | Commit time. |
| 5749 | |`commit_msg` | The commit message. |
| 5750 | |`ranges` | |
| 5751 | The blame row coordinates as link:#range-info[RangeInfo] entities. |
| 5752 | |=========================== |
| 5753 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 5754 | [[change-edit-input]] |
| 5755 | === ChangeEditInput |
| 5756 | The `ChangeEditInput` entity contains information for restoring a |
| 5757 | path within change edit. |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 5758 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 5759 | [options="header",cols="1,^1,5"] |
| 5760 | |=========================== |
| 5761 | |Field Name ||Description |
| 5762 | |`restore_path`|optional|Path to file to restore. |
| 5763 | |`old_path` |optional|Old path to file to rename. |
| 5764 | |`new_path` |optional|New path to file to rename. |
| 5765 | |=========================== |
| 5766 | |
| 5767 | [[change-edit-message-input]] |
| 5768 | === ChangeEditMessageInput |
| 5769 | The `ChangeEditMessageInput` entity contains information for changing |
| 5770 | the commit message within a change edit. |
| 5771 | |
| 5772 | [options="header",cols="1,^1,5"] |
| 5773 | |=========================== |
| 5774 | |Field Name ||Description |
| 5775 | |`message` ||New commit message. |
| 5776 | |=========================== |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 5777 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5778 | [[change-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5779 | === ChangeInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5780 | The `ChangeInfo` entity contains information about a change. |
| 5781 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5782 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5783 | |================================== |
| 5784 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5785 | |`id` || |
| 5786 | The ID of the change in the format "'<project>\~<branch>~<Change-Id>'", |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 5787 | where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5788 | `refs/heads/` prefix is omitted. |
| 5789 | |`project` ||The name of the project. |
| 5790 | |`branch` || |
| 5791 | The name of the target branch. + |
| 5792 | The `refs/heads/` prefix is omitted. |
Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 5793 | |`topic` |optional|The topic to which this change belongs. |
Edwin Kempin | 93b74fb | 2017-08-25 10:42:56 +0200 | [diff] [blame] | 5794 | |`assignee` |optional| |
| 5795 | The assignee of the change as an link:rest-api-accounts.html#account-info[ |
| 5796 | AccountInfo] entity. |
| 5797 | |`hashtags` |optional| |
| 5798 | List of hashtags that are set on the change (only populated when NoteDb |
| 5799 | is enabled). |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5800 | |`change_id` ||The Change-Id of the change. |
| 5801 | |`subject` || |
| 5802 | The subject of the change (header line of the commit message). |
| 5803 | |`status` || |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 5804 | The status of the change (`NEW`, `MERGED`, `ABANDONED`). |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5805 | |`created` || |
| 5806 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 5807 | created. |
| 5808 | |`updated` || |
| 5809 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 5810 | updated. |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 5811 | |`submitted` |only set for merged changes| |
| 5812 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 5813 | submitted. |
Dave Borowitz | 8ec31f9 | 2017-08-23 10:28:34 -0400 | [diff] [blame] | 5814 | |`submitter` |only set for merged changes| |
| 5815 | The user who submitted the change, as an |
| 5816 | link:rest-api-accounts.html#account-info[ AccountInfo] entity. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5817 | |`starred` |not set if `false`| |
Edwin Kempin | 9e972cc | 2016-04-15 10:39:13 +0200 | [diff] [blame] | 5818 | Whether the calling user has starred this change with the default label. |
| 5819 | |`stars` |optional| |
| 5820 | A list of star labels that are applied by the calling user to this |
| 5821 | change. The labels are lexicographically sorted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5822 | |`reviewed` |not set if `false`| |
| 5823 | Whether the change was reviewed by the calling user. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 5824 | Only set if link:#reviewed[reviewed] is requested. |
Dave Borowitz | ace3210 | 2015-12-17 13:08:25 -0500 | [diff] [blame] | 5825 | |`submit_type` |optional| |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 5826 | The link:config-project-config.html#submit-type[submit type] of the change. + |
Dave Borowitz | ace3210 | 2015-12-17 13:08:25 -0500 | [diff] [blame] | 5827 | Not set for merged changes. |
Edwin Kempin | baf70e1 | 2013-02-27 10:36:13 +0100 | [diff] [blame] | 5828 | |`mergeable` |optional| |
| 5829 | Whether the change is mergeable. + |
Han-Wen Nienhuys | 19de6cd | 2018-01-16 13:15:38 +0100 | [diff] [blame] | 5830 | Not set for merged changes, if the change has not yet been tested, or |
Patrick Hiesel | db8df48 | 2019-01-24 10:11:23 +0100 | [diff] [blame] | 5831 | if the link:#skip_mergeable[skip_mergeable] option is set or when |
| 5832 | link:config-gerrit.html#change.api.excludeMergeableInChangeInfo[change.api.excludeMergeableInChangeInfo] |
| 5833 | is set. |
Shawn Pearce | 4cd05b2 | 2016-09-17 22:45:33 -0700 | [diff] [blame] | 5834 | |`submittable` |optional| |
| 5835 | Whether the change has been approved by the project submit rules. + |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 5836 | Only set if link:#submittable[requested]. |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 5837 | |`insertions` || |
| 5838 | Number of inserted lines. |
| 5839 | |`deletions` || |
| 5840 | Number of deleted lines. |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 5841 | |`total_comment_count` |optional| |
| 5842 | Total number of inline comments across all patch sets. Not set if the current |
| 5843 | change index doesn't have the data. |
Changcheng Xiao | 81c4809 | 2017-02-08 13:04:07 +0100 | [diff] [blame] | 5844 | |`unresolved_comment_count` |optional| |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 5845 | Number of unresolved inline comment threads across all patch sets. Not set if |
| 5846 | the current change index doesn't have the data. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5847 | |`_number` ||The legacy numeric ID of the change. |
| 5848 | |`owner` || |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 5849 | The owner of the change as an link:rest-api-accounts.html#account-info[ |
| 5850 | AccountInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 5851 | |`actions` |optional| |
| 5852 | Actions the caller might be able to perform on this revision. The |
| 5853 | information is a map of view name to link:#action-info[ActionInfo] |
| 5854 | entities. |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 5855 | |`requirements` |optional| |
| 5856 | List of the link:rest-api-changes.html#requirement[requirements] to be met before this change |
| 5857 | can be submitted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5858 | |`labels` |optional| |
| 5859 | The labels of the change as a map that maps the label names to |
| 5860 | link:#label-info[LabelInfo] entries. + |
| 5861 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 5862 | labels] are requested. |
| 5863 | |`permitted_labels` |optional| |
| 5864 | A map of the permitted labels that maps a label name to the list of |
| 5865 | values that are allowed for that label. + |
| 5866 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 5867 | |`removable_reviewers`|optional| |
| 5868 | The reviewers that can be removed by the calling user as a list of |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 5869 | link:rest-api-accounts.html#account-info[AccountInfo] entities. + |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5870 | Only set if link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 5871 | |`reviewers` |optional| |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 5872 | The reviewers as a map that maps a reviewer state to a list of |
| 5873 | link:rest-api-accounts.html#account-info[AccountInfo] entities. |
| 5874 | Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. + |
| 5875 | `REVIEWER`: Users with at least one non-zero vote on the change. + |
| 5876 | `CC`: Users that were added to the change, but have not voted. + |
| 5877 | `REMOVED`: Users that were previously reviewers on the change, but have |
| 5878 | been removed. + |
| 5879 | Only set if link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 5880 | |`pending_reviewers` |optional| |
| 5881 | Updates to `reviewers` that have been made while the change was in the |
| 5882 | WIP state. Only present on WIP changes and only if there are pending |
| 5883 | reviewer updates to report. These are reviewers who have not yet been |
| 5884 | notified about being added to or removed from the change. + |
| 5885 | Only set if link:#detailed-labels[detailed labels] are requested. |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 5886 | |`reviewer_updates`|optional| |
| 5887 | Updates to reviewers set for the change as |
| 5888 | link:#review-update-info[ReviewerUpdateInfo] entities. |
Han-Wen Nienhuys | 3c670be | 2020-06-30 19:17:07 +0200 | [diff] [blame] | 5889 | Only set if link:#reviewer-updates[reviewer updates] are requested. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5890 | |`messages`|optional| |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 5891 | Messages associated with the change as a list of |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5892 | link:#change-message-info[ChangeMessageInfo] entities. + |
| 5893 | Only set if link:#messages[messages] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5894 | |`current_revision` |optional| |
| 5895 | The commit ID of the current patch set of this change. + |
| 5896 | Only set if link:#current-revision[the current revision] is requested |
| 5897 | or if link:#all-revisions[all revisions] are requested. |
| 5898 | |`revisions` |optional| |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 5899 | All patch sets of this change as a map that maps the commit ID of the |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5900 | patch set to a link:#revision-info[RevisionInfo] entity. + |
Dave Borowitz | 0adf270 | 2014-01-22 10:41:52 -0800 | [diff] [blame] | 5901 | Only set if link:#current-revision[the current revision] is requested |
| 5902 | (in which case it will only contain a key for the current revision) or |
| 5903 | if link:#all-revisions[all revisions] are requested. |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 5904 | |`tracking_ids` |optional| |
| 5905 | A list of link:#tracking-id-info[TrackingIdInfo] entities describing |
| 5906 | references to external tracking systems. Only set if |
| 5907 | link:#tracking-ids[tracking ids] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5908 | |`_more_changes` |optional, not set if `false`| |
| 5909 | Whether the query would deliver more results if not limited. + |
Dave Borowitz | 4241459 | 2014-12-19 11:27:14 -0800 | [diff] [blame] | 5910 | Only set on the last change that is returned. |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 5911 | |`problems` |optional| |
| 5912 | A list of link:#problem-info[ProblemInfo] entities describing potential |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 5913 | problems with this change. Only set if link:#check[CHECK] is set. |
David Ostrovsky | cb19cec | 2017-04-28 11:55:45 +0200 | [diff] [blame] | 5914 | |`is_private` |optional, not set if `false`| |
| 5915 | When present, change is marked as private. |
David Ostrovsky | 258849b | 2017-03-09 23:21:03 +0100 | [diff] [blame] | 5916 | |`work_in_progress` |optional, not set if `false`| |
| 5917 | When present, change is marked as Work In Progress. |
Logan Hanks | 724b24c | 2017-07-14 10:01:05 -0700 | [diff] [blame] | 5918 | |`has_review_started` |optional, not set if `false`| |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 5919 | When present, change has been marked Ready at some point in time. |
Patrick Hiesel | 828f322 | 2017-07-13 14:18:38 +0200 | [diff] [blame] | 5920 | |`revert_of` |optional| |
| 5921 | The numeric Change-Id of the change that this change reverts. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 5922 | |================================== |
| 5923 | |
| 5924 | [[change-input]] |
| 5925 | === ChangeInput |
| 5926 | The `ChangeInput` entity contains information about creating a new change. |
| 5927 | |
| 5928 | [options="header",cols="1,^1,5"] |
| 5929 | |================================== |
| 5930 | |Field Name ||Description |
| 5931 | |`project` ||The name of the project. |
| 5932 | |`branch` || |
| 5933 | The name of the target branch. + |
| 5934 | The `refs/heads/` prefix is omitted. |
| 5935 | |`subject` || |
David Pursehouse | 38cb32d | 2018-06-07 14:44:33 +0900 | [diff] [blame] | 5936 | The commit message of the change. Comment lines (beginning with `#`) will |
| 5937 | be removed. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 5938 | |`topic` |optional|The topic to which this change belongs. |
| 5939 | |`status` |optional, default to `NEW`| |
David Ostrovsky | 4b44bdc | 2017-07-27 08:05:43 +0200 | [diff] [blame] | 5940 | The status of the change (only `NEW` accepted here). |
Edwin Kempin | 14d50ed | 2017-05-03 13:26:30 +0200 | [diff] [blame] | 5941 | |`is_private` |optional, default to `false`| |
| 5942 | Whether the new change should be marked as private. |
| 5943 | |`work_in_progress` |optional, default to `false`| |
| 5944 | Whether the new change should be set to work in progress. |
David Ostrovsky | 9d8ec42 | 2014-12-24 00:52:09 +0100 | [diff] [blame] | 5945 | |`base_change` |optional| |
| 5946 | A link:#change-id[\{change-id\}] that identifies the base change for a create |
Aaron Gable | e8e7328 | 2018-04-26 11:09:30 -0700 | [diff] [blame] | 5947 | change operation. Mutually exclusive with `base_commit`. |
| 5948 | |`base_commit` |optional| |
| 5949 | A 40-digit hex SHA-1 of the commit which will be the parent commit of the newly |
| 5950 | created change. If set, it must be a merged commit on the destination branch. |
| 5951 | Mutually exclusive with `base_change`. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 5952 | |`new_branch` |optional, default to `false`| |
Edwin Kempin | e94bb87 | 2019-10-08 13:47:41 +0200 | [diff] [blame] | 5953 | Allow creating a new branch when set to `true`. Using this option is |
| 5954 | only possible for non-merge commits (if the `merge` field is not set). |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 5955 | |`merge` |optional| |
| 5956 | The detail of a merge commit as a link:#merge-input[MergeInput] entity. |
Edwin Kempin | e94bb87 | 2019-10-08 13:47:41 +0200 | [diff] [blame] | 5957 | If set, the target branch (see `branch` field) must exist (it is not |
| 5958 | possible to create it automatically by setting the `new_branch` field |
| 5959 | to `true`. |
Edwin Kempin | 5f8c383 | 2017-01-13 11:45:06 +0100 | [diff] [blame] | 5960 | |`notify` |optional| |
| 5961 | Notify handling that defines to whom email notifications should be sent |
| 5962 | after the change is created. + |
| 5963 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 5964 | If not set, the default is `ALL`. |
| 5965 | |`notify_details` |optional| |
| 5966 | Additional information about whom to notify about the change creation |
| 5967 | as a map of recipient type to link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5968 | |================================== |
| 5969 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5970 | [[change-message-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5971 | === ChangeMessageInfo |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5972 | The `ChangeMessageInfo` entity contains information about a message |
| 5973 | attached to a change. |
| 5974 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5975 | [options="header",cols="1,^1,5"] |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5976 | |================================== |
| 5977 | |Field Name ||Description |
| 5978 | |`id` ||The ID of the message. |
| 5979 | |`author` |optional| |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 5980 | Author of the message as an |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5981 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 5982 | Unset if written by the Gerrit system. |
Patrick Hiesel | 9221ef1 | 2017-03-23 16:44:36 +0100 | [diff] [blame] | 5983 | |`real_author` |optional| |
| 5984 | Real author of the message as an |
| 5985 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 5986 | Set if the message was posted on behalf of another user. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5987 | |`date` || |
| 5988 | The link:rest-api.html#timestamp[timestamp] this message was posted. |
| 5989 | |`message` ||The text left by the user. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 5990 | |`tag` |optional| |
| 5991 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 5992 | while posting the review. Votes/comments that contain `tag` with |
| 5993 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 5994 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 5995 | invocations of the REST call are required. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5996 | |`_revision_number` |optional| |
| 5997 | Which patchset (if any) generated this message. |
| 5998 | |================================== |
| 5999 | |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 6000 | [[cherry-pick-change-info]] |
| 6001 | === CherryPickChangeInfo |
| 6002 | The `CherryPickChangeInfo` entity contains information about a |
| 6003 | cherry-pick change. |
| 6004 | |
| 6005 | `CherryPickChangeInfo` has the same fields as link:#change-info[ |
| 6006 | ChangeInfo]. In addition `CherryPickChangeInfo` has the following |
| 6007 | fields: |
| 6008 | |
| 6009 | [options="header",cols="1,^1,5"] |
| 6010 | |====================================== |
| 6011 | |Field Name ||Description |
| 6012 | |`contains_git_conflicts` |optional, not set if `false`| |
| 6013 | Whether any file in the change contains Git conflict markers. |
| 6014 | |====================================== |
| 6015 | |
| 6016 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6017 | [[cherrypick-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6018 | === CherryPickInput |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6019 | The `CherryPickInput` entity contains information for cherry-picking a change to a new branch. |
| 6020 | |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6021 | [options="header",cols="1,^1,5"] |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6022 | |=========================== |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6023 | |Field Name ||Description |
Edwin Kempin | 159804b | 2019-09-23 11:09:39 +0200 | [diff] [blame] | 6024 | |`message` |optional| |
| 6025 | Commit message for the cherry-pick change. If not set, the commit message of |
| 6026 | the cherry-picked commit is used. |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6027 | |`destination` ||Destination branch |
Changcheng Xiao | e333258 | 2017-05-26 15:29:41 +0200 | [diff] [blame] | 6028 | |`base` |optional| |
| 6029 | 40-hex digit SHA-1 of the commit which will be the parent commit of the newly created change. |
| 6030 | If set, it must be a merged commit or a change revision on the destination branch. |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6031 | |`parent` |optional, defaults to 1| |
| 6032 | Number of the parent relative to which the cherry-pick should be considered. |
Changcheng Xiao | e04e846 | 2017-05-23 09:39:03 +0200 | [diff] [blame] | 6033 | |`notify` |optional| |
| 6034 | Notify handling that defines to whom email notifications should be sent |
| 6035 | after the cherry-pick. + |
| 6036 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Saša Živkov | 357e2bd | 2020-06-12 12:06:07 +0200 | [diff] [blame] | 6037 | If not set, the default is `ALL`. |
Changcheng Xiao | e04e846 | 2017-05-23 09:39:03 +0200 | [diff] [blame] | 6038 | |`notify_details` |optional| |
| 6039 | Additional information about whom to notify about the update as a map |
| 6040 | of recipient type to link:#notify-info[NotifyInfo] entity. |
Aaron Gable | 54bc983 | 2017-07-05 14:44:36 -0700 | [diff] [blame] | 6041 | |`keep_reviewers` |optional, defaults to false| |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 6042 | If `true`, carries reviewers and ccs over from original change to newly created one. |
| 6043 | |`allow_conflicts` |optional, defaults to false| |
| 6044 | If `true`, the cherry-pick uses content merge and succeeds also if |
| 6045 | there are conflicts. If there are conflicts the file contents of the |
| 6046 | created change contain git conflict markers to indicate the conflicts. |
| 6047 | Callers can find out if there were conflicts by checking the |
| 6048 | `contains_git_conflicts` field in the link:#cherry-pick-change-info[ |
| 6049 | CherryPickChangeInfo] that is returned by the cherry-pick REST |
Edwin Kempin | 3c4113a | 2018-10-12 10:49:33 +0200 | [diff] [blame] | 6050 | endpoints. If there are conflicts the cherry-pick change is marked as |
| 6051 | work-in-progress. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6052 | |=========================== |
| 6053 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6054 | [[comment-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6055 | === CommentInfo |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 6056 | The `CommentInfo` entity contains information about an inline comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6057 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6058 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6059 | |=========================== |
| 6060 | |Field Name ||Description |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 6061 | |`patch_set` |optional| |
| 6062 | The patch set number for the comment; only set in contexts where + |
| 6063 | comments may be returned for multiple patch sets. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6064 | |`id` ||The URL encoded UUID of the comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6065 | |`path` |optional| |
| 6066 | The path of the file for which the inline comment was done. + |
| 6067 | Not set if returned in a map where the key is the file path. |
| 6068 | |`side` |optional| |
| 6069 | The side on which the comment was added. + |
| 6070 | Allowed values are `REVISION` and `PARENT`. + |
| 6071 | If not set, the default is `REVISION`. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 6072 | |`parent` |optional| |
| 6073 | The 1-based parent number. Used only for merge commits when `side == PARENT`. |
| 6074 | When not set the comment is for the auto-merge tree. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6075 | |`line` |optional| |
| 6076 | The number of the line for which the comment was done. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6077 | If range is set, this equals the end line of the range. + |
| 6078 | If neither line nor range is set, it's a file comment. |
| 6079 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 6080 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6081 | entity. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6082 | |`in_reply_to` |optional| |
| 6083 | The URL encoded UUID of the comment to which this comment is a reply. |
| 6084 | |`message` |optional|The comment message. |
| 6085 | |`updated` || |
| 6086 | The link:rest-api.html#timestamp[timestamp] of when this comment was |
| 6087 | written. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6088 | |`author` |optional| |
David Pursehouse | c633a57 | 2013-08-26 14:01:59 +0900 | [diff] [blame] | 6089 | The author of the message as an |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6090 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 6091 | Unset for draft comments, assumed to be the calling user. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6092 | |`tag` |optional| |
| 6093 | Value of the `tag` field from link:#review-input[ReviewInput] set |
| 6094 | while posting the review. |
Sven Selberg | 1a6728d | 2018-09-28 12:30:12 +0200 | [diff] [blame] | 6095 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6096 | invocations of the REST call are required. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 6097 | |`unresolved` |optional| |
| 6098 | Whether or not the comment must be addressed by the user. The state of |
| 6099 | resolution of a comment thread is stored in the last comment in that thread |
| 6100 | chronologically. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6101 | |=========================== |
| 6102 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6103 | [[comment-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6104 | === CommentInput |
Orgad Shaneh | c99da3a | 2014-06-13 14:57:54 +0300 | [diff] [blame] | 6105 | The `CommentInput` entity contains information for creating an inline |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6106 | comment. |
| 6107 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6108 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6109 | |=========================== |
| 6110 | |Field Name ||Description |
| 6111 | |`id` |optional| |
Edwin Kempin | c09826d7 | 2013-02-26 16:10:39 +0100 | [diff] [blame] | 6112 | The URL encoded UUID of the comment if an existing draft comment should |
| 6113 | be updated. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 6114 | |`path` |optional| |
| 6115 | The path of the file for which the inline comment should be added. + |
| 6116 | Doesn't need to be set if contained in a map where the key is the file |
| 6117 | path. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6118 | |`side` |optional| |
| 6119 | The side on which the comment should be added. + |
| 6120 | Allowed values are `REVISION` and `PARENT`. + |
| 6121 | If not set, the default is `REVISION`. |
| 6122 | |`line` |optional| |
| 6123 | The number of the line for which the comment should be added. + |
| 6124 | `0` if it is a file comment. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6125 | If neither line nor range is set, a file comment is added. + |
David Pursehouse | 4a159a1 | 2014-08-26 15:45:14 +0900 | [diff] [blame] | 6126 | If range is set, this value is ignored in favor of the `end_line` of the range. |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6127 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 6128 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6129 | entity. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6130 | |`in_reply_to` |optional| |
| 6131 | The URL encoded UUID of the comment to which this comment is a reply. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 6132 | |`updated` |optional| |
| 6133 | The link:rest-api.html#timestamp[timestamp] of this comment. + |
| 6134 | Accepted but ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6135 | |`message` |optional| |
| 6136 | The comment message. + |
| 6137 | If not set and an existing draft comment is updated, the existing draft |
| 6138 | comment is deleted. |
Dave Borowitz | 3dd203b | 2016-04-19 13:52:41 -0400 | [diff] [blame] | 6139 | |`tag` |optional, drafts only| |
| 6140 | Value of the `tag` field. Only allowed on link:#create-draft[draft comment] + |
| 6141 | inputs; for published comments, use the `tag` field in + |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 6142 | link#review-input[ReviewInput]. Votes/comments that contain `tag` with |
| 6143 | 'autogenerated:' prefix can be filtered out in the web UI. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 6144 | |`unresolved` |optional| |
| 6145 | Whether or not the comment must be addressed by the user. This value will |
| 6146 | default to false if the comment is an orphan, or the value of the `in_reply_to` |
| 6147 | comment if it is supplied. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6148 | |=========================== |
| 6149 | |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6150 | [[comment-range]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6151 | === CommentRange |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6152 | The `CommentRange` entity describes the range of an inline comment. |
| 6153 | |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 6154 | The comment range is a range from the start position, specified by `start_line` |
| 6155 | and `start_character`, to the end position, specified by `end_line` and |
| 6156 | `end_character`. The start position is *inclusive* and the end position is |
| 6157 | *exclusive*. |
| 6158 | |
| 6159 | So, a range over part of a line will have `start_line` equal to |
| 6160 | `end_line`; however a range with `end_line` set to 5 and `end_character` equal |
| 6161 | to 0 will not include any characters on line 5, |
| 6162 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6163 | [options="header",cols="1,^1,5"] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6164 | |=========================== |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 6165 | |Field Name ||Description |
| 6166 | |`start_line` ||The start line number of the range. (1-based) |
| 6167 | |`start_character` ||The character position in the start line. (0-based) |
| 6168 | |`end_line` ||The end line number of the range. (1-based) |
| 6169 | |`end_character` ||The character position in the end line. (0-based) |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6170 | |=========================== |
| 6171 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6172 | [[commit-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6173 | === CommitInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6174 | The `CommitInfo` entity contains information about a commit. |
| 6175 | |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6176 | [options="header",cols="1,^1,5"] |
| 6177 | |=========================== |
| 6178 | |Field Name ||Description |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 6179 | |`commit` |Optional| |
| 6180 | The commit ID. Not set if included in a link:#revision-info[ |
| 6181 | RevisionInfo] entity that is contained in a map which has the commit ID |
| 6182 | as key. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6183 | |`parents` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6184 | The parent commits of this commit as a list of |
Edwin Kempin | cecf90a | 2014-04-09 14:58:35 +0200 | [diff] [blame] | 6185 | link:#commit-info[CommitInfo] entities. In each parent |
| 6186 | only the `commit` and `subject` fields are populated. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6187 | |`author` ||The author of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6188 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6189 | |`committer` ||The committer of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6190 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6191 | |`subject` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6192 | The subject of the commit (header line of the commit message). |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6193 | |`message` ||The commit message. |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 6194 | |`web_links` |optional| |
| 6195 | Links to the commit in external sites as a list of |
| 6196 | link:#web-link-info[WebLinkInfo] entities. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6197 | |=========================== |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6198 | |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 6199 | [[commit-message-input]] |
| 6200 | === CommitMessageInput |
| 6201 | The `CommitMessageInput` entity contains information for changing |
| 6202 | the commit message of a change. |
| 6203 | |
| 6204 | [options="header",cols="1,^1,5"] |
| 6205 | |============================= |
| 6206 | |Field Name ||Description |
| 6207 | |`message` ||New commit message. |
| 6208 | |`notify` |optional| |
| 6209 | Notify handling that defines to whom email notifications should be sent |
| 6210 | after the commit message was updated. + |
| 6211 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 6212 | If not set, the default is `OWNER` for WIP changes and `ALL` otherwise. |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 6213 | |`notify_details`|optional| |
| 6214 | Additional information about whom to notify about the update as a map |
| 6215 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 6216 | |============================= |
| 6217 | |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 6218 | [[delete-change-message-input]] |
| 6219 | === DeleteChangeMessageInput |
| 6220 | The `DeleteChangeMessageInput` entity contains the options for deleting a change message. |
| 6221 | |
| 6222 | [options="header",cols="1,^1,5"] |
| 6223 | |============================= |
| 6224 | |Field Name ||Description |
| 6225 | |`reason` |optional| |
| 6226 | The reason why the change message should be deleted. + |
| 6227 | If set, the change message will be replaced with |
| 6228 | "Change message removed by: `name`\nReason: `reason`", |
| 6229 | or just "Change message removed by: `name`." if not set. |
| 6230 | |============================= |
| 6231 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 6232 | [[delete-comment-input]] |
| 6233 | === DeleteCommentInput |
| 6234 | The `DeleteCommentInput` entity contains the option for deleting a comment. |
| 6235 | |
| 6236 | [options="header",cols="1,^1,5"] |
| 6237 | |============================= |
| 6238 | |Field Name ||Description |
| 6239 | |`reason` |optional| |
| 6240 | The reason why the comment should be deleted. + |
| 6241 | If set, the comment's message will be replaced with |
| 6242 | "Comment removed by: `name`; Reason: `reason`", |
| 6243 | or just "Comment removed by: `name`." if not set. |
| 6244 | |============================= |
| 6245 | |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 6246 | [[delete-reviewer-input]] |
| 6247 | === DeleteReviewerInput |
| 6248 | The `DeleteReviewerInput` entity contains options for the deletion of a |
| 6249 | reviewer. |
| 6250 | |
| 6251 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6252 | |============================= |
| 6253 | |Field Name ||Description |
| 6254 | |`notify` |optional| |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 6255 | Notify handling that defines to whom email notifications should be sent |
| 6256 | after the reviewer is deleted. + |
| 6257 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6258 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6259 | |`notify_details`|optional| |
| 6260 | Additional information about whom to notify about the update as a map |
| 6261 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 6262 | |============================= |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 6263 | |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 6264 | [[delete-vote-input]] |
| 6265 | === DeleteVoteInput |
| 6266 | The `DeleteVoteInput` entity contains options for the deletion of a |
| 6267 | vote. |
| 6268 | |
| 6269 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6270 | |============================= |
| 6271 | |Field Name ||Description |
| 6272 | |`label` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 6273 | The label for which the vote should be deleted. + |
| 6274 | If set, must match the label in the URL. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6275 | |`notify` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 6276 | Notify handling that defines to whom email notifications should be sent |
| 6277 | after the vote is deleted. + |
| 6278 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6279 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6280 | |`notify_details`|optional| |
| 6281 | Additional information about whom to notify about the update as a map |
| 6282 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 6283 | |============================= |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 6284 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 6285 | [[description-input]] |
| 6286 | === DescriptionInput |
| 6287 | The `DescriptionInput` entity contains information for setting a description. |
| 6288 | |
| 6289 | [options="header",cols="1,6"] |
| 6290 | |=========================== |
| 6291 | |Field Name |Description |
| 6292 | |`description` |The description text. |
| 6293 | |=========================== |
| 6294 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6295 | [[diff-content]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6296 | === DiffContent |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6297 | The `DiffContent` entity contains information about the content differences |
| 6298 | in a file. |
| 6299 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6300 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6301 | |========================== |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 6302 | |Field Name ||Description |
| 6303 | |`a` |optional|Content only in the file on side A (deleted in B). |
| 6304 | |`b` |optional|Content only in the file on side B (added in B). |
| 6305 | |`ab` |optional|Content in the file on both sides (unchanged). |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 6306 | |`edit_a` |only present when the `intraline` parameter is set and the |
| 6307 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6308 | Text sections deleted from side A as a |
| 6309 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 6310 | |`edit_b` |only present when the `intraline` parameter is set and the |
| 6311 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6312 | Text sections inserted in side B as a |
| 6313 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 6314 | |`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a |
| 6315 | rebase. |
| 6316 | |`skip` |optional|count of lines skipped on both sides when the file is |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6317 | too large to include all common lines. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 6318 | |`common` |optional|Set to `true` if the region is common according |
Shawn Pearce | 425a2be | 2014-01-02 16:00:58 -0800 | [diff] [blame] | 6319 | to the requested ignore-whitespace parameter, but a and b contain |
| 6320 | differing amounts of whitespace. When present and true a and b are |
| 6321 | used instead of ab. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6322 | |========================== |
| 6323 | |
| 6324 | [[diff-file-meta-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6325 | === DiffFileMetaInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6326 | The `DiffFileMetaInfo` entity contains meta information about a file diff. |
| 6327 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6328 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6329 | |========================== |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 6330 | |Field Name ||Description |
| 6331 | |`name` ||The name of the file. |
| 6332 | |`content_type`||The content type of the file. |
| 6333 | |`lines` ||The total number of lines in the file. |
Edwin Kempin | 26c95a4 | 2014-11-25 16:29:47 +0100 | [diff] [blame] | 6334 | |`web_links` |optional| |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 6335 | Links to the file in external sites as a list of |
Shawn Pearce | b62414c | 2014-10-16 22:48:33 -0700 | [diff] [blame] | 6336 | link:rest-api-changes.html#web-link-info[WebLinkInfo] entries. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6337 | |========================== |
| 6338 | |
| 6339 | [[diff-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6340 | === DiffInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6341 | The `DiffInfo` entity contains information about the diff of a file |
| 6342 | in a revision. |
| 6343 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 6344 | If the link:#weblinks-only[weblinks-only] parameter is specified, only |
| 6345 | the `web_links` field is set. |
| 6346 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6347 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6348 | |========================== |
| 6349 | |Field Name ||Description |
| 6350 | |`meta_a` |not present when the file is added| |
| 6351 | Meta information about the file on side A as a |
| 6352 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 6353 | |`meta_b` |not present when the file is deleted| |
| 6354 | Meta information about the file on side B as a |
| 6355 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 6356 | |`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED` |
| 6357 | `COPIED`, `REWRITE`). |
| 6358 | |`intraline_status`|only set when the `intraline` parameter was specified in the request| |
| 6359 | Intraline status (`OK`, `ERROR`, `TIMEOUT`). |
| 6360 | |`diff_header` ||A list of strings representing the patch set diff header. |
| 6361 | |`content` ||The content differences in the file as a list of |
| 6362 | link:#diff-content[DiffContent] entities. |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 6363 | |`web_links` |optional| |
| 6364 | Links to the file diff in external sites as a list of |
| 6365 | link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries. |
David Ostrovsky | cdbef23 | 2015-02-13 01:16:37 +0100 | [diff] [blame] | 6366 | |`binary` |not set if `false`|Whether the file is binary. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6367 | |========================== |
| 6368 | |
| 6369 | [[diff-intraline-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6370 | === DiffIntralineInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6371 | The `DiffIntralineInfo` entity contains information about intraline edits in a |
| 6372 | file. |
| 6373 | |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 6374 | The information consists of a list of `<skip length, edit length>` pairs, where |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 6375 | the skip length is the number of characters between the end of the previous edit |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 6376 | and the start of this edit, and the edit length is the number of edited characters |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 6377 | following the skip. The start of the edits is from the beginning of the related |
Tao Zhou | 4243048 | 2019-09-13 11:26:01 +0200 | [diff] [blame] | 6378 | diff content lines. If the list is empty, the entire DiffContent should be considered |
| 6379 | as unedited. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6380 | |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 6381 | Note that the implied newline character at the end of each line is included in |
Colby Ranger | 4c29275 | 2013-06-07 11:11:00 -0700 | [diff] [blame] | 6382 | the length calculation, and thus it is possible for the edits to span newlines. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6383 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 6384 | [[diff-web-link-info]] |
| 6385 | === DiffWebLinkInfo |
| 6386 | The `DiffWebLinkInfo` entity describes a link on a diff screen to an |
| 6387 | external site. |
| 6388 | |
| 6389 | [options="header",cols="1,6"] |
| 6390 | |======================= |
| 6391 | |Field Name|Description |
| 6392 | |`name` |The link name. |
| 6393 | |`url` |The link URL. |
| 6394 | |`image_url`|URL to the icon of the link. |
| 6395 | |show_on_side_by_side_diff_view| |
| 6396 | Whether the web link should be shown on the side-by-side diff screen. |
| 6397 | |show_on_unified_diff_view| |
| 6398 | Whether the web link should be shown on the unified diff screen. |
| 6399 | |======================= |
| 6400 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 6401 | [[edit-file-info]] |
| 6402 | === EditFileInfo |
| 6403 | The `EditFileInfo` entity contains additional information |
| 6404 | of a file within a change edit. |
| 6405 | |
| 6406 | [options="header",cols="1,^1,5"] |
| 6407 | |=========================== |
| 6408 | |Field Name ||Description |
| 6409 | |`web_links` |optional| |
| 6410 | Links to the diff info in external sites as a list of |
| 6411 | link:#web-link-info[WebLinkInfo] entities. |
| 6412 | |=========================== |
| 6413 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6414 | [[edit-info]] |
| 6415 | === EditInfo |
| 6416 | The `EditInfo` entity contains information about a change edit. |
| 6417 | |
| 6418 | [options="header",cols="1,^1,5"] |
| 6419 | |=========================== |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 6420 | |Field Name ||Description |
| 6421 | |`commit` ||The commit of change edit as |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6422 | link:#commit-info[CommitInfo] entity. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 6423 | |`base_patch_set_number`||The patch set number of the patch set the change edit is based on. |
| 6424 | |`base_revision` ||The revision of the patch set the change edit is based on. |
David Pursehouse | 1bb55ff | 2019-01-07 15:28:22 +0900 | [diff] [blame] | 6425 | |`ref` ||The ref of the change edit. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 6426 | |`fetch` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6427 | Information about how to fetch this patch set. The fetch information is |
| 6428 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 6429 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 6430 | |`files` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6431 | The files of the change edit as a map that maps the file names to |
| 6432 | link:#file-info[FileInfo] entities. |
| 6433 | |=========================== |
| 6434 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6435 | [[fetch-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6436 | === FetchInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6437 | The `FetchInfo` entity contains information about how to fetch a patch |
| 6438 | set via a certain protocol. |
| 6439 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6440 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6441 | |========================== |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 6442 | |Field Name ||Description |
| 6443 | |`url` ||The URL of the project. |
| 6444 | |`ref` ||The ref of the patch set. |
| 6445 | |`commands` |optional| |
| 6446 | The download commands for this patch set as a map that maps the command |
| 6447 | names to the commands. + |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 6448 | Only set if link:#download-commands[download commands] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6449 | |========================== |
| 6450 | |
| 6451 | [[file-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6452 | === FileInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6453 | The `FileInfo` entity contains information about a file in a patch set. |
| 6454 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6455 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6456 | |============================= |
| 6457 | |Field Name ||Description |
| 6458 | |`status` |optional| |
| 6459 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 6460 | "`C`"=Copied, "`W`"=Rewritten). + |
| 6461 | Not set if the file was Modified ("`M`"). |
| 6462 | |`binary` |not set if `false`|Whether the file is binary. |
| 6463 | |`old_path` |optional| |
| 6464 | The old file path. + |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 6465 | Only set if the file was renamed or copied. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6466 | |`lines_inserted`|optional| |
| 6467 | Number of inserted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 6468 | Not set for binary files or if no lines were inserted. + |
| 6469 | An empty last line is not included in the count and hence this number can |
| 6470 | differ by one from details provided in <<#diff-info,DiffInfo>>. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6471 | |`lines_deleted` |optional| |
| 6472 | Number of deleted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 6473 | Not set for binary files or if no lines were deleted. + |
| 6474 | An empty last line is not included in the count and hence this number can |
| 6475 | differ by one from details provided in <<#diff-info,DiffInfo>>. |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 6476 | |`size_delta` || |
| 6477 | Number of bytes by which the file size increased/decreased. |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 6478 | |`size` || |
| 6479 | File size in bytes. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6480 | |============================= |
| 6481 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 6482 | [[fix-input]] |
| 6483 | === FixInput |
| 6484 | The `FixInput` entity contains options for fixing commits using the |
| 6485 | link:#fix-change[fix change] endpoint. |
| 6486 | |
| 6487 | [options="header",cols="1,6"] |
| 6488 | |========================== |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 6489 | |Field Name |Description |
| 6490 | |`delete_patch_set_if_commit_missing`|If true, delete patch sets from the |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 6491 | database if they refer to missing commit options. |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 6492 | |`expect_merged_as` |If set, check that the change is |
Dave Borowitz | a828fed | 2015-05-05 14:43:40 -0700 | [diff] [blame] | 6493 | merged into the destination branch as this exact SHA-1. If not, insert |
| 6494 | a new patch set referring to this commit. |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 6495 | |========================== |
| 6496 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6497 | [[fix-suggestion-info]] |
| 6498 | === FixSuggestionInfo |
| 6499 | The `FixSuggestionInfo` entity represents a suggested fix. |
| 6500 | |
| 6501 | [options="header",cols="1,^1,5"] |
| 6502 | |========================== |
| 6503 | |Field Name ||Description |
| 6504 | |`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested |
| 6505 | fix. It will be generated automatically and hence will be ignored if it's set |
| 6506 | for input objects. |
| 6507 | |`description` ||A description of the suggested fix. |
| 6508 | |`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>> |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 6509 | entities indicating how the content of one or several files should be modified. |
| 6510 | Within a file, they should refer to non-overlapping regions. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6511 | |========================== |
| 6512 | |
| 6513 | [[fix-replacement-info]] |
| 6514 | === FixReplacementInfo |
Alice Kober-Sotzek | 110f60f | 2016-12-19 14:53:40 +0100 | [diff] [blame] | 6515 | The `FixReplacementInfo` entity describes how the content of a file should be |
| 6516 | replaced by another content. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6517 | |
| 6518 | [options="header",cols="1,6"] |
| 6519 | |========================== |
| 6520 | |Field Name |Description |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 6521 | |`path` |The path of the file which should be modified. Any file in |
| 6522 | the repository may be modified. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6523 | |`range` |A <<comment-range,CommentRange>> indicating which content |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 6524 | of the file should be replaced. Lines in the file are assumed to be separated |
| 6525 | by the line feed character, the carriage return character, the carriage return |
| 6526 | followed by the line feed character, or one of the other Unicode linebreak |
| 6527 | sequences supported by Java. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6528 | |`replacement` |The content which should be used instead of the current one. |
| 6529 | |========================== |
| 6530 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6531 | [[git-person-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6532 | === GitPersonInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6533 | The `GitPersonInfo` entity contains information about the |
| 6534 | author/committer of a commit. |
| 6535 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6536 | [options="header",cols="1,6"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6537 | |========================== |
| 6538 | |Field Name |Description |
| 6539 | |`name` |The name of the author/committer. |
| 6540 | |`email` |The email address of the author/committer. |
| 6541 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 6542 | this identity was constructed. |
| 6543 | |`tz` |The timezone offset from UTC of when this identity was |
| 6544 | constructed. |
| 6545 | |========================== |
| 6546 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6547 | [[group-base-info]] |
| 6548 | === GroupBaseInfo |
| 6549 | The `GroupBaseInfo` entity contains base information about the group. |
| 6550 | |
| 6551 | [options="header",cols="1,6"] |
| 6552 | |========================== |
| 6553 | |Field Name |Description |
Edwin Kempin | 703613c | 2016-11-25 16:06:04 +0100 | [diff] [blame] | 6554 | |`id` |The UUID of the group. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6555 | |`name` |The name of the group. |
| 6556 | |========================== |
| 6557 | |
David Pursehouse | d9dac37 | 2016-11-24 19:41:10 +0900 | [diff] [blame] | 6558 | [[hashtags-input]] |
| 6559 | === HashtagsInput |
| 6560 | |
| 6561 | The `HashtagsInput` entity contains information about hashtags to add to, |
| 6562 | and/or remove from, a change. |
| 6563 | |
| 6564 | [options="header",cols="1,^1,5"] |
| 6565 | |======================= |
| 6566 | |Field Name||Description |
| 6567 | |`add` |optional|The list of hashtags to be added to the change. |
| 6568 | |`remove |optional|The list of hashtags to be removed from the change. |
| 6569 | |======================= |
| 6570 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6571 | [[included-in-info]] |
| 6572 | === IncludedInInfo |
| 6573 | The `IncludedInInfo` entity contains information about the branches a |
| 6574 | change was merged into and tags it was tagged with. |
| 6575 | |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 6576 | [options="header",cols="1,^1,5"] |
| 6577 | |======================= |
| 6578 | |Field Name||Description |
| 6579 | |`branches`||The list of branches this change was merged into. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6580 | Each branch is listed without the 'refs/head/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 6581 | |`tags` ||The list of tags this change was tagged with. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6582 | Each tag is listed without the 'refs/tags/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 6583 | |`external`|optional|A map that maps a name to a list of external |
| 6584 | systems that include this change, e.g. a list of servers on which this |
| 6585 | change is deployed. |
| 6586 | |======================= |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6587 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6588 | [[label-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6589 | === LabelInfo |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6590 | The `LabelInfo` entity contains information about a label on a change, always |
| 6591 | corresponding to the current patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6592 | |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6593 | There are two options that control the contents of `LabelInfo`: |
Dave Borowitz | 7d6aa01 | 2013-06-14 16:53:48 -0700 | [diff] [blame] | 6594 | link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`]. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6595 | |
| 6596 | * For a quick summary of the state of labels, use `LABELS`. |
| 6597 | * For detailed information about labels, including exact numeric votes for all |
| 6598 | users and the allowed range of votes for the current user, use `DETAILED_LABELS`. |
| 6599 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6600 | ==== Common fields |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6601 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6602 | |=========================== |
| 6603 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6604 | |`optional` |not set if `false`| |
| 6605 | Whether the label is optional. Optional means the label may be set, but |
| 6606 | it's neither necessary for submission nor does it block submission if |
| 6607 | set. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6608 | |=========================== |
| 6609 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6610 | ==== Fields set by `LABELS` |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6611 | [options="header",cols="1,^1,5"] |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6612 | |=========================== |
| 6613 | |Field Name ||Description |
| 6614 | |`approved` |optional|One user who approved this label on the change |
| 6615 | (voted the maximum value) as an |
| 6616 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6617 | |`rejected` |optional|One user who rejected this label on the change |
| 6618 | (voted the minimum value) as an |
| 6619 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6620 | |`recommended` |optional|One user who recommended this label on the |
| 6621 | change (voted positively, but not the maximum value) as an |
| 6622 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6623 | |`disliked` |optional|One user who disliked this label on the change |
| 6624 | (voted negatively, but not the minimum value) as an |
| 6625 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
David Ostrovsky | 5292fd7 | 2014-02-27 21:56:35 +0100 | [diff] [blame] | 6626 | |`blocking` |optional|If `true`, the label blocks submit operation. |
| 6627 | If not set, the default is false. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6628 | |`value` |optional|The voting value of the user who |
| 6629 | recommended/disliked this label on the change if it is not |
| 6630 | "`+1`"/"`-1`". |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 6631 | |`default_value`|optional|The default voting value for the label. |
| 6632 | This value may be outside the range specified in permitted_labels. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6633 | |=========================== |
| 6634 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6635 | ==== Fields set by `DETAILED_LABELS` |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6636 | [options="header",cols="1,^1,5"] |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6637 | |=========================== |
| 6638 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6639 | |`all` |optional|List of all approvals for this label as a list |
Aaron Gable | ea8a211 | 2017-04-25 14:18:16 -0700 | [diff] [blame] | 6640 | of link:#approval-info[ApprovalInfo] entities. Items in this list may |
| 6641 | not represent actual votes cast by users; if a user votes on any label, |
| 6642 | a corresponding ApprovalInfo will appear in this list for all labels. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6643 | |`values` |optional|A map of all values that are allowed for this |
| 6644 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6645 | to the value descriptions. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6646 | |=========================== |
| 6647 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6648 | [[mergeable-info]] |
| 6649 | === MergeableInfo |
| 6650 | The `MergeableInfo` entity contains information about the mergeability of a |
| 6651 | change. |
| 6652 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6653 | [options="header",cols="1,^1,5"] |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6654 | |============================ |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 6655 | |Field Name ||Description |
| 6656 | |`submit_type` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6657 | Submit type used for this change, can be `MERGE_IF_NECESSARY`, |
Gert van Dijk | a4e49d0 | 2017-08-27 22:50:40 +0200 | [diff] [blame] | 6658 | `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6659 | `CHERRY_PICK`. |
Zhen Chen | ec13e45 | 2016-08-03 23:29:43 -0700 | [diff] [blame] | 6660 | |`strategy` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 6661 | The strategy of the merge, can be `recursive`, `resolve`, |
| 6662 | `simple-two-way-in-core`, `ours` or `theirs`. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 6663 | |`mergeable` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6664 | `true` if this change is cleanly mergeable, `false` otherwise |
Zhen Chen | 8f00d55 | 2016-07-26 16:54:59 -0700 | [diff] [blame] | 6665 | |`commit_merged` |optional| |
| 6666 | `true` if this change is already merged, `false` otherwise |
| 6667 | |`content_merged` |optional| |
| 6668 | `true` if the content of this change is already merged, `false` otherwise |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 6669 | |`conflicts`|optional| |
| 6670 | A list of paths with conflicts |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 6671 | |`mergeable_into`|optional| |
| 6672 | A list of other branch names where this change could merge cleanly |
Saša Živkov | 76bab29 | 2014-05-08 14:29:12 +0200 | [diff] [blame] | 6673 | |============================ |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6674 | |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 6675 | [[merge-input]] |
| 6676 | === MergeInput |
| 6677 | The `MergeInput` entity contains information about the merge |
| 6678 | |
| 6679 | [options="header",cols="1,^1,5"] |
| 6680 | |============================ |
| 6681 | |Field Name ||Description |
| 6682 | |`source` || |
| 6683 | The source to merge from, e.g. a complete or abbreviated commit SHA-1, |
David Pursehouse | 4abaef93 | 2018-03-18 15:05:08 +0900 | [diff] [blame] | 6684 | a complete reference name, a short reference name under `refs/heads`, `refs/tags`, |
| 6685 | or `refs/remotes` namespace, etc. |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 6686 | |`strategy` |optional| |
| 6687 | The strategy of the merge, can be `recursive`, `resolve`, |
| 6688 | `simple-two-way-in-core`, `ours` or `theirs`, default will use project settings. |
| 6689 | |============================ |
| 6690 | |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 6691 | [[merge-patch-set-input]] |
| 6692 | === MergePatchSetInput |
| 6693 | The `MergePatchSetInput` entity contains information about updating a new |
| 6694 | change by creating a new merge commit. |
| 6695 | |
| 6696 | [options="header",cols="1,^1,5"] |
| 6697 | |================================== |
| 6698 | |Field Name ||Description |
| 6699 | |`subject` |optional| |
| 6700 | The new subject for the change, if not specified, will reuse the current patch |
| 6701 | set's subject |
Han-Wen Nienhuys | bd2af0c | 2020-01-09 16:39:26 +0100 | [diff] [blame] | 6702 | |`inherit_parent` |optional, default to `false`| |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 6703 | Use the current patch set's first parent as the merge tip when set to `true`. |
Changcheng Xiao | 9bdedaf | 2017-10-24 09:34:42 +0200 | [diff] [blame] | 6704 | |`base_change` |optional| |
Han-Wen Nienhuys | bd2af0c | 2020-01-09 16:39:26 +0100 | [diff] [blame] | 6705 | A link:#change-id[\{change-id\}] that identifies a change. When `inherit_parent` |
Changcheng Xiao | 9bdedaf | 2017-10-24 09:34:42 +0200 | [diff] [blame] | 6706 | is `false`, the merge tip will be the current patch set of the `base_change` if |
| 6707 | it's set. Otherwise, the current branch tip of the destination branch will be used. |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 6708 | |`merge` || |
| 6709 | The detail of the source commit for merge as a link:#merge-input[MergeInput] |
| 6710 | entity. |
| 6711 | |================================== |
| 6712 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 6713 | [[move-input]] |
| 6714 | === MoveInput |
| 6715 | The `MoveInput` entity contains information for moving a change to a new branch. |
| 6716 | |
| 6717 | [options="header",cols="1,^1,5"] |
| 6718 | |=========================== |
Michael Zhou | d03fe28 | 2016-04-25 17:13:17 -0400 | [diff] [blame] | 6719 | |Field Name ||Description |
| 6720 | |`destination_branch`||Destination branch |
| 6721 | |`message` |optional| |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 6722 | A message to be posted in this change's comments |
| 6723 | |=========================== |
| 6724 | |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6725 | [[notify-info]] |
| 6726 | === NotifyInfo |
| 6727 | The `NotifyInfo` entity contains detailed information about who should |
| 6728 | be notified about an update. These notifications are sent out even if a |
| 6729 | `notify` option in the request input disables normal notifications. |
| 6730 | `NotifyInfo` entities are normally contained in a `notify_details` map |
| 6731 | in the request input where the key is the recipient type. The recipient |
| 6732 | type can be `TO`, `CC` and `BCC`. |
| 6733 | |
| 6734 | [options="header",cols="1,^1,5"] |
| 6735 | |======================= |
| 6736 | |Field Name||Description |
| 6737 | |`accounts`|optional| |
| 6738 | A list of link:rest-api-accounts.html#account-id[account IDs] that |
| 6739 | identify the accounts that should be should be notified. |
| 6740 | |======================= |
| 6741 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 6742 | [[private-input]] |
| 6743 | === PrivateInput |
| 6744 | The `PrivateInput` entity contains information for changing the private |
| 6745 | flag on a change. |
| 6746 | |
| 6747 | [options="header",cols="1,^1,5"] |
| 6748 | |======================= |
| 6749 | |Field Name||Description |
| 6750 | |`message` |optional|Message describing why the private flag was changed. |
| 6751 | |======================= |
| 6752 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6753 | [[problem-info]] |
| 6754 | === ProblemInfo |
| 6755 | The `ProblemInfo` entity contains a description of a potential consistency problem |
| 6756 | with a change. These are not related to the code review process, but rather |
| 6757 | indicate some inconsistency in Gerrit's database or repository metadata related |
| 6758 | to the enclosing change. |
| 6759 | |
| 6760 | [options="header",cols="1,^1,5"] |
| 6761 | |=========================== |
| 6762 | |Field Name||Description |
| 6763 | |`message` ||Plaintext message describing the problem with the change. |
| 6764 | |`status` |optional| |
| 6765 | The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a |
| 6766 | fix was attempted. |
| 6767 | |`outcome` |optional| |
| 6768 | If `status` is set, an additional plaintext message describing the |
| 6769 | outcome of the fix. |
| 6770 | |=========================== |
| 6771 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 6772 | [[publish-change-edit-input]] |
| 6773 | === PublishChangeEditInput |
| 6774 | The `PublishChangeEditInput` entity contains options for the publishing of |
| 6775 | change edit. |
| 6776 | |
| 6777 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6778 | |============================= |
| 6779 | |Field Name ||Description |
| 6780 | |`notify` |optional| |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 6781 | Notify handling that defines to whom email notifications should be sent |
| 6782 | after the change edit is published. + |
| 6783 | Allowed values are `NONE` and `ALL`. + |
| 6784 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6785 | |`notify_details`|optional| |
| 6786 | Additional information about whom to notify about the update as a map |
| 6787 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 6788 | |============================= |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 6789 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 6790 | [[pure-revert-info]] |
| 6791 | === PureRevertInfo |
| 6792 | The `PureRevertInfo` entity describes the result of a pure revert check. |
| 6793 | |
| 6794 | [options="header",cols="1,6"] |
| 6795 | |====================== |
| 6796 | |Field Name |Description |
| 6797 | |`is_pure_revert` |Outcome of the check as boolean. |
| 6798 | |====================== |
| 6799 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 6800 | [[push-certificate-info]] |
| 6801 | === PushCertificateInfo |
| 6802 | The `PushCertificateInfo` entity contains information about a push |
| 6803 | certificate provided when the user pushed for review with `git push |
| 6804 | --signed HEAD:refs/for/<branch>`. Only used when signed push is |
| 6805 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the server. |
| 6806 | |
| 6807 | [options="header",cols="1,6"] |
| 6808 | |=========================== |
| 6809 | |Field Name|Description |
| 6810 | |`certificate`|Signed certificate payload and GPG signature block. |
| 6811 | |`key` | |
| 6812 | Information about the key that signed the push, along with any problems |
| 6813 | found while checking the signature or the key itself, as a |
| 6814 | link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity. |
| 6815 | |=========================== |
| 6816 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 6817 | [[range-info]] |
| 6818 | === RangeInfo |
| 6819 | The `RangeInfo` entity stores the coordinates of a range. |
| 6820 | |
| 6821 | [options="header",cols="1,6"] |
| 6822 | |=========================== |
| 6823 | |Field Name | Description |
| 6824 | |`start` | First index. |
| 6825 | |`end` | Last index. |
| 6826 | |=========================== |
| 6827 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 6828 | [[rebase-input]] |
| 6829 | === RebaseInput |
| 6830 | The `RebaseInput` entity contains information for changing parent when rebasing. |
| 6831 | |
| 6832 | [options="header",width="50%",cols="1,^1,5"] |
| 6833 | |=========================== |
| 6834 | |Field Name ||Description |
| 6835 | |`base` |optional| |
| 6836 | The new parent revision. This can be a ref or a SHA1 to a concrete patchset. + |
| 6837 | Alternatively, a change number can be specified, in which case the current |
| 6838 | patch set is inferred. + |
| 6839 | Empty string is used for rebasing directly on top of the target branch, |
| 6840 | which effectively breaks dependency towards a parent change. |
| 6841 | |=========================== |
| 6842 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6843 | [[related-change-and-commit-info]] |
| 6844 | === RelatedChangeAndCommitInfo |
| 6845 | |
| 6846 | The `RelatedChangeAndCommitInfo` entity contains information about |
| 6847 | a related change and commit. |
| 6848 | |
| 6849 | [options="header",cols="1,^1,5"] |
| 6850 | |=========================== |
| 6851 | |Field Name ||Description |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 6852 | |`project` ||The project of the change or commit. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6853 | |`change_id` |optional|The Change-Id of the change. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6854 | |`commit` ||The commit as a |
| 6855 | link:#commit-info[CommitInfo] entity. |
| 6856 | |`_change_number` |optional|The change number. |
| 6857 | |`_revision_number` |optional|The revision number. |
| 6858 | |`_current_revision_number`|optional|The current revision number. |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 6859 | |`status` |optional|The status of the change. The status of |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 6860 | the change is one of (`NEW`, `MERGED`, `ABANDONED`). |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6861 | |=========================== |
| 6862 | |
| 6863 | [[related-changes-info]] |
| 6864 | === RelatedChangesInfo |
| 6865 | The `RelatedChangesInfo` entity contains information about related |
| 6866 | changes. |
| 6867 | |
| 6868 | [options="header",cols="1,6"] |
| 6869 | |=========================== |
| 6870 | |Field Name |Description |
| 6871 | |`changes` |A list of |
| 6872 | link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities |
| 6873 | describing the related changes. Sorted by git commit order, newest to |
| 6874 | oldest. Empty if there are no related changes. |
| 6875 | |=========================== |
| 6876 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 6877 | |
| 6878 | [[requirement]] |
| 6879 | === Requirement |
| 6880 | The `Requirement` entity contains information about a requirement relative to a change. |
| 6881 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 6882 | [options="header",cols="1,^1,5"] |
| 6883 | |=========================== |
| 6884 | |Field Name | |Description |
| 6885 | |`status` | | Status of the requirement. Can be either `OK`, `NOT_READY` or `RULE_ERROR`. |
Sven Selberg | e748e3f | 2020-09-24 13:44:56 +0200 | [diff] [blame] | 6886 | |`fallback_text` | | A human readable reason |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 6887 | |`type` | | |
| 6888 | Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it |
| 6889 | was triggered. Can be seen as a class: requirements sharing the same type were created for a similar |
| 6890 | reason, and the data structure will follow one set of rules. |
| 6891 | |`data` |optional| |
| 6892 | Holds custom key-value strings, used in templates to render richer status messages |
| 6893 | |=========================== |
| 6894 | |
| 6895 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6896 | [[restore-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6897 | === RestoreInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6898 | The `RestoreInput` entity contains information for restoring a change. |
| 6899 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6900 | [options="header",cols="1,^1,5"] |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6901 | |=========================== |
| 6902 | |Field Name ||Description |
| 6903 | |`message` |optional| |
| 6904 | Message to be added as review comment to the change when restoring the |
| 6905 | change. |
| 6906 | |=========================== |
| 6907 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 6908 | [[revert-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6909 | === RevertInput |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 6910 | The `RevertInput` entity contains information for reverting a change. |
| 6911 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6912 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 6913 | |============================= |
| 6914 | |Field Name ||Description |
| 6915 | |`message` |optional| |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 6916 | Message to be added as review comment to the change when reverting the |
| 6917 | change. |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 6918 | |`notify` |optional| |
| 6919 | Notify handling that defines to whom email notifications should be sent |
| 6920 | for reverting the change. + |
| 6921 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6922 | If not set, the default is `ALL`. |
| 6923 | |`notify_details`|optional| |
| 6924 | Additional information about whom to notify about the revert as a map |
| 6925 | of recipient type to link:#notify-info[NotifyInfo] entity. |
Gal Paikin | cc93c56 | 2019-10-09 13:24:12 +0200 | [diff] [blame] | 6926 | |`topic` |optional| |
| 6927 | Name of the topic for the revert change. If not set, the default is the topic |
| 6928 | of the change being reverted. |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 6929 | |============================= |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 6930 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6931 | [[review-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6932 | === ReviewInfo |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6933 | The `ReviewInfo` entity contains information about a review. |
| 6934 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6935 | [options="header",cols="1,6"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6936 | |=========================== |
| 6937 | |Field Name |Description |
| 6938 | |`labels` | |
| 6939 | The labels of the review as a map that maps the label names to the |
| 6940 | voting values. |
| 6941 | |=========================== |
| 6942 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 6943 | [[review-update-info]] |
| 6944 | === ReviewerUpdateInfo |
| 6945 | The `ReviewerUpdateInfo` entity contains information about updates to |
| 6946 | change's reviewers set. |
| 6947 | |
| 6948 | [options="header",cols="1,6"] |
| 6949 | |=========================== |
| 6950 | |Field Name |Description |
| 6951 | |`updated`| |
| 6952 | Timestamp of the update. |
| 6953 | |`updated_by`| |
| 6954 | The account which modified state of the reviewer in question as |
| 6955 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6956 | |`reviewer`| |
| 6957 | The reviewer account added or removed from the change as an |
| 6958 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6959 | |`state`| |
| 6960 | The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`. |
| 6961 | |=========================== |
| 6962 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6963 | [[review-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6964 | === ReviewInput |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6965 | The `ReviewInput` entity contains information for adding a review to a |
| 6966 | revision. |
| 6967 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6968 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6969 | |============================ |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 6970 | |Field Name ||Description |
| 6971 | |`message` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6972 | The message to be added as review comment. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6973 | |`tag` |optional| |
| 6974 | Apply this tag to the review comment message, votes, and inline |
| 6975 | comments. Tags may be used by CI or other automated systems to |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 6976 | distinguish them from human reviews. Votes/comments that contain `tag` with |
| 6977 | 'autogenerated:' prefix can be filtered out in the web UI. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 6978 | |`labels` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6979 | The votes that should be added to the revision as a map that maps the |
| 6980 | label names to the voting values. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 6981 | |`comments` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6982 | The comments that should be added as a map that maps a file path to a |
| 6983 | list of link:#comment-input[CommentInput] entities. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 6984 | |`robot_comments` |optional| |
| 6985 | The robot comments that should be added as a map that maps a file path |
| 6986 | to a list of link:#robot-comment-input[RobotCommentInput] entities. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 6987 | |`drafts` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6988 | Draft handling that defines how draft comments are handled that are |
| 6989 | already in the database but that were not also described in this |
| 6990 | input. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 6991 | Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values |
| 6992 | except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. + |
Dave Borowitz | c064054 | 2016-10-05 16:19:21 -0400 | [diff] [blame] | 6993 | Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 6994 | If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value |
| 6995 | besides `KEEP` is allowed. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 6996 | |`notify` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6997 | Notify handling that defines to whom email notifications should be sent |
| 6998 | after the review is stored. + |
| 6999 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7000 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7001 | |`notify_details` |optional| |
| 7002 | Additional information about whom to notify about the update as a map |
| 7003 | of recipient type to link:#notify-info[NotifyInfo] entity. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 7004 | |`omit_duplicate_comments`|optional| |
| 7005 | If `true`, comments with the same content at the same place will be omitted. |
| 7006 | |`on_behalf_of` |optional| |
Shawn Pearce | 9d78312 | 2013-06-11 18:18:03 -0700 | [diff] [blame] | 7007 | link:rest-api-accounts.html#account-id[\{account-id\}] the review |
| 7008 | should be posted on behalf of. To use this option the caller must |
| 7009 | have been granted `labelAs-NAME` permission for all keys of labels. |
Patrick Hiesel | cf6d935 | 2017-04-13 10:15:42 +0200 | [diff] [blame] | 7010 | |`reviewers` |optional| |
| 7011 | A list of link:rest-api-changes.html#reviewer-input[ReviewerInput] |
| 7012 | representing reviewers that should be added to the change. |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 7013 | |`ready` |optional| |
| 7014 | If true, and if the change is work in progress, then start review. |
| 7015 | It is an error for both `ready` and `work_in_progress` to be true. |
| 7016 | |`work_in_progress` |optional| |
| 7017 | If true, mark the change as work in progress. It is an error for both |
| 7018 | `ready` and `work_in_progress` to be true. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7019 | |============================ |
| 7020 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 7021 | [[review-result]] |
| 7022 | === ReviewResult |
| 7023 | The `ReviewResult` entity contains information regarding the updates |
| 7024 | that were made to a review. |
| 7025 | |
| 7026 | [options="header",cols="1,^1,5"] |
| 7027 | |============================ |
| 7028 | |Field Name ||Description |
| 7029 | |`labels` |optional| |
| 7030 | Map of labels to values after the review was posted. Null if any reviewer |
| 7031 | additions were rejected. |
| 7032 | |`reviewers` |optional| |
| 7033 | Map of account or group identifier to |
| 7034 | link:rest-api-changes.html#add-reviewer-result[AddReviewerResult] |
| 7035 | representing the outcome of adding as a reviewer. |
| 7036 | Absent if no reviewer additions were requested. |
Logan Hanks | e81ad8e | 2017-07-18 09:45:46 -0700 | [diff] [blame] | 7037 | |`ready` |optional| |
| 7038 | If true, the change was moved from WIP to ready for review as a result of this |
| 7039 | action. Not set if false. |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 7040 | |============================ |
| 7041 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7042 | [[reviewer-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7043 | === ReviewerInfo |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7044 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 7045 | votes on a change. |
| 7046 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 7047 | `ReviewerInfo` has the same fields as |
| 7048 | link:rest-api-accounts.html#account-info[AccountInfo] and includes |
| 7049 | link:#detailed-accounts[detailed account information]. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7050 | In addition `ReviewerInfo` has the following fields: |
| 7051 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7052 | [options="header",cols="1,6"] |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7053 | |========================== |
| 7054 | |Field Name |Description |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7055 | |`approvals` | |
| 7056 | The approvals of the reviewer as a map that maps the label names to the |
David Pursehouse | 778fefc | 2014-09-01 14:32:52 +0900 | [diff] [blame] | 7057 | approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`"). |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 7058 | |`_account_id` | |
| 7059 | This field is inherited from `AccountInfo` but is optional here if an |
| 7060 | unregistered reviewer was added by email. See |
| 7061 | link:rest-api-changes.html#add-reviewer[add-reviewer] for details. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7062 | |========================== |
| 7063 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7064 | [[reviewer-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7065 | === ReviewerInput |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7066 | The `ReviewerInput` entity contains information for adding a reviewer |
| 7067 | to a change. |
| 7068 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7069 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7070 | |============================= |
| 7071 | |Field Name ||Description |
| 7072 | |`reviewer` || |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7073 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 7074 | should be added as reviewer or the link:rest-api-groups.html#group-id[ |
| 7075 | ID] of one group for which all members should be added as reviewers. + |
| 7076 | If an ID identifies both an account and a group, only the account is |
| 7077 | added as reviewer to the change. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7078 | |`state` |optional| |
Logan Hanks | ee0a418 | 2016-07-06 14:39:26 -0700 | [diff] [blame] | 7079 | Add reviewer in this state. Possible reviewer states are `REVIEWER` |
| 7080 | and `CC`. If not given, defaults to `REVIEWER`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7081 | |`confirmed` |optional| |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7082 | Whether adding the reviewer is confirmed. + |
| 7083 | The Gerrit server may be configured to |
| 7084 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 7085 | confirmation] when adding a group as reviewer that has many members. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7086 | |`notify` |optional| |
Sven Selberg | 4d64f97 | 2016-09-26 16:15:02 +0200 | [diff] [blame] | 7087 | Notify handling that defines to whom email notifications should be sent |
| 7088 | after the reviewer is added. + |
| 7089 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7090 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7091 | |`notify_details`|optional| |
| 7092 | Additional information about whom to notify about the update as a map |
| 7093 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 7094 | |============================= |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7095 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7096 | [[revision-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7097 | === RevisionInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7098 | The `RevisionInfo` entity contains information about a patch set. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 7099 | Not all fields are returned by default. Additional fields can |
| 7100 | be obtained by adding `o` parameters as described in |
| 7101 | link:#list-changes[Query Changes]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7102 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7103 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7104 | |=========================== |
| 7105 | |Field Name ||Description |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 7106 | |`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`, |
| 7107 | `MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`. |
Kasper Nilsson | be3616d | 2018-01-23 14:10:36 -0800 | [diff] [blame] | 7108 | |`_number` ||The patch set number, or `edit` if the patch set is an edit. |
Edwin Kempin | 04cbd34 | 2015-02-19 16:31:22 +0100 | [diff] [blame] | 7109 | |`created` || |
| 7110 | The link:rest-api.html#timestamp[timestamp] of when the patch set was |
| 7111 | created. |
| 7112 | |`uploader` || |
| 7113 | The uploader of the patch set as an |
| 7114 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 7115 | |`ref` ||The Git reference for the patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7116 | |`fetch` || |
| 7117 | Information about how to fetch this patch set. The fetch information is |
| 7118 | provided as a map that maps the protocol name ("`git`", "`http`", |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 7119 | "`ssh`") to link:#fetch-info[FetchInfo] entities. This information is |
| 7120 | only included if a plugin implementing the |
| 7121 | link:intro-project-owner.html#download-commands[download commands] |
| 7122 | interface is installed. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 7123 | |`commit` |optional|The commit of the patch set as |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7124 | link:#commit-info[CommitInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 7125 | |`files` |optional| |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7126 | The files of the patch set as a map that maps the file names to |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 7127 | link:#file-info[FileInfo] entities. Only set if |
| 7128 | link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES] |
| 7129 | option is requested. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 7130 | |`actions` |optional| |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 7131 | Actions the caller might be able to perform on this revision. The |
| 7132 | information is a map of view name to link:#action-info[ActionInfo] |
| 7133 | entities. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 7134 | |`reviewed` |optional| |
| 7135 | Indicates whether the caller is authenticated and has commented on the |
| 7136 | current revision. Only set if link:#reviewed[REVIEWED] option is requested. |
Quinten Yearsley | 28cd212 | 2019-06-10 14:41:13 -0700 | [diff] [blame] | 7137 | |`commit_with_footers` |optional| |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 7138 | If the link:#commit-footers[COMMIT_FOOTERS] option is requested and |
| 7139 | this is the current patch set, contains the full commit message with |
| 7140 | Gerrit-specific commit footers, as if this revision were submitted |
| 7141 | using the link:project-configuration.html#cherry_pick[Cherry Pick] |
| 7142 | submit type. |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 7143 | |`push_certificate` |optional| |
| 7144 | If the link:#push-certificates[PUSH_CERTIFICATES] option is requested, |
| 7145 | contains the push certificate provided by the user when uploading this |
| 7146 | patch set as a link:#push-certificate-info[PushCertificateInfo] entity. |
| 7147 | This field is always set if the option is requested; if no push |
| 7148 | certificate was provided, it is set to an empty object. |
Aaron Gable | 621c9b6 | 2017-04-21 09:24:20 -0700 | [diff] [blame] | 7149 | |`description` |optional| |
| 7150 | The description of this patchset, as displayed in the patchset |
| 7151 | selector menu. May be null if no description is set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7152 | |=========================== |
| 7153 | |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7154 | [[robot-comment-info]] |
| 7155 | === RobotCommentInfo |
| 7156 | The `RobotCommentInfo` entity contains information about a robot inline |
| 7157 | comment. |
| 7158 | |
Alice Kober-Sotzek | 265805d | 2016-12-07 15:24:21 +0100 | [diff] [blame] | 7159 | `RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7160 | In addition `RobotCommentInfo` has the following fields: |
| 7161 | |
| 7162 | [options="header",cols="1,^1,5"] |
| 7163 | |=========================== |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7164 | |Field Name ||Description |
| 7165 | |`robot_id` ||The ID of the robot that generated this comment. |
| 7166 | |`robot_run_id` ||An ID of the run of the robot. |
| 7167 | |`url` |optional|URL to more information. |
| 7168 | |`properties` |optional|Robot specific properties as map that maps arbitrary |
| 7169 | keys to values. |
| 7170 | |`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of |
| 7171 | <<fix-suggestion-info,FixSuggestionInfo>> entities. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7172 | |=========================== |
| 7173 | |
| 7174 | [[robot-comment-input]] |
| 7175 | === RobotCommentInput |
| 7176 | The `RobotCommentInput` entity contains information for creating an inline |
| 7177 | robot comment. |
| 7178 | |
Alice Kober-Sotzek | 265805d | 2016-12-07 15:24:21 +0100 | [diff] [blame] | 7179 | `RobotCommentInput` has the same fields as |
| 7180 | <<robot-comment-info,RobotCommentInfo>>. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7181 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7182 | [[rule-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7183 | === RuleInput |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7184 | The `RuleInput` entity contains information to test a Prolog rule. |
| 7185 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7186 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7187 | |=========================== |
| 7188 | |Field Name ||Description |
| 7189 | |`rule`|| |
| 7190 | Prolog code to execute instead of the code in `refs/meta/config`. |
| 7191 | |`filters`|`RUN` if not set| |
| 7192 | When `RUN` filter rules in the parent projects are called to |
| 7193 | post-process the results of the project specific rule. This |
| 7194 | behavior matches how the rule will execute if installed. + |
| 7195 | If `SKIP` the parent filters are not called, allowing the test |
| 7196 | to return results from the input rule. |
| 7197 | |=========================== |
| 7198 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 7199 | [[submit-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7200 | === SubmitInfo |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 7201 | The `SubmitInfo` entity contains information about the change status |
| 7202 | after submitting. |
| 7203 | |
Stefan Beller | e4785b4 | 2015-06-18 12:31:03 -0700 | [diff] [blame] | 7204 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 7205 | |========================== |
Stefan Beller | e4785b4 | 2015-06-18 12:31:03 -0700 | [diff] [blame] | 7206 | |Field Name ||Description |
| 7207 | |`status` || |
Stefan Beller | 0d3cab0 | 2015-07-10 13:32:57 -0700 | [diff] [blame] | 7208 | The status of the change after submitting is `MERGED`. |
David Ostrovsky | 868e341 | 2014-01-30 19:50:57 +0100 | [diff] [blame] | 7209 | |`on_behalf_of`|optional| |
| 7210 | The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on |
| 7211 | whose behalf the action should be done. To use this option the caller must |
David Pursehouse | 22bd6f9 | 2014-02-20 21:11:01 +0900 | [diff] [blame] | 7212 | have been granted both `Submit` and `Submit (On Behalf Of)` permissions. |
| 7213 | The user named by `on_behalf_of` does not need to be granted the `Submit` |
| 7214 | permission. This feature is aimed for CI solutions: the CI account can be |
David Pursehouse | a61ee50 | 2016-09-06 16:27:09 +0900 | [diff] [blame] | 7215 | granted both permissions, so individual users don't need `Submit` permission |
| 7216 | themselves. Still the changes can be submitted on behalf of real users and |
David Pursehouse | 22bd6f9 | 2014-02-20 21:11:01 +0900 | [diff] [blame] | 7217 | not with the identity of the CI account. |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 7218 | |========================== |
| 7219 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 7220 | [[submit-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7221 | === SubmitInput |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 7222 | The `SubmitInput` entity contains information for submitting a change. |
| 7223 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7224 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7225 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 7226 | |Field Name ||Description |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7227 | |`on_behalf_of` |optional| |
Dave Borowitz | c6d143d | 2016-02-24 12:32:23 -0500 | [diff] [blame] | 7228 | If set, submit the change on behalf of the given user. The value may take any |
| 7229 | format link:rest-api-accounts.html#account-id[accepted by the accounts REST |
| 7230 | API]. Using this option requires |
| 7231 | link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)] |
| 7232 | permission on the branch. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7233 | |`notify` |optional| |
Stephen Li | a5a5ef0 | 2016-03-31 16:55:53 -0700 | [diff] [blame] | 7234 | Notify handling that defines to whom email notifications should be sent after |
| 7235 | the change is submitted. + |
| 7236 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7237 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7238 | |`notify_details`|optional| |
| 7239 | Additional information about whom to notify about the update as a map |
| 7240 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 7241 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 7242 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7243 | [[submit-record]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7244 | === SubmitRecord |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7245 | The `SubmitRecord` entity describes results from a submit_rule. |
Dave Borowitz | 6453fce | 2016-09-22 16:11:56 +0200 | [diff] [blame] | 7246 | Fields in this entity roughly correspond to the fields set by `LABELS` |
| 7247 | in link:#label-info[LabelInfo]. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7248 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7249 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7250 | |=========================== |
| 7251 | |Field Name ||Description |
| 7252 | |`status`|| |
| 7253 | `OK`, the change can be submitted. + |
| 7254 | `NOT_READY`, additional labels are required before submit. + |
| 7255 | `CLOSED`, closed changes cannot be submitted. + |
| 7256 | `RULE_ERROR`, rule code failed with an error. |
| 7257 | |`ok`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 7258 | Map of labels that are approved; an |
| 7259 | link:rest-api-accounts.html#account-info[AccountInfo] identifies the |
| 7260 | voter chosen by the rule. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7261 | |`reject`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 7262 | Map of labels that are preventing submit; |
| 7263 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7264 | |`need`|optional| |
| 7265 | Map of labels that need to be given to submit. The value is |
| 7266 | currently an empty object. |
| 7267 | |`may`|optional| |
| 7268 | Map of labels that can be used, but do not affect submit. |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 7269 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter, |
| 7270 | if the label has been applied. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7271 | |`impossible`|optional| |
| 7272 | Map of labels that should have been in `need` but cannot be |
| 7273 | used by any user because of access restrictions. The value |
| 7274 | is currently an empty object. |
| 7275 | |`error_message`|optional| |
| 7276 | When status is RULE_ERROR this message provides some text describing |
| 7277 | the failure of the rule predicate. |
| 7278 | |=========================== |
| 7279 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 7280 | [[submitted-together-info]] |
| 7281 | === SubmittedTogetherInfo |
| 7282 | The `SubmittedTogetherInfo` entity contains information about a |
| 7283 | collection of changes that would be submitted together. |
| 7284 | |
| 7285 | [options="header",cols="1,6"] |
| 7286 | |=========================== |
| 7287 | |Field Name |Description |
| 7288 | |`changes` | |
| 7289 | A list of ChangeInfo entities representing the changes to be submitted together. |
| 7290 | |`non_visible_changes`| |
| 7291 | The number of changes to be submitted together that the current user |
| 7292 | cannot see. (This count includes changes that are visible to the |
| 7293 | current user when their reason for being submitted together involves |
| 7294 | changes the user cannot see.) |
| 7295 | |=========================== |
| 7296 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7297 | [[suggested-reviewer-info]] |
| 7298 | === SuggestedReviewerInfo |
| 7299 | The `SuggestedReviewerInfo` entity contains information about a reviewer |
| 7300 | that can be added to a change (an account or a group). |
| 7301 | |
| 7302 | `SuggestedReviewerInfo` has either the `account` field that contains |
| 7303 | the link:rest-api-accounts.html#account-info[AccountInfo] entity, or |
| 7304 | the `group` field that contains the |
| 7305 | link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity. |
| 7306 | |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 7307 | [options="header",cols="1,^1,5"] |
| 7308 | |=========================== |
| 7309 | |Field Name ||Description |
| 7310 | |`account` |optional| |
| 7311 | An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the |
| 7312 | suggestion is an account. |
| 7313 | |`group` |optional| |
| 7314 | A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the |
| 7315 | suggestion is a group. |
| 7316 | |`count` || |
| 7317 | The total number of accounts in the suggestion. This is `1` if `account` is |
| 7318 | present. If `group` is present, the total number of accounts that are |
| 7319 | members of the group is returned (this count includes members of nested |
| 7320 | groups). |
| 7321 | |`confirm` |optional| |
| 7322 | True if `group` is present and `count` is above the threshold where the |
| 7323 | `confirmed` flag must be passed to add the group as a reviewer. |
| 7324 | |=========================== |
| 7325 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 7326 | [[topic-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7327 | === TopicInput |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 7328 | The `TopicInput` entity contains information for setting a topic. |
| 7329 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7330 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 7331 | |=========================== |
| 7332 | |Field Name ||Description |
| 7333 | |`topic` |optional|The topic. + |
| 7334 | The topic will be deleted if not set. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 7335 | |=========================== |
| 7336 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 7337 | [[tracking-id-info]] |
| 7338 | === TrackingIdInfo |
| 7339 | The `TrackingIdInfo` entity describes a reference to an external tracking system. |
| 7340 | |
| 7341 | [options="header",cols="1,6"] |
| 7342 | |====================== |
| 7343 | |Field Name|Description |
| 7344 | |`system` |The name of the external tracking system. |
| 7345 | |`id` |The tracking id. |
| 7346 | |====================== |
| 7347 | |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 7348 | [[voting-range-info]] |
| 7349 | === VotingRangeInfo |
| 7350 | The `VotingRangeInfo` entity describes the continuous voting range from min |
| 7351 | to max values. |
| 7352 | |
| 7353 | [options="header",cols="1,6"] |
| 7354 | |====================== |
| 7355 | |Field Name|Description |
| 7356 | |`min` |The minimum voting value. |
| 7357 | |`max` |The maximum voting value. |
| 7358 | |====================== |
| 7359 | |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 7360 | [[web-link-info]] |
| 7361 | === WebLinkInfo |
| 7362 | The `WebLinkInfo` entity describes a link to an external site. |
| 7363 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7364 | [options="header",cols="1,6"] |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 7365 | |====================== |
| 7366 | |Field Name|Description |
| 7367 | |`name` |The link name. |
| 7368 | |`url` |The link URL. |
Sven Selberg | 5548420 | 2014-06-26 08:48:51 +0200 | [diff] [blame] | 7369 | |`image_url`|URL to the icon of the link. |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 7370 | |====================== |
| 7371 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 7372 | [[work-in-progress-input]] |
| 7373 | === WorkInProgressInput |
| 7374 | The `WorkInProgressInput` entity contains additional information for a change |
| 7375 | set to WorkInProgress/ReadyForReview. |
| 7376 | |
| 7377 | [options="header",cols="1,^1,5"] |
| 7378 | |============================= |
| 7379 | |Field Name ||Description |
| 7380 | |`message` |optional| |
| 7381 | Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview. |
| 7382 | |============================= |
| 7383 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 7384 | GERRIT |
| 7385 | ------ |
| 7386 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 7387 | |
| 7388 | SEARCHBOX |
| 7389 | --------- |