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 | |
| 141 | Clients are allowed to specify more than one query by setting the `q` |
| 142 | parameter multiple times. In this case the result is an array of |
| 143 | arrays, one per query in the same order the queries were given in. |
| 144 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 145 | .Query for the 25 most recent open changes of the projects that you watch |
| 146 | **** |
| 147 | get::/changes/?q=status:open+is:watched&n=25 |
| 148 | **** |
| 149 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 150 | Query that retrieves changes for a user's dashboard: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 151 | |
| 152 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 153 | ---- |
| 154 | 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] | 155 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 156 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 157 | .Response |
| 158 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 159 | HTTP/1.1 200 OK |
| 160 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 161 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 162 | |
| 163 | )]}' |
| 164 | [ |
| 165 | [ |
| 166 | { |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 167 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 168 | "project": "demo", |
| 169 | "branch": "master", |
| 170 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 171 | "subject": "One change", |
| 172 | "status": "NEW", |
| 173 | "created": "2012-07-17 07:18:30.854000000", |
| 174 | "updated": "2012-07-17 07:19:27.766000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 175 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 176 | "insertions": 4, |
| 177 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 178 | "_number": 1756, |
| 179 | "owner": { |
| 180 | "name": "John Doe" |
| 181 | }, |
| 182 | "labels": { |
| 183 | "Verified": {}, |
| 184 | "Code-Review": {} |
| 185 | } |
| 186 | } |
| 187 | ], |
| 188 | [], |
| 189 | [] |
| 190 | ] |
| 191 | ---- |
| 192 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 193 | .Query the changes for your user dashboard |
| 194 | **** |
| 195 | get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS |
| 196 | **** |
| 197 | |
David Pursehouse | 2cf2843 | 2016-08-21 23:20:08 +0900 | [diff] [blame] | 198 | [[query-options]] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 199 | Additional fields can be obtained by adding `o` parameters, each |
| 200 | option requires more database lookups and slows down the query |
| 201 | response time to the client so they are generally disabled by |
| 202 | default. Optional fields are: |
| 203 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 204 | [[labels]] |
| 205 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 206 | * `LABELS`: a summary of each label required for submit, and |
| 207 | approvers that have granted (or rejected) with that label. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 208 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 209 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 210 | [[detailed-labels]] |
| 211 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 212 | * `DETAILED_LABELS`: detailed label information, including numeric |
Dave Borowitz | 992ddd7 | 2013-02-13 11:53:17 -0800 | [diff] [blame] | 213 | values of all existing approvals, recognized label values, values |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 214 | permitted to be set by the current user, all reviewers by state, and |
| 215 | reviewers that may be removed by the current user. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 216 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 217 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 218 | [[current-revision]] |
| 219 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 220 | * `CURRENT_REVISION`: describe the current revision (patch set) |
| 221 | 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] | 222 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 223 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 224 | [[all-revisions]] |
| 225 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 226 | * `ALL_REVISIONS`: describe all revisions, not just current. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 227 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 228 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 229 | [[download-commands]] |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 230 | -- |
| 231 | * `DOWNLOAD_COMMANDS`: include the `commands` field in the |
| 232 | link:#fetch-info[FetchInfo] for revisions. Only valid when the |
| 233 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
| 234 | -- |
| 235 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 236 | [[current-commit]] |
| 237 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 238 | * `CURRENT_COMMIT`: parse and output all header fields from the |
David Pursehouse | 98006e8 | 2013-10-02 10:15:52 +0900 | [diff] [blame] | 239 | commit object, including message. Only valid when the |
| 240 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 241 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 242 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 243 | [[all-commits]] |
| 244 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 245 | * `ALL_COMMITS`: parse and output all header fields from the |
| 246 | output revisions. If only `CURRENT_REVISION` was requested |
| 247 | then only the current revision's commit data will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 248 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 249 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 250 | [[current-files]] |
| 251 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 252 | * `CURRENT_FILES`: list files modified by the commit and magic files, |
| 253 | including basic line counts inserted/deleted per file. Only valid |
| 254 | when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 255 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 256 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 257 | [[all-files]] |
| 258 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 259 | * `ALL_FILES`: list files modified by the commit and magic files, |
| 260 | including basic line counts inserted/deleted per file. If only the |
| 261 | `CURRENT_REVISION` was requested then only that commit's modified |
| 262 | files will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 263 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 264 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 265 | [[detailed-accounts]] |
| 266 | -- |
Edwin Kempin | 4a00e22 | 2013-10-16 14:34:24 +0200 | [diff] [blame] | 267 | * `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username` |
| 268 | fields when referencing accounts. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 269 | -- |
Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 270 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 271 | [[reviewer-updates]] |
| 272 | -- |
| 273 | * `REVIEWER_UPDATES`: include updates to reviewers set as |
| 274 | link:#review-update-info[ReviewerUpdateInfo] entities. |
| 275 | -- |
| 276 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 277 | [[messages]] |
| 278 | -- |
| 279 | * `MESSAGES`: include messages associated with the change. |
| 280 | -- |
| 281 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 282 | [[actions]] |
| 283 | -- |
| 284 | * `CURRENT_ACTIONS`: include information on available actions |
Stefan Beller | 09cd95d | 2015-02-12 13:40:23 -0800 | [diff] [blame] | 285 | for the change and its current revision. Ignored if the caller |
| 286 | is not authenticated. |
| 287 | -- |
| 288 | |
| 289 | [[change-actions]] |
| 290 | -- |
| 291 | * `CHANGE_ACTIONS`: include information on available |
| 292 | change actions for the change. Ignored if the caller |
| 293 | is not authenticated. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 294 | -- |
| 295 | |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 296 | [[reviewed]] |
| 297 | -- |
Dave Borowitz | 86669b3 | 2015-05-27 14:56:10 -0700 | [diff] [blame] | 298 | * `REVIEWED`: include the `reviewed` field if all of the following are |
| 299 | true: |
Ardo Septama | 505f9ad | 2016-12-06 16:28:00 +0100 | [diff] [blame] | 300 | - the change is open |
| 301 | - the caller is authenticated |
| 302 | - 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] | 303 | from the change owner, i.e. this change would show up in the results of |
| 304 | link:user-search.html#reviewedby[reviewedby:self]. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 305 | -- |
| 306 | |
Han-Wen Nienhuys | 19de6cd | 2018-01-16 13:15:38 +0100 | [diff] [blame] | 307 | [[skip_mergeable]] |
| 308 | -- |
| 309 | * `SKIP_MERGEABLE`: skip the `mergeable` field in |
| 310 | link:#change-info[ChangeInfo]. For fast moving projects, this field must |
| 311 | be recomputed often, which is slow for projects with big trees. |
Patrick Hiesel | db8df48 | 2019-01-24 10:11:23 +0100 | [diff] [blame] | 312 | + |
David Pursehouse | ec17692 | 2019-02-05 12:31:29 +0900 | [diff] [blame] | 313 | When link:config-gerrit.html#change.api.excludeMergeableInChangeInfo[ |
| 314 | `change.api.excludeMergeableInChangeInfo`] is set in the `gerrit.config`, |
| 315 | the `mergeable` field will always be omitted and `SKIP_MERGEABLE` has no |
| 316 | effect. |
| 317 | + |
| 318 | A change's mergeability can be requested separately by calling the |
| 319 | link:#get-mergeable[get-mergeable] endpoint. |
Alice Kober-Sotzek | a19fd75 | 2018-01-19 15:31:46 +0100 | [diff] [blame] | 320 | -- |
Gal Paikin | 3a2aa01 | 2019-06-21 18:30:01 +0200 | [diff] [blame] | 321 | [[skip_diffstat]] |
| 322 | -- |
| 323 | * `SKIP_DIFFSTAT`: skip the 'insertions' and 'deletions' field in link:#change-info[ChangeInfo]. |
| 324 | For large trees, their computation may be expensive. |
| 325 | -- |
Han-Wen Nienhuys | 19de6cd | 2018-01-16 13:15:38 +0100 | [diff] [blame] | 326 | |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 327 | [[submittable]] |
| 328 | -- |
Jonathan Nieder | ad5240f | 2016-10-04 11:03:23 -0700 | [diff] [blame] | 329 | * `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo], |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 330 | which can be used to tell if the change is reviewed and ready for submit. |
| 331 | -- |
| 332 | |
Khai Do | 2a23ec8 | 2014-09-19 16:33:02 -0700 | [diff] [blame] | 333 | [[web-links]] |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 334 | -- |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 335 | * `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo], |
| 336 | therefore only valid in combination with `CURRENT_COMMIT` or |
| 337 | `ALL_COMMITS`. |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 338 | -- |
| 339 | |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 340 | [[check]] |
| 341 | -- |
| 342 | * `CHECK`: include potential problems with the change. |
| 343 | -- |
| 344 | |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 345 | [[commit-footers]] |
| 346 | -- |
| 347 | * `COMMIT_FOOTERS`: include the full commit message with |
| 348 | Gerrit-specific commit footers in the |
| 349 | link:#revision-info[RevisionInfo]. |
Yuxuan 'fishy' Wang | 16baf21 | 2015-05-05 16:49:55 -0700 | [diff] [blame] | 350 | -- |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 351 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 352 | [[push-certificates]] |
| 353 | -- |
| 354 | * `PUSH_CERTIFICATES`: include push certificate information in the |
| 355 | link:#revision-info[RevisionInfo]. Ignored if signed push is not |
| 356 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the |
| 357 | server. |
| 358 | -- |
| 359 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 360 | [[tracking-ids]] |
| 361 | -- |
| 362 | * `TRACKING_IDS`: include references to external tracking systems |
| 363 | as link:#tracking-id-info[TrackingIdInfo]. |
| 364 | -- |
| 365 | |
Martin Fick | b186cd7 | 2018-12-02 23:34:23 -0700 | [diff] [blame] | 366 | [[no-limit]] |
| 367 | -- |
| 368 | * `NO-LIMIT`: Return all results |
| 369 | -- |
| 370 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 371 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 372 | ---- |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 373 | 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] | 374 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 375 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 376 | .Response |
| 377 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 378 | HTTP/1.1 200 OK |
| 379 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 380 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 381 | |
| 382 | )]}' |
| 383 | [ |
| 384 | { |
David Pursehouse | c3be6ad | 2014-07-18 12:03:06 +0900 | [diff] [blame] | 385 | "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 386 | "project": "gerrit", |
| 387 | "branch": "master", |
| 388 | "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 389 | "subject": "Use an EventBus to manage star icons", |
| 390 | "status": "NEW", |
| 391 | "created": "2012-04-25 00:52:25.580000000", |
| 392 | "updated": "2012-04-25 00:52:25.586000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 393 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 394 | "insertions": 16, |
| 395 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 396 | "_number": 97, |
| 397 | "owner": { |
| 398 | "name": "Shawn Pearce" |
| 399 | }, |
| 400 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", |
| 401 | "revisions": { |
| 402 | "184ebe53805e102605d11f6b143486d15c23a09c": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 403 | "kind": "REWORK", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 404 | "_number": 1, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 405 | "ref": "refs/changes/97/97/1", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 406 | "fetch": { |
| 407 | "git": { |
| 408 | "url": "git://localhost/gerrit", |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 409 | "ref": "refs/changes/97/97/1", |
| 410 | "commands": { |
| 411 | "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 412 | "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 413 | "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 414 | "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1" |
| 415 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 416 | }, |
| 417 | "http": { |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 418 | "url": "http://myuser@127.0.0.1:8080/gerrit", |
| 419 | "ref": "refs/changes/97/97/1", |
| 420 | "commands": { |
| 421 | "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 422 | "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 423 | "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", |
| 424 | "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1" |
| 425 | } |
| 426 | }, |
| 427 | "ssh": { |
| 428 | "url": "ssh://myuser@*:29418/gerrit", |
| 429 | "ref": "refs/changes/97/97/1", |
| 430 | "commands": { |
| 431 | "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 432 | "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 433 | "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 434 | "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1" |
| 435 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 436 | } |
| 437 | }, |
| 438 | "commit": { |
| 439 | "parents": [ |
| 440 | { |
| 441 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 442 | "subject": "Migrate contributor agreements to All-Projects." |
| 443 | } |
| 444 | ], |
| 445 | "author": { |
| 446 | "name": "Shawn O. Pearce", |
| 447 | "email": "sop@google.com", |
| 448 | "date": "2012-04-24 18:08:08.000000000", |
| 449 | "tz": -420 |
| 450 | }, |
| 451 | "committer": { |
| 452 | "name": "Shawn O. Pearce", |
| 453 | "email": "sop@google.com", |
| 454 | "date": "2012-04-24 18:08:08.000000000", |
| 455 | "tz": -420 |
| 456 | }, |
| 457 | "subject": "Use an EventBus to manage star icons", |
| 458 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 459 | }, |
| 460 | "files": { |
| 461 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 462 | "lines_deleted": 8, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 463 | "size_delta": -412, |
| 464 | "size": 7782 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 465 | }, |
| 466 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 467 | "lines_inserted": 1, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 468 | "size_delta": 23, |
| 469 | "size": 6762 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 470 | }, |
| 471 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { |
| 472 | "lines_inserted": 11, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 473 | "lines_deleted": 19, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 474 | "size_delta": -298, |
| 475 | "size": 47023 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 476 | }, |
| 477 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { |
| 478 | "lines_inserted": 23, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 479 | "lines_deleted": 20, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 480 | "size_delta": 132, |
| 481 | "size": 17727 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 482 | }, |
| 483 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { |
| 484 | "status": "D", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 485 | "lines_deleted": 139, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 486 | "size_delta": -5512, |
| 487 | "size": 13098 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 488 | }, |
| 489 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { |
| 490 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 491 | "lines_inserted": 204, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 492 | "size_delta": 8345, |
| 493 | "size": 8345 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 494 | }, |
| 495 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 496 | "lines_deleted": 9, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 497 | "size_delta": -343, |
| 498 | "size": 5385 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 499 | } |
| 500 | } |
| 501 | } |
| 502 | } |
| 503 | } |
| 504 | ] |
| 505 | ---- |
| 506 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 507 | [[get-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 508 | === Get Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 509 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 510 | 'GET /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 511 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 512 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 513 | Retrieves a change. |
| 514 | |
Dave Borowitz | 0314f73 | 2013-10-03 09:34:30 -0700 | [diff] [blame] | 515 | Additional fields can be obtained by adding `o` parameters, each |
| 516 | option requires more database lookups and slows down the query |
| 517 | response time to the client so they are generally disabled by |
| 518 | default. Fields are described in link:#list-changes[Query Changes]. |
| 519 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 520 | .Request |
| 521 | ---- |
| 522 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 523 | ---- |
| 524 | |
| 525 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 526 | describes the change. |
| 527 | |
| 528 | .Response |
| 529 | ---- |
| 530 | HTTP/1.1 200 OK |
| 531 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 532 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 533 | |
| 534 | )]}' |
| 535 | { |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 536 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 537 | "project": "myProject", |
| 538 | "branch": "master", |
| 539 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 540 | "subject": "Implementing Feature X", |
| 541 | "status": "NEW", |
| 542 | "created": "2013-02-01 09:59:32.126000000", |
| 543 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 544 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 545 | "insertions": 34, |
| 546 | "deletions": 101, |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 547 | "_number": 3965, |
| 548 | "owner": { |
| 549 | "name": "John Doe" |
| 550 | } |
| 551 | } |
| 552 | ---- |
| 553 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 554 | [[get-change-detail]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 555 | === Get Change Detail |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 556 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 557 | 'GET /changes/link:#change-id[\{change-id\}]/detail' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 558 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 559 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 560 | Retrieves a change with link:#labels[labels], link:#detailed-labels[ |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 561 | detailed labels], link:#detailed-accounts[detailed accounts], |
| 562 | link:#reviewer-updates[reviewer updates], and link:#messages[messages]. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 563 | |
Shawn Pearce | 7f3dccf | 2013-07-06 19:24:29 -0700 | [diff] [blame] | 564 | Additional fields can be obtained by adding `o` parameters, each |
| 565 | option requires more database lookups and slows down the query |
| 566 | response time to the client so they are generally disabled by |
| 567 | default. Fields are described in link:#list-changes[Query Changes]. |
| 568 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 569 | .Request |
| 570 | ---- |
| 571 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0 |
| 572 | ---- |
| 573 | |
| 574 | As response a link:#change-info[ChangeInfo] entity is returned that |
Khai Do | ad63201 | 2014-06-22 08:29:57 -0700 | [diff] [blame] | 575 | describes the change. This response will contain all votes for each |
| 576 | label and include one combined vote. The combined label vote is |
| 577 | calculated in the following order (from highest to lowest): |
| 578 | REJECTED > APPROVED > DISLIKED > RECOMMENDED. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 579 | |
| 580 | .Response |
| 581 | ---- |
| 582 | HTTP/1.1 200 OK |
| 583 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 584 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 585 | |
| 586 | )]}' |
| 587 | { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 588 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 589 | "project": "myProject", |
| 590 | "branch": "master", |
| 591 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 592 | "subject": "Implementing Feature X", |
| 593 | "status": "NEW", |
| 594 | "created": "2013-02-01 09:59:32.126000000", |
| 595 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 596 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 597 | "insertions": 126, |
| 598 | "deletions": 11, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 599 | "_number": 3965, |
| 600 | "owner": { |
| 601 | "_account_id": 1000096, |
| 602 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 603 | "email": "john.doe@example.com", |
| 604 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 605 | }, |
| 606 | "labels": { |
| 607 | "Verified": { |
| 608 | "all": [ |
| 609 | { |
| 610 | "value": 0, |
| 611 | "_account_id": 1000096, |
| 612 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 613 | "email": "john.doe@example.com", |
| 614 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 615 | }, |
| 616 | { |
| 617 | "value": 0, |
| 618 | "_account_id": 1000097, |
| 619 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 620 | "email": "jane.roe@example.com", |
| 621 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 622 | } |
| 623 | ], |
| 624 | "values": { |
| 625 | "-1": "Fails", |
| 626 | " 0": "No score", |
| 627 | "+1": "Verified" |
| 628 | } |
| 629 | }, |
| 630 | "Code-Review": { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 631 | "disliked": { |
| 632 | "_account_id": 1000096, |
| 633 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 634 | "email": "john.doe@example.com", |
| 635 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 636 | }, |
| 637 | "all": [ |
| 638 | { |
| 639 | "value": -1, |
| 640 | "_account_id": 1000096, |
| 641 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 642 | "email": "john.doe@example.com", |
| 643 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 644 | }, |
| 645 | { |
| 646 | "value": 1, |
| 647 | "_account_id": 1000097, |
| 648 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 649 | "email": "jane.roe@example.com", |
| 650 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 651 | } |
| 652 | ] |
| 653 | "values": { |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame] | 654 | "-2": "This shall not be merged", |
| 655 | "-1": "I would prefer this is not merged as is", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 656 | " 0": "No score", |
| 657 | "+1": "Looks good to me, but someone else must approve", |
| 658 | "+2": "Looks good to me, approved" |
| 659 | } |
| 660 | } |
| 661 | }, |
| 662 | "permitted_labels": { |
| 663 | "Verified": [ |
| 664 | "-1", |
| 665 | " 0", |
| 666 | "+1" |
| 667 | ], |
| 668 | "Code-Review": [ |
| 669 | "-2", |
| 670 | "-1", |
| 671 | " 0", |
| 672 | "+1", |
| 673 | "+2" |
| 674 | ] |
| 675 | }, |
| 676 | "removable_reviewers": [ |
| 677 | { |
| 678 | "_account_id": 1000096, |
| 679 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 680 | "email": "john.doe@example.com", |
| 681 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 682 | }, |
| 683 | { |
| 684 | "_account_id": 1000097, |
| 685 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 686 | "email": "jane.roe@example.com", |
| 687 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 688 | } |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 689 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 690 | "reviewers": { |
| 691 | "REVIEWER": [ |
| 692 | { |
| 693 | "_account_id": 1000096, |
| 694 | "name": "John Doe", |
| 695 | "email": "john.doe@example.com", |
| 696 | "username": "jdoe" |
| 697 | }, |
| 698 | { |
| 699 | "_account_id": 1000097, |
| 700 | "name": "Jane Roe", |
| 701 | "email": "jane.roe@example.com", |
| 702 | "username": "jroe" |
| 703 | } |
| 704 | ] |
| 705 | }, |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 706 | "reviewer_updates": [ |
| 707 | { |
| 708 | "state": "REVIEWER", |
| 709 | "reviewer": { |
| 710 | "_account_id": 1000096, |
| 711 | "name": "John Doe", |
| 712 | "email": "john.doe@example.com", |
| 713 | "username": "jdoe" |
| 714 | }, |
| 715 | "updated_by": { |
| 716 | "_account_id": 1000096, |
| 717 | "name": "John Doe", |
| 718 | "email": "john.doe@example.com", |
| 719 | "username": "jdoe" |
| 720 | }, |
| 721 | "updated": "2016-07-21 20:12:39.000000000" |
| 722 | }, |
| 723 | { |
| 724 | "state": "REMOVED", |
| 725 | "reviewer": { |
| 726 | "_account_id": 1000096, |
| 727 | "name": "John Doe", |
| 728 | "email": "john.doe@example.com", |
| 729 | "username": "jdoe" |
| 730 | }, |
| 731 | "updated_by": { |
| 732 | "_account_id": 1000096, |
| 733 | "name": "John Doe", |
| 734 | "email": "john.doe@example.com", |
| 735 | "username": "jdoe" |
| 736 | }, |
| 737 | "updated": "2016-07-21 20:12:33.000000000" |
| 738 | }, |
| 739 | { |
| 740 | "state": "CC", |
| 741 | "reviewer": { |
| 742 | "_account_id": 1000096, |
| 743 | "name": "John Doe", |
| 744 | "email": "john.doe@example.com", |
| 745 | "username": "jdoe" |
| 746 | }, |
| 747 | "updated_by": { |
| 748 | "_account_id": 1000096, |
| 749 | "name": "John Doe", |
| 750 | "email": "john.doe@example.com", |
| 751 | "username": "jdoe" |
| 752 | }, |
| 753 | "updated": "2016-03-23 21:34:02.419000000", |
| 754 | }, |
| 755 | ], |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 756 | "messages": [ |
| 757 | { |
| 758 | "id": "YH-egE", |
| 759 | "author": { |
| 760 | "_account_id": 1000096, |
| 761 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 762 | "email": "john.doe@example.com", |
| 763 | "username": "jdoe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 764 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 765 | "date": "2013-03-23 21:34:02.419000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 766 | "message": "Patch Set 1:\n\nThis is the first message.", |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 767 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 768 | }, |
| 769 | { |
| 770 | "id": "WEEdhU", |
| 771 | "author": { |
| 772 | "_account_id": 1000097, |
| 773 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 774 | "email": "jane.roe@example.com", |
| 775 | "username": "jroe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 776 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 777 | "date": "2013-03-23 21:36:52.332000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 778 | "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] | 779 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 780 | } |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 781 | ] |
| 782 | } |
| 783 | ---- |
| 784 | |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 785 | [[create-merge-patch-set-for-change]] |
| 786 | === Create Merge Patch Set For Change |
| 787 | -- |
| 788 | 'POST /changes/link:#change-id[\{change-id\}]/merge' |
| 789 | -- |
| 790 | |
| 791 | Update an existing change by using a |
| 792 | link:#merge-patch-set-input[MergePatchSetInput] entity. |
| 793 | |
| 794 | Gerrit will create a merge commit based on the information of |
| 795 | MergePatchSetInput and add a new patch set to the change corresponding |
| 796 | to the new merge commit. |
| 797 | |
| 798 | .Request |
| 799 | ---- |
| 800 | POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0 |
| 801 | Content-Type: application/json; charset=UTF-8 |
| 802 | |
| 803 | { |
| 804 | "subject": "Merge dev_branch into master", |
| 805 | "merge": { |
David Pursehouse | f4fb104 | 2018-03-18 23:03:46 +0900 | [diff] [blame] | 806 | "source": "refs/changes/34/1234/1" |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 807 | } |
| 808 | } |
| 809 | ---- |
| 810 | |
| 811 | As response a link:#change-info[ChangeInfo] entity with current revision is |
| 812 | returned that describes the resulting change. |
| 813 | |
| 814 | .Response |
| 815 | ---- |
| 816 | HTTP/1.1 200 OK |
| 817 | Content-Disposition: attachment |
| 818 | Content-Type: application/json; charset=UTF-8 |
| 819 | |
| 820 | )]}' |
| 821 | { |
| 822 | "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 823 | "project": "test", |
| 824 | "branch": "master", |
| 825 | "hashtags": [], |
| 826 | "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 827 | "subject": "Merge dev_branch into master", |
| 828 | "status": "NEW", |
| 829 | "created": "2016-09-23 18:08:53.238000000", |
| 830 | "updated": "2016-09-23 18:09:25.934000000", |
| 831 | "submit_type": "MERGE_IF_NECESSARY", |
| 832 | "mergeable": true, |
| 833 | "insertions": 5, |
| 834 | "deletions": 0, |
| 835 | "_number": 72, |
| 836 | "owner": { |
| 837 | "_account_id": 1000000 |
| 838 | }, |
| 839 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822" |
| 840 | } |
| 841 | ---- |
| 842 | |
| 843 | [[set-message]] |
| 844 | === Set Commit Message |
| 845 | -- |
| 846 | 'PUT /changes/link:#change-id[\{change-id\}]/message' |
| 847 | -- |
| 848 | |
| 849 | Creates a new patch set with a new commit message. |
| 850 | |
| 851 | 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] | 852 | link:#commit-message-input[CommitMessageInput] entity. If a Change-Id |
| 853 | footer is specified, it must match the current Change-Id footer. If |
| 854 | the Change-Id footer is absent, the current Change-Id is added to the |
| 855 | message. |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 856 | |
| 857 | .Request |
| 858 | ---- |
| 859 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0 |
| 860 | Content-Type: application/json; charset=UTF-8 |
| 861 | |
| 862 | { |
| 863 | "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n" |
| 864 | } |
| 865 | ---- |
| 866 | |
| 867 | .Notifications |
| 868 | |
| 869 | An email will be sent using the "newpatchset" template. |
| 870 | |
| 871 | [options="header",cols="1,1"] |
| 872 | |============================= |
| 873 | |WIP State |Default |
| 874 | |Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers |
| 875 | |Work in progress|owner |
| 876 | |============================= |
| 877 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 878 | [[get-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 879 | === Get Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 880 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 881 | 'GET /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 882 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 883 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 884 | Retrieves the topic of a change. |
| 885 | |
| 886 | .Request |
| 887 | ---- |
| 888 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 889 | ---- |
| 890 | |
| 891 | .Response |
| 892 | ---- |
| 893 | HTTP/1.1 200 OK |
| 894 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 895 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 896 | |
| 897 | )]}' |
| 898 | "Documentation" |
| 899 | ---- |
| 900 | |
| 901 | If the change does not have a topic an empty string is returned. |
| 902 | |
| 903 | [[set-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 904 | === Set Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 905 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 906 | 'PUT /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 907 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 908 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 909 | Sets the topic of a change. |
| 910 | |
| 911 | The new topic must be provided in the request body inside a |
Patrick Hiesel | 4aa1456 | 2018-06-19 15:07:50 +0200 | [diff] [blame] | 912 | link:#topic-input[TopicInput] entity. Any leading or trailing whitespace |
| 913 | in the topic name will be removed. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 914 | |
| 915 | .Request |
| 916 | ---- |
| 917 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 918 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 919 | |
| 920 | { |
| 921 | "topic": "Documentation" |
| 922 | } |
| 923 | ---- |
| 924 | |
| 925 | As response the new topic is returned. |
| 926 | |
| 927 | .Response |
| 928 | ---- |
| 929 | HTTP/1.1 200 OK |
| 930 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 931 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 932 | |
| 933 | )]}' |
| 934 | "Documentation" |
| 935 | ---- |
| 936 | |
| 937 | If the topic was deleted the response is "`204 No Content`". |
| 938 | |
| 939 | [[delete-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 940 | === Delete Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 941 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 942 | 'DELETE /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 943 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 944 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 945 | Deletes the topic of a change. |
| 946 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 947 | .Request |
| 948 | ---- |
| 949 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 950 | ---- |
| 951 | |
| 952 | .Response |
| 953 | ---- |
| 954 | HTTP/1.1 204 No Content |
| 955 | ---- |
| 956 | |
Sven Selberg | 273a4aa | 2016-09-21 16:28:10 +0200 | [diff] [blame] | 957 | [[get-assignee]] |
| 958 | === Get Assignee |
| 959 | -- |
| 960 | 'GET /changes/link:#change-id[\{change-id\}]/assignee' |
| 961 | -- |
| 962 | |
| 963 | Retrieves the account of the user assigned to a change. |
| 964 | |
| 965 | .Request |
| 966 | ---- |
| 967 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0 |
| 968 | ---- |
| 969 | |
| 970 | As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity |
| 971 | describing the assigned account is returned. |
| 972 | |
| 973 | .Response |
| 974 | ---- |
| 975 | HTTP/1.1 200 OK |
| 976 | Content-Disposition: attachment |
| 977 | Content-Type: application/json; charset=UTF-8 |
| 978 | |
| 979 | )]}' |
| 980 | { |
| 981 | "_account_id": 1000096, |
| 982 | "name": "John Doe", |
| 983 | "email": "john.doe@example.com", |
| 984 | "username": "jdoe" |
| 985 | } |
| 986 | ---- |
| 987 | |
| 988 | If the change has no assignee the response is "`204 No Content`". |
| 989 | |
| 990 | [[get-past-assignees]] |
| 991 | === Get Past Assignees |
| 992 | -- |
| 993 | 'GET /changes/link:#change-id[\{change-id\}]/past_assignees' |
| 994 | -- |
| 995 | |
| 996 | Returns a list of every user ever assigned to a change, in the order in which |
| 997 | they were first assigned. |
| 998 | |
David Pursehouse | 90e452c | 2017-08-25 13:20:20 +0900 | [diff] [blame] | 999 | [NOTE] Past assignees are only available when NoteDb is enabled. |
| 1000 | |
Sven Selberg | 273a4aa | 2016-09-21 16:28:10 +0200 | [diff] [blame] | 1001 | .Request |
| 1002 | ---- |
| 1003 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/past_assignees HTTP/1.0 |
| 1004 | ---- |
| 1005 | |
| 1006 | As a response a list of link:rest-api-accounts.html#account-info[AccountInfo] |
| 1007 | entities is returned. |
| 1008 | |
| 1009 | .Response |
| 1010 | ---- |
| 1011 | HTTP/1.1 200 OK |
| 1012 | Content-Disposition: attachment |
| 1013 | Content-Type: application/json; charset=UTF-8 |
| 1014 | |
| 1015 | )]}' |
| 1016 | [ |
| 1017 | { |
| 1018 | "_account_id": 1000051, |
| 1019 | "name": "Jane Doe", |
| 1020 | "email": "jane.doe@example.com", |
| 1021 | "username": "janed" |
| 1022 | }, |
| 1023 | { |
| 1024 | "_account_id": 1000096, |
| 1025 | "name": "John Doe", |
| 1026 | "email": "john.doe@example.com", |
| 1027 | "username": "jdoe" |
| 1028 | } |
| 1029 | ] |
| 1030 | |
| 1031 | ---- |
| 1032 | |
| 1033 | |
| 1034 | [[set-assignee]] |
| 1035 | === Set Assignee |
| 1036 | -- |
| 1037 | 'PUT /changes/link:#change-id[\{change-id\}]/assignee' |
| 1038 | -- |
| 1039 | |
| 1040 | Sets the assignee of a change. |
| 1041 | |
| 1042 | The new assignee must be provided in the request body inside a |
| 1043 | link:#assignee-input[AssigneeInput] entity. |
| 1044 | |
| 1045 | .Request |
| 1046 | ---- |
| 1047 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0 |
| 1048 | Content-Type: application/json; charset=UTF-8 |
| 1049 | |
| 1050 | { |
| 1051 | "assignee": "jdoe" |
| 1052 | } |
| 1053 | ---- |
| 1054 | |
| 1055 | As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity |
| 1056 | describing the assigned account is returned. |
| 1057 | |
| 1058 | .Response |
| 1059 | ---- |
| 1060 | HTTP/1.1 200 OK |
| 1061 | Content-Disposition: attachment |
| 1062 | Content-Type: application/json; charset=UTF-8 |
| 1063 | |
| 1064 | )]}' |
| 1065 | { |
| 1066 | "_account_id": 1000096, |
| 1067 | "name": "John Doe", |
| 1068 | "email": "john.doe@example.com", |
| 1069 | "username": "jdoe" |
| 1070 | } |
| 1071 | ---- |
| 1072 | |
| 1073 | [[delete-assignee]] |
| 1074 | === Delete Assignee |
| 1075 | -- |
| 1076 | 'DELETE /changes/link:#change-id[\{change-id\}]/assignee' |
| 1077 | -- |
| 1078 | |
| 1079 | Deletes the assignee of a change. |
| 1080 | |
| 1081 | |
| 1082 | .Request |
| 1083 | ---- |
| 1084 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0 |
| 1085 | ---- |
| 1086 | |
| 1087 | As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity |
| 1088 | describing the account of the deleted assignee is returned. |
| 1089 | |
| 1090 | .Response |
| 1091 | ---- |
| 1092 | HTTP/1.1 200 OK |
| 1093 | Content-Disposition: attachment |
| 1094 | Content-Type: application/json; charset=UTF-8 |
| 1095 | |
| 1096 | )]}' |
| 1097 | { |
| 1098 | "_account_id": 1000096, |
| 1099 | "name": "John Doe", |
| 1100 | "email": "john.doe@example.com", |
| 1101 | "username": "jdoe" |
| 1102 | } |
| 1103 | ---- |
| 1104 | |
| 1105 | If the change had no assignee the response is "`204 No Content`". |
| 1106 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 1107 | [[get-pure-revert]] |
| 1108 | === Get Pure Revert |
| 1109 | -- |
| 1110 | 'GET /changes/link:#change-id[\{change-id\}]/pure_revert' |
| 1111 | -- |
| 1112 | |
| 1113 | Check if the given change is a pure revert of the change it references in `revertOf`. |
| 1114 | Optionally, the query parameter `o` can be passed in to specify a commit (SHA1 in |
| 1115 | 40 digit hex representation) to check against. It takes precedence over `revertOf`. |
| 1116 | If the change has no reference in `revertOf`, the parameter is mandatory. |
| 1117 | |
| 1118 | As response a link:#pure-revert-info[PureRevertInfo] entity is returned. |
| 1119 | |
| 1120 | .Request |
| 1121 | ---- |
| 1122 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0 |
| 1123 | ---- |
| 1124 | |
| 1125 | .Response |
| 1126 | ---- |
| 1127 | HTTP/1.1 200 OK |
| 1128 | Content-Disposition: attachment |
| 1129 | Content-Type: application/json; charset=UTF-8 |
| 1130 | |
| 1131 | )]}' |
| 1132 | { |
| 1133 | "is_pure_revert" : false |
| 1134 | } |
| 1135 | ---- |
| 1136 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1137 | [[abandon-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1138 | === Abandon Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1139 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1140 | 'POST /changes/link:#change-id[\{change-id\}]/abandon' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1141 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1142 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1143 | Abandons a change. |
| 1144 | |
| 1145 | The request body does not need to include a link:#abandon-input[ |
| 1146 | AbandonInput] entity if no review comment is added. |
| 1147 | |
| 1148 | .Request |
| 1149 | ---- |
| 1150 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0 |
| 1151 | ---- |
| 1152 | |
| 1153 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1154 | describes the abandoned change. |
| 1155 | |
| 1156 | .Response |
| 1157 | ---- |
| 1158 | HTTP/1.1 200 OK |
| 1159 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1160 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1161 | |
| 1162 | )]}' |
| 1163 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1164 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1165 | "project": "myProject", |
| 1166 | "branch": "master", |
| 1167 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1168 | "subject": "Implementing Feature X", |
| 1169 | "status": "ABANDONED", |
| 1170 | "created": "2013-02-01 09:59:32.126000000", |
| 1171 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1172 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1173 | "insertions": 3, |
| 1174 | "deletions": 310, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1175 | "_number": 3965, |
| 1176 | "owner": { |
| 1177 | "name": "John Doe" |
| 1178 | } |
| 1179 | } |
| 1180 | ---- |
| 1181 | |
| 1182 | If the change cannot be abandoned because the change state doesn't |
| 1183 | allow abandoning of the change, the response is "`409 Conflict`" and |
| 1184 | the error message is contained in the response body. |
| 1185 | |
| 1186 | .Response |
| 1187 | ---- |
| 1188 | HTTP/1.1 409 Conflict |
| 1189 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1190 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1191 | |
| 1192 | change is merged |
| 1193 | ---- |
| 1194 | |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1195 | .Notifications |
| 1196 | |
| 1197 | An email will be sent using the "abandon" template. The notify handling is ALL. |
| 1198 | Notifications are suppressed on WIP changes that have never started review. |
| 1199 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1200 | [options="header",cols="1,2"] |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1201 | |============================= |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1202 | |WIP State |notify=ALL |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1203 | |Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1204 | |Work in progress|not sent |
| 1205 | |Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1206 | |============================= |
| 1207 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1208 | [[restore-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1209 | === Restore Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1210 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1211 | 'POST /changes/link:#change-id[\{change-id\}]/restore' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1212 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1213 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1214 | Restores a change. |
| 1215 | |
| 1216 | The request body does not need to include a link:#restore-input[ |
| 1217 | RestoreInput] entity if no review comment is added. |
| 1218 | |
| 1219 | .Request |
| 1220 | ---- |
| 1221 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0 |
| 1222 | ---- |
| 1223 | |
| 1224 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1225 | describes the restored change. |
| 1226 | |
| 1227 | .Response |
| 1228 | ---- |
| 1229 | HTTP/1.1 200 OK |
| 1230 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1231 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1232 | |
| 1233 | )]}' |
| 1234 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1235 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1236 | "project": "myProject", |
| 1237 | "branch": "master", |
| 1238 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1239 | "subject": "Implementing Feature X", |
| 1240 | "status": "NEW", |
| 1241 | "created": "2013-02-01 09:59:32.126000000", |
| 1242 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1243 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1244 | "insertions": 2, |
| 1245 | "deletions": 13, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1246 | "_number": 3965, |
| 1247 | "owner": { |
| 1248 | "name": "John Doe" |
| 1249 | } |
| 1250 | } |
| 1251 | ---- |
| 1252 | |
| 1253 | If the change cannot be restored because the change state doesn't |
| 1254 | allow restoring the change, the response is "`409 Conflict`" and |
| 1255 | the error message is contained in the response body. |
| 1256 | |
| 1257 | .Response |
| 1258 | ---- |
| 1259 | HTTP/1.1 409 Conflict |
| 1260 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1261 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1262 | |
| 1263 | change is new |
| 1264 | ---- |
| 1265 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1266 | [[rebase-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1267 | === Rebase Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1268 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1269 | 'POST /changes/link:#change-id[\{change-id\}]/rebase' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1270 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1271 | |
| 1272 | Rebases a change. |
| 1273 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1274 | Optionally, the parent revision can be changed to another patch set through the |
| 1275 | link:#rebase-input[RebaseInput] entity. |
| 1276 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1277 | .Request |
| 1278 | ---- |
| 1279 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1280 | Content-Type: application/json;charset=UTF-8 |
| 1281 | |
| 1282 | { |
| 1283 | "base" : "1234", |
| 1284 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1285 | ---- |
| 1286 | |
| 1287 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1288 | describes the rebased change. Information about the current patch set |
| 1289 | is included. |
| 1290 | |
| 1291 | .Response |
| 1292 | ---- |
| 1293 | HTTP/1.1 200 OK |
| 1294 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1295 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1296 | |
| 1297 | )]}' |
| 1298 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1299 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1300 | "project": "myProject", |
| 1301 | "branch": "master", |
| 1302 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1303 | "subject": "Implement Feature X", |
| 1304 | "status": "NEW", |
| 1305 | "created": "2013-02-01 09:59:32.126000000", |
| 1306 | "updated": "2013-02-21 11:16:36.775000000", |
| 1307 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1308 | "insertions": 33, |
| 1309 | "deletions": 9, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1310 | "_number": 4799, |
| 1311 | "owner": { |
| 1312 | "name": "John Doe" |
| 1313 | }, |
| 1314 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 1315 | "revisions": { |
| 1316 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1317 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1318 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 1319 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1320 | "fetch": { |
| 1321 | "http": { |
| 1322 | "url": "http://gerrit:8080/myProject", |
| 1323 | "ref": "refs/changes/99/4799/2" |
| 1324 | } |
| 1325 | }, |
| 1326 | "commit": { |
| 1327 | "parents": [ |
| 1328 | { |
| 1329 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 1330 | "subject": "Implement Feature A" |
| 1331 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 1332 | ], |
| 1333 | "author": { |
| 1334 | "name": "John Doe", |
| 1335 | "email": "john.doe@example.com", |
| 1336 | "date": "2013-05-07 15:21:27.000000000", |
| 1337 | "tz": 120 |
| 1338 | }, |
| 1339 | "committer": { |
| 1340 | "name": "Gerrit Code Review", |
| 1341 | "email": "gerrit-server@example.com", |
| 1342 | "date": "2013-05-07 15:35:43.000000000", |
| 1343 | "tz": 120 |
| 1344 | }, |
| 1345 | "subject": "Implement Feature X", |
| 1346 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1347 | } |
| 1348 | } |
| 1349 | } |
| 1350 | ---- |
| 1351 | |
| 1352 | If the change cannot be rebased, e.g. due to conflicts, the response is |
| 1353 | "`409 Conflict`" and the error message is contained in the response |
| 1354 | body. |
| 1355 | |
| 1356 | .Response |
| 1357 | ---- |
| 1358 | HTTP/1.1 409 Conflict |
| 1359 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1360 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1361 | |
| 1362 | The change could not be rebased due to a path conflict during merge. |
| 1363 | ---- |
| 1364 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1365 | [[move-change]] |
| 1366 | === Move Change |
| 1367 | -- |
| 1368 | 'POST /changes/link:#change-id[\{change-id\}]/move' |
| 1369 | -- |
| 1370 | |
| 1371 | Move a change. |
| 1372 | |
| 1373 | The destination branch must be provided in the request body inside a |
| 1374 | link:#move-input[MoveInput] entity. |
| 1375 | |
| 1376 | .Request |
| 1377 | ---- |
| 1378 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0 |
| 1379 | Content-Type: application/json; charset=UTF-8 |
| 1380 | |
| 1381 | { |
| 1382 | "destination_branch" : "release-branch" |
| 1383 | } |
| 1384 | |
| 1385 | ---- |
| 1386 | |
| 1387 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1388 | describes the moved change. |
| 1389 | |
| 1390 | .Response |
| 1391 | ---- |
| 1392 | HTTP/1.1 200 OK |
| 1393 | Content-Disposition: attachment |
| 1394 | Content-Type: application/json; charset=UTF-8 |
| 1395 | |
| 1396 | )]}' |
| 1397 | { |
| 1398 | "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1399 | "project": "myProject", |
| 1400 | "branch": "release-branch", |
| 1401 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1402 | "subject": "Implementing Feature X", |
| 1403 | "status": "NEW", |
| 1404 | "created": "2013-02-01 09:59:32.126000000", |
| 1405 | "updated": "2013-02-21 11:16:36.775000000", |
| 1406 | "mergeable": true, |
| 1407 | "insertions": 2, |
| 1408 | "deletions": 13, |
| 1409 | "_number": 3965, |
| 1410 | "owner": { |
| 1411 | "name": "John Doe" |
| 1412 | } |
| 1413 | } |
| 1414 | ---- |
| 1415 | |
Changcheng Xiao | 6dc9042 | 2017-08-09 10:21:58 +0200 | [diff] [blame] | 1416 | Note that this endpoint will not update the change's parents, which is |
| 1417 | different from the link:#cherry-pick[cherry-pick] endpoint. |
| 1418 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1419 | If the change cannot be moved because the change state doesn't |
| 1420 | allow moving the change, the response is "`409 Conflict`" and |
| 1421 | the error message is contained in the response body. |
| 1422 | |
| 1423 | .Response |
| 1424 | ---- |
| 1425 | HTTP/1.1 409 Conflict |
| 1426 | Content-Disposition: attachment |
| 1427 | Content-Type: text/plain; charset=UTF-8 |
| 1428 | |
| 1429 | change is merged |
| 1430 | ---- |
| 1431 | |
| 1432 | If the change cannot be moved because the user doesn't have |
| 1433 | abandon permission on the change or upload permission on the destination, |
| 1434 | the response is "`409 Conflict`" and the error message is contained in the |
| 1435 | response body. |
| 1436 | |
| 1437 | .Response |
| 1438 | ---- |
| 1439 | HTTP/1.1 409 Conflict |
| 1440 | Content-Disposition: attachment |
| 1441 | Content-Type: text/plain; charset=UTF-8 |
| 1442 | |
| 1443 | move not permitted |
| 1444 | ---- |
| 1445 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1446 | [[revert-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1447 | === Revert Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1448 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1449 | 'POST /changes/link:#change-id[\{change-id\}]/revert' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1450 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1451 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1452 | Reverts a change. |
| 1453 | |
| 1454 | The request body does not need to include a link:#revert-input[ |
| 1455 | RevertInput] entity if no review comment is added. |
| 1456 | |
| 1457 | .Request |
| 1458 | ---- |
Michael Zhou | 1027049 | 2016-03-24 22:35:40 -0400 | [diff] [blame] | 1459 | POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1460 | ---- |
| 1461 | |
| 1462 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1463 | describes the reverting change. |
| 1464 | |
| 1465 | .Response |
| 1466 | ---- |
| 1467 | HTTP/1.1 200 OK |
| 1468 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1469 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1470 | |
| 1471 | )]}' |
| 1472 | { |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1473 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1474 | "project": "myProject", |
| 1475 | "branch": "master", |
| 1476 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1477 | "subject": "Revert \"Implementing Feature X\"", |
| 1478 | "status": "NEW", |
| 1479 | "created": "2013-02-01 09:59:32.126000000", |
| 1480 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1481 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1482 | "insertions": 6, |
| 1483 | "deletions": 4, |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1484 | "_number": 3965, |
| 1485 | "owner": { |
| 1486 | "name": "John Doe" |
| 1487 | } |
| 1488 | } |
| 1489 | ---- |
| 1490 | |
| 1491 | If the change cannot be reverted because the change state doesn't |
| 1492 | allow reverting the change, the response is "`409 Conflict`" and |
| 1493 | the error message is contained in the response body. |
| 1494 | |
| 1495 | .Response |
| 1496 | ---- |
| 1497 | HTTP/1.1 409 Conflict |
| 1498 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1499 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1500 | |
| 1501 | change is new |
| 1502 | ---- |
| 1503 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1504 | [[revert-submission]] |
| 1505 | === Revert Submission |
| 1506 | -- |
| 1507 | 'POST /changes/link:#change-id[\{change-id\}]/revert_submission' |
| 1508 | -- |
| 1509 | |
| 1510 | Creates open revert changes for all of the changes of a certain submission. |
| 1511 | |
| 1512 | Details for the revert can be specified in the request body inside a link:#revert-input[ |
| 1513 | RevertInput] The topic of all created revert changes will be |
| 1514 | `revert-{submission_id}-{random_string_of_size_10}`. |
| 1515 | |
| 1516 | The changes will not be rebased on onto the destination branch so the users may still |
| 1517 | have to manually rebase them to resolve conflicts and make them submittable. |
| 1518 | |
| 1519 | .Request |
| 1520 | ---- |
| 1521 | POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0 |
| 1522 | ---- |
| 1523 | |
| 1524 | As response link:#revert-submission-info[RevertSubmissionInfo] entity |
| 1525 | is returned. That entity describes the revert changes. |
| 1526 | |
| 1527 | .Response |
| 1528 | ---- |
| 1529 | HTTP/1.1 200 OK |
| 1530 | Content-Disposition: attachment |
| 1531 | Content-Type: application/json; charset=UTF-8 |
| 1532 | |
| 1533 | )]}' |
| 1534 | "revert_changes": |
| 1535 | [ |
| 1536 | { |
| 1537 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1538 | "project": "myProject", |
| 1539 | "branch": "master", |
| 1540 | "topic": "revert--1571043962462-3640749-ABCEEZGHIJ", |
| 1541 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1542 | "subject": "Revert \"Implementing Feature X\"", |
| 1543 | "status": "NEW", |
| 1544 | "created": "2013-02-01 09:59:32.126000000", |
| 1545 | "updated": "2013-02-21 11:16:36.775000000", |
| 1546 | "mergeable": true, |
| 1547 | "insertions": 6, |
| 1548 | "deletions": 4, |
| 1549 | "_number": 3965, |
| 1550 | "owner": { |
| 1551 | "name": "John Doe" |
| 1552 | } |
| 1553 | }, |
| 1554 | { |
| 1555 | "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 1556 | "project": "anyProject", |
| 1557 | "branch": "master", |
| 1558 | "topic": "revert--1571043962462-3640749-ABCEEZGHIJ", |
| 1559 | "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 1560 | "subject": "Revert \"Implementing Feature Y\"", |
| 1561 | "status": "NEW", |
| 1562 | "created": "2013-02-04 09:59:33.126000000", |
| 1563 | "updated": "2013-02-21 11:16:37.775000000", |
| 1564 | "mergeable": true, |
| 1565 | "insertions": 62, |
| 1566 | "deletions": 11, |
| 1567 | "_number": 3966, |
| 1568 | "owner": { |
| 1569 | "name": "Jane Doe" |
| 1570 | } |
| 1571 | } |
| 1572 | ] |
| 1573 | ---- |
| 1574 | |
| 1575 | If any of the changes cannot be reverted because the change state doesn't |
| 1576 | allow reverting the change, the response is "`409 Conflict`" and |
| 1577 | the error message is contained in the response body. |
| 1578 | |
| 1579 | .Response |
| 1580 | ---- |
| 1581 | HTTP/1.1 409 Conflict |
| 1582 | Content-Disposition: attachment |
| 1583 | Content-Type: text/plain; charset=UTF-8 |
| 1584 | |
| 1585 | change is new |
| 1586 | ---- |
| 1587 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1588 | [[submit-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1589 | === Submit Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1590 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1591 | 'POST /changes/link:#change-id[\{change-id\}]/submit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1592 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1593 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1594 | Submits a change. |
| 1595 | |
| 1596 | The request body only needs to include a link:#submit-input[ |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 1597 | SubmitInput] entity if submitting on behalf of another user. |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1598 | |
| 1599 | .Request |
| 1600 | ---- |
| 1601 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1602 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1603 | |
| 1604 | { |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 1605 | "on_behalf_of": 1001439 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1606 | } |
| 1607 | ---- |
| 1608 | |
| 1609 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1610 | describes the submitted/merged change. |
| 1611 | |
| 1612 | .Response |
| 1613 | ---- |
| 1614 | HTTP/1.1 200 OK |
| 1615 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1616 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1617 | |
| 1618 | )]}' |
| 1619 | { |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1620 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1621 | "project": "myProject", |
| 1622 | "branch": "master", |
| 1623 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1624 | "subject": "Implementing Feature X", |
| 1625 | "status": "MERGED", |
| 1626 | "created": "2013-02-01 09:59:32.126000000", |
| 1627 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 1628 | "submitted": "2013-02-21 11:16:36.615000000", |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1629 | "_number": 3965, |
| 1630 | "owner": { |
| 1631 | "name": "John Doe" |
| 1632 | } |
| 1633 | } |
| 1634 | ---- |
| 1635 | |
| 1636 | If the change cannot be submitted because the submit rule doesn't allow |
| 1637 | submitting the change, the response is "`409 Conflict`" and the error |
| 1638 | message is contained in the response body. |
| 1639 | |
| 1640 | .Response |
| 1641 | ---- |
| 1642 | HTTP/1.1 409 Conflict |
| 1643 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1644 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1645 | |
| 1646 | blocked by Verified |
| 1647 | ---- |
| 1648 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 1649 | [[submitted-together]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1650 | === Changes Submitted Together |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1651 | -- |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1652 | '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] | 1653 | -- |
| 1654 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1655 | Computes list of all changes which are submitted when |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1656 | link:#submit-change[Submit] is called for this change, |
Stefan Beller | 460f354 | 2015-07-20 14:10:41 -0700 | [diff] [blame] | 1657 | including the current change itself. |
| 1658 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1659 | The list consists of: |
| 1660 | |
| 1661 | * The given change. |
| 1662 | * If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 1663 | is enabled, include all open changes with the same topic. |
| 1664 | * For each change whose submit type is not CHERRY_PICK, include unmerged |
| 1665 | ancestors targeting the same branch. |
| 1666 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1667 | As a special case, the list is empty if this change would be |
| 1668 | submitted by itself (without other changes). |
| 1669 | |
| 1670 | .Request |
| 1671 | ---- |
| 1672 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0 |
| 1673 | Content-Type: application/json; charset=UTF-8 |
| 1674 | ---- |
| 1675 | |
| 1676 | As a response a link:#submitted-together-info[SubmittedTogetherInfo] |
| 1677 | entity is returned that describes what would happen if the change were |
| 1678 | submitted. This response contains a list of changes and a count of |
| 1679 | changes that are not visible to the caller that are part of the set of |
| 1680 | changes to be merged. |
| 1681 | |
| 1682 | The listed changes use the same format as in |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1683 | link:#list-changes[Query Changes] with the |
| 1684 | link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`], |
Patrick Hiesel | 6fbbdaa | 2018-04-05 15:10:13 +0200 | [diff] [blame] | 1685 | link:#current-revision[`CURRENT_REVISION`],and |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 1686 | link:#submittable[`SUBMITTABLE`] options set. |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1687 | |
Shawn Pearce | 8080c3d | 2016-09-19 19:15:04 -0700 | [diff] [blame] | 1688 | Standard link:#query-options[formatting options] can be specified |
| 1689 | with the `o` parameter, as well as the `submitted_together` specific |
| 1690 | option `NON_VISIBLE_CHANGES`. |
| 1691 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1692 | .Response |
| 1693 | ---- |
| 1694 | HTTP/1.1 200 OK |
| 1695 | Content-Disposition: attachment |
| 1696 | Content-Type: application/json; charset=UTF-8 |
| 1697 | |
| 1698 | )]}' |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1699 | { |
| 1700 | "changes": [ |
| 1701 | { |
| 1702 | "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 1703 | "project": "gerrit", |
| 1704 | "branch": "master", |
| 1705 | "hashtags": [], |
| 1706 | "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 1707 | "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes", |
| 1708 | "status": "NEW", |
| 1709 | "created": "2015-05-01 15:39:57.979000000", |
| 1710 | "updated": "2015-05-20 19:25:21.592000000", |
| 1711 | "mergeable": true, |
| 1712 | "insertions": 303, |
| 1713 | "deletions": 210, |
| 1714 | "_number": 1779, |
| 1715 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1716 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1717 | }, |
| 1718 | "labels": { |
| 1719 | "Code-Review": { |
| 1720 | "approved": { |
| 1721 | "_account_id": 1000000 |
| 1722 | }, |
| 1723 | "all": [ |
| 1724 | { |
| 1725 | "value": 2, |
| 1726 | "date": "2015-05-20 19:25:21.592000000", |
| 1727 | "_account_id": 1000000 |
| 1728 | } |
| 1729 | ], |
| 1730 | "values": { |
| 1731 | "-2": "This shall not be merged", |
| 1732 | "-1": "I would prefer this is not merged as is", |
| 1733 | " 0": "No score", |
| 1734 | "+1": "Looks good to me, but someone else must approve", |
| 1735 | "+2": "Looks good to me, approved" |
| 1736 | }, |
| 1737 | "default_value": 0 |
| 1738 | }, |
| 1739 | "Verified": { |
| 1740 | "approved": { |
| 1741 | "_account_id": 1000000 |
| 1742 | }, |
| 1743 | "all": [ |
| 1744 | { |
| 1745 | "value": 1, |
| 1746 | "date": "2015-05-20 19:25:21.592000000", |
| 1747 | "_account_id": 1000000 |
| 1748 | } |
| 1749 | ], |
| 1750 | "values": { |
| 1751 | "-1": "Fails", |
| 1752 | " 0": "No score", |
| 1753 | "+1": "Verified" |
| 1754 | }, |
| 1755 | "default_value": 0 |
| 1756 | } |
| 1757 | }, |
| 1758 | "permitted_labels": { |
| 1759 | "Code-Review": [ |
| 1760 | "-2", |
| 1761 | "-1", |
| 1762 | " 0", |
| 1763 | "+1", |
| 1764 | "+2" |
| 1765 | ], |
| 1766 | "Verified": [ |
| 1767 | "-1", |
| 1768 | " 0", |
| 1769 | "+1" |
| 1770 | ] |
| 1771 | }, |
| 1772 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 1773 | { |
| 1774 | "_account_id": 1000000 |
| 1775 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1776 | ], |
| 1777 | "reviewers": { |
| 1778 | "REVIEWER": [ |
| 1779 | { |
| 1780 | "_account_id": 1000000 |
| 1781 | } |
| 1782 | ] |
| 1783 | }, |
| 1784 | "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379", |
| 1785 | "revisions": { |
| 1786 | "9adb9f4c7b40eeee0646e235de818d09164d7379": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1787 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1788 | "_number": 1, |
| 1789 | "created": "2015-05-01 15:39:57.979000000", |
| 1790 | "uploader": { |
| 1791 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1792 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1793 | "ref": "refs/changes/79/1779/1", |
| 1794 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1795 | } |
| 1796 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1797 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1798 | { |
| 1799 | "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 1800 | "project": "gerrit", |
| 1801 | "branch": "master", |
| 1802 | "hashtags": [], |
| 1803 | "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 1804 | "subject": "AbstractSubmoduleSubscription: Split up createSubscription", |
| 1805 | "status": "NEW", |
| 1806 | "created": "2015-05-01 15:39:57.979000000", |
| 1807 | "updated": "2015-05-20 19:25:21.546000000", |
| 1808 | "mergeable": true, |
| 1809 | "insertions": 15, |
| 1810 | "deletions": 6, |
| 1811 | "_number": 1780, |
| 1812 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1813 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1814 | }, |
| 1815 | "labels": { |
| 1816 | "Code-Review": { |
| 1817 | "approved": { |
| 1818 | "_account_id": 1000000 |
| 1819 | }, |
| 1820 | "all": [ |
| 1821 | { |
| 1822 | "value": 2, |
| 1823 | "date": "2015-05-20 19:25:21.546000000", |
| 1824 | "_account_id": 1000000 |
| 1825 | } |
| 1826 | ], |
| 1827 | "values": { |
| 1828 | "-2": "This shall not be merged", |
| 1829 | "-1": "I would prefer this is not merged as is", |
| 1830 | " 0": "No score", |
| 1831 | "+1": "Looks good to me, but someone else must approve", |
| 1832 | "+2": "Looks good to me, approved" |
| 1833 | }, |
| 1834 | "default_value": 0 |
| 1835 | }, |
| 1836 | "Verified": { |
| 1837 | "approved": { |
| 1838 | "_account_id": 1000000 |
| 1839 | }, |
| 1840 | "all": [ |
| 1841 | { |
| 1842 | "value": 1, |
| 1843 | "date": "2015-05-20 19:25:21.546000000", |
| 1844 | "_account_id": 1000000 |
| 1845 | } |
| 1846 | ], |
| 1847 | "values": { |
| 1848 | "-1": "Fails", |
| 1849 | " 0": "No score", |
| 1850 | "+1": "Verified" |
| 1851 | }, |
| 1852 | "default_value": 0 |
| 1853 | } |
| 1854 | }, |
| 1855 | "permitted_labels": { |
| 1856 | "Code-Review": [ |
| 1857 | "-2", |
| 1858 | "-1", |
| 1859 | " 0", |
| 1860 | "+1", |
| 1861 | "+2" |
| 1862 | ], |
| 1863 | "Verified": [ |
| 1864 | "-1", |
| 1865 | " 0", |
| 1866 | "+1" |
| 1867 | ] |
| 1868 | }, |
| 1869 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 1870 | { |
| 1871 | "_account_id": 1000000 |
| 1872 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1873 | ], |
| 1874 | "reviewers": { |
| 1875 | "REVIEWER": [ |
| 1876 | { |
| 1877 | "_account_id": 1000000 |
| 1878 | } |
| 1879 | ] |
| 1880 | }, |
| 1881 | "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4", |
| 1882 | "revisions": { |
| 1883 | "1bd7c12a38854a2c6de426feec28800623f492c4": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1884 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1885 | "_number": 1, |
| 1886 | "created": "2015-05-01 15:39:57.979000000", |
| 1887 | "uploader": { |
| 1888 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1889 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1890 | "ref": "refs/changes/80/1780/1", |
| 1891 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1892 | } |
| 1893 | } |
| 1894 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1895 | ], |
| 1896 | "non_visible_changes": 0 |
| 1897 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1898 | ---- |
| 1899 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1900 | If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then |
| 1901 | instead of a link:#submitted-together-info[SubmittedTogetherInfo] |
| 1902 | entity, the response is a list of changes, or a 403 response with a |
| 1903 | message if the set of changes to be submitted with this change |
| 1904 | includes changes the caller cannot read. |
| 1905 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1906 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 1907 | [[delete-change]] |
| 1908 | === Delete Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1909 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1910 | 'DELETE /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1911 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1912 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 1913 | Deletes a change. |
| 1914 | |
Paladox none | 580ae0e | 2017-02-12 18:15:48 +0000 | [diff] [blame] | 1915 | New or abandoned changes can be deleted by their owner if the user is granted |
| 1916 | the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission, |
| 1917 | otherwise only by administrators. |
| 1918 | |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1919 | .Request |
| 1920 | ---- |
| 1921 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1922 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 1923 | ---- |
| 1924 | |
| 1925 | .Response |
| 1926 | ---- |
| 1927 | HTTP/1.1 204 No Content |
| 1928 | ---- |
| 1929 | |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1930 | [[get-included-in]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1931 | === Get Included In |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1932 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1933 | 'GET /changes/link:#change-id[\{change-id\}]/in' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1934 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1935 | |
| 1936 | Retrieves the branches and tags in which a change is included. As result |
| 1937 | an link:#included-in-info[IncludedInInfo] entity is returned. |
| 1938 | |
| 1939 | .Request |
| 1940 | ---- |
| 1941 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0 |
| 1942 | ---- |
| 1943 | |
| 1944 | .Response |
| 1945 | ---- |
| 1946 | HTTP/1.1 200 OK |
| 1947 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1948 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1949 | |
| 1950 | )]}' |
| 1951 | { |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 1952 | "branches": [ |
| 1953 | "master" |
| 1954 | ], |
| 1955 | "tags": [] |
| 1956 | } |
| 1957 | ---- |
| 1958 | |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 1959 | [[index-change]] |
| 1960 | === Index Change |
| 1961 | -- |
| 1962 | 'POST /changes/link:#change-id[\{change-id\}]/index' |
| 1963 | -- |
| 1964 | |
| 1965 | Adds or updates the change in the secondary index. |
| 1966 | |
| 1967 | .Request |
| 1968 | ---- |
| 1969 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0 |
| 1970 | ---- |
| 1971 | |
| 1972 | .Response |
| 1973 | ---- |
| 1974 | HTTP/1.1 204 No Content |
| 1975 | ---- |
| 1976 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 1977 | [[list-change-comments]] |
| 1978 | === List Change Comments |
| 1979 | -- |
| 1980 | 'GET /changes/link:#change-id[\{change-id\}]/comments' |
| 1981 | -- |
| 1982 | |
| 1983 | Lists the published comments of all revisions of the change. |
| 1984 | |
| 1985 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 1986 | entries. The entries in the map are sorted by file path, and the |
| 1987 | comments for each path are sorted by patch set number. Each comment has |
| 1988 | the `patch_set` and `author` fields set. |
| 1989 | |
| 1990 | .Request |
| 1991 | ---- |
| 1992 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0 |
| 1993 | ---- |
| 1994 | |
| 1995 | .Response |
| 1996 | ---- |
| 1997 | HTTP/1.1 200 OK |
| 1998 | Content-Disposition: attachment |
| 1999 | Content-Type: application/json; charset=UTF-8 |
| 2000 | |
| 2001 | )]}' |
| 2002 | { |
| 2003 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2004 | { |
| 2005 | "patch_set": 1, |
| 2006 | "id": "TvcXrmjM", |
| 2007 | "line": 23, |
| 2008 | "message": "[nit] trailing whitespace", |
| 2009 | "updated": "2013-02-26 15:40:43.986000000" |
| 2010 | "author": { |
| 2011 | "_account_id": 1000096, |
| 2012 | "name": "John Doe", |
| 2013 | "email": "john.doe@example.com" |
| 2014 | } |
| 2015 | }, |
| 2016 | { |
| 2017 | "patch_set": 2, |
| 2018 | "id": "TveXwFiA", |
| 2019 | "line": 49, |
| 2020 | "in_reply_to": "TfYX-Iuo", |
| 2021 | "message": "Done", |
| 2022 | "updated": "2013-02-26 15:40:45.328000000" |
| 2023 | "author": { |
| 2024 | "_account_id": 1000097, |
| 2025 | "name": "Jane Roe", |
| 2026 | "email": "jane.roe@example.com" |
| 2027 | } |
| 2028 | } |
| 2029 | ] |
| 2030 | } |
| 2031 | ---- |
| 2032 | |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2033 | [[list-change-robot-comments]] |
| 2034 | === List Change Robot Comments |
| 2035 | -- |
| 2036 | 'GET /changes/link:#change-id[\{change-id\}]/robotcomments' |
| 2037 | -- |
| 2038 | |
| 2039 | Lists the robot comments of all revisions of the change. |
| 2040 | |
| 2041 | Return a map that maps the file path to a list of |
| 2042 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 2043 | map are sorted by file path. |
| 2044 | |
| 2045 | .Request |
| 2046 | ---- |
| 2047 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0 |
| 2048 | ---- |
| 2049 | |
| 2050 | .Response |
| 2051 | ---- |
| 2052 | HTTP/1.1 200 OK |
| 2053 | Content-Disposition: attachment |
| 2054 | Content-Type: application/json; charset=UTF-8 |
| 2055 | |
| 2056 | )]}' |
| 2057 | { |
| 2058 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2059 | { |
| 2060 | "id": "TvcXrmjM", |
| 2061 | "line": 23, |
| 2062 | "message": "unused import", |
| 2063 | "updated": "2016-02-26 15:40:43.986000000", |
| 2064 | "author": { |
| 2065 | "_account_id": 1000110, |
| 2066 | "name": "Code Analyzer", |
| 2067 | "email": "code.analyzer@example.com" |
| 2068 | }, |
| 2069 | "robotId": "importChecker", |
| 2070 | "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
| 2071 | }, |
| 2072 | { |
| 2073 | "id": "TveXwFiA", |
| 2074 | "line": 49, |
| 2075 | "message": "wrong indention", |
| 2076 | "updated": "2016-02-26 15:40:45.328000000", |
| 2077 | "author": { |
| 2078 | "_account_id": 1000110, |
| 2079 | "name": "Code Analyzer", |
| 2080 | "email": "code.analyzer@example.com" |
| 2081 | }, |
| 2082 | "robotId": "styleChecker", |
| 2083 | "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
| 2084 | } |
| 2085 | ] |
| 2086 | } |
| 2087 | ---- |
| 2088 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2089 | [[list-change-drafts]] |
| 2090 | === List Change Drafts |
| 2091 | -- |
| 2092 | 'GET /changes/link:#change-id[\{change-id\}]/drafts' |
| 2093 | -- |
| 2094 | |
| 2095 | Lists the draft comments of all revisions of the change that belong to |
| 2096 | the calling user. |
| 2097 | |
| 2098 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 2099 | entries. The entries in the map are sorted by file path, and the |
| 2100 | comments for each path are sorted by patch set number. Each comment has |
| 2101 | the `patch_set` field set, and no `author`. |
| 2102 | |
| 2103 | .Request |
| 2104 | ---- |
| 2105 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0 |
| 2106 | ---- |
| 2107 | |
| 2108 | .Response |
| 2109 | ---- |
| 2110 | HTTP/1.1 200 OK |
| 2111 | Content-Disposition: attachment |
| 2112 | Content-Type: application/json; charset=UTF-8 |
| 2113 | |
| 2114 | )]}' |
| 2115 | { |
| 2116 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2117 | { |
| 2118 | "patch_set": 1, |
| 2119 | "id": "TvcXrmjM", |
| 2120 | "line": 23, |
| 2121 | "message": "[nit] trailing whitespace", |
| 2122 | "updated": "2013-02-26 15:40:43.986000000" |
| 2123 | }, |
| 2124 | { |
| 2125 | "patch_set": 2, |
| 2126 | "id": "TveXwFiA", |
| 2127 | "line": 49, |
| 2128 | "in_reply_to": "TfYX-Iuo", |
| 2129 | "message": "Done", |
| 2130 | "updated": "2013-02-26 15:40:45.328000000" |
| 2131 | } |
| 2132 | ] |
| 2133 | } |
| 2134 | ---- |
| 2135 | |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2136 | [[check-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2137 | === Check Change |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2138 | -- |
| 2139 | 'GET /changes/link:#change-id[\{change-id\}]/check' |
| 2140 | -- |
| 2141 | |
| 2142 | Performs consistency checks on the change, and returns a |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2143 | link:#change-info[ChangeInfo] entity with the `problems` field set to a |
| 2144 | list of link:#problem-info[ProblemInfo] entities. |
| 2145 | |
| 2146 | Depending on the type of problem, some fields not marked optional may be |
| 2147 | missing from the result. At least `id`, `project`, `branch`, and |
| 2148 | `_number` will be present. |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2149 | |
| 2150 | .Request |
| 2151 | ---- |
| 2152 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2153 | ---- |
| 2154 | |
| 2155 | .Response |
| 2156 | ---- |
| 2157 | HTTP/1.1 200 OK |
| 2158 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2159 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2160 | |
| 2161 | )]}' |
| 2162 | { |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2163 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2164 | "project": "myProject", |
| 2165 | "branch": "master", |
| 2166 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2167 | "subject": "Implementing Feature X", |
| 2168 | "status": "NEW", |
| 2169 | "created": "2013-02-01 09:59:32.126000000", |
| 2170 | "updated": "2013-02-21 11:16:36.775000000", |
| 2171 | "mergeable": true, |
| 2172 | "insertions": 34, |
| 2173 | "deletions": 101, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2174 | "_number": 3965, |
| 2175 | "owner": { |
| 2176 | "name": "John Doe" |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2177 | }, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2178 | "problems": [ |
| 2179 | { |
| 2180 | "message": "Current patch set 1 not found" |
| 2181 | } |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2182 | ] |
| 2183 | } |
| 2184 | ---- |
| 2185 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2186 | [[fix-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2187 | === Fix Change |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2188 | -- |
| 2189 | 'POST /changes/link:#change-id[\{change-id\}]/check' |
| 2190 | -- |
| 2191 | |
| 2192 | Performs consistency checks on the change as with link:#check-change[GET |
| 2193 | /check], and additionally fixes any problems that can be fixed |
| 2194 | automatically. The returned field values reflect any fixes. |
| 2195 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 2196 | Some fixes have options controlling their behavior, which can be set in the |
| 2197 | link:#fix-input[FixInput] entity body. |
| 2198 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2199 | Only the change owner, a project owner, or an administrator may fix changes. |
| 2200 | |
| 2201 | .Request |
| 2202 | ---- |
| 2203 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2204 | ---- |
| 2205 | |
| 2206 | .Response |
| 2207 | ---- |
| 2208 | HTTP/1.1 200 OK |
| 2209 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2210 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2211 | |
| 2212 | )]}' |
| 2213 | { |
| 2214 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2215 | "project": "myProject", |
| 2216 | "branch": "master", |
| 2217 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2218 | "subject": "Implementing Feature X", |
| 2219 | "status": "MERGED", |
| 2220 | "created": "2013-02-01 09:59:32.126000000", |
| 2221 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 2222 | "submitted": "2013-02-21 11:16:36.615000000", |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2223 | "mergeable": true, |
| 2224 | "insertions": 34, |
| 2225 | "deletions": 101, |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2226 | "_number": 3965, |
| 2227 | "owner": { |
| 2228 | "name": "John Doe" |
| 2229 | }, |
| 2230 | "problems": [ |
| 2231 | { |
| 2232 | "message": "Current patch set 2 not found" |
| 2233 | }, |
| 2234 | { |
| 2235 | "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW", |
| 2236 | "status": FIXED, |
| 2237 | "outcome": "Marked change as merged" |
| 2238 | } |
| 2239 | ] |
| 2240 | } |
| 2241 | ---- |
| 2242 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2243 | [[set-work-in-pogress]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2244 | === Set Work-In-Progress |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2245 | -- |
| 2246 | 'POST /changes/link:#change-id[\{change-id\}]/wip' |
| 2247 | -- |
| 2248 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2249 | Marks the change as not ready for review yet. Changes may only be marked not |
| 2250 | ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2251 | |
| 2252 | The request body does not need to include a |
| 2253 | link:#work-in-progress-input[WorkInProgressInput] entity if no review comment |
| 2254 | is added. Actions that create a new patch set in a WIP change default to |
| 2255 | notifying *OWNER* instead of *ALL*. |
| 2256 | |
| 2257 | .Request |
| 2258 | ---- |
| 2259 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0 |
| 2260 | Content-Type: application/json; charset=UTF-8 |
| 2261 | |
| 2262 | { |
| 2263 | "message": "Refactoring needs to be done before we can proceed here." |
| 2264 | } |
| 2265 | ---- |
| 2266 | |
| 2267 | .Response |
| 2268 | ---- |
| 2269 | HTTP/1.1 200 OK |
| 2270 | ---- |
| 2271 | |
| 2272 | [[set-ready-for-review]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2273 | === Set Ready-For-Review |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2274 | -- |
| 2275 | 'POST /changes/link:#change-id[\{change-id\}]/ready' |
| 2276 | -- |
| 2277 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2278 | Marks the change as ready for review (set WIP property to false). Changes may |
| 2279 | only be marked ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2280 | |
| 2281 | Activates notifications of reviewer. The request body does not need |
| 2282 | to include a link:#work-in-progress-input[WorkInProgressInput] entity |
| 2283 | if no review comment is added. |
| 2284 | |
| 2285 | .Request |
| 2286 | ---- |
| 2287 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0 |
| 2288 | Content-Type: application/json;charset=UTF-8 |
| 2289 | |
| 2290 | { |
| 2291 | "message": "Refactoring is done." |
| 2292 | } |
| 2293 | |
| 2294 | ---- |
| 2295 | |
| 2296 | .Response |
| 2297 | ---- |
| 2298 | HTTP/1.1 200 OK |
| 2299 | ---- |
| 2300 | |
David Pursehouse | 7c5c3a5 | 2017-04-10 11:37:23 +0900 | [diff] [blame] | 2301 | [[mark-private]] |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2302 | === Mark Private |
| 2303 | -- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2304 | 'POST /changes/link:#change-id[\{change-id\}]/private' |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2305 | -- |
| 2306 | |
Patrick Hiesel | 707e61a | 2019-02-13 18:28:48 +0100 | [diff] [blame] | 2307 | Marks the change to be private. Only open changes can be marked private. |
| 2308 | Changes may only be marked private by the owner or site administrators. |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2309 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2310 | A message can be specified in the request body inside a |
| 2311 | link:#private-input[PrivateInput] entity. |
| 2312 | |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2313 | .Request |
| 2314 | ---- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2315 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2316 | Content-Type: application/json; charset=UTF-8 |
| 2317 | |
| 2318 | { |
| 2319 | "message": "After this security fix has been released we can make it public now." |
| 2320 | } |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2321 | ---- |
| 2322 | |
| 2323 | .Response |
| 2324 | ---- |
| 2325 | HTTP/1.1 201 Created |
| 2326 | ---- |
| 2327 | |
| 2328 | If the change was already private the response is "`200 OK`". |
| 2329 | |
| 2330 | [[unmark-private]] |
| 2331 | === Unmark Private |
| 2332 | -- |
| 2333 | 'DELETE /changes/link:#change-id[\{change-id\}]/private' |
| 2334 | -- |
| 2335 | |
| 2336 | Marks the change to be non-private. Note users can only unmark own private |
| 2337 | changes. |
| 2338 | |
| 2339 | .Request |
| 2340 | ---- |
| 2341 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2342 | ---- |
| 2343 | |
| 2344 | .Response |
| 2345 | ---- |
| 2346 | HTTP/1.1 204 No Content |
| 2347 | ---- |
| 2348 | |
| 2349 | If the change was already not private, the response is "`409 Conflict`". |
| 2350 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 2351 | A message can be specified in the request body inside a |
| 2352 | link:#private-input[PrivateInput] entity. Historically, this method allowed |
| 2353 | a body in the DELETE, but that behavior is |
| 2354 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 2355 | In this case, use a POST request instead: |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2356 | |
| 2357 | .Request |
| 2358 | ---- |
| 2359 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0 |
| 2360 | Content-Type: application/json; charset=UTF-8 |
| 2361 | |
| 2362 | { |
| 2363 | "message": "This is a security fix that must not be public." |
| 2364 | } |
| 2365 | ---- |
| 2366 | |
David Pursehouse | d656fa8 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 2367 | [[ignore]] |
| 2368 | === Ignore |
| 2369 | -- |
| 2370 | 'PUT /changes/link:#change-id[\{change-id\}]/ignore' |
| 2371 | -- |
| 2372 | |
| 2373 | 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] | 2374 | reviews dashboard, and email notifications will be suppressed. Ignoring |
| 2375 | a change does not cause the change's "updated" timestamp to be modified, |
| 2376 | and the owner is not notified. |
David Pursehouse | d656fa8 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 2377 | |
| 2378 | .Request |
| 2379 | ---- |
| 2380 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ignore HTTP/1.0 |
| 2381 | ---- |
| 2382 | |
| 2383 | [[unignore]] |
| 2384 | === Unignore |
| 2385 | -- |
| 2386 | 'PUT /changes/link:#change-id[\{change-id\}]/unignore' |
| 2387 | -- |
| 2388 | |
| 2389 | Un-marks a change as ignored. |
| 2390 | |
| 2391 | .Request |
| 2392 | ---- |
| 2393 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unignore HTTP/1.0 |
| 2394 | ---- |
| 2395 | |
Edwin Kempin | ceb673e | 2017-10-01 12:29:05 +0200 | [diff] [blame] | 2396 | [[mark-as-reviewed]] |
| 2397 | === Mark as Reviewed |
| 2398 | -- |
| 2399 | 'PUT /changes/link:#change-id[\{change-id\}]/reviewed' |
| 2400 | -- |
| 2401 | |
| 2402 | Marks a change as reviewed. |
| 2403 | |
| 2404 | This allows users to "de-highlight" changes in their dashboard until a new |
| 2405 | patch set is uploaded. |
| 2406 | |
| 2407 | This differs from the link:#ignore[ignore] endpoint, which will mute |
| 2408 | emails and hide the change from dashboard completely until it is |
| 2409 | link:#unignore[unignored] again. |
| 2410 | |
| 2411 | |
| 2412 | .Request |
| 2413 | ---- |
| 2414 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewed HTTP/1.0 |
| 2415 | ---- |
| 2416 | |
| 2417 | [[mark-as-unreviewed]] |
| 2418 | === Mark as Unreviewed |
| 2419 | -- |
| 2420 | 'PUT /changes/link:#change-id[\{change-id\}]/unreviewed' |
| 2421 | -- |
| 2422 | |
| 2423 | Marks a change as unreviewed. |
| 2424 | |
| 2425 | This allows users to "highlight" changes in their dashboard |
| 2426 | |
| 2427 | .Request |
| 2428 | ---- |
| 2429 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unreviewed HTTP/1.0 |
| 2430 | ---- |
| 2431 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2432 | [[get-hashtags]] |
| 2433 | === Get Hashtags |
| 2434 | -- |
| 2435 | 'GET /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2436 | -- |
| 2437 | |
| 2438 | Gets the hashtags associated with a change. |
| 2439 | |
| 2440 | [NOTE] Hashtags are only available when NoteDb is enabled. |
| 2441 | |
| 2442 | .Request |
| 2443 | ---- |
| 2444 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2445 | ---- |
| 2446 | |
| 2447 | As response the change's hashtags are returned as a list of strings. |
| 2448 | |
| 2449 | .Response |
| 2450 | ---- |
| 2451 | HTTP/1.1 200 OK |
| 2452 | Content-Disposition: attachment |
| 2453 | Content-Type: application/json; charset=UTF-8 |
| 2454 | |
| 2455 | )]}' |
| 2456 | [ |
| 2457 | "hashtag1", |
| 2458 | "hashtag2" |
| 2459 | ] |
| 2460 | ---- |
| 2461 | |
| 2462 | [[set-hashtags]] |
| 2463 | === Set Hashtags |
| 2464 | -- |
| 2465 | 'POST /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2466 | -- |
| 2467 | |
| 2468 | Adds and/or removes hashtags from a change. |
| 2469 | |
| 2470 | [NOTE] Hashtags are only available when NoteDb is enabled. |
| 2471 | |
| 2472 | The hashtags to add or remove must be provided in the request body inside a |
| 2473 | link:#hashtags-input[HashtagsInput] entity. |
| 2474 | |
| 2475 | .Request |
| 2476 | ---- |
| 2477 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2478 | Content-Type: application/json; charset=UTF-8 |
| 2479 | |
| 2480 | { |
| 2481 | "add" : [ |
| 2482 | "hashtag3" |
| 2483 | ], |
| 2484 | "remove" : [ |
| 2485 | "hashtag2" |
| 2486 | ] |
| 2487 | } |
| 2488 | ---- |
| 2489 | |
| 2490 | As response the change's hashtags are returned as a list of strings. |
| 2491 | |
| 2492 | .Response |
| 2493 | ---- |
| 2494 | HTTP/1.1 200 OK |
| 2495 | Content-Disposition: attachment |
| 2496 | Content-Type: application/json; charset=UTF-8 |
| 2497 | |
| 2498 | )]}' |
| 2499 | [ |
| 2500 | "hashtag1", |
| 2501 | "hashtag3" |
| 2502 | ] |
| 2503 | ---- |
| 2504 | |
Changcheng Xiao | 7fb7329 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2505 | [[list-change-messages]] |
| 2506 | === List Change Messages |
| 2507 | -- |
| 2508 | 'GET /changes/link:#change-id[\{change-id\}]/messages' |
| 2509 | -- |
| 2510 | |
| 2511 | Lists all the messages of a change including link:#detailed-accounts[detailed account information]. |
| 2512 | |
| 2513 | .Request |
| 2514 | ---- |
| 2515 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages |
| 2516 | ---- |
| 2517 | |
| 2518 | As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned. |
| 2519 | |
| 2520 | .Response |
| 2521 | ---- |
| 2522 | HTTP/1.1 200 OK |
| 2523 | Content-Disposition: attachment |
| 2524 | Content-Type: application/json; charset=UTF-8 |
| 2525 | |
| 2526 | )]}' |
| 2527 | [ |
| 2528 | { |
| 2529 | "id": "YH-egE", |
| 2530 | "author": { |
| 2531 | "_account_id": 1000096, |
| 2532 | "name": "John Doe", |
| 2533 | "email": "john.doe@example.com", |
| 2534 | "username": "jdoe" |
| 2535 | }, |
| 2536 | "date": "2013-03-23 21:34:02.419000000", |
| 2537 | "message": "Patch Set 1:\n\nThis is the first message.", |
| 2538 | "_revision_number": 1 |
| 2539 | }, |
| 2540 | { |
| 2541 | "id": "WEEdhU", |
| 2542 | "author": { |
| 2543 | "_account_id": 1000097, |
| 2544 | "name": "Jane Roe", |
| 2545 | "email": "jane.roe@example.com", |
| 2546 | "username": "jroe" |
| 2547 | }, |
| 2548 | "date": "2013-03-23 21:36:52.332000000", |
| 2549 | "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.", |
| 2550 | "_revision_number": 1 |
| 2551 | } |
| 2552 | ] |
| 2553 | ---- |
David Pursehouse | c32050d | 2017-08-25 16:27:47 +0900 | [diff] [blame] | 2554 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 2555 | [[get-change-message]] |
| 2556 | === Get Change Message |
| 2557 | |
| 2558 | Retrieves a change message including link:#detailed-accounts[detailed account information]. |
| 2559 | |
| 2560 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2561 | '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] | 2562 | -- |
| 2563 | |
| 2564 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned. |
| 2565 | |
| 2566 | .Response |
| 2567 | ---- |
| 2568 | HTTP/1.1 200 OK |
| 2569 | Content-Disposition: attachment |
| 2570 | Content-Type: application/json; charset=UTF-8 |
| 2571 | |
| 2572 | )]}' |
| 2573 | { |
| 2574 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 2575 | "author": { |
| 2576 | "_account_id": 1000096, |
| 2577 | "name": "John Doe", |
| 2578 | "email": "john.doe@example.com", |
| 2579 | "username": "jdoe" |
| 2580 | }, |
| 2581 | "date": "2013-03-23 21:34:02.419000000", |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2582 | "message": "a change message", |
| 2583 | "_revision_number": 1 |
| 2584 | } |
| 2585 | ---- |
| 2586 | |
| 2587 | [[delete-change-message]] |
| 2588 | === Delete Change Message |
| 2589 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2590 | 'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' + |
| 2591 | '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] | 2592 | -- |
| 2593 | |
| 2594 | Deletes a change message by replacing the change message with a new message, |
| 2595 | which contains the name of the user who deleted the change message and the |
| 2596 | reason why it was deleted. The reason can be provided in the request body as a |
| 2597 | link:#delete-change-message-input[DeleteChangeMessageInput] entity. |
| 2598 | |
| 2599 | Note that only users with the |
| 2600 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 2601 | global capability are permitted to delete a change message. |
| 2602 | |
| 2603 | To delete a change message, send a DELETE request: |
| 2604 | |
| 2605 | .Request |
| 2606 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2607 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2608 | ---- |
| 2609 | |
| 2610 | To provide a reason for the deletion, use a POST request: |
| 2611 | |
| 2612 | .Request |
| 2613 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2614 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2615 | Content-Type: application/json; charset=UTF-8 |
| 2616 | |
| 2617 | { |
| 2618 | "reason": "spam" |
| 2619 | } |
| 2620 | ---- |
| 2621 | |
| 2622 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned that |
| 2623 | describes the updated change message. |
| 2624 | |
| 2625 | .Response |
| 2626 | ---- |
| 2627 | HTTP/1.1 200 OK |
| 2628 | Content-Disposition: attachment |
| 2629 | Content-Type: application/json; charset=UTF-8 |
| 2630 | |
| 2631 | )]}' |
| 2632 | { |
| 2633 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 2634 | "author": { |
| 2635 | "_account_id": 1000096, |
| 2636 | "name": "John Doe", |
| 2637 | "email": "john.doe@example.com", |
| 2638 | "username": "jdoe" |
| 2639 | }, |
| 2640 | "date": "2013-03-23 21:34:02.419000000", |
| 2641 | "message": "Change message removed by: Administrator\nReason: spam", |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 2642 | "_revision_number": 1 |
| 2643 | } |
| 2644 | ---- |
Gustaf Lundh | e8647c6 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 2645 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2646 | [[edit-endpoints]] |
| 2647 | == Change Edit Endpoints |
| 2648 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2649 | [[get-edit-detail]] |
| 2650 | === Get Change Edit Details |
| 2651 | -- |
| 2652 | 'GET /changes/link:#change-id[\{change-id\}]/edit |
| 2653 | -- |
| 2654 | |
| 2655 | Retrieves a change edit details. |
| 2656 | |
| 2657 | .Request |
| 2658 | ---- |
| 2659 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 2660 | ---- |
| 2661 | |
| 2662 | As response an link:#edit-info[EditInfo] entity is returned that |
| 2663 | describes the change edit, or "`204 No Content`" when change edit doesn't |
| 2664 | exist for this change. Change edits are stored on special branches and there |
| 2665 | 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] | 2666 | When request parameter `list` is provided the response also includes the file |
| 2667 | list. When `base` request parameter is provided the file list is computed |
David Ostrovsky | 5562fe5 | 2014-08-12 22:36:27 +0200 | [diff] [blame] | 2668 | against this base revision. When request parameter `download-commands` is |
| 2669 | provided fetch info map is also included. |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2670 | |
| 2671 | .Response |
| 2672 | ---- |
| 2673 | HTTP/1.1 200 OK |
| 2674 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2675 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2676 | |
| 2677 | )]}' |
| 2678 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2679 | "commit": { |
| 2680 | "parents": [ |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2681 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2682 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2683 | } |
| 2684 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2685 | "author": { |
| 2686 | "name": "Shawn O. Pearce", |
| 2687 | "email": "sop@google.com", |
| 2688 | "date": "2012-04-24 18:08:08.000000000", |
| 2689 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2690 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2691 | "committer": { |
| 2692 | "name": "Shawn O. Pearce", |
| 2693 | "email": "sop@google.com", |
| 2694 | "date": "2012-04-24 18:08:08.000000000", |
| 2695 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2696 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2697 | "subject": "Use an EventBus to manage star icons", |
| 2698 | "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] | 2699 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2700 | "base_patch_set_number": 1, |
| 2701 | "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3", |
| 2702 | "ref": "refs/users/01/1000001/edit-76482/1" |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2703 | } |
| 2704 | ---- |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 2705 | |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 2706 | [[put-edit-file]] |
| 2707 | === Change file content in Change Edit |
| 2708 | -- |
| 2709 | 'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile |
| 2710 | -- |
| 2711 | |
| 2712 | Put content of a file to a change edit. |
| 2713 | |
| 2714 | .Request |
| 2715 | ---- |
| 2716 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 2717 | ---- |
| 2718 | |
| 2719 | When change edit doesn't exist for this change yet it is created. When file |
| 2720 | content isn't provided, it is wiped out for that file. As response |
| 2721 | "`204 No Content`" is returned. |
| 2722 | |
| 2723 | .Response |
| 2724 | ---- |
| 2725 | HTTP/1.1 204 No Content |
| 2726 | ---- |
| 2727 | |
Gal Paikin | 68d217b | 2019-10-07 21:01:22 +0200 | [diff] [blame] | 2728 | When the change edit is a no-op, for example when providing the same file |
| 2729 | content that the file already has, '409 no changes were made' is returned. |
| 2730 | |
| 2731 | .Response |
| 2732 | ---- |
| 2733 | HTTP/1.1 409 no changes were made |
| 2734 | ---- |
| 2735 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2736 | [[post-edit]] |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2737 | === Restore file content or rename files in Change Edit |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2738 | -- |
| 2739 | 'POST /changes/link:#change-id[\{change-id\}]/edit |
| 2740 | -- |
| 2741 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2742 | Creates empty change edit, restores file content or renames files in change |
| 2743 | edit. The request body needs to include a |
| 2744 | link:#change-edit-input[ChangeEditInput] entity when a file within change |
| 2745 | 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] | 2746 | |
| 2747 | .Request |
| 2748 | ---- |
| 2749 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2750 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2751 | |
| 2752 | { |
David Ostrovsky | bd12e17 | 2014-08-21 23:08:15 +0200 | [diff] [blame] | 2753 | "restore_path": "foo" |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2754 | } |
| 2755 | ---- |
| 2756 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2757 | or for rename: |
| 2758 | |
| 2759 | .Request |
| 2760 | ---- |
| 2761 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 2762 | Content-Type: application/json; charset=UTF-8 |
| 2763 | |
| 2764 | { |
| 2765 | "old_path": "foo", |
| 2766 | "new_path": "bar" |
| 2767 | } |
| 2768 | ---- |
| 2769 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2770 | 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] | 2771 | and restore flag are provided in request body, this file is restored. When |
| 2772 | old and new file names are provided, the file is renamed. As response |
| 2773 | "`204 No Content`" is returned. |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2774 | |
| 2775 | .Response |
| 2776 | ---- |
| 2777 | HTTP/1.1 204 No Content |
| 2778 | ---- |
| 2779 | |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 2780 | [[put-change-edit-message]] |
| 2781 | === Change commit message in Change Edit |
| 2782 | -- |
| 2783 | 'PUT /changes/link:#change-id[\{change-id\}]/edit:message |
| 2784 | -- |
| 2785 | |
| 2786 | Modify commit message. The request body needs to include a |
| 2787 | link:#change-edit-message-input[ChangeEditMessageInput] |
| 2788 | entity. |
| 2789 | |
| 2790 | .Request |
| 2791 | ---- |
| 2792 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2793 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 2794 | |
| 2795 | { |
| 2796 | "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444" |
| 2797 | } |
| 2798 | ---- |
| 2799 | |
| 2800 | If a change edit doesn't exist for this change yet, it is created. As |
| 2801 | response "`204 No Content`" is returned. |
| 2802 | |
| 2803 | .Response |
| 2804 | ---- |
| 2805 | HTTP/1.1 204 No Content |
| 2806 | ---- |
| 2807 | |
David Ostrovsky | 2830c29 | 2014-08-01 02:24:31 +0200 | [diff] [blame] | 2808 | [[delete-edit-file]] |
| 2809 | === Delete file in Change Edit |
| 2810 | -- |
| 2811 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile' |
| 2812 | -- |
| 2813 | |
| 2814 | Deletes a file from a change edit. This deletes the file from the repository |
| 2815 | completely. This is not the same as reverting or restoring a file to its |
| 2816 | previous contents. |
| 2817 | |
| 2818 | .Request |
| 2819 | ---- |
| 2820 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 2821 | ---- |
| 2822 | |
| 2823 | When change edit doesn't exist for this change yet it is created. |
| 2824 | |
| 2825 | .Response |
| 2826 | ---- |
| 2827 | HTTP/1.1 204 No Content |
| 2828 | ---- |
| 2829 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2830 | [[get-edit-file]] |
| 2831 | === Retrieve file content from Change Edit |
| 2832 | -- |
| 2833 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile |
| 2834 | -- |
| 2835 | |
| 2836 | Retrieves content of a file from a change edit. |
| 2837 | |
| 2838 | .Request |
| 2839 | ---- |
| 2840 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 2841 | ---- |
| 2842 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 2843 | The content of the file is returned as text encoded inside base64. |
| 2844 | The Content-Type header will always be `text/plain` reflecting the |
| 2845 | outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header |
| 2846 | can be examined to find the server detected content type of the file. |
| 2847 | |
| 2848 | When the specified file was deleted in the change edit |
| 2849 | "`204 No Content`" is returned. |
| 2850 | |
| 2851 | If only the content type is required, callers should use HEAD to |
| 2852 | avoid downloading the encoded file contents. |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2853 | |
Michael Zhou | 551ad0c | 2016-04-26 01:21:42 -0400 | [diff] [blame] | 2854 | If the `base` parameter is set to true, the returned content is from the |
| 2855 | revision that the edit is based on. |
| 2856 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2857 | .Response |
| 2858 | ---- |
| 2859 | HTTP/1.1 200 OK |
| 2860 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2861 | Content-Type: text/plain; charset=ISO-8859-1 |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2862 | X-FYI-Content-Encoding: base64 |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 2863 | X-FYI-Content-Type: text/xml |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 2864 | |
| 2865 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
| 2866 | ---- |
| 2867 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 2868 | Alternatively, if the only value of the Accept request header is |
| 2869 | `application/json` the content is returned as JSON string and |
| 2870 | `X-FYI-Content-Encoding` is set to `json`. |
| 2871 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 2872 | [[get-edit-meta-data]] |
| 2873 | === Retrieve meta data of a file from Change Edit |
| 2874 | -- |
| 2875 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta |
| 2876 | -- |
| 2877 | |
| 2878 | Retrieves meta data of a file from a change edit. Currently only |
| 2879 | web links are returned. |
| 2880 | |
| 2881 | .Request |
| 2882 | ---- |
| 2883 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0 |
| 2884 | ---- |
| 2885 | |
| 2886 | This REST endpoint retrieves additional information for a file in a |
| 2887 | change edit. As result an link:#edit-file-info[EditFileInfo] entity is |
| 2888 | returned. |
| 2889 | |
| 2890 | .Response |
| 2891 | ---- |
| 2892 | HTTP/1.1 200 OK |
| 2893 | Content-Disposition: attachment |
| 2894 | Content-Type: application/json; charset=UTF-8 |
| 2895 | |
| 2896 | )]}' |
| 2897 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2898 | "web_links": [ |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 2899 | { |
| 2900 | "show_on_side_by_side_diff_view": true, |
| 2901 | "name": "side-by-side preview diff", |
| 2902 | "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png", |
| 2903 | "url": "#/x/xdocs/c/42/1..0/README.md", |
| 2904 | "target": "_self" |
| 2905 | }, |
| 2906 | { |
| 2907 | "show_on_unified_diff_view": true, |
| 2908 | "name": "unified preview diff", |
| 2909 | "image_url": "plugins/xdocs/static/unifiedDiffPreview.png", |
| 2910 | "url": "#/x/xdocs/c/42/1..0/README.md,unified", |
| 2911 | "target": "_self" |
| 2912 | } |
| 2913 | ]} |
| 2914 | ---- |
| 2915 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 2916 | [[get-edit-message]] |
| 2917 | === Retrieve commit message from Change Edit or current patch set of the change |
| 2918 | -- |
| 2919 | 'GET /changes/link:#change-id[\{change-id\}]/edit:message |
| 2920 | -- |
| 2921 | |
David Ostrovsky | 25ad15e | 2014-12-15 21:18:59 +0100 | [diff] [blame] | 2922 | Retrieves commit message from change edit. |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 2923 | |
David Ostrovsky | 0ee0bb2 | 2016-05-31 22:47:47 +0200 | [diff] [blame] | 2924 | If the `base` parameter is set to true, the returned message is from the |
| 2925 | revision that the edit is based on. |
| 2926 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 2927 | .Request |
| 2928 | ---- |
| 2929 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
| 2930 | ---- |
| 2931 | |
| 2932 | The commit message is returned as base64 encoded string. |
| 2933 | |
| 2934 | .Response |
| 2935 | ---- |
| 2936 | HTTP/1.1 200 OK |
| 2937 | |
| 2938 | VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz |
| 2939 | M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg== |
| 2940 | ---- |
| 2941 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 2942 | Alternatively, if the only value of the Accept request header is |
| 2943 | `application/json` the commit message is returned as JSON string: |
| 2944 | |
| 2945 | .Response |
| 2946 | ---- |
| 2947 | HTTP/1.1 200 OK |
| 2948 | |
| 2949 | )]}' |
| 2950 | "Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n" |
| 2951 | ---- |
| 2952 | |
| 2953 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 2954 | [[publish-edit]] |
| 2955 | === Publish Change Edit |
| 2956 | -- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 2957 | 'POST /changes/link:#change-id[\{change-id\}]/edit:publish |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 2958 | -- |
| 2959 | |
| 2960 | Promotes change edit to a regular patch set. |
| 2961 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 2962 | Options can be provided in the request body as a |
| 2963 | link:#publish-change-edit-input[PublishChangeEditInput] entity. |
| 2964 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 2965 | .Request |
| 2966 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 2967 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0 |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 2968 | Content-Type: application/json; charset=UTF-8 |
| 2969 | |
| 2970 | { |
| 2971 | "notify": "NONE" |
| 2972 | } |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 2973 | ---- |
| 2974 | |
| 2975 | As response "`204 No Content`" is returned. |
| 2976 | |
| 2977 | .Response |
| 2978 | ---- |
| 2979 | HTTP/1.1 204 No Content |
| 2980 | ---- |
| 2981 | |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 2982 | [[rebase-edit]] |
| 2983 | === Rebase Change Edit |
| 2984 | -- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 2985 | 'POST /changes/link:#change-id[\{change-id\}]/edit:rebase |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 2986 | -- |
| 2987 | |
| 2988 | Rebases change edit on top of latest patch set. |
| 2989 | |
| 2990 | .Request |
| 2991 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 2992 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0 |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 2993 | ---- |
| 2994 | |
| 2995 | When change was rebased on top of latest patch set, response |
David Pursehouse | 56fbc08 | 2015-05-19 16:33:03 +0900 | [diff] [blame] | 2996 | "`204 No Content`" is returned. When change edit is already |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 2997 | based on top of the latest patch set, the response |
| 2998 | "`409 Conflict`" is returned. |
| 2999 | |
| 3000 | .Response |
| 3001 | ---- |
| 3002 | HTTP/1.1 204 No Content |
| 3003 | ---- |
| 3004 | |
David Ostrovsky | 8e75f50 | 2014-08-10 00:36:31 +0200 | [diff] [blame] | 3005 | [[delete-edit]] |
| 3006 | === Delete Change Edit |
| 3007 | -- |
| 3008 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit' |
| 3009 | -- |
| 3010 | |
| 3011 | Deletes change edit. |
| 3012 | |
| 3013 | .Request |
| 3014 | ---- |
| 3015 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 3016 | ---- |
| 3017 | |
| 3018 | As response "`204 No Content`" is returned. |
| 3019 | |
| 3020 | .Response |
| 3021 | ---- |
| 3022 | HTTP/1.1 204 No Content |
| 3023 | ---- |
| 3024 | |
Edwin Kempin | 9a9f1c0 | 2017-01-02 15:10:49 +0100 | [diff] [blame] | 3025 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3026 | [[reviewer-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3027 | == Reviewer Endpoints |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3028 | |
| 3029 | [[list-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3030 | === List Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3031 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3032 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3033 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3034 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3035 | Lists the reviewers of a change. |
| 3036 | |
| 3037 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 3038 | |
| 3039 | .Request |
| 3040 | ---- |
| 3041 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0 |
| 3042 | ---- |
| 3043 | |
| 3044 | .Response |
| 3045 | ---- |
| 3046 | HTTP/1.1 200 OK |
| 3047 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3048 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3049 | |
| 3050 | )]}' |
| 3051 | [ |
| 3052 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3053 | "approvals": { |
| 3054 | "Verified": "+1", |
| 3055 | "Code-Review": "+2" |
| 3056 | }, |
| 3057 | "_account_id": 1000096, |
| 3058 | "name": "John Doe", |
| 3059 | "email": "john.doe@example.com" |
| 3060 | }, |
| 3061 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3062 | "approvals": { |
| 3063 | "Verified": " 0", |
| 3064 | "Code-Review": "-1" |
| 3065 | }, |
| 3066 | "_account_id": 1000097, |
| 3067 | "name": "Jane Roe", |
| 3068 | "email": "jane.roe@example.com" |
| 3069 | } |
| 3070 | ] |
| 3071 | ---- |
| 3072 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3073 | [[suggest-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3074 | === Suggest Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3075 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3076 | '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] | 3077 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3078 | |
| 3079 | Suggest the reviewers for a given query `q` and result limit `n`. If result |
| 3080 | limit is not passed, then the default 10 is used. |
| 3081 | |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3082 | This REST endpoint only suggests accounts that |
| 3083 | |
| 3084 | * are active |
| 3085 | * can see the change |
| 3086 | * are visible to the calling user |
| 3087 | * are not already reviewer on the change |
| 3088 | * don't own the change |
| 3089 | |
Edwin Kempin | ec02a55 | 2019-08-27 09:30:15 +0200 | [diff] [blame] | 3090 | Groups can be excluded from the results by specifying the 'exclude-groups' |
| 3091 | request parameter: |
| 3092 | |
| 3093 | -- |
| 3094 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups' |
| 3095 | -- |
Patrick Hiesel | c79ae0e | 2017-06-28 14:50:53 +0200 | [diff] [blame] | 3096 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3097 | As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned. |
| 3098 | |
| 3099 | .Request |
| 3100 | ---- |
| 3101 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0 |
| 3102 | ---- |
| 3103 | |
| 3104 | .Response |
| 3105 | ---- |
| 3106 | HTTP/1.1 200 OK |
| 3107 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3108 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3109 | |
| 3110 | )]}' |
| 3111 | [ |
| 3112 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3113 | "account": { |
| 3114 | "_account_id": 1000097, |
| 3115 | "name": "Jane Roe", |
| 3116 | "email": "jane.roe@example.com" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3117 | }, |
| 3118 | "count": 1 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3119 | }, |
| 3120 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3121 | "group": { |
| 3122 | "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279", |
| 3123 | "name": "Joiner" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3124 | }, |
| 3125 | "count": 5 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3126 | } |
| 3127 | ] |
| 3128 | ---- |
| 3129 | |
Edwin Kempin | 0ca3f72 | 2019-08-27 09:43:31 +0200 | [diff] [blame] | 3130 | To suggest CCs `reviewer-state=CC` can be specified as additional URL |
| 3131 | parameter. This includes existing reviewers in the result, but excludes |
| 3132 | existing CCs. |
| 3133 | |
| 3134 | -- |
| 3135 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC' |
| 3136 | -- |
| 3137 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3138 | [[get-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3139 | === Get Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3140 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3141 | '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] | 3142 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3143 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3144 | Retrieves a reviewer of a change. |
| 3145 | |
| 3146 | As response a link:#reviewer-info[ReviewerInfo] entity is returned that |
| 3147 | describes the reviewer. |
| 3148 | |
| 3149 | .Request |
| 3150 | ---- |
| 3151 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0 |
| 3152 | ---- |
| 3153 | |
| 3154 | .Response |
| 3155 | ---- |
| 3156 | HTTP/1.1 200 OK |
| 3157 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3158 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3159 | |
| 3160 | )]}' |
| 3161 | { |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3162 | "approvals": { |
| 3163 | "Verified": "+1", |
| 3164 | "Code-Review": "+2" |
| 3165 | }, |
| 3166 | "_account_id": 1000096, |
| 3167 | "name": "John Doe", |
| 3168 | "email": "john.doe@example.com" |
| 3169 | } |
| 3170 | ---- |
| 3171 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3172 | [[add-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3173 | === Add Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3174 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3175 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3176 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3177 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3178 | Adds one user or all members of one group as reviewer to the change. |
| 3179 | |
| 3180 | The reviewer to be added to the change must be provided in the request |
| 3181 | body as a link:#reviewer-input[ReviewerInput] entity. |
| 3182 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3183 | Users can be moved from reviewer to CC and vice versa. This means if a |
| 3184 | user is added as CC that is already a reviewer on the change, the |
| 3185 | reviewer state of that user is updated to CC. If a user that is already |
| 3186 | a CC on the change is added as reviewer, the reviewer state of that |
| 3187 | user is updated to reviewer. |
| 3188 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3189 | .Request |
| 3190 | ---- |
| 3191 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3192 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3193 | |
| 3194 | { |
| 3195 | "reviewer": "john.doe@example.com" |
| 3196 | } |
| 3197 | ---- |
| 3198 | |
| 3199 | As response an link:#add-reviewer-result[AddReviewerResult] entity is |
| 3200 | returned that describes the newly added reviewers. |
| 3201 | |
| 3202 | .Response |
| 3203 | ---- |
| 3204 | HTTP/1.1 200 OK |
| 3205 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3206 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3207 | |
| 3208 | )]}' |
| 3209 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3210 | "input": "john.doe@example.com", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3211 | "reviewers": [ |
| 3212 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3213 | "_account_id": 1000096, |
| 3214 | "name": "John Doe", |
| 3215 | "email": "john.doe@example.com" |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3216 | "approvals": { |
| 3217 | "Verified": " 0", |
| 3218 | "Code-Review": " 0" |
| 3219 | }, |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3220 | } |
| 3221 | ] |
| 3222 | } |
| 3223 | ---- |
| 3224 | |
| 3225 | If a group is specified, adding the group members as reviewers is an |
| 3226 | atomic operation. This means if an error is returned, none of the |
| 3227 | members are added as reviewer. |
| 3228 | |
| 3229 | If a group with many members is added as reviewer a confirmation may be |
| 3230 | required. |
| 3231 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3232 | If a group is added as CC and members of this group are already |
| 3233 | reviewers on the change, these members stay reviewers on the change |
| 3234 | (they are not downgraded to CC). However if a group is added as |
| 3235 | reviewer, all group members become reviewer of the change, even if they |
| 3236 | have been added as CC before. |
| 3237 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3238 | .Request |
| 3239 | ---- |
| 3240 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3241 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3242 | |
| 3243 | { |
| 3244 | "reviewer": "MyProjectVerifiers" |
| 3245 | } |
| 3246 | ---- |
| 3247 | |
| 3248 | .Response |
| 3249 | ---- |
| 3250 | HTTP/1.1 200 OK |
| 3251 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3252 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3253 | |
| 3254 | )]}' |
| 3255 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3256 | "input": "MyProjectVerifiers", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3257 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 3258 | "confirm": true |
| 3259 | } |
| 3260 | ---- |
| 3261 | |
| 3262 | To confirm the addition of the reviewers, resend the request with the |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3263 | `confirmed` flag being set. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3264 | |
| 3265 | .Request |
| 3266 | ---- |
| 3267 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3268 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3269 | |
| 3270 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3271 | "input": "MyProjectVerifiers", |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3272 | "confirmed": true |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3273 | } |
| 3274 | ---- |
| 3275 | |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 3276 | If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set |
| 3277 | for the project, reviewers and CCs are not required to have a Gerrit account. If you POST |
| 3278 | an email address of a reviewer or CC then, they will be added to the change even if they |
| 3279 | don't have a Gerrit account. |
| 3280 | |
| 3281 | If this option is disabled, the request would fail with `400 Bad Request` if the email |
| 3282 | address can't be resolved to an active Gerrit account. |
| 3283 | |
| 3284 | Note that the name is optional so both "un.registered@reviewer.com" and |
| 3285 | "John Doe <un.registered@reviewer.com>" are valid inputs. |
| 3286 | |
| 3287 | Reviewers without Gerrit accounts can only be added on changes visible to anonymous users. |
| 3288 | |
| 3289 | .Request |
| 3290 | ---- |
| 3291 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 3292 | Content-Type: application/json; charset=UTF-8 |
| 3293 | |
| 3294 | { |
| 3295 | "reviewer": "John Doe <un.registered@reviewer.com>" |
| 3296 | } |
| 3297 | ---- |
| 3298 | |
| 3299 | .Response |
| 3300 | ---- |
| 3301 | HTTP/1.1 200 OK |
| 3302 | Content-Disposition: attachment |
| 3303 | Content-Type: application/json; charset=UTF-8 |
| 3304 | |
| 3305 | )]}' |
| 3306 | { |
| 3307 | "input": "John Doe <un.registered@reviewer.com>" |
| 3308 | } |
| 3309 | ---- |
| 3310 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3311 | .Notifications |
| 3312 | |
| 3313 | An email will be sent using the "newchange" template. |
| 3314 | |
| 3315 | [options="header",cols="1,1,1"] |
| 3316 | |============================= |
| 3317 | |WIP State |Default|notify=ALL |
| 3318 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 3319 | |Work in progress|not sent|owner, reviewers, CCs |
| 3320 | |============================= |
| 3321 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3322 | [[delete-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3323 | === Delete Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3324 | -- |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3325 | 'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' + |
| 3326 | '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] | 3327 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3328 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3329 | Deletes a reviewer from a change. |
| 3330 | |
| 3331 | .Request |
| 3332 | ---- |
| 3333 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0 |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3334 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3335 | ---- |
| 3336 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3337 | Options can be provided in the request body as a |
| 3338 | link:#delete-reviewer-input[DeleteReviewerInput] entity. |
| 3339 | Historically, this method allowed a body in the DELETE, but that behavior is |
| 3340 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 3341 | In this case, use a POST request instead: |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3342 | |
| 3343 | .Request |
| 3344 | ---- |
| 3345 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3346 | Content-Type: application/json; charset=UTF-8 |
| 3347 | |
| 3348 | { |
| 3349 | "notify": "NONE" |
| 3350 | } |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3351 | ---- |
| 3352 | |
| 3353 | .Response |
| 3354 | ---- |
| 3355 | HTTP/1.1 204 No Content |
| 3356 | ---- |
| 3357 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 3358 | .Notifications |
| 3359 | |
| 3360 | An email will be sent using the "deleteReviewer" template. If deleting the |
| 3361 | reviewer resulted in one or more approvals being removed, then the deleted |
| 3362 | reviewer will also receive a notification (unless notify=NONE). |
| 3363 | |
| 3364 | [options="header",cols="1,5"] |
| 3365 | |============================= |
| 3366 | |WIP State |Default Recipients |
| 3367 | |Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers |
| 3368 | |Work in progress|notify=NONE: deleted reviewer (if voted) |
| 3369 | |============================= |
| 3370 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3371 | [[list-votes]] |
| 3372 | === List Votes |
| 3373 | -- |
| 3374 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 3375 | -- |
| 3376 | |
| 3377 | Lists the votes for a specific reviewer of the change. |
| 3378 | |
| 3379 | .Request |
| 3380 | ---- |
Edwin Kempin | 314f10a | 2016-07-11 11:39:05 +0200 | [diff] [blame] | 3381 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0 |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3382 | ---- |
| 3383 | |
| 3384 | As result a map is returned that maps the label name to the label value. |
| 3385 | The entries in the map are sorted by label name. |
| 3386 | |
| 3387 | .Response |
| 3388 | ---- |
| 3389 | HTTP/1.1 200 OK |
| 3390 | Content-Disposition: attachment |
| 3391 | Content-Type: application/json;charset=UTF-8 |
| 3392 | |
| 3393 | )]}' |
| 3394 | { |
| 3395 | "Code-Review": -1, |
| 3396 | "Verified": 1 |
| 3397 | "Work-In-Progress": 1, |
| 3398 | } |
| 3399 | ---- |
| 3400 | |
| 3401 | [[delete-vote]] |
| 3402 | === Delete Vote |
| 3403 | -- |
Edwin Kempin | 5488dc1 | 2016-08-29 11:13:31 +0200 | [diff] [blame] | 3404 | '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] | 3405 | '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] | 3406 | -- |
| 3407 | |
| 3408 | Deletes a single vote from a change. Note, that even when the last vote of |
| 3409 | a reviewer is removed the reviewer itself is still listed on the change. |
| 3410 | |
| 3411 | .Request |
| 3412 | ---- |
| 3413 | 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] | 3414 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 3415 | ---- |
| 3416 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3417 | Options can be provided in the request body as a |
| 3418 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 3419 | Historically, this method allowed a body in the DELETE, but that behavior is |
| 3420 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 3421 | In this case, use a POST request instead: |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 3422 | |
| 3423 | .Request |
| 3424 | ---- |
| 3425 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 3426 | Content-Type: application/json; charset=UTF-8 |
| 3427 | |
| 3428 | { |
| 3429 | "notify": "NONE" |
| 3430 | } |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3431 | ---- |
| 3432 | |
| 3433 | .Response |
| 3434 | ---- |
| 3435 | HTTP/1.1 204 No Content |
| 3436 | ---- |
| 3437 | |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 3438 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3439 | [[revision-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3440 | == Revision Endpoints |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3441 | |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3442 | [[get-commit]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3443 | === Get Commit |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3444 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3445 | '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] | 3446 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3447 | |
| 3448 | Retrieves a parsed commit of a revision. |
| 3449 | |
| 3450 | .Request |
| 3451 | ---- |
| 3452 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0 |
| 3453 | ---- |
| 3454 | |
| 3455 | As response a link:#commit-info[CommitInfo] entity is returned that |
| 3456 | describes the revision. |
| 3457 | |
| 3458 | .Response |
| 3459 | ---- |
| 3460 | HTTP/1.1 200 OK |
| 3461 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3462 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3463 | |
| 3464 | )]}' |
| 3465 | { |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 3466 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3467 | "parents": [ |
| 3468 | { |
| 3469 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 3470 | "subject": "Migrate contributor agreements to All-Projects." |
| 3471 | } |
| 3472 | ], |
| 3473 | "author": { |
| 3474 | "name": "Shawn O. Pearce", |
| 3475 | "email": "sop@google.com", |
| 3476 | "date": "2012-04-24 18:08:08.000000000", |
| 3477 | "tz": -420 |
| 3478 | }, |
| 3479 | "committer": { |
| 3480 | "name": "Shawn O. Pearce", |
| 3481 | "email": "sop@google.com", |
| 3482 | "date": "2012-04-24 18:08:08.000000000", |
| 3483 | "tz": -420 |
| 3484 | }, |
| 3485 | "subject": "Use an EventBus to manage star icons", |
| 3486 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 3487 | } |
| 3488 | ---- |
| 3489 | |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 3490 | Adding query parameter `links` (for example `/changes/.../commit?links`) |
| 3491 | returns a link:#commit-info[CommitInfo] with the additional field `web_links`. |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3492 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 3493 | [[get-description]] |
| 3494 | === Get Description |
| 3495 | -- |
| 3496 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 3497 | -- |
| 3498 | |
| 3499 | Retrieves the description of a patch set. |
| 3500 | |
| 3501 | .Request |
| 3502 | ---- |
| 3503 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 3504 | ---- |
| 3505 | |
| 3506 | .Response |
| 3507 | ---- |
| 3508 | HTTP/1.1 200 OK |
| 3509 | Content-Disposition: attachment |
| 3510 | Content-Type: application/json; charset=UTF-8 |
| 3511 | |
| 3512 | )]}' |
| 3513 | "Added Documentation" |
| 3514 | ---- |
| 3515 | |
| 3516 | If the patch set does not have a description an empty string is returned. |
| 3517 | |
| 3518 | [[set-description]] |
| 3519 | === Set Description |
| 3520 | -- |
| 3521 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 3522 | -- |
| 3523 | |
| 3524 | Sets the description of a patch set. |
| 3525 | |
| 3526 | The new description must be provided in the request body inside a |
| 3527 | link:#description-input[DescriptionInput] entity. |
| 3528 | |
| 3529 | .Request |
| 3530 | ---- |
| 3531 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 3532 | Content-Type: application/json; charset=UTF-8 |
| 3533 | |
| 3534 | { |
| 3535 | "description": "Added Documentation" |
| 3536 | } |
| 3537 | ---- |
| 3538 | |
| 3539 | As response the new description is returned. |
| 3540 | |
| 3541 | .Response |
| 3542 | ---- |
| 3543 | HTTP/1.1 200 OK |
| 3544 | Content-Disposition: attachment |
| 3545 | Content-Type: application/json; charset=UTF-8 |
| 3546 | |
| 3547 | )]}' |
| 3548 | "Added Documentation" |
| 3549 | ---- |
| 3550 | |
Edwin Kempin | 0f22944 | 2016-09-09 13:06:12 +0200 | [diff] [blame] | 3551 | [[get-merge-list]] |
| 3552 | === Get Merge List |
| 3553 | -- |
| 3554 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist' |
| 3555 | -- |
| 3556 | |
| 3557 | Returns the list of commits that are being integrated into a target |
| 3558 | branch by a merge commit. By default the first parent is assumed to be |
| 3559 | uninteresting. By using the `parent` option another parent can be set |
| 3560 | as uninteresting (parents are 1-based). |
| 3561 | |
| 3562 | The list of commits is returned as a list of |
| 3563 | link:#commit-info[CommitInfo] entities. Web links are only included if |
| 3564 | the `links` option was set. |
| 3565 | |
| 3566 | .Request |
| 3567 | ---- |
| 3568 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0 |
| 3569 | ---- |
| 3570 | |
| 3571 | .Response |
| 3572 | ---- |
| 3573 | HTTP/1.1 200 OK |
| 3574 | Content-Disposition: attachment |
| 3575 | Content-Type: application/json; charset=UTF-8 |
| 3576 | |
| 3577 | )]}' |
| 3578 | [ |
| 3579 | { |
| 3580 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 3581 | "parents": [ |
| 3582 | { |
| 3583 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 3584 | "subject": "Migrate contributor agreements to All-Projects." |
| 3585 | } |
| 3586 | ], |
| 3587 | "author": { |
| 3588 | "name": "Shawn O. Pearce", |
| 3589 | "email": "sop@google.com", |
| 3590 | "date": "2012-04-24 18:08:08.000000000", |
| 3591 | "tz": -420 |
| 3592 | }, |
| 3593 | "committer": { |
| 3594 | "name": "Shawn O. Pearce", |
| 3595 | "email": "sop@google.com", |
| 3596 | "date": "2012-04-24 18:08:08.000000000", |
| 3597 | "tz": -420 |
| 3598 | }, |
| 3599 | "subject": "Use an EventBus to manage star icons", |
| 3600 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 3601 | } |
| 3602 | ] |
| 3603 | ---- |
| 3604 | |
Stefan Beller | c725966 | 2015-02-12 17:23:05 -0800 | [diff] [blame] | 3605 | [[get-revision-actions]] |
| 3606 | === Get Revision Actions |
| 3607 | -- |
| 3608 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions' |
| 3609 | -- |
| 3610 | |
| 3611 | Retrieves revision link:#action-info[actions] of the revision of a change. |
| 3612 | |
| 3613 | .Request |
| 3614 | ---- |
| 3615 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0 |
| 3616 | ---- |
| 3617 | |
| 3618 | .Response |
| 3619 | ---- |
| 3620 | HTTP/1.1 200 OK |
| 3621 | Content-Disposition: attachment |
| 3622 | Content-Type: application/json; charset=UTF-8 |
| 3623 | |
| 3624 | )]}' |
| 3625 | |
| 3626 | { |
| 3627 | "submit": { |
| 3628 | "method": "POST", |
| 3629 | "label": "Submit", |
| 3630 | "title": "Submit patch set 1 into master", |
| 3631 | "enabled": true |
| 3632 | }, |
| 3633 | "cherrypick": { |
| 3634 | "method": "POST", |
| 3635 | "label": "Cherry Pick", |
| 3636 | "title": "Cherry pick change to a different branch", |
| 3637 | "enabled": true |
| 3638 | } |
| 3639 | } |
| 3640 | ---- |
| 3641 | |
| 3642 | The response is a flat map of possible revision actions mapped to their |
| 3643 | link:#action-info[ActionInfo]. |
| 3644 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3645 | [[get-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3646 | === Get Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3647 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3648 | '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] | 3649 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3650 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3651 | Retrieves a review of a revision. |
| 3652 | |
| 3653 | .Request |
| 3654 | ---- |
| 3655 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 3656 | ---- |
| 3657 | |
| 3658 | As response a link:#change-info[ChangeInfo] entity with |
| 3659 | link:#detailed-labels[detailed labels] and link:#detailed-accounts[ |
| 3660 | detailed accounts] is returned that describes the review of the |
| 3661 | revision. The revision for which the review is retrieved is contained |
| 3662 | in the `revisions` field. In addition the `current_revision` field is |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 3663 | 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] | 3664 | revision of the change. Please note that the returned labels are always |
| 3665 | for the current patch set. |
| 3666 | |
| 3667 | .Response |
| 3668 | ---- |
| 3669 | HTTP/1.1 200 OK |
| 3670 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3671 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3672 | |
| 3673 | )]}' |
| 3674 | { |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3675 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 3676 | "project": "myProject", |
| 3677 | "branch": "master", |
| 3678 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 3679 | "subject": "Implementing Feature X", |
| 3680 | "status": "NEW", |
| 3681 | "created": "2013-02-01 09:59:32.126000000", |
| 3682 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3683 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 3684 | "insertions": 34, |
| 3685 | "deletions": 45, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3686 | "_number": 3965, |
| 3687 | "owner": { |
| 3688 | "_account_id": 1000096, |
| 3689 | "name": "John Doe", |
| 3690 | "email": "john.doe@example.com" |
| 3691 | }, |
| 3692 | "labels": { |
| 3693 | "Verified": { |
| 3694 | "all": [ |
| 3695 | { |
| 3696 | "value": 0, |
| 3697 | "_account_id": 1000096, |
| 3698 | "name": "John Doe", |
| 3699 | "email": "john.doe@example.com" |
| 3700 | }, |
| 3701 | { |
| 3702 | "value": 0, |
| 3703 | "_account_id": 1000097, |
| 3704 | "name": "Jane Roe", |
| 3705 | "email": "jane.roe@example.com" |
| 3706 | } |
| 3707 | ], |
| 3708 | "values": { |
| 3709 | "-1": "Fails", |
| 3710 | " 0": "No score", |
| 3711 | "+1": "Verified" |
| 3712 | } |
| 3713 | }, |
| 3714 | "Code-Review": { |
| 3715 | "all": [ |
| 3716 | { |
| 3717 | "value": -1, |
| 3718 | "_account_id": 1000096, |
| 3719 | "name": "John Doe", |
| 3720 | "email": "john.doe@example.com" |
| 3721 | }, |
| 3722 | { |
| 3723 | "value": 1, |
| 3724 | "_account_id": 1000097, |
| 3725 | "name": "Jane Roe", |
| 3726 | "email": "jane.roe@example.com" |
| 3727 | } |
| 3728 | ] |
| 3729 | "values": { |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame] | 3730 | "-2": "This shall not be merged", |
| 3731 | "-1": "I would prefer this is not merged as is", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3732 | " 0": "No score", |
| 3733 | "+1": "Looks good to me, but someone else must approve", |
| 3734 | "+2": "Looks good to me, approved" |
| 3735 | } |
| 3736 | } |
| 3737 | }, |
| 3738 | "permitted_labels": { |
| 3739 | "Verified": [ |
| 3740 | "-1", |
| 3741 | " 0", |
| 3742 | "+1" |
| 3743 | ], |
| 3744 | "Code-Review": [ |
| 3745 | "-2", |
| 3746 | "-1", |
| 3747 | " 0", |
| 3748 | "+1", |
| 3749 | "+2" |
| 3750 | ] |
| 3751 | }, |
| 3752 | "removable_reviewers": [ |
| 3753 | { |
| 3754 | "_account_id": 1000096, |
| 3755 | "name": "John Doe", |
| 3756 | "email": "john.doe@example.com" |
| 3757 | }, |
| 3758 | { |
| 3759 | "_account_id": 1000097, |
| 3760 | "name": "Jane Roe", |
| 3761 | "email": "jane.roe@example.com" |
| 3762 | } |
| 3763 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 3764 | "reviewers": { |
| 3765 | "REVIEWER": [ |
| 3766 | { |
| 3767 | "_account_id": 1000096, |
| 3768 | "name": "John Doe", |
| 3769 | "email": "john.doe@example.com" |
| 3770 | }, |
| 3771 | { |
| 3772 | "_account_id": 1000097, |
| 3773 | "name": "Jane Roe", |
| 3774 | "email": "jane.roe@example.com" |
| 3775 | } |
| 3776 | ] |
| 3777 | }, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3778 | "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 3779 | "revisions": { |
| 3780 | "674ac754f91e64a0efb8087e59a176484bd534d1": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 3781 | "kind": "REWORK", |
| 3782 | "_number": 2, |
| 3783 | "ref": "refs/changes/65/3965/2", |
| 3784 | "fetch": { |
| 3785 | "http": { |
| 3786 | "url": "http://gerrit/myProject", |
| 3787 | "ref": "refs/changes/65/3965/2" |
| 3788 | } |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3789 | } |
| 3790 | } |
| 3791 | } |
| 3792 | } |
| 3793 | ---- |
| 3794 | |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3795 | [[get-related-changes]] |
| 3796 | === Get Related Changes |
| 3797 | -- |
| 3798 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related' |
| 3799 | -- |
| 3800 | |
| 3801 | Retrieves related changes of a revision. Related changes are changes that either |
| 3802 | depend on, or are dependencies of the revision. |
| 3803 | |
| 3804 | .Request |
| 3805 | ---- |
| 3806 | GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0 |
| 3807 | ---- |
| 3808 | |
| 3809 | As result a link:#related-changes-info[RelatedChangesInfo] entity is returned |
| 3810 | describing the related changes. |
| 3811 | |
| 3812 | .Response |
| 3813 | ---- |
| 3814 | HTTP/1.1 200 OK |
| 3815 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3816 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3817 | |
| 3818 | )]}' |
| 3819 | { |
| 3820 | "changes": [ |
| 3821 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 3822 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3823 | "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5", |
| 3824 | "commit": { |
| 3825 | "commit": "78847477532e386f5a2185a4e8c90b2509e354e3", |
| 3826 | "parents": [ |
| 3827 | { |
| 3828 | "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e" |
| 3829 | } |
| 3830 | ], |
| 3831 | "author": { |
| 3832 | "name": "David Ostrovsky", |
| 3833 | "email": "david@ostrovsky.org", |
| 3834 | "date": "2014-07-12 15:04:24.000000000", |
| 3835 | "tz": 120 |
| 3836 | }, |
| 3837 | "subject": "Remove Solr" |
| 3838 | }, |
| 3839 | "_change_number": 58478, |
| 3840 | "_revision_number": 2, |
| 3841 | "_current_revision_number": 2 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 3842 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3843 | }, |
| 3844 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 3845 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3846 | "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774", |
| 3847 | "commit": { |
| 3848 | "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe", |
| 3849 | "parents": [ |
| 3850 | { |
| 3851 | "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad" |
| 3852 | } |
| 3853 | ], |
| 3854 | "author": { |
| 3855 | "name": "David Pursehouse", |
| 3856 | "email": "david.pursehouse@sonymobile.com", |
| 3857 | "date": "2014-06-24 02:01:28.000000000", |
| 3858 | "tz": 540 |
| 3859 | }, |
| 3860 | "subject": "Add support for secondary index with Elasticsearch" |
| 3861 | }, |
| 3862 | "_change_number": 58081, |
| 3863 | "_revision_number": 10, |
| 3864 | "_current_revision_number": 10 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 3865 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 3866 | } |
| 3867 | ] |
| 3868 | } |
| 3869 | ---- |
| 3870 | |
| 3871 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3872 | [[set-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3873 | === Set Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3874 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3875 | '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] | 3876 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3877 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3878 | Sets a review on a revision, optionally also publishing draft comments, setting |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 3879 | labels, adding reviewers or CCs, and modifying the work in progress property. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3880 | |
| 3881 | The review must be provided in the request body as a |
| 3882 | link:#review-input[ReviewInput] entity. |
| 3883 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3884 | A review cannot be set on a change edit. Trying to post a review for a |
| 3885 | change edit fails with `409 Conflict`. |
| 3886 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3887 | Here is an example of using this method to set labels: |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3888 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3889 | .Request |
| 3890 | ---- |
| 3891 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3892 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3893 | |
| 3894 | { |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 3895 | "tag": "jenkins", |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3896 | "message": "Some nits need to be fixed.", |
| 3897 | "labels": { |
| 3898 | "Code-Review": -1 |
| 3899 | }, |
| 3900 | "comments": { |
| 3901 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 3902 | { |
| 3903 | "line": 23, |
| 3904 | "message": "[nit] trailing whitespace" |
| 3905 | }, |
| 3906 | { |
| 3907 | "line": 49, |
| 3908 | "message": "[nit] s/conrtol/control" |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 3909 | }, |
| 3910 | { |
| 3911 | "range": { |
| 3912 | "start_line": 50, |
| 3913 | "start_character": 0, |
| 3914 | "end_line": 55, |
| 3915 | "end_character": 20 |
| 3916 | }, |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 3917 | "message": "Incorrect indentation" |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3918 | } |
| 3919 | ] |
| 3920 | } |
| 3921 | } |
| 3922 | ---- |
| 3923 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 3924 | As response a link:#review-result[ReviewResult] entity is returned that |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3925 | describes the applied labels and any added reviewers (e.g. yourself, |
| 3926 | 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] | 3927 | |
| 3928 | .Response |
| 3929 | ---- |
| 3930 | HTTP/1.1 200 OK |
| 3931 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3932 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 3933 | |
| 3934 | )]}' |
| 3935 | { |
| 3936 | "labels": { |
| 3937 | "Code-Review": -1 |
| 3938 | } |
| 3939 | } |
| 3940 | ---- |
| 3941 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3942 | It is also possible to add one or more reviewers or CCs |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3943 | to a change simultaneously with a review: |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3944 | |
| 3945 | .Request |
| 3946 | ---- |
| 3947 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 3948 | Content-Type: application/json; charset=UTF-8 |
| 3949 | |
| 3950 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3951 | "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] | 3952 | "reviewers": [ |
| 3953 | { |
| 3954 | "reviewer": "jane.roe@example.com" |
| 3955 | }, |
| 3956 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3957 | "reviewer": "john.doe@example.com", |
| 3958 | "state": "CC" |
| 3959 | } |
| 3960 | { |
| 3961 | "reviewer": "MyProjectVerifiers", |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3962 | } |
| 3963 | ] |
| 3964 | } |
| 3965 | ---- |
| 3966 | |
| 3967 | Each element of the `reviewers` list is an instance of |
| 3968 | link:#reviewer-input[ReviewerInput]. The corresponding result of |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3969 | adding each reviewer will be returned in a map of inputs to |
| 3970 | link:#add-reviewer-result[AddReviewerResult]s. |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3971 | |
| 3972 | .Response |
| 3973 | ---- |
| 3974 | HTTP/1.1 200 OK |
| 3975 | Content-Disposition: attachment |
| 3976 | Content-Type: application/json; charset=UTF-8 |
| 3977 | |
| 3978 | )]}' |
| 3979 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3980 | "reviewers": { |
| 3981 | "jane.roe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3982 | "input": "jane.roe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3983 | "reviewers": [ |
| 3984 | { |
| 3985 | "_account_id": 1000097, |
| 3986 | "name": "Jane Roe", |
| 3987 | "email": "jane.roe@example.com" |
| 3988 | "approvals": { |
| 3989 | "Verified": " 0", |
| 3990 | "Code-Review": " 0" |
| 3991 | }, |
| 3992 | }, |
| 3993 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3994 | }, |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3995 | "john.doe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 3996 | "input": "john.doe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3997 | "ccs": [ |
| 3998 | { |
| 3999 | "_account_id": 1000096, |
| 4000 | "name": "John Doe", |
| 4001 | "email": "john.doe@example.com" |
| 4002 | "approvals": { |
| 4003 | "Verified": " 0", |
| 4004 | "Code-Review": " 0" |
| 4005 | }, |
| 4006 | } |
| 4007 | ] |
| 4008 | }, |
| 4009 | "MyProjectVerifiers": { |
| 4010 | "input": "MyProjectVerifiers", |
| 4011 | "reviewers": [ |
| 4012 | { |
| 4013 | "_account_id": 1000098, |
| 4014 | "name": "Alice Ansel", |
| 4015 | "email": "alice.ansel@example.com" |
| 4016 | "approvals": { |
| 4017 | "Verified": " 0", |
| 4018 | "Code-Review": " 0" |
| 4019 | }, |
| 4020 | }, |
| 4021 | { |
| 4022 | "_account_id": 1000099, |
| 4023 | "name": "Bob Bollard", |
| 4024 | "email": "bob.bollard@example.com" |
| 4025 | "approvals": { |
| 4026 | "Verified": " 0", |
| 4027 | "Code-Review": " 0" |
| 4028 | }, |
| 4029 | }, |
| 4030 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4031 | } |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4032 | } |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4033 | } |
| 4034 | ---- |
| 4035 | |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4036 | 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] | 4037 | be rejected with `400 Bad Request`. None of the entries will have the |
| 4038 | `reviewers` or `ccs` field set, and those which specifically failed will have |
| 4039 | the `errors` field set containing details of why they failed. |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4040 | |
| 4041 | .Error Response |
| 4042 | ---- |
| 4043 | HTTP/1.1 400 Bad Request |
| 4044 | Content-Disposition: attachment |
| 4045 | Content-Type: application/json; charset=UTF-8 |
| 4046 | |
| 4047 | )]}' |
| 4048 | { |
| 4049 | "reviewers": { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4050 | "jane.roe@example.com": { |
| 4051 | "input": "jane.roe@example.com", |
| 4052 | "error": "Account of jane.roe@example.com is inactive." |
| 4053 | }, |
| 4054 | "john.doe@example.com": { |
| 4055 | "input": "john.doe@example.com" |
| 4056 | }, |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4057 | "MyProjectVerifiers": { |
| 4058 | "input": "MyProjectVerifiers", |
| 4059 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 4060 | "confirm": true |
| 4061 | } |
| 4062 | } |
| 4063 | } |
| 4064 | ---- |
| 4065 | |
Dave Borowitz | d2e4145 | 2017-10-26 08:06:23 -0400 | [diff] [blame] | 4066 | [[set-review-notifications]] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4067 | .Notifications |
| 4068 | |
| 4069 | An email will be sent using the "comment" template. |
| 4070 | |
| 4071 | If the top-level notify property is null or not set, then notification behavior |
| 4072 | depends on whether the change is WIP, whether it has started review, and whether |
| 4073 | the tag property is null. |
| 4074 | |
| 4075 | NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*. |
| 4076 | Use the notify property of the top-level link:#review-input[ReviewInput] instead. |
| 4077 | |
| 4078 | For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS |
| 4079 | watchers*. |
| 4080 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4081 | [options="header",cols="2,1,1,2,2"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4082 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4083 | |WIP State |Review Started|Tag Given|Default |notify=ALL |
| 4084 | |Ready for review|N/A |N/A |everyone|everyone |
| 4085 | |Work in progress|no |no |not sent|everyone |
| 4086 | |Work in progress|no |yes |owner |everyone |
| 4087 | |Work in progress|yes |no |everyone|everyone |
| 4088 | |Work in progress|yes |yes |owner |everyone |
| 4089 | |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4090 | |============================= |
| 4091 | |
| 4092 | If reviewers are added, then a second email will be sent using the "newchange" |
| 4093 | template. The notification logic for this email is the same as for |
| 4094 | link:#add-reviewer[Add Reviewer]. |
| 4095 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4096 | [options="header",cols="1,1,1"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4097 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4098 | |WIP State |Default |notify=ALL |
| 4099 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 4100 | |Work in progress|not sent |owner, reviewers, CCs |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4101 | |============================= |
| 4102 | |
| 4103 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4104 | [[rebase-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4105 | === Rebase Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4106 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4107 | '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] | 4108 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4109 | |
| 4110 | Rebases a revision. |
| 4111 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4112 | Optionally, the parent revision can be changed to another patch set through the |
| 4113 | link:#rebase-input[RebaseInput] entity. |
| 4114 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4115 | .Request |
| 4116 | ---- |
| 4117 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4118 | Content-Type: application/json;charset=UTF-8 |
| 4119 | |
| 4120 | { |
| 4121 | "base" : "1234", |
| 4122 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4123 | ---- |
| 4124 | |
| 4125 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 4126 | describes the rebased change. Information about the current patch set |
| 4127 | is included. |
| 4128 | |
| 4129 | .Response |
| 4130 | ---- |
| 4131 | HTTP/1.1 200 OK |
| 4132 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4133 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4134 | |
| 4135 | )]}' |
| 4136 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4137 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4138 | "project": "myProject", |
| 4139 | "branch": "master", |
| 4140 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4141 | "subject": "Implement Feature X", |
| 4142 | "status": "NEW", |
| 4143 | "created": "2013-02-01 09:59:32.126000000", |
| 4144 | "updated": "2013-02-21 11:16:36.775000000", |
| 4145 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 4146 | "insertions": 21, |
| 4147 | "deletions": 21, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4148 | "_number": 4799, |
| 4149 | "owner": { |
| 4150 | "name": "John Doe" |
| 4151 | }, |
| 4152 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 4153 | "revisions": { |
| 4154 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 4155 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4156 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 4157 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4158 | "fetch": { |
| 4159 | "http": { |
| 4160 | "url": "http://gerrit:8080/myProject", |
| 4161 | "ref": "refs/changes/99/4799/2" |
| 4162 | } |
| 4163 | }, |
| 4164 | "commit": { |
| 4165 | "parents": [ |
| 4166 | { |
| 4167 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 4168 | "subject": "Implement Feature A" |
| 4169 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 4170 | ], |
| 4171 | "author": { |
| 4172 | "name": "John Doe", |
| 4173 | "email": "john.doe@example.com", |
| 4174 | "date": "2013-05-07 15:21:27.000000000", |
| 4175 | "tz": 120 |
| 4176 | }, |
| 4177 | "committer": { |
| 4178 | "name": "Gerrit Code Review", |
| 4179 | "email": "gerrit-server@example.com", |
| 4180 | "date": "2013-05-07 15:35:43.000000000", |
| 4181 | "tz": 120 |
| 4182 | }, |
| 4183 | "subject": "Implement Feature X", |
| 4184 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4185 | } |
| 4186 | } |
| 4187 | } |
| 4188 | ---- |
| 4189 | |
| 4190 | If the revision cannot be rebased, e.g. due to conflicts, the response is |
| 4191 | "`409 Conflict`" and the error message is contained in the response |
| 4192 | body. |
| 4193 | |
| 4194 | .Response |
| 4195 | ---- |
| 4196 | HTTP/1.1 409 Conflict |
| 4197 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4198 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4199 | |
| 4200 | The change could not be rebased due to a path conflict during merge. |
| 4201 | ---- |
| 4202 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4203 | [[submit-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4204 | === Submit Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4205 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4206 | '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] | 4207 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4208 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4209 | Submits a revision. |
| 4210 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4211 | .Request |
| 4212 | ---- |
| 4213 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4214 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4215 | ---- |
| 4216 | |
| 4217 | As response a link:#submit-info[SubmitInfo] entity is returned that |
| 4218 | describes the status of the submitted change. |
| 4219 | |
| 4220 | .Response |
| 4221 | ---- |
| 4222 | HTTP/1.1 200 OK |
| 4223 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4224 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4225 | |
| 4226 | )]}' |
| 4227 | { |
| 4228 | "status": "MERGED" |
| 4229 | } |
| 4230 | ---- |
| 4231 | |
| 4232 | If the revision cannot be submitted, e.g. because the submit rule |
| 4233 | doesn't allow submitting the revision or the revision is not the |
| 4234 | current revision, the response is "`409 Conflict`" and the error |
| 4235 | message is contained in the response body. |
| 4236 | |
| 4237 | .Response |
| 4238 | ---- |
| 4239 | HTTP/1.1 409 Conflict |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4240 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4241 | |
| 4242 | "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision" |
| 4243 | ---- |
| 4244 | |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4245 | [[get-patch]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4246 | === Get Patch |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4247 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4248 | '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] | 4249 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4250 | |
| 4251 | Gets the formatted patch for one revision. |
| 4252 | |
| 4253 | .Request |
| 4254 | ---- |
| 4255 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0 |
| 4256 | ---- |
| 4257 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4258 | The formatted patch is returned as text encoded inside base64: |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4259 | |
| 4260 | .Response |
| 4261 | ---- |
| 4262 | HTTP/1.1 200 OK |
| 4263 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4264 | Content-Type: text/plain; charset=ISO-8859-1 |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4265 | X-FYI-Content-Encoding: base64 |
| 4266 | X-FYI-Content-Type: application/mbox |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4267 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4268 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4269 | ---- |
| 4270 | |
David Ostrovsky | 973f38b | 2013-08-22 00:24:51 -0700 | [diff] [blame] | 4271 | Adding query parameter `zip` (for example `/changes/.../patch?zip`) |
| 4272 | returns the patch as a single file inside of a ZIP archive. Clients |
| 4273 | can expand the ZIP to obtain the plain text patch, avoiding the |
| 4274 | need for a base64 decoding step. This option implies `download`. |
| 4275 | |
| 4276 | Query parameter `download` (e.g. `/changes/.../patch?download`) |
| 4277 | will suggest the browser save the patch as `commitsha1.diff.base64`, |
| 4278 | for later processing by command line tools. |
| 4279 | |
Kasper Nilsson | 8144807 | 2016-10-17 15:04:33 -0700 | [diff] [blame] | 4280 | If the `path` parameter is set, the returned content is a diff of the single |
| 4281 | file that the path refers to. |
| 4282 | |
Stefan Beller | dfa1ef3 | 2016-09-16 12:20:02 -0700 | [diff] [blame] | 4283 | [[submit-preview]] |
Edwin Kempin | 807eb4b | 2016-10-18 15:49:41 +0200 | [diff] [blame] | 4284 | === Submit Preview |
Stefan Beller | dfa1ef3 | 2016-09-16 12:20:02 -0700 | [diff] [blame] | 4285 | -- |
| 4286 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit' |
| 4287 | -- |
| 4288 | Gets a file containing thin bundles of all modified projects if this |
| 4289 | change was submitted. The bundles are named `${ProjectName}.git`. |
| 4290 | Each thin bundle contains enough to construct the state in which a project would |
| 4291 | be in if this change were submitted. The base of the thin bundles are the |
| 4292 | current target branches, so to make use of this call in a non-racy way, first |
| 4293 | get the bundles and then fetch all projects contained in the bundle. |
| 4294 | (This assumes no non-fastforward pushes). |
| 4295 | |
| 4296 | 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] | 4297 | format for the outer container. It is always possible to use tgz, even if |
| 4298 | tgz is not in the list of allowed archive formats. |
Stefan Beller | dfa1ef3 | 2016-09-16 12:20:02 -0700 | [diff] [blame] | 4299 | |
| 4300 | To make good use of this call, you would roughly need code as found at: |
| 4301 | ---- |
| 4302 | $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh |
| 4303 | ---- |
| 4304 | .Request |
| 4305 | ---- |
| 4306 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0 |
| 4307 | ---- |
| 4308 | |
| 4309 | .Response |
| 4310 | ---- |
| 4311 | HTTP/1.1 200 OK |
| 4312 | Date: Tue, 13 Sep 2016 19:13:46 GMT |
| 4313 | Content-Disposition: attachment; filename="submit-preview-147.zip" |
| 4314 | X-Content-Type-Options: nosniff |
| 4315 | Cache-Control: no-cache, no-store, max-age=0, must-revalidate |
| 4316 | Pragma: no-cache |
| 4317 | Expires: Mon, 01 Jan 1990 00:00:00 GMT |
| 4318 | Content-Type: application/x-zip |
| 4319 | Transfer-Encoding: chunked |
| 4320 | |
| 4321 | [binary stuff] |
| 4322 | ---- |
| 4323 | |
| 4324 | In case of an error, the response is not a zip file but a regular json response, |
| 4325 | containing only the error message: |
| 4326 | |
| 4327 | .Response |
| 4328 | ---- |
| 4329 | HTTP/1.1 200 OK |
| 4330 | Content-Disposition: attachment |
| 4331 | Content-Type: application/json; charset=UTF-8 |
| 4332 | |
| 4333 | )]}' |
| 4334 | "Anonymous users cannot submit" |
| 4335 | ---- |
| 4336 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4337 | [[get-mergeable]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4338 | === Get Mergeable |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4339 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4340 | '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] | 4341 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4342 | |
| 4343 | Gets the method the server will use to submit (merge) the change and |
| 4344 | an indicator if the change is currently mergeable. |
| 4345 | |
| 4346 | .Request |
| 4347 | ---- |
| 4348 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0 |
| 4349 | ---- |
| 4350 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 4351 | As response a link:#mergeable-info[MergeableInfo] entity is returned. |
| 4352 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4353 | .Response |
| 4354 | ---- |
| 4355 | HTTP/1.1 200 OK |
| 4356 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4357 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4358 | |
| 4359 | )]}' |
| 4360 | { |
| 4361 | submit_type: "MERGE_IF_NECESSARY", |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 4362 | strategy: "recursive", |
| 4363 | mergeable: true |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4364 | } |
| 4365 | ---- |
| 4366 | |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4367 | If the `other-branches` parameter is specified, the mergeability will also be |
Zhen Chen | 6729b63 | 2016-11-11 17:32:32 -0800 | [diff] [blame] | 4368 | checked for all other branches which are listed in the |
| 4369 | link:config-project-config.html#branchOrder-section[branchOrder] section in the |
| 4370 | project.config file. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4371 | |
| 4372 | .Request |
| 4373 | ---- |
| 4374 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0 |
| 4375 | ---- |
| 4376 | |
| 4377 | The response will then contain a list of all other branches where this changes |
| 4378 | could merge cleanly. |
| 4379 | |
| 4380 | .Response |
| 4381 | ---- |
| 4382 | HTTP/1.1 200 OK |
| 4383 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4384 | Content-Type: application/json; charset=UTF-8 |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4385 | |
| 4386 | )]}' |
| 4387 | { |
| 4388 | submit_type: "MERGE_IF_NECESSARY", |
| 4389 | mergeable: true, |
| 4390 | mergeable_into: [ |
| 4391 | "refs/heads/stable-2.7", |
| 4392 | "refs/heads/stable-2.8", |
| 4393 | ] |
| 4394 | } |
| 4395 | ---- |
| 4396 | |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4397 | [[get-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4398 | === Get Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4399 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4400 | '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] | 4401 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4402 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4403 | Gets the method the server will use to submit (merge) the change. |
| 4404 | |
| 4405 | .Request |
| 4406 | ---- |
| 4407 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0 |
| 4408 | ---- |
| 4409 | |
| 4410 | .Response |
| 4411 | ---- |
| 4412 | HTTP/1.1 200 OK |
| 4413 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4414 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4415 | |
| 4416 | )]}' |
| 4417 | "MERGE_IF_NECESSARY" |
| 4418 | ---- |
| 4419 | |
| 4420 | [[test-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4421 | === Test Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4422 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4423 | '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] | 4424 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4425 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4426 | Tests the submit_type Prolog rule in the project, or the one given. |
| 4427 | |
| 4428 | Request body may be either the Prolog code as `text/plain` or a |
| 4429 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 4430 | may be set to `SKIP` to bypass parent project filters while testing |
| 4431 | a project-specific rule. |
| 4432 | |
| 4433 | .Request |
| 4434 | ---- |
| 4435 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4436 | Content-Type: text/plain; charset-UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4437 | |
| 4438 | submit_type(cherry_pick). |
| 4439 | ---- |
| 4440 | |
| 4441 | .Response |
| 4442 | ---- |
| 4443 | HTTP/1.1 200 OK |
| 4444 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4445 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4446 | |
| 4447 | )]}' |
Shawn Pearce | 7076f4e | 2013-08-20 22:11:51 -0700 | [diff] [blame] | 4448 | "CHERRY_PICK" |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4449 | ---- |
| 4450 | |
| 4451 | [[test-submit-rule]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4452 | === Test Submit Rule |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4453 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4454 | '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] | 4455 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4456 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4457 | Tests the submit_rule Prolog rule in the project, or the one given. |
| 4458 | |
| 4459 | Request body may be either the Prolog code as `text/plain` or a |
| 4460 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 4461 | may be set to `SKIP` to bypass parent project filters while testing |
| 4462 | a project-specific rule. |
| 4463 | |
| 4464 | .Request |
| 4465 | ---- |
Shawn Pearce | a3cce71 | 2014-03-21 08:16:11 -0700 | [diff] [blame] | 4466 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4467 | Content-Type: text/plain; charset-UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4468 | |
| 4469 | submit_rule(submit(R)) :- |
| 4470 | R = label('Any-Label-Name', reject(_)). |
| 4471 | ---- |
| 4472 | |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4473 | The response is a link:#submit-record[SubmitRecord] describing the |
| 4474 | permutations that satisfy the tested submit rule. |
| 4475 | |
David Pursehouse | 87a3fb0 | 2019-10-29 16:01:27 +0900 | [diff] [blame] | 4476 | 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] | 4477 | |
| 4478 | .Response |
| 4479 | ---- |
| 4480 | HTTP/1.1 200 OK |
| 4481 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4482 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4483 | |
| 4484 | )]}' |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4485 | { |
| 4486 | "status": "NOT_READY", |
| 4487 | "reject": { |
| 4488 | "Any-Label-Name": {} |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4489 | } |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4490 | } |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4491 | ---- |
| 4492 | |
Shawn Pearce | b42e303 | 2015-04-02 10:28:10 -0700 | [diff] [blame] | 4493 | When testing with the `curl` command line client the |
| 4494 | `--data-binary @rules.pl` flag should be used to ensure |
| 4495 | all LFs are included in the Prolog code: |
| 4496 | |
| 4497 | ---- |
| 4498 | curl -X POST \ |
| 4499 | -H 'Content-Type: text/plain; charset=UTF-8' \ |
| 4500 | --data-binary @rules.pl \ |
| 4501 | http://.../test.submit_rule |
| 4502 | ---- |
| 4503 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4504 | [[list-drafts]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 4505 | === List Revision Drafts |
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/' |
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 | Lists the draft comments of a revision that belong to the calling |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4511 | user. |
| 4512 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 4513 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 4514 | entries. The entries in the map are sorted by file path. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4515 | |
| 4516 | .Request |
| 4517 | ---- |
| 4518 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0 |
| 4519 | ---- |
| 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 | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4526 | |
| 4527 | )]}' |
| 4528 | { |
| 4529 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4530 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4531 | "id": "TvcXrmjM", |
| 4532 | "line": 23, |
| 4533 | "message": "[nit] trailing whitespace", |
| 4534 | "updated": "2013-02-26 15:40:43.986000000" |
| 4535 | }, |
| 4536 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4537 | "id": "TveXwFiA", |
| 4538 | "line": 49, |
| 4539 | "in_reply_to": "TfYX-Iuo", |
| 4540 | "message": "Done", |
| 4541 | "updated": "2013-02-26 15:40:45.328000000" |
| 4542 | } |
| 4543 | ] |
| 4544 | } |
| 4545 | ---- |
| 4546 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4547 | [[create-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4548 | === Create Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4549 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4550 | '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] | 4551 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4552 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4553 | Creates a draft comment on a revision. |
| 4554 | |
| 4555 | The new draft comment must be provided in the request body inside a |
| 4556 | link:#comment-input[CommentInput] entity. |
| 4557 | |
| 4558 | .Request |
| 4559 | ---- |
| 4560 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4561 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4562 | |
| 4563 | { |
| 4564 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4565 | "line": 23, |
| 4566 | "message": "[nit] trailing whitespace" |
| 4567 | } |
| 4568 | ---- |
| 4569 | |
| 4570 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4571 | describes the draft comment. |
| 4572 | |
| 4573 | .Response |
| 4574 | ---- |
| 4575 | HTTP/1.1 200 OK |
| 4576 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4577 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4578 | |
| 4579 | )]}' |
| 4580 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4581 | "id": "TvcXrmjM", |
| 4582 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4583 | "line": 23, |
| 4584 | "message": "[nit] trailing whitespace", |
| 4585 | "updated": "2013-02-26 15:40:43.986000000" |
| 4586 | } |
| 4587 | ---- |
| 4588 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4589 | [[get-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4590 | === Get Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4591 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4592 | '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] | 4593 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4594 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4595 | Retrieves a draft comment of a revision that belongs to the calling |
| 4596 | user. |
| 4597 | |
| 4598 | .Request |
| 4599 | ---- |
| 4600 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 4601 | ---- |
| 4602 | |
| 4603 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4604 | describes the draft comment. |
| 4605 | |
| 4606 | .Response |
| 4607 | ---- |
| 4608 | HTTP/1.1 200 OK |
| 4609 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4610 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4611 | |
| 4612 | )]}' |
| 4613 | { |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4614 | "id": "TvcXrmjM", |
| 4615 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4616 | "line": 23, |
| 4617 | "message": "[nit] trailing whitespace", |
| 4618 | "updated": "2013-02-26 15:40:43.986000000" |
| 4619 | } |
| 4620 | ---- |
| 4621 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4622 | [[update-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4623 | === Update Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4624 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4625 | '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] | 4626 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4627 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4628 | Updates a draft comment on a revision. |
| 4629 | |
| 4630 | The new draft comment must be provided in the request body inside a |
| 4631 | link:#comment-input[CommentInput] entity. |
| 4632 | |
| 4633 | .Request |
| 4634 | ---- |
| 4635 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4636 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4637 | |
| 4638 | { |
| 4639 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4640 | "line": 23, |
| 4641 | "message": "[nit] trailing whitespace" |
| 4642 | } |
| 4643 | ---- |
| 4644 | |
| 4645 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4646 | describes the draft comment. |
| 4647 | |
| 4648 | .Response |
| 4649 | ---- |
| 4650 | HTTP/1.1 200 OK |
| 4651 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4652 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4653 | |
| 4654 | )]}' |
| 4655 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4656 | "id": "TvcXrmjM", |
| 4657 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4658 | "line": 23, |
| 4659 | "message": "[nit] trailing whitespace", |
| 4660 | "updated": "2013-02-26 15:40:43.986000000" |
| 4661 | } |
| 4662 | ---- |
| 4663 | |
| 4664 | [[delete-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4665 | === Delete Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4666 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4667 | '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] | 4668 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4669 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4670 | Deletes a draft comment from a revision. |
| 4671 | |
| 4672 | .Request |
| 4673 | ---- |
| 4674 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 4675 | ---- |
| 4676 | |
| 4677 | .Response |
| 4678 | ---- |
| 4679 | HTTP/1.1 204 No Content |
| 4680 | ---- |
| 4681 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4682 | [[list-comments]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 4683 | === List Revision Comments |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4684 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4685 | '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] | 4686 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4687 | |
| 4688 | Lists the published comments of a revision. |
| 4689 | |
| 4690 | As result a map is returned that maps the file path to a list of |
| 4691 | link:#comment-info[CommentInfo] entries. The entries in the map are |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 4692 | sorted by file path and only include file (or inline) comments. Use |
| 4693 | the link:#get-change-detail[Get Change Detail] endpoint to retrieve |
| 4694 | the general change message (or comment). |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4695 | |
| 4696 | .Request |
| 4697 | ---- |
| 4698 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0 |
| 4699 | ---- |
| 4700 | |
| 4701 | .Response |
| 4702 | ---- |
| 4703 | HTTP/1.1 200 OK |
| 4704 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4705 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4706 | |
| 4707 | )]}' |
| 4708 | { |
| 4709 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4710 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4711 | "id": "TvcXrmjM", |
| 4712 | "line": 23, |
| 4713 | "message": "[nit] trailing whitespace", |
| 4714 | "updated": "2013-02-26 15:40:43.986000000", |
| 4715 | "author": { |
| 4716 | "_account_id": 1000096, |
| 4717 | "name": "John Doe", |
| 4718 | "email": "john.doe@example.com" |
| 4719 | } |
| 4720 | }, |
| 4721 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4722 | "id": "TveXwFiA", |
| 4723 | "line": 49, |
| 4724 | "in_reply_to": "TfYX-Iuo", |
| 4725 | "message": "Done", |
| 4726 | "updated": "2013-02-26 15:40:45.328000000", |
| 4727 | "author": { |
| 4728 | "_account_id": 1000097, |
| 4729 | "name": "Jane Roe", |
| 4730 | "email": "jane.roe@example.com" |
| 4731 | } |
| 4732 | } |
| 4733 | ] |
| 4734 | } |
| 4735 | ---- |
| 4736 | |
| 4737 | [[get-comment]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4738 | === Get Comment |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4739 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4740 | '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] | 4741 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4742 | |
| 4743 | Retrieves a published comment of a revision. |
| 4744 | |
| 4745 | .Request |
| 4746 | ---- |
| 4747 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0 |
| 4748 | ---- |
| 4749 | |
| 4750 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4751 | describes the published comment. |
| 4752 | |
| 4753 | .Response |
| 4754 | ---- |
| 4755 | HTTP/1.1 200 OK |
| 4756 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4757 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4758 | |
| 4759 | )]}' |
| 4760 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4761 | "id": "TvcXrmjM", |
| 4762 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4763 | "line": 23, |
| 4764 | "message": "[nit] trailing whitespace", |
| 4765 | "updated": "2013-02-26 15:40:43.986000000", |
| 4766 | "author": { |
| 4767 | "_account_id": 1000096, |
| 4768 | "name": "John Doe", |
| 4769 | "email": "john.doe@example.com" |
| 4770 | } |
| 4771 | } |
| 4772 | ---- |
| 4773 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 4774 | [[delete-comment]] |
| 4775 | === Delete Comment |
| 4776 | -- |
| 4777 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' + |
| 4778 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete' |
| 4779 | -- |
| 4780 | |
| 4781 | Deletes a published comment of a revision. Instead of deleting the |
| 4782 | whole comment, this endpoint just replaces the comment's message |
| 4783 | 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] | 4784 | the comment and the reason why it's deleted. |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 4785 | |
| 4786 | Note that only users with the |
| 4787 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 4788 | global capability are permitted to delete a comment. |
| 4789 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 4790 | Deletion reason can be provided in the request body as a |
| 4791 | link:#delete-comment-input[DeleteCommentInput] entity. |
| 4792 | Historically, this method allowed a body in the DELETE, but that behavior is |
| 4793 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 4794 | In this case, use a POST request instead: |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 4795 | |
| 4796 | .Request |
| 4797 | ---- |
| 4798 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0 |
| 4799 | Content-Type: application/json; charset=UTF-8 |
| 4800 | |
| 4801 | { |
| 4802 | "reason": "contains confidential information" |
| 4803 | } |
| 4804 | ---- |
| 4805 | |
| 4806 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4807 | describes the updated comment. |
| 4808 | |
| 4809 | .Response |
| 4810 | ---- |
| 4811 | HTTP/1.1 200 OK |
| 4812 | Content-Disposition: attachment |
| 4813 | Content-Type: application/json; charset=UTF-8 |
| 4814 | |
| 4815 | )]}' |
| 4816 | { |
| 4817 | "id": "TvcXrmjM", |
| 4818 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4819 | "line": 23, |
| 4820 | "message": "Comment removed by: Administrator; Reason: contains confidential information", |
| 4821 | "updated": "2013-02-26 15:40:43.986000000", |
| 4822 | "author": { |
| 4823 | "_account_id": 1000096, |
| 4824 | "name": "John Doe", |
| 4825 | "email": "john.doe@example.com" |
| 4826 | } |
| 4827 | } |
| 4828 | ---- |
| 4829 | |
Edwin Kempin | b050a48 | 2016-12-01 09:11:19 +0100 | [diff] [blame] | 4830 | [[list-robot-comments]] |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 4831 | === List Robot Comments |
| 4832 | -- |
| 4833 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/' |
| 4834 | -- |
| 4835 | |
| 4836 | Lists the link:config-robot-comments.html[robot comments] of a |
| 4837 | revision. |
| 4838 | |
| 4839 | As result a map is returned that maps the file path to a list of |
| 4840 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 4841 | map are sorted by file path. |
| 4842 | |
| 4843 | .Request |
| 4844 | ---- |
| 4845 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0 |
| 4846 | ---- |
| 4847 | |
| 4848 | .Response |
| 4849 | ---- |
| 4850 | HTTP/1.1 200 OK |
| 4851 | Content-Disposition: attachment |
| 4852 | Content-Type: application/json; charset=UTF-8 |
| 4853 | |
| 4854 | )]}' |
| 4855 | { |
| 4856 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4857 | { |
| 4858 | "id": "TvcXrmjM", |
| 4859 | "line": 23, |
| 4860 | "message": "unused import", |
| 4861 | "updated": "2016-02-26 15:40:43.986000000", |
| 4862 | "author": { |
| 4863 | "_account_id": 1000110, |
| 4864 | "name": "Code Analyzer", |
| 4865 | "email": "code.analyzer@example.com" |
| 4866 | }, |
| 4867 | "robotId": "importChecker", |
| 4868 | "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
| 4869 | }, |
| 4870 | { |
| 4871 | "id": "TveXwFiA", |
| 4872 | "line": 49, |
| 4873 | "message": "wrong indention", |
| 4874 | "updated": "2016-02-26 15:40:45.328000000", |
| 4875 | "author": { |
| 4876 | "_account_id": 1000110, |
| 4877 | "name": "Code Analyzer", |
| 4878 | "email": "code.analyzer@example.com" |
| 4879 | }, |
| 4880 | "robotId": "styleChecker", |
| 4881 | "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
| 4882 | } |
| 4883 | ] |
| 4884 | } |
| 4885 | ---- |
| 4886 | |
| 4887 | [[get-robot-comment]] |
| 4888 | === Get Robot Comment |
| 4889 | -- |
| 4890 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]' |
| 4891 | -- |
| 4892 | |
| 4893 | Retrieves a link:config-robot-comments.html[robot comment] of a |
| 4894 | revision. |
| 4895 | |
| 4896 | .Request |
| 4897 | ---- |
| 4898 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0 |
| 4899 | ---- |
| 4900 | |
| 4901 | As response a link:#robot-comment-info[RobotCommentInfo] entity is |
| 4902 | returned that describes the robot comment. |
| 4903 | |
| 4904 | .Response |
| 4905 | ---- |
| 4906 | HTTP/1.1 200 OK |
| 4907 | Content-Disposition: attachment |
| 4908 | Content-Type: application/json; charset=UTF-8 |
| 4909 | |
| 4910 | )]}' |
| 4911 | { |
| 4912 | "id": "TvcXrmjM", |
| 4913 | "line": 23, |
| 4914 | "message": "unused import", |
| 4915 | "updated": "2016-02-26 15:40:43.986000000", |
| 4916 | "author": { |
| 4917 | "_account_id": 1000110, |
| 4918 | "name": "Code Analyzer", |
| 4919 | "email": "code.analyzer@example.com" |
| 4920 | }, |
| 4921 | "robotId": "importChecker", |
| 4922 | "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
| 4923 | } |
| 4924 | ---- |
| 4925 | |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4926 | [[apply-fix]] |
| 4927 | === Apply Fix |
| 4928 | -- |
| 4929 | 'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply' |
| 4930 | -- |
| 4931 | |
| 4932 | Applies a suggested fix by creating a change edit which includes the |
| 4933 | modifications indicated by the fix suggestion. If a change edit already exists, |
| 4934 | it will be updated accordingly. A fix can only be applied if no change edit |
| 4935 | exists and the fix refers to the current patch set, or the fix refers to the |
| 4936 | patch set on which the change edit is based. |
| 4937 | |
| 4938 | .Request |
| 4939 | ---- |
| 4940 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0 |
| 4941 | ---- |
| 4942 | |
| 4943 | If the fix was successfully applied, an <<edit-info,EditInfo>> describing the |
| 4944 | resulting change edit is returned. |
| 4945 | |
| 4946 | .Response |
| 4947 | ---- |
| 4948 | HTTP/1.1 200 OK |
| 4949 | Content-Disposition: attachment |
| 4950 | Content-Type: application/json; charset=UTF-8 |
| 4951 | |
| 4952 | )]}' |
| 4953 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4954 | "commit": { |
| 4955 | "parents": [ |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4956 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4957 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4958 | } |
| 4959 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4960 | "author": { |
| 4961 | "name": "John Doe", |
| 4962 | "email": "john.doe@example.com", |
| 4963 | "date": "2013-05-07 15:21:27.000000000", |
| 4964 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4965 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4966 | "committer": { |
| 4967 | "name": "Jane Doe", |
| 4968 | "email": "jane.doe@example.com", |
| 4969 | "date": "2013-05-07 15:35:43.000000000", |
| 4970 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4971 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4972 | "subject": "Implement feature X", |
| 4973 | "message": "Implement feature X\n\nWith this feature ..." |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4974 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 4975 | "base_patch_set_number": 1, |
| 4976 | "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1" |
| 4977 | "ref": "refs/users/01/1000001/edit-42622/1" |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 4978 | } |
| 4979 | ---- |
| 4980 | |
| 4981 | If the application failed e.g. due to conflicts with an existing change edit, |
| 4982 | the response "`409 Conflict`" including an error message in the response body |
| 4983 | is returned. |
| 4984 | |
| 4985 | .Response |
| 4986 | ---- |
| 4987 | HTTP/1.1 409 Conflict |
| 4988 | Content-Disposition: attachment |
| 4989 | Content-Type: text/plain; charset=UTF-8 |
| 4990 | |
| 4991 | The existing change edit could not be merged with another tree. |
| 4992 | ---- |
| 4993 | |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4994 | [[list-files]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4995 | === List Files |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4996 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4997 | '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] | 4998 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 4999 | |
| 5000 | Lists the files that were modified, added or deleted in a revision. |
| 5001 | |
| 5002 | .Request |
| 5003 | ---- |
| 5004 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0 |
| 5005 | ---- |
| 5006 | |
Makson Lee | faf05c2 | 2018-07-26 22:42:59 +0000 | [diff] [blame] | 5007 | As result a map is returned that maps the link:#file-id[file path] to a |
| 5008 | link:#file-info[FileInfo] entry. The entries in the map are |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5009 | sorted by file path. |
| 5010 | |
| 5011 | .Response |
| 5012 | ---- |
| 5013 | HTTP/1.1 200 OK |
| 5014 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5015 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5016 | |
| 5017 | )]}' |
| 5018 | { |
| 5019 | "/COMMIT_MSG": { |
| 5020 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 5021 | "lines_inserted": 7, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 5022 | "size_delta": 551, |
| 5023 | "size": 551 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5024 | }, |
| 5025 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": { |
| 5026 | "lines_inserted": 5, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 5027 | "lines_deleted": 3, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 5028 | "size_delta": 98, |
| 5029 | "size": 23348 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5030 | } |
| 5031 | } |
| 5032 | ---- |
| 5033 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5034 | The request parameter `reviewed` changes the response to return a list |
| 5035 | of the paths the caller has marked as reviewed. Clients that also |
| 5036 | need the FileInfo should make two requests. |
| 5037 | |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 5038 | The request parameter `q` changes the response to return a list |
| 5039 | of all files (modified or unmodified) that contain that substring |
| 5040 | in the path name. This is useful to implement suggestion services |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 5041 | finding a file by partial name. Clients that also need the FileInfo |
| 5042 | should make two requests. |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 5043 | |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 5044 | For merge commits only, the integer-valued request parameter `parent` |
| 5045 | changes the response to return a map of the files which are different |
| 5046 | 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] | 5047 | 1-based index of the parent's position in the commit object, |
| 5048 | with the first parent always belonging to the target branch. If not |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 5049 | specified, the response contains a map of the files different in the |
| 5050 | auto merge result. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 5051 | |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 5052 | The request parameter `base` changes the response to return a map of the |
| 5053 | files which are different in this commit compared to the given revision. The |
| 5054 | revision must correspond to a patch set in the change. |
| 5055 | |
| 5056 | The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive. |
| 5057 | That is, only one of them may be used at a time. |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5058 | |
| 5059 | .Request |
| 5060 | ---- |
| 5061 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0 |
| 5062 | ---- |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5063 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5064 | .Response |
| 5065 | ---- |
| 5066 | HTTP/1.1 200 OK |
| 5067 | Content-Disposition: attachment |
| 5068 | Content-Type: application/json; charset=UTF-8 |
| 5069 | |
| 5070 | )]}' |
| 5071 | [ |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5072 | "/COMMIT_MSG", |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5073 | "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] | 5074 | ] |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5075 | ---- |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5076 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5077 | [[get-content]] |
| 5078 | === Get Content |
| 5079 | -- |
| 5080 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content' |
| 5081 | -- |
| 5082 | |
| 5083 | Gets the content of a file from a certain revision. |
| 5084 | |
Patrick Hiesel | 38667d4 | 2017-05-02 13:12:48 +0200 | [diff] [blame] | 5085 | The optional, integer-valued `parent` parameter can be specified to request |
| 5086 | the named file from a parent commit of the specified revision. The value is |
| 5087 | the 1-based index of the parent's position in the commit object. If the |
| 5088 | parameter is omitted or the value is non-positive, the patch set is referenced. |
| 5089 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5090 | .Request |
| 5091 | ---- |
| 5092 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0 |
| 5093 | ---- |
| 5094 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5095 | The content is returned as base64 encoded string. The HTTP response |
| 5096 | Content-Type is always `text/plain`, reflecting the base64 wrapping. |
| 5097 | A Gerrit-specific `X-FYI-Content-Type` header is returned describing |
| 5098 | the server detected content type of the file. |
| 5099 | |
| 5100 | If only the content type is required, callers should use HEAD to |
| 5101 | avoid downloading the encoded file contents. |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5102 | |
| 5103 | .Response |
| 5104 | ---- |
| 5105 | HTTP/1.1 200 OK |
| 5106 | Content-Disposition: attachment |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5107 | Content-Type: text/plain; charset=ISO-8859-1 |
| 5108 | X-FYI-Content-Encoding: base64 |
| 5109 | X-FYI-Content-Type: text/xml |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5110 | |
| 5111 | Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY... |
| 5112 | ---- |
| 5113 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 5114 | Alternatively, if the only value of the Accept request header is |
| 5115 | `application/json` the content is returned as JSON string and |
| 5116 | `X-FYI-Content-Encoding` is set to `json`. |
| 5117 | |
David Pletcher | d1efb45 | 2015-09-01 17:45:55 -0700 | [diff] [blame] | 5118 | [[get-safe-content]] |
| 5119 | === Download Content |
| 5120 | -- |
| 5121 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download' |
| 5122 | -- |
| 5123 | |
| 5124 | Downloads the content of a file from a certain revision, in a safe format |
| 5125 | that poses no risk for inadvertent execution of untrusted code. |
| 5126 | |
| 5127 | If the content type is defined as safe, the binary file content is returned |
| 5128 | verbatim. If the content type is not safe, the file is stored inside a ZIP |
| 5129 | file, containing a single entry with a random, unpredictable name having the |
| 5130 | same base and suffix as the true filename. The ZIP file is returned in |
| 5131 | verbatim binary form. |
| 5132 | |
| 5133 | See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation] |
| 5134 | for information about safe file type configuration. |
| 5135 | |
| 5136 | The HTTP resource Content-Type is dependent on the file type: the |
| 5137 | applicable type for safe files, or "application/zip" for unsafe files. |
| 5138 | |
David Pletcher | ec622bf | 2015-09-18 14:30:05 -0700 | [diff] [blame] | 5139 | The optional, integer-valued `parent` parameter can be specified to request |
| 5140 | the named file from a parent commit of the specified revision. The value is |
| 5141 | the 1-based index of the parent's position in the commit object. If the |
| 5142 | parameter is omitted or the value non-positive, the patch set is referenced. |
| 5143 | |
| 5144 | Filenames are decorated with a suffix of `_new` for the current patch, |
| 5145 | `_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] | 5146 | |
| 5147 | .Request |
| 5148 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 5149 | 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] | 5150 | ---- |
| 5151 | |
| 5152 | .Response |
| 5153 | ---- |
| 5154 | HTTP/1.1 200 OK |
| 5155 | Content-Disposition: attachment; filename="logo.png" |
| 5156 | Content-Type: image/png |
| 5157 | |
| 5158 | `[binary data for logo.png]` |
| 5159 | ---- |
| 5160 | |
| 5161 | .Request |
| 5162 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 5163 | 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] | 5164 | ---- |
| 5165 | |
| 5166 | .Response |
| 5167 | ---- |
| 5168 | HTTP/1.1 200 OK |
| 5169 | Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip" |
| 5170 | Content-Type:application/zip |
| 5171 | |
| 5172 | `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]` |
| 5173 | ---- |
| 5174 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5175 | [[get-diff]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5176 | === Get Diff |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5177 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5178 | '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] | 5179 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5180 | |
| 5181 | Gets the diff of a file from a certain revision. |
| 5182 | |
| 5183 | .Request |
| 5184 | ---- |
| 5185 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0 |
| 5186 | ---- |
| 5187 | |
| 5188 | As response a link:#diff-info[DiffInfo] entity is returned that describes the diff. |
| 5189 | |
| 5190 | .Response |
| 5191 | ---- |
| 5192 | HTTP/1.1 200 OK |
| 5193 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5194 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5195 | |
| 5196 | )] |
| 5197 | { |
| 5198 | "meta_a": { |
| 5199 | "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] | 5200 | "content_type": "text/x-java-source", |
| 5201 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5202 | }, |
| 5203 | "meta_b": { |
| 5204 | "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] | 5205 | "content_type": "text/x-java-source", |
| 5206 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5207 | }, |
| 5208 | "change_type": "MODIFIED", |
| 5209 | "diff_header": [ |
| 5210 | "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", |
| 5211 | "index 59b7670..9faf81c 100644", |
| 5212 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5213 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 5214 | ], |
| 5215 | "content": [ |
| 5216 | { |
| 5217 | "ab": [ |
| 5218 | "// Copyright (C) 2010 The Android Open Source Project", |
| 5219 | "//", |
| 5220 | "// Licensed under the Apache License, Version 2.0 (the \"License\");", |
| 5221 | "// you may not use this file except in compliance with the License.", |
| 5222 | "// You may obtain a copy of the License at", |
| 5223 | "//", |
| 5224 | "// http://www.apache.org/licenses/LICENSE-2.0", |
| 5225 | "//", |
| 5226 | "// Unless required by applicable law or agreed to in writing, software", |
| 5227 | "// distributed under the License is distributed on an \"AS IS\" BASIS,", |
| 5228 | "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", |
| 5229 | "// See the License for the specific language governing permissions and", |
| 5230 | "// limitations under the License." |
| 5231 | ] |
| 5232 | }, |
| 5233 | { |
| 5234 | "b": [ |
| 5235 | "//", |
| 5236 | "// Add some more lines in the header." |
| 5237 | ] |
| 5238 | }, |
| 5239 | { |
| 5240 | "ab": [ |
| 5241 | "", |
| 5242 | "package com.google.gerrit.server.project;", |
| 5243 | "", |
| 5244 | "import com.google.common.collect.Maps;", |
| 5245 | ... |
| 5246 | ] |
| 5247 | } |
| 5248 | ... |
| 5249 | ] |
| 5250 | } |
| 5251 | ---- |
| 5252 | |
| 5253 | If the `intraline` parameter is specified, intraline differences are included in the diff. |
| 5254 | |
| 5255 | .Request |
| 5256 | ---- |
| 5257 | 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 |
| 5258 | ---- |
| 5259 | |
| 5260 | .Response |
| 5261 | ---- |
| 5262 | HTTP/1.1 200 OK |
| 5263 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5264 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5265 | |
| 5266 | )] |
| 5267 | { |
| 5268 | "meta_a": { |
| 5269 | "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] | 5270 | "content_type": "text/x-java-source", |
| 5271 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5272 | }, |
| 5273 | "meta_b": { |
| 5274 | "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] | 5275 | "content_type": "text/x-java-source", |
| 5276 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5277 | }, |
| 5278 | "change_type": "MODIFIED", |
| 5279 | "diff_header": [ |
| 5280 | "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", |
| 5281 | "index 59b7670..9faf81c 100644", |
| 5282 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5283 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 5284 | ], |
| 5285 | "content": [ |
| 5286 | ... |
| 5287 | { |
| 5288 | "a": [ |
| 5289 | "/** Manages access control for Git references (aka branches, tags). */" |
| 5290 | ], |
| 5291 | "b": [ |
| 5292 | "/** Manages access control for the Git references (aka branches, tags). */" |
| 5293 | ], |
| 5294 | "edit_a": [], |
| 5295 | "edit_b": [ |
| 5296 | [ |
| 5297 | 31, |
| 5298 | 4 |
| 5299 | ] |
| 5300 | ] |
| 5301 | } |
| 5302 | ] |
| 5303 | } |
| 5304 | ---- |
| 5305 | |
| 5306 | The `base` parameter can be specified to control the base patch set from which the diff should |
| 5307 | be generated. |
| 5308 | |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 5309 | The integer-valued request parameter `parent` can be specified to control the |
| 5310 | parent commit number against which the diff should be generated. This is useful |
| 5311 | for supporting review of merge commits. The value is the 1-based index of the |
| 5312 | parent's position in the commit object. |
| 5313 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5314 | .Request |
| 5315 | ---- |
| 5316 | 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 |
| 5317 | ---- |
| 5318 | |
| 5319 | .Response |
| 5320 | ---- |
| 5321 | HTTP/1.1 200 OK |
| 5322 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5323 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5324 | |
| 5325 | )] |
| 5326 | { |
| 5327 | "meta_a": { |
| 5328 | "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] | 5329 | "content_type": "text/x-java-source", |
| 5330 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5331 | }, |
| 5332 | "meta_b": { |
| 5333 | "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] | 5334 | "content_type": "text/x-java-source", |
| 5335 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5336 | }, |
| 5337 | "change_type": "MODIFIED", |
| 5338 | "content": [ |
| 5339 | { |
| 5340 | "skip": 578 |
| 5341 | } |
| 5342 | ] |
| 5343 | } |
| 5344 | ---- |
| 5345 | |
Edwin Kempin | 0b7c40f | 2016-02-09 17:13:23 +0100 | [diff] [blame] | 5346 | The `whitespace` parameter can be specified to control how whitespace |
| 5347 | differences are reported in the result. Valid values are `IGNORE_NONE`, |
| 5348 | `IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5349 | |
| 5350 | The `context` parameter can be specified to control the number of lines of surrounding context |
| 5351 | in the diff. Valid values are `ALL` or number of lines. |
| 5352 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 5353 | [[get-blame]] |
| 5354 | === Get Blame |
| 5355 | -- |
| 5356 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame' |
| 5357 | -- |
| 5358 | |
| 5359 | Gets the blame of a file from a certain revision. |
| 5360 | |
| 5361 | .Request |
| 5362 | ---- |
| 5363 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0 |
| 5364 | ---- |
| 5365 | |
| 5366 | As response a link:#blame-info[BlameInfo] entity is returned that describes the |
| 5367 | blame. |
| 5368 | |
| 5369 | .Response |
| 5370 | ---- |
| 5371 | HTTP/1.1 200 OK |
| 5372 | Content-Disposition: attachment |
| 5373 | Content-Type: application/json; charset=UTF-8 |
| 5374 | |
| 5375 | )] |
| 5376 | { |
| 5377 | [ |
| 5378 | { |
| 5379 | "author": "Joe Daw", |
| 5380 | "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7", |
| 5381 | "time": 1421441349, |
| 5382 | "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n", |
| 5383 | "ranges": [ |
| 5384 | { |
| 5385 | "start": 1, |
| 5386 | "end": 10 |
| 5387 | }, |
| 5388 | { |
| 5389 | "start": 16, |
| 5390 | "end": 296 |
| 5391 | } |
| 5392 | ] |
| 5393 | }, |
| 5394 | { |
| 5395 | "author": "Jane Daw", |
| 5396 | "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7", |
| 5397 | "time": 1421825421, |
| 5398 | "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n", |
| 5399 | "ranges": [ |
| 5400 | { |
| 5401 | "start": 13, |
| 5402 | "end": 13 |
| 5403 | } |
| 5404 | ] |
| 5405 | } |
| 5406 | ] |
| 5407 | } |
| 5408 | ---- |
| 5409 | |
| 5410 | The `base` parameter can be specified to control the base patch set from which |
| 5411 | the blame should be generated. |
| 5412 | |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5413 | [[set-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5414 | === Set Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5415 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5416 | '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] | 5417 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5418 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5419 | Marks a file of a revision as reviewed by the calling user. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5420 | |
| 5421 | .Request |
| 5422 | ---- |
| 5423 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 5424 | ---- |
| 5425 | |
| 5426 | .Response |
| 5427 | ---- |
| 5428 | HTTP/1.1 201 Created |
| 5429 | ---- |
| 5430 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5431 | 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] | 5432 | response is "`200 OK`". |
| 5433 | |
| 5434 | [[delete-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5435 | === Delete Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5436 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5437 | '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] | 5438 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5439 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5440 | 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] | 5441 | |
| 5442 | .Request |
| 5443 | ---- |
| 5444 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 5445 | ---- |
| 5446 | |
| 5447 | .Response |
| 5448 | ---- |
| 5449 | HTTP/1.1 204 No Content |
| 5450 | ---- |
| 5451 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5452 | [[cherry-pick]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5453 | === Cherry Pick Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5454 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5455 | '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] | 5456 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5457 | |
| 5458 | Cherry picks a revision to a destination branch. |
| 5459 | |
Changcheng Xiao | 54b6c0c | 2017-10-23 14:57:42 +0200 | [diff] [blame] | 5460 | To cherry pick a commit with no change-id associated with it, see |
| 5461 | link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit]. |
| 5462 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5463 | 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] | 5464 | link:#cherrypick-input[CherryPickInput] entity. If the commit message |
| 5465 | 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] | 5466 | |
| 5467 | .Request |
| 5468 | ---- |
| 5469 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5470 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5471 | |
| 5472 | { |
Gustaf Lundh | 98df5b5 | 2013-05-07 19:22:13 +0100 | [diff] [blame] | 5473 | "message" : "Implementing Feature X", |
| 5474 | "destination" : "release-branch" |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5475 | } |
| 5476 | ---- |
| 5477 | |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 5478 | As response a link:#cherry-pick-change-info[CherryPickChangeInfo] |
| 5479 | entity is returned that describes the resulting cherry-pick change. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5480 | |
| 5481 | .Response |
| 5482 | ---- |
| 5483 | HTTP/1.1 200 OK |
| 5484 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5485 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5486 | |
| 5487 | )]}' |
| 5488 | { |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5489 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 5490 | "project": "myProject", |
| 5491 | "branch": "release-branch", |
| 5492 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 5493 | "subject": "Implementing Feature X", |
| 5494 | "status": "NEW", |
| 5495 | "created": "2013-02-01 09:59:32.126000000", |
| 5496 | "updated": "2013-02-21 11:16:36.775000000", |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5497 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 5498 | "insertions": 12, |
| 5499 | "deletions": 11, |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5500 | "_number": 3965, |
| 5501 | "owner": { |
| 5502 | "name": "John Doe" |
| 5503 | } |
| 5504 | } |
| 5505 | ---- |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5506 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 5507 | [[revision-reviewer-endpoints]] |
| 5508 | == Revision Reviewer Endpoints |
| 5509 | |
| 5510 | [[list-revision-reviewers]] |
| 5511 | === List Revision Reviewers |
| 5512 | -- |
| 5513 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/' |
| 5514 | -- |
| 5515 | |
| 5516 | Lists the reviewers of a revision. |
| 5517 | |
| 5518 | Please note that only the current revision is supported. |
| 5519 | |
| 5520 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 5521 | |
| 5522 | .Request |
| 5523 | ---- |
| 5524 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0 |
| 5525 | ---- |
| 5526 | |
| 5527 | .Response |
| 5528 | ---- |
| 5529 | HTTP/1.1 200 OK |
| 5530 | Content-Disposition: attachment |
| 5531 | Content-Type: application/json; charset=UTF-8 |
| 5532 | |
| 5533 | )]}' |
| 5534 | [ |
| 5535 | { |
| 5536 | "approvals": { |
| 5537 | "Verified": "+1", |
| 5538 | "Code-Review": "+2" |
| 5539 | }, |
| 5540 | "_account_id": 1000096, |
| 5541 | "name": "John Doe", |
| 5542 | "email": "john.doe@example.com" |
| 5543 | }, |
| 5544 | { |
| 5545 | "approvals": { |
| 5546 | "Verified": " 0", |
| 5547 | "Code-Review": "-1" |
| 5548 | }, |
| 5549 | "_account_id": 1000097, |
| 5550 | "name": "Jane Roe", |
| 5551 | "email": "jane.roe@example.com" |
| 5552 | } |
| 5553 | ] |
| 5554 | ---- |
| 5555 | |
| 5556 | [[list-revision-votes]] |
| 5557 | === List Revision Votes |
| 5558 | -- |
| 5559 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 5560 | -- |
| 5561 | |
| 5562 | Lists the votes for a specific reviewer of the revision. |
| 5563 | |
| 5564 | Please note that only the current revision is supported. |
| 5565 | |
| 5566 | .Request |
| 5567 | ---- |
| 5568 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0 |
| 5569 | ---- |
| 5570 | |
| 5571 | As result a map is returned that maps the label name to the label value. |
| 5572 | The entries in the map are sorted by label name. |
| 5573 | |
| 5574 | .Response |
| 5575 | ---- |
| 5576 | HTTP/1.1 200 OK |
| 5577 | Content-Disposition: attachment |
| 5578 | Content-Type: application/json;charset=UTF-8 |
| 5579 | |
| 5580 | )]}' |
| 5581 | { |
| 5582 | "Code-Review": -1, |
| 5583 | "Verified": 1, |
| 5584 | "Work-In-Progress": 1 |
| 5585 | } |
| 5586 | ---- |
| 5587 | |
| 5588 | [[delete-revision-vote]] |
| 5589 | === Delete Revision Vote |
| 5590 | -- |
| 5591 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 5592 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' + |
| 5593 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 5594 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete' |
| 5595 | -- |
| 5596 | |
| 5597 | Deletes a single vote from a revision. The deletion will be possible only |
| 5598 | if the revision is the current revision. By using this endpoint you can prevent |
| 5599 | deleting the vote (with same label) from a newer patch set by mistake. |
| 5600 | |
| 5601 | Note, that even when the last vote of a reviewer is removed the reviewer itself |
| 5602 | is still listed on the change. |
| 5603 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 5604 | .Request |
| 5605 | ---- |
| 5606 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0 |
| 5607 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 5608 | ---- |
| 5609 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 5610 | Options can be provided in the request body as a |
| 5611 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 5612 | Historically, this method allowed a body in the DELETE, but that behavior is |
| 5613 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated]. |
| 5614 | In this case, use a POST request instead: |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 5615 | |
| 5616 | .Request |
| 5617 | ---- |
| 5618 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 5619 | Content-Type: application/json; charset=UTF-8 |
| 5620 | |
| 5621 | { |
| 5622 | "notify": "NONE" |
| 5623 | } |
| 5624 | ---- |
| 5625 | |
| 5626 | .Response |
| 5627 | ---- |
| 5628 | HTTP/1.1 204 No Content |
| 5629 | ---- |
| 5630 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5631 | [[ids]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5632 | == IDs |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5633 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 5634 | [[account-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5635 | === link:rest-api-accounts.html#account-id[\{account-id\}] |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 5636 | -- |
| 5637 | -- |
| 5638 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5639 | [[change-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5640 | === \{change-id\} |
Patrick Hiesel | 18da045 | 2017-12-21 14:02:05 +0100 | [diff] [blame] | 5641 | Identifier that uniquely identifies one change. It contains the URL-encoded |
| 5642 | project name as well as the change number: "'$$<project>~<numericId>$$'" |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5643 | |
Patrick Hiesel | 18da045 | 2017-12-21 14:02:05 +0100 | [diff] [blame] | 5644 | Depending on the server's configuration, Gerrit can still support the following |
| 5645 | deprecated identifiers. These will be removed in a future release: |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5646 | |
| 5647 | * an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'", |
| 5648 | where for the branch the `refs/heads/` prefix can be omitted |
| 5649 | ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$") |
| 5650 | * a Change-Id if it uniquely identifies one change |
| 5651 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
Patrick Hiesel | 4d2dd18 | 2017-05-09 17:35:18 +0200 | [diff] [blame] | 5652 | * a numeric change ID ("4247") |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5653 | |
Patrick Hiesel | 18da045 | 2017-12-21 14:02:05 +0100 | [diff] [blame] | 5654 | If you need more time to migrate off of old change IDs, please see |
| 5655 | link:config-gerrit.html#change.api.allowedIdentifier[change.api.allowedIdentifier] |
| 5656 | for more information on how to enable the use of deprecated identifiers. |
| 5657 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 5658 | [[change-message-id]] |
| 5659 | === \{change-message-id\} |
| 5660 | ID of a change message returned in a link:#change-message-info[ChangeMessageInfo]. |
| 5661 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5662 | [[comment-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5663 | === \{comment-id\} |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5664 | UUID of a published comment. |
| 5665 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5666 | [[draft-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5667 | === \{draft-id\} |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5668 | UUID of a draft comment. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5669 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 5670 | [[label-id]] |
| 5671 | === \{label-id\} |
| 5672 | The name of the label. |
| 5673 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5674 | [[file-id]] |
David Pursehouse | b10c266 | 2016-12-06 08:41:33 +0900 | [diff] [blame] | 5675 | === \{file-id\} |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5676 | The path of the file. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5677 | |
David Pursehouse | 11badbb | 2017-03-27 10:58:05 +0900 | [diff] [blame] | 5678 | The following magic paths are supported: |
| 5679 | |
| 5680 | * `/COMMIT_MSG`: |
| 5681 | + |
| 5682 | The commit message and headers with the parent commit(s), the author |
| 5683 | information and the committer information. |
| 5684 | |
| 5685 | * `/MERGE_LIST` (for merge commits only): |
| 5686 | + |
| 5687 | The list of commits that are being integrated into the destination |
| 5688 | branch by submitting the merge commit. |
| 5689 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 5690 | [[fix-id]] |
| 5691 | === \{fix-id\} |
| 5692 | UUID of a suggested fix. |
| 5693 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 5694 | [[revision-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5695 | === \{revision-id\} |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 5696 | Identifier that uniquely identifies one revision of a change. |
| 5697 | |
| 5698 | This can be: |
| 5699 | |
Shawn Pearce | 9c0722a | 2013-03-02 15:30:31 -0800 | [diff] [blame] | 5700 | * the literal `current` to name the current patch set/revision |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 5701 | * a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1") |
| 5702 | * an abbreviated commit ID that uniquely identifies one revision of the |
| 5703 | change ("674ac754"), at least 4 digits are required |
| 5704 | * 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] | 5705 | * "0" or the literal `edit` for a change edit |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 5706 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5707 | [[json-entities]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5708 | == JSON Entities |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5709 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 5710 | [[abandon-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5711 | === AbandonInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 5712 | The `AbandonInput` entity contains information for abandoning a change. |
| 5713 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5714 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 5715 | |============================= |
| 5716 | |Field Name ||Description |
| 5717 | |`message` |optional| |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 5718 | Message to be added as review comment to the change when abandoning the |
| 5719 | change. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 5720 | |`notify` |optional| |
Stephen Li | e5fcdf7 | 2016-08-02 11:05:11 -0700 | [diff] [blame] | 5721 | Notify handling that defines to whom email notifications should be sent after |
| 5722 | the change is abandoned. + |
| 5723 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 5724 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 5725 | |`notify_details`|optional| |
| 5726 | Additional information about whom to notify about the update as a map |
| 5727 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 5728 | |============================= |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 5729 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 5730 | [[action-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5731 | === ActionInfo |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 5732 | The `ActionInfo` entity describes a REST API call the client can |
| 5733 | make to manipulate a resource. These are frequently implemented by |
| 5734 | plugins and may be discovered at runtime. |
| 5735 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5736 | [options="header",cols="1,^1,5"] |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 5737 | |==================================== |
| 5738 | |Field Name ||Description |
| 5739 | |`method` |optional| |
| 5740 | HTTP method to use with the action. Most actions use `POST`, `PUT` |
| 5741 | or `DELETE` to cause state changes. |
| 5742 | |`label` |optional| |
| 5743 | Short title to display to a user describing the action. In the |
| 5744 | Gerrit web interface the label is used as the text on the button |
| 5745 | presented in the UI. |
| 5746 | |`title` |optional| |
| 5747 | Longer text to display describing the action. In a web UI this |
| 5748 | should be the title attribute of the element, displaying when |
| 5749 | the user hovers the mouse. |
| 5750 | |`enabled` |optional| |
| 5751 | If true the action is permitted at this time and the caller is |
| 5752 | likely allowed to execute it. This may change if state is updated |
| 5753 | at the server or permissions are modified. Not present if false. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 5754 | |==================================== |
| 5755 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5756 | [[add-reviewer-result]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5757 | === AddReviewerResult |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5758 | The `AddReviewerResult` entity describes the result of adding a |
| 5759 | reviewer to a change. |
| 5760 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5761 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5762 | |=========================== |
| 5763 | |Field Name ||Description |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 5764 | |`input` || |
| 5765 | Value of the `reviewer` field from link:#reviewer-input[ReviewerInput] |
| 5766 | set while adding the reviewer. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5767 | |`reviewers` |optional| |
| 5768 | The newly added reviewers as a list of link:#reviewer-info[ |
| 5769 | ReviewerInfo] entities. |
Logan Hanks | ee0a418 | 2016-07-06 14:39:26 -0700 | [diff] [blame] | 5770 | |`ccs` |optional| |
| 5771 | The newly CCed accounts as a list of link:#reviewer-info[ |
| 5772 | ReviewerInfo] entities. This field will only appear if the requested |
| 5773 | `state` for the reviewer was `CC` *and* NoteDb is enabled on the |
| 5774 | server. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 5775 | |`error` |optional| |
| 5776 | Error message explaining why the reviewer could not be added. + |
| 5777 | If a group was specified in the input and an error is returned, it |
| 5778 | means that none of the members were added as reviewer. |
| 5779 | |`confirm` |`false` if not set| |
| 5780 | Whether adding the reviewer requires confirmation. |
| 5781 | |=========================== |
| 5782 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5783 | [[approval-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5784 | === ApprovalInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5785 | The `ApprovalInfo` entity contains information about an approval from a |
| 5786 | user for a label on a change. |
| 5787 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 5788 | `ApprovalInfo` has the same fields as |
| 5789 | link:rest-api-accounts.html#account-info[AccountInfo]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5790 | In addition `ApprovalInfo` has the following fields: |
| 5791 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5792 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5793 | |=========================== |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 5794 | |Field Name ||Description |
| 5795 | |`value` |optional| |
Dave Borowitz | a30db91 | 2013-03-22 14:20:33 -0700 | [diff] [blame] | 5796 | The vote that the user has given for the label. If present and zero, the |
| 5797 | user is permitted to vote on the label. If absent, the user is not |
| 5798 | permitted to vote on that label. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 5799 | |`permitted_voting_range` |optional| |
| 5800 | The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote |
| 5801 | on that label. If present, the user is permitted to vote on the label |
| 5802 | regarding the range values. If absent, the user is not permitted to vote |
| 5803 | on that label. |
| 5804 | |`date` |optional| |
Gustaf Lundh | 2e07d502 | 2013-05-08 17:07:42 +0100 | [diff] [blame] | 5805 | The time and date describing when the approval was made. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 5806 | |`tag` |optional| |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 5807 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 5808 | while posting the review. Votes/comments that contain `tag` with |
| 5809 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 5810 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 5811 | invocations of the REST call are required. |
Dave Borowitz | e47fe47 | 2016-09-09 13:57:14 -0400 | [diff] [blame] | 5812 | |`post_submit` |not set if `false`| |
| 5813 | If true, this vote was made after the change was submitted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5814 | |=========================== |
| 5815 | |
Sven Selberg | 273a4aa | 2016-09-21 16:28:10 +0200 | [diff] [blame] | 5816 | [[assignee-input]] |
| 5817 | === AssigneeInput |
| 5818 | The `AssigneeInput` entity contains the identity of the user to be set as assignee. |
| 5819 | |
| 5820 | [options="header",cols="1,^1,5"] |
| 5821 | |=========================== |
| 5822 | |Field Name ||Description |
| 5823 | |`assignee` || |
| 5824 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 5825 | should be added as assignee. |
| 5826 | |=========================== |
| 5827 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 5828 | [[blame-info]] |
| 5829 | === BlameInfo |
| 5830 | The `BlameInfo` entity stores the commit metadata with the row coordinates where |
| 5831 | it applies. |
| 5832 | |
| 5833 | [options="header",cols="1,6"] |
| 5834 | |=========================== |
| 5835 | |Field Name | Description |
| 5836 | |`author` | The author of the commit. |
| 5837 | |`id` | The id of the commit. |
| 5838 | |`time` | Commit time. |
| 5839 | |`commit_msg` | The commit message. |
| 5840 | |`ranges` | |
| 5841 | The blame row coordinates as link:#range-info[RangeInfo] entities. |
| 5842 | |=========================== |
| 5843 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 5844 | [[change-edit-input]] |
| 5845 | === ChangeEditInput |
| 5846 | The `ChangeEditInput` entity contains information for restoring a |
| 5847 | path within change edit. |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 5848 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 5849 | [options="header",cols="1,^1,5"] |
| 5850 | |=========================== |
| 5851 | |Field Name ||Description |
| 5852 | |`restore_path`|optional|Path to file to restore. |
| 5853 | |`old_path` |optional|Old path to file to rename. |
| 5854 | |`new_path` |optional|New path to file to rename. |
| 5855 | |=========================== |
| 5856 | |
| 5857 | [[change-edit-message-input]] |
| 5858 | === ChangeEditMessageInput |
| 5859 | The `ChangeEditMessageInput` entity contains information for changing |
| 5860 | the commit message within a change edit. |
| 5861 | |
| 5862 | [options="header",cols="1,^1,5"] |
| 5863 | |=========================== |
| 5864 | |Field Name ||Description |
| 5865 | |`message` ||New commit message. |
| 5866 | |=========================== |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 5867 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5868 | [[change-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5869 | === ChangeInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5870 | The `ChangeInfo` entity contains information about a change. |
| 5871 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 5872 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5873 | |================================== |
| 5874 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5875 | |`id` || |
| 5876 | The ID of the change in the format "'<project>\~<branch>~<Change-Id>'", |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 5877 | where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5878 | `refs/heads/` prefix is omitted. |
| 5879 | |`project` ||The name of the project. |
| 5880 | |`branch` || |
| 5881 | The name of the target branch. + |
| 5882 | The `refs/heads/` prefix is omitted. |
Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 5883 | |`topic` |optional|The topic to which this change belongs. |
Edwin Kempin | 93b74fb | 2017-08-25 10:42:56 +0200 | [diff] [blame] | 5884 | |`assignee` |optional| |
| 5885 | The assignee of the change as an link:rest-api-accounts.html#account-info[ |
| 5886 | AccountInfo] entity. |
| 5887 | |`hashtags` |optional| |
| 5888 | List of hashtags that are set on the change (only populated when NoteDb |
| 5889 | is enabled). |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5890 | |`change_id` ||The Change-Id of the change. |
| 5891 | |`subject` || |
| 5892 | The subject of the change (header line of the commit message). |
| 5893 | |`status` || |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 5894 | The status of the change (`NEW`, `MERGED`, `ABANDONED`). |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5895 | |`created` || |
| 5896 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 5897 | created. |
| 5898 | |`updated` || |
| 5899 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 5900 | updated. |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 5901 | |`submitted` |only set for merged changes| |
| 5902 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 5903 | submitted. |
Dave Borowitz | 8ec31f9 | 2017-08-23 10:28:34 -0400 | [diff] [blame] | 5904 | |`submitter` |only set for merged changes| |
| 5905 | The user who submitted the change, as an |
| 5906 | link:rest-api-accounts.html#account-info[ AccountInfo] entity. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5907 | |`starred` |not set if `false`| |
Edwin Kempin | 9e972cc | 2016-04-15 10:39:13 +0200 | [diff] [blame] | 5908 | Whether the calling user has starred this change with the default label. |
| 5909 | |`stars` |optional| |
| 5910 | A list of star labels that are applied by the calling user to this |
| 5911 | change. The labels are lexicographically sorted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5912 | |`reviewed` |not set if `false`| |
| 5913 | Whether the change was reviewed by the calling user. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 5914 | Only set if link:#reviewed[reviewed] is requested. |
Dave Borowitz | ace3210 | 2015-12-17 13:08:25 -0500 | [diff] [blame] | 5915 | |`submit_type` |optional| |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 5916 | 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] | 5917 | Not set for merged changes. |
Edwin Kempin | baf70e1 | 2013-02-27 10:36:13 +0100 | [diff] [blame] | 5918 | |`mergeable` |optional| |
| 5919 | Whether the change is mergeable. + |
Han-Wen Nienhuys | 19de6cd | 2018-01-16 13:15:38 +0100 | [diff] [blame] | 5920 | 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] | 5921 | if the link:#skip_mergeable[skip_mergeable] option is set or when |
| 5922 | link:config-gerrit.html#change.api.excludeMergeableInChangeInfo[change.api.excludeMergeableInChangeInfo] |
| 5923 | is set. |
Shawn Pearce | 4cd05b2 | 2016-09-17 22:45:33 -0700 | [diff] [blame] | 5924 | |`submittable` |optional| |
| 5925 | Whether the change has been approved by the project submit rules. + |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 5926 | Only set if link:#submittable[requested]. |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 5927 | |`insertions` || |
| 5928 | Number of inserted lines. |
| 5929 | |`deletions` || |
| 5930 | Number of deleted lines. |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 5931 | |`total_comment_count` |optional| |
| 5932 | Total number of inline comments across all patch sets. Not set if the current |
| 5933 | change index doesn't have the data. |
Changcheng Xiao | 81c4809 | 2017-02-08 13:04:07 +0100 | [diff] [blame] | 5934 | |`unresolved_comment_count` |optional| |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 5935 | Number of unresolved inline comment threads across all patch sets. Not set if |
| 5936 | the current change index doesn't have the data. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5937 | |`_number` ||The legacy numeric ID of the change. |
| 5938 | |`owner` || |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 5939 | The owner of the change as an link:rest-api-accounts.html#account-info[ |
| 5940 | AccountInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 5941 | |`actions` |optional| |
| 5942 | Actions the caller might be able to perform on this revision. The |
| 5943 | information is a map of view name to link:#action-info[ActionInfo] |
| 5944 | entities. |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 5945 | |`requirements` |optional| |
| 5946 | List of the link:rest-api-changes.html#requirement[requirements] to be met before this change |
| 5947 | can be submitted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5948 | |`labels` |optional| |
| 5949 | The labels of the change as a map that maps the label names to |
| 5950 | link:#label-info[LabelInfo] entries. + |
| 5951 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 5952 | labels] are requested. |
| 5953 | |`permitted_labels` |optional| |
| 5954 | A map of the permitted labels that maps a label name to the list of |
| 5955 | values that are allowed for that label. + |
| 5956 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 5957 | |`removable_reviewers`|optional| |
| 5958 | 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] | 5959 | link:rest-api-accounts.html#account-info[AccountInfo] entities. + |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5960 | Only set if link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 5961 | |`reviewers` |optional| |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 5962 | The reviewers as a map that maps a reviewer state to a list of |
| 5963 | link:rest-api-accounts.html#account-info[AccountInfo] entities. |
| 5964 | Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. + |
| 5965 | `REVIEWER`: Users with at least one non-zero vote on the change. + |
| 5966 | `CC`: Users that were added to the change, but have not voted. + |
| 5967 | `REMOVED`: Users that were previously reviewers on the change, but have |
| 5968 | been removed. + |
| 5969 | Only set if link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 5970 | |`pending_reviewers` |optional| |
| 5971 | Updates to `reviewers` that have been made while the change was in the |
| 5972 | WIP state. Only present on WIP changes and only if there are pending |
| 5973 | reviewer updates to report. These are reviewers who have not yet been |
| 5974 | notified about being added to or removed from the change. + |
| 5975 | Only set if link:#detailed-labels[detailed labels] are requested. |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 5976 | |`reviewer_updates`|optional| |
| 5977 | Updates to reviewers set for the change as |
| 5978 | link:#review-update-info[ReviewerUpdateInfo] entities. |
| 5979 | Only set if link:#reviewer-updates[reviewer updates] are requested and |
| 5980 | if NoteDb is enabled. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5981 | |`messages`|optional| |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 5982 | Messages associated with the change as a list of |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 5983 | link:#change-message-info[ChangeMessageInfo] entities. + |
| 5984 | Only set if link:#messages[messages] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5985 | |`current_revision` |optional| |
| 5986 | The commit ID of the current patch set of this change. + |
| 5987 | Only set if link:#current-revision[the current revision] is requested |
| 5988 | or if link:#all-revisions[all revisions] are requested. |
| 5989 | |`revisions` |optional| |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 5990 | 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] | 5991 | patch set to a link:#revision-info[RevisionInfo] entity. + |
Dave Borowitz | 0adf270 | 2014-01-22 10:41:52 -0800 | [diff] [blame] | 5992 | Only set if link:#current-revision[the current revision] is requested |
| 5993 | (in which case it will only contain a key for the current revision) or |
| 5994 | if link:#all-revisions[all revisions] are requested. |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 5995 | |`tracking_ids` |optional| |
| 5996 | A list of link:#tracking-id-info[TrackingIdInfo] entities describing |
| 5997 | references to external tracking systems. Only set if |
| 5998 | link:#tracking-ids[tracking ids] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 5999 | |`_more_changes` |optional, not set if `false`| |
| 6000 | Whether the query would deliver more results if not limited. + |
Dave Borowitz | 4241459 | 2014-12-19 11:27:14 -0800 | [diff] [blame] | 6001 | Only set on the last change that is returned. |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 6002 | |`problems` |optional| |
| 6003 | A list of link:#problem-info[ProblemInfo] entities describing potential |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 6004 | problems with this change. Only set if link:#check[CHECK] is set. |
David Ostrovsky | cb19cec | 2017-04-28 11:55:45 +0200 | [diff] [blame] | 6005 | |`is_private` |optional, not set if `false`| |
| 6006 | When present, change is marked as private. |
David Ostrovsky | 258849b | 2017-03-09 23:21:03 +0100 | [diff] [blame] | 6007 | |`work_in_progress` |optional, not set if `false`| |
| 6008 | When present, change is marked as Work In Progress. |
Logan Hanks | 724b24c | 2017-07-14 10:01:05 -0700 | [diff] [blame] | 6009 | |`has_review_started` |optional, not set if `false`| |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 6010 | When present, change has been marked Ready at some point in time. |
Patrick Hiesel | 828f322 | 2017-07-13 14:18:38 +0200 | [diff] [blame] | 6011 | |`revert_of` |optional| |
| 6012 | The numeric Change-Id of the change that this change reverts. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 6013 | |================================== |
| 6014 | |
| 6015 | [[change-input]] |
| 6016 | === ChangeInput |
| 6017 | The `ChangeInput` entity contains information about creating a new change. |
| 6018 | |
| 6019 | [options="header",cols="1,^1,5"] |
| 6020 | |================================== |
| 6021 | |Field Name ||Description |
| 6022 | |`project` ||The name of the project. |
| 6023 | |`branch` || |
| 6024 | The name of the target branch. + |
| 6025 | The `refs/heads/` prefix is omitted. |
| 6026 | |`subject` || |
David Pursehouse | 38cb32d | 2018-06-07 14:44:33 +0900 | [diff] [blame] | 6027 | The commit message of the change. Comment lines (beginning with `#`) will |
| 6028 | be removed. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 6029 | |`topic` |optional|The topic to which this change belongs. |
| 6030 | |`status` |optional, default to `NEW`| |
David Ostrovsky | 4b44bdc | 2017-07-27 08:05:43 +0200 | [diff] [blame] | 6031 | The status of the change (only `NEW` accepted here). |
Edwin Kempin | 14d50ed | 2017-05-03 13:26:30 +0200 | [diff] [blame] | 6032 | |`is_private` |optional, default to `false`| |
| 6033 | Whether the new change should be marked as private. |
| 6034 | |`work_in_progress` |optional, default to `false`| |
| 6035 | Whether the new change should be set to work in progress. |
David Ostrovsky | 9d8ec42 | 2014-12-24 00:52:09 +0100 | [diff] [blame] | 6036 | |`base_change` |optional| |
| 6037 | 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] | 6038 | change operation. Mutually exclusive with `base_commit`. |
| 6039 | |`base_commit` |optional| |
| 6040 | A 40-digit hex SHA-1 of the commit which will be the parent commit of the newly |
| 6041 | created change. If set, it must be a merged commit on the destination branch. |
| 6042 | Mutually exclusive with `base_change`. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 6043 | |`new_branch` |optional, default to `false`| |
Edwin Kempin | e94bb87 | 2019-10-08 13:47:41 +0200 | [diff] [blame] | 6044 | Allow creating a new branch when set to `true`. Using this option is |
| 6045 | 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] | 6046 | |`merge` |optional| |
| 6047 | 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] | 6048 | If set, the target branch (see `branch` field) must exist (it is not |
| 6049 | possible to create it automatically by setting the `new_branch` field |
| 6050 | to `true`. |
Edwin Kempin | 5f8c383 | 2017-01-13 11:45:06 +0100 | [diff] [blame] | 6051 | |`notify` |optional| |
| 6052 | Notify handling that defines to whom email notifications should be sent |
| 6053 | after the change is created. + |
| 6054 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6055 | If not set, the default is `ALL`. |
| 6056 | |`notify_details` |optional| |
| 6057 | Additional information about whom to notify about the change creation |
| 6058 | as a map of recipient type to link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6059 | |================================== |
| 6060 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6061 | [[change-message-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6062 | === ChangeMessageInfo |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6063 | The `ChangeMessageInfo` entity contains information about a message |
| 6064 | attached to a change. |
| 6065 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6066 | [options="header",cols="1,^1,5"] |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6067 | |================================== |
| 6068 | |Field Name ||Description |
| 6069 | |`id` ||The ID of the message. |
| 6070 | |`author` |optional| |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 6071 | Author of the message as an |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6072 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 6073 | Unset if written by the Gerrit system. |
Patrick Hiesel | 9221ef1 | 2017-03-23 16:44:36 +0100 | [diff] [blame] | 6074 | |`real_author` |optional| |
| 6075 | Real author of the message as an |
| 6076 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 6077 | Set if the message was posted on behalf of another user. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6078 | |`date` || |
| 6079 | The link:rest-api.html#timestamp[timestamp] this message was posted. |
| 6080 | |`message` ||The text left by the user. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6081 | |`tag` |optional| |
| 6082 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 6083 | while posting the review. Votes/comments that contain `tag` with |
| 6084 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 6085 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6086 | invocations of the REST call are required. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6087 | |`_revision_number` |optional| |
| 6088 | Which patchset (if any) generated this message. |
| 6089 | |================================== |
| 6090 | |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 6091 | [[cherry-pick-change-info]] |
| 6092 | === CherryPickChangeInfo |
| 6093 | The `CherryPickChangeInfo` entity contains information about a |
| 6094 | cherry-pick change. |
| 6095 | |
| 6096 | `CherryPickChangeInfo` has the same fields as link:#change-info[ |
| 6097 | ChangeInfo]. In addition `CherryPickChangeInfo` has the following |
| 6098 | fields: |
| 6099 | |
| 6100 | [options="header",cols="1,^1,5"] |
| 6101 | |====================================== |
| 6102 | |Field Name ||Description |
| 6103 | |`contains_git_conflicts` |optional, not set if `false`| |
| 6104 | Whether any file in the change contains Git conflict markers. |
| 6105 | |====================================== |
| 6106 | |
| 6107 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6108 | [[cherrypick-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6109 | === CherryPickInput |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6110 | The `CherryPickInput` entity contains information for cherry-picking a change to a new branch. |
| 6111 | |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6112 | [options="header",cols="1,^1,5"] |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6113 | |=========================== |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6114 | |Field Name ||Description |
Edwin Kempin | 159804b | 2019-09-23 11:09:39 +0200 | [diff] [blame] | 6115 | |`message` |optional| |
| 6116 | Commit message for the cherry-pick change. If not set, the commit message of |
| 6117 | the cherry-picked commit is used. |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6118 | |`destination` ||Destination branch |
Changcheng Xiao | e333258 | 2017-05-26 15:29:41 +0200 | [diff] [blame] | 6119 | |`base` |optional| |
| 6120 | 40-hex digit SHA-1 of the commit which will be the parent commit of the newly created change. |
| 6121 | 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] | 6122 | |`parent` |optional, defaults to 1| |
| 6123 | 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] | 6124 | |`notify` |optional| |
| 6125 | Notify handling that defines to whom email notifications should be sent |
| 6126 | after the cherry-pick. + |
| 6127 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6128 | If not set, the default is `NONE`. |
| 6129 | |`notify_details` |optional| |
| 6130 | Additional information about whom to notify about the update as a map |
| 6131 | of recipient type to link:#notify-info[NotifyInfo] entity. |
Aaron Gable | 54bc983 | 2017-07-05 14:44:36 -0700 | [diff] [blame] | 6132 | |`keep_reviewers` |optional, defaults to false| |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 6133 | If `true`, carries reviewers and ccs over from original change to newly created one. |
| 6134 | |`allow_conflicts` |optional, defaults to false| |
| 6135 | If `true`, the cherry-pick uses content merge and succeeds also if |
| 6136 | there are conflicts. If there are conflicts the file contents of the |
| 6137 | created change contain git conflict markers to indicate the conflicts. |
| 6138 | Callers can find out if there were conflicts by checking the |
| 6139 | `contains_git_conflicts` field in the link:#cherry-pick-change-info[ |
| 6140 | CherryPickChangeInfo] that is returned by the cherry-pick REST |
Edwin Kempin | 3c4113a | 2018-10-12 10:49:33 +0200 | [diff] [blame] | 6141 | endpoints. If there are conflicts the cherry-pick change is marked as |
| 6142 | work-in-progress. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6143 | |=========================== |
| 6144 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6145 | [[comment-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6146 | === CommentInfo |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 6147 | The `CommentInfo` entity contains information about an inline comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6148 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6149 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6150 | |=========================== |
| 6151 | |Field Name ||Description |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 6152 | |`patch_set` |optional| |
| 6153 | The patch set number for the comment; only set in contexts where + |
| 6154 | comments may be returned for multiple patch sets. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6155 | |`id` ||The URL encoded UUID of the comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6156 | |`path` |optional| |
| 6157 | The path of the file for which the inline comment was done. + |
| 6158 | Not set if returned in a map where the key is the file path. |
| 6159 | |`side` |optional| |
| 6160 | The side on which the comment was added. + |
| 6161 | Allowed values are `REVISION` and `PARENT`. + |
| 6162 | If not set, the default is `REVISION`. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 6163 | |`parent` |optional| |
| 6164 | The 1-based parent number. Used only for merge commits when `side == PARENT`. |
| 6165 | When not set the comment is for the auto-merge tree. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6166 | |`line` |optional| |
| 6167 | The number of the line for which the comment was done. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6168 | If range is set, this equals the end line of the range. + |
| 6169 | If neither line nor range is set, it's a file comment. |
| 6170 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 6171 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6172 | entity. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6173 | |`in_reply_to` |optional| |
| 6174 | The URL encoded UUID of the comment to which this comment is a reply. |
| 6175 | |`message` |optional|The comment message. |
| 6176 | |`updated` || |
| 6177 | The link:rest-api.html#timestamp[timestamp] of when this comment was |
| 6178 | written. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6179 | |`author` |optional| |
David Pursehouse | c633a57 | 2013-08-26 14:01:59 +0900 | [diff] [blame] | 6180 | The author of the message as an |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6181 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 6182 | Unset for draft comments, assumed to be the calling user. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6183 | |`tag` |optional| |
| 6184 | Value of the `tag` field from link:#review-input[ReviewInput] set |
| 6185 | while posting the review. |
Sven Selberg | 1a6728d | 2018-09-28 12:30:12 +0200 | [diff] [blame] | 6186 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6187 | invocations of the REST call are required. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 6188 | |`unresolved` |optional| |
| 6189 | Whether or not the comment must be addressed by the user. The state of |
| 6190 | resolution of a comment thread is stored in the last comment in that thread |
| 6191 | chronologically. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6192 | |=========================== |
| 6193 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6194 | [[comment-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6195 | === CommentInput |
Orgad Shaneh | c99da3a | 2014-06-13 14:57:54 +0300 | [diff] [blame] | 6196 | The `CommentInput` entity contains information for creating an inline |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6197 | comment. |
| 6198 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6199 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6200 | |=========================== |
| 6201 | |Field Name ||Description |
| 6202 | |`id` |optional| |
Edwin Kempin | c09826d7 | 2013-02-26 16:10:39 +0100 | [diff] [blame] | 6203 | The URL encoded UUID of the comment if an existing draft comment should |
| 6204 | be updated. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 6205 | |`path` |optional| |
| 6206 | The path of the file for which the inline comment should be added. + |
| 6207 | Doesn't need to be set if contained in a map where the key is the file |
| 6208 | path. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6209 | |`side` |optional| |
| 6210 | The side on which the comment should be added. + |
| 6211 | Allowed values are `REVISION` and `PARENT`. + |
| 6212 | If not set, the default is `REVISION`. |
| 6213 | |`line` |optional| |
| 6214 | The number of the line for which the comment should be added. + |
| 6215 | `0` if it is a file comment. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6216 | If neither line nor range is set, a file comment is added. + |
David Pursehouse | 4a159a1 | 2014-08-26 15:45:14 +0900 | [diff] [blame] | 6217 | 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] | 6218 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 6219 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6220 | entity. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6221 | |`in_reply_to` |optional| |
| 6222 | 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] | 6223 | |`updated` |optional| |
| 6224 | The link:rest-api.html#timestamp[timestamp] of this comment. + |
| 6225 | Accepted but ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6226 | |`message` |optional| |
| 6227 | The comment message. + |
| 6228 | If not set and an existing draft comment is updated, the existing draft |
| 6229 | comment is deleted. |
Dave Borowitz | 3dd203b | 2016-04-19 13:52:41 -0400 | [diff] [blame] | 6230 | |`tag` |optional, drafts only| |
| 6231 | Value of the `tag` field. Only allowed on link:#create-draft[draft comment] + |
| 6232 | inputs; for published comments, use the `tag` field in + |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 6233 | link#review-input[ReviewInput]. Votes/comments that contain `tag` with |
| 6234 | 'autogenerated:' prefix can be filtered out in the web UI. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 6235 | |`unresolved` |optional| |
| 6236 | Whether or not the comment must be addressed by the user. This value will |
| 6237 | default to false if the comment is an orphan, or the value of the `in_reply_to` |
| 6238 | comment if it is supplied. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6239 | |=========================== |
| 6240 | |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6241 | [[comment-range]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6242 | === CommentRange |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6243 | The `CommentRange` entity describes the range of an inline comment. |
| 6244 | |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 6245 | The comment range is a range from the start position, specified by `start_line` |
| 6246 | and `start_character`, to the end position, specified by `end_line` and |
| 6247 | `end_character`. The start position is *inclusive* and the end position is |
| 6248 | *exclusive*. |
| 6249 | |
| 6250 | So, a range over part of a line will have `start_line` equal to |
| 6251 | `end_line`; however a range with `end_line` set to 5 and `end_character` equal |
| 6252 | to 0 will not include any characters on line 5, |
| 6253 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6254 | [options="header",cols="1,^1,5"] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6255 | |=========================== |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 6256 | |Field Name ||Description |
| 6257 | |`start_line` ||The start line number of the range. (1-based) |
| 6258 | |`start_character` ||The character position in the start line. (0-based) |
| 6259 | |`end_line` ||The end line number of the range. (1-based) |
| 6260 | |`end_character` ||The character position in the end line. (0-based) |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6261 | |=========================== |
| 6262 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6263 | [[commit-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6264 | === CommitInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6265 | The `CommitInfo` entity contains information about a commit. |
| 6266 | |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6267 | [options="header",cols="1,^1,5"] |
| 6268 | |=========================== |
| 6269 | |Field Name ||Description |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 6270 | |`commit` |Optional| |
| 6271 | The commit ID. Not set if included in a link:#revision-info[ |
| 6272 | RevisionInfo] entity that is contained in a map which has the commit ID |
| 6273 | as key. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6274 | |`parents` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6275 | The parent commits of this commit as a list of |
Edwin Kempin | cecf90a | 2014-04-09 14:58:35 +0200 | [diff] [blame] | 6276 | link:#commit-info[CommitInfo] entities. In each parent |
| 6277 | only the `commit` and `subject` fields are populated. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6278 | |`author` ||The author of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6279 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6280 | |`committer` ||The committer of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6281 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6282 | |`subject` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6283 | The subject of the commit (header line of the commit message). |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6284 | |`message` ||The commit message. |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 6285 | |`web_links` |optional| |
| 6286 | Links to the commit in external sites as a list of |
| 6287 | link:#web-link-info[WebLinkInfo] entities. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6288 | |=========================== |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6289 | |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 6290 | [[commit-message-input]] |
| 6291 | === CommitMessageInput |
| 6292 | The `CommitMessageInput` entity contains information for changing |
| 6293 | the commit message of a change. |
| 6294 | |
| 6295 | [options="header",cols="1,^1,5"] |
| 6296 | |============================= |
| 6297 | |Field Name ||Description |
| 6298 | |`message` ||New commit message. |
| 6299 | |`notify` |optional| |
| 6300 | Notify handling that defines to whom email notifications should be sent |
| 6301 | after the commit message was updated. + |
| 6302 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 6303 | 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] | 6304 | |`notify_details`|optional| |
| 6305 | Additional information about whom to notify about the update as a map |
| 6306 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 6307 | |============================= |
| 6308 | |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 6309 | [[delete-change-message-input]] |
| 6310 | === DeleteChangeMessageInput |
| 6311 | The `DeleteChangeMessageInput` entity contains the options for deleting a change message. |
| 6312 | |
| 6313 | [options="header",cols="1,^1,5"] |
| 6314 | |============================= |
| 6315 | |Field Name ||Description |
| 6316 | |`reason` |optional| |
| 6317 | The reason why the change message should be deleted. + |
| 6318 | If set, the change message will be replaced with |
| 6319 | "Change message removed by: `name`\nReason: `reason`", |
| 6320 | or just "Change message removed by: `name`." if not set. |
| 6321 | |============================= |
| 6322 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 6323 | [[delete-comment-input]] |
| 6324 | === DeleteCommentInput |
| 6325 | The `DeleteCommentInput` entity contains the option for deleting a comment. |
| 6326 | |
| 6327 | [options="header",cols="1,^1,5"] |
| 6328 | |============================= |
| 6329 | |Field Name ||Description |
| 6330 | |`reason` |optional| |
| 6331 | The reason why the comment should be deleted. + |
| 6332 | If set, the comment's message will be replaced with |
| 6333 | "Comment removed by: `name`; Reason: `reason`", |
| 6334 | or just "Comment removed by: `name`." if not set. |
| 6335 | |============================= |
| 6336 | |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 6337 | [[delete-reviewer-input]] |
| 6338 | === DeleteReviewerInput |
| 6339 | The `DeleteReviewerInput` entity contains options for the deletion of a |
| 6340 | reviewer. |
| 6341 | |
| 6342 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6343 | |============================= |
| 6344 | |Field Name ||Description |
| 6345 | |`notify` |optional| |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 6346 | Notify handling that defines to whom email notifications should be sent |
| 6347 | after the reviewer is deleted. + |
| 6348 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6349 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6350 | |`notify_details`|optional| |
| 6351 | Additional information about whom to notify about the update as a map |
| 6352 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 6353 | |============================= |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 6354 | |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 6355 | [[delete-vote-input]] |
| 6356 | === DeleteVoteInput |
| 6357 | The `DeleteVoteInput` entity contains options for the deletion of a |
| 6358 | vote. |
| 6359 | |
| 6360 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6361 | |============================= |
| 6362 | |Field Name ||Description |
| 6363 | |`label` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 6364 | The label for which the vote should be deleted. + |
| 6365 | If set, must match the label in the URL. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6366 | |`notify` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 6367 | Notify handling that defines to whom email notifications should be sent |
| 6368 | after the vote is deleted. + |
| 6369 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6370 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6371 | |`notify_details`|optional| |
| 6372 | Additional information about whom to notify about the update as a map |
| 6373 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 6374 | |============================= |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 6375 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 6376 | [[description-input]] |
| 6377 | === DescriptionInput |
| 6378 | The `DescriptionInput` entity contains information for setting a description. |
| 6379 | |
| 6380 | [options="header",cols="1,6"] |
| 6381 | |=========================== |
| 6382 | |Field Name |Description |
| 6383 | |`description` |The description text. |
| 6384 | |=========================== |
| 6385 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6386 | [[diff-content]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6387 | === DiffContent |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6388 | The `DiffContent` entity contains information about the content differences |
| 6389 | in a file. |
| 6390 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6391 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6392 | |========================== |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 6393 | |Field Name ||Description |
| 6394 | |`a` |optional|Content only in the file on side A (deleted in B). |
| 6395 | |`b` |optional|Content only in the file on side B (added in B). |
| 6396 | |`ab` |optional|Content in the file on both sides (unchanged). |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 6397 | |`edit_a` |only present when the `intraline` parameter is set and the |
| 6398 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6399 | Text sections deleted from side A as a |
| 6400 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 6401 | |`edit_b` |only present when the `intraline` parameter is set and the |
| 6402 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6403 | Text sections inserted in side B as a |
| 6404 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 6405 | |`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a |
| 6406 | rebase. |
| 6407 | |`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] | 6408 | too large to include all common lines. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 6409 | |`common` |optional|Set to `true` if the region is common according |
Shawn Pearce | 425a2be | 2014-01-02 16:00:58 -0800 | [diff] [blame] | 6410 | to the requested ignore-whitespace parameter, but a and b contain |
| 6411 | differing amounts of whitespace. When present and true a and b are |
| 6412 | used instead of ab. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6413 | |========================== |
| 6414 | |
| 6415 | [[diff-file-meta-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6416 | === DiffFileMetaInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6417 | The `DiffFileMetaInfo` entity contains meta information about a file diff. |
| 6418 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6419 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6420 | |========================== |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 6421 | |Field Name ||Description |
| 6422 | |`name` ||The name of the file. |
| 6423 | |`content_type`||The content type of the file. |
| 6424 | |`lines` ||The total number of lines in the file. |
Edwin Kempin | 26c95a4 | 2014-11-25 16:29:47 +0100 | [diff] [blame] | 6425 | |`web_links` |optional| |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 6426 | Links to the file in external sites as a list of |
Shawn Pearce | b62414c | 2014-10-16 22:48:33 -0700 | [diff] [blame] | 6427 | link:rest-api-changes.html#web-link-info[WebLinkInfo] entries. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6428 | |========================== |
| 6429 | |
| 6430 | [[diff-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6431 | === DiffInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6432 | The `DiffInfo` entity contains information about the diff of a file |
| 6433 | in a revision. |
| 6434 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 6435 | If the link:#weblinks-only[weblinks-only] parameter is specified, only |
| 6436 | the `web_links` field is set. |
| 6437 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6438 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6439 | |========================== |
| 6440 | |Field Name ||Description |
| 6441 | |`meta_a` |not present when the file is added| |
| 6442 | Meta information about the file on side A as a |
| 6443 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 6444 | |`meta_b` |not present when the file is deleted| |
| 6445 | Meta information about the file on side B as a |
| 6446 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 6447 | |`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED` |
| 6448 | `COPIED`, `REWRITE`). |
| 6449 | |`intraline_status`|only set when the `intraline` parameter was specified in the request| |
| 6450 | Intraline status (`OK`, `ERROR`, `TIMEOUT`). |
| 6451 | |`diff_header` ||A list of strings representing the patch set diff header. |
| 6452 | |`content` ||The content differences in the file as a list of |
| 6453 | link:#diff-content[DiffContent] entities. |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 6454 | |`web_links` |optional| |
| 6455 | Links to the file diff in external sites as a list of |
| 6456 | link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries. |
David Ostrovsky | cdbef23 | 2015-02-13 01:16:37 +0100 | [diff] [blame] | 6457 | |`binary` |not set if `false`|Whether the file is binary. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6458 | |========================== |
| 6459 | |
| 6460 | [[diff-intraline-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6461 | === DiffIntralineInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6462 | The `DiffIntralineInfo` entity contains information about intraline edits in a |
| 6463 | file. |
| 6464 | |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 6465 | 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] | 6466 | 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] | 6467 | 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] | 6468 | 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] | 6469 | diff content lines. If the list is empty, the entire DiffContent should be considered |
| 6470 | as unedited. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6471 | |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 6472 | 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] | 6473 | 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] | 6474 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 6475 | [[diff-web-link-info]] |
| 6476 | === DiffWebLinkInfo |
| 6477 | The `DiffWebLinkInfo` entity describes a link on a diff screen to an |
| 6478 | external site. |
| 6479 | |
| 6480 | [options="header",cols="1,6"] |
| 6481 | |======================= |
| 6482 | |Field Name|Description |
| 6483 | |`name` |The link name. |
| 6484 | |`url` |The link URL. |
| 6485 | |`image_url`|URL to the icon of the link. |
| 6486 | |show_on_side_by_side_diff_view| |
| 6487 | Whether the web link should be shown on the side-by-side diff screen. |
| 6488 | |show_on_unified_diff_view| |
| 6489 | Whether the web link should be shown on the unified diff screen. |
| 6490 | |======================= |
| 6491 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 6492 | [[edit-file-info]] |
| 6493 | === EditFileInfo |
| 6494 | The `EditFileInfo` entity contains additional information |
| 6495 | of a file within a change edit. |
| 6496 | |
| 6497 | [options="header",cols="1,^1,5"] |
| 6498 | |=========================== |
| 6499 | |Field Name ||Description |
| 6500 | |`web_links` |optional| |
| 6501 | Links to the diff info in external sites as a list of |
| 6502 | link:#web-link-info[WebLinkInfo] entities. |
| 6503 | |=========================== |
| 6504 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6505 | [[edit-info]] |
| 6506 | === EditInfo |
| 6507 | The `EditInfo` entity contains information about a change edit. |
| 6508 | |
| 6509 | [options="header",cols="1,^1,5"] |
| 6510 | |=========================== |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 6511 | |Field Name ||Description |
| 6512 | |`commit` ||The commit of change edit as |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6513 | link:#commit-info[CommitInfo] entity. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 6514 | |`base_patch_set_number`||The patch set number of the patch set the change edit is based on. |
| 6515 | |`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] | 6516 | |`ref` ||The ref of the change edit. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 6517 | |`fetch` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6518 | Information about how to fetch this patch set. The fetch information is |
| 6519 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 6520 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 6521 | |`files` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6522 | The files of the change edit as a map that maps the file names to |
| 6523 | link:#file-info[FileInfo] entities. |
| 6524 | |=========================== |
| 6525 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6526 | [[fetch-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6527 | === FetchInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6528 | The `FetchInfo` entity contains information about how to fetch a patch |
| 6529 | set via a certain protocol. |
| 6530 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6531 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6532 | |========================== |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 6533 | |Field Name ||Description |
| 6534 | |`url` ||The URL of the project. |
| 6535 | |`ref` ||The ref of the patch set. |
| 6536 | |`commands` |optional| |
| 6537 | The download commands for this patch set as a map that maps the command |
| 6538 | names to the commands. + |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 6539 | Only set if link:#download-commands[download commands] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6540 | |========================== |
| 6541 | |
| 6542 | [[file-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6543 | === FileInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6544 | The `FileInfo` entity contains information about a file in a patch set. |
| 6545 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6546 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6547 | |============================= |
| 6548 | |Field Name ||Description |
| 6549 | |`status` |optional| |
| 6550 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 6551 | "`C`"=Copied, "`W`"=Rewritten). + |
| 6552 | Not set if the file was Modified ("`M`"). |
| 6553 | |`binary` |not set if `false`|Whether the file is binary. |
| 6554 | |`old_path` |optional| |
| 6555 | The old file path. + |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 6556 | Only set if the file was renamed or copied. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6557 | |`lines_inserted`|optional| |
| 6558 | Number of inserted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 6559 | Not set for binary files or if no lines were inserted. + |
| 6560 | An empty last line is not included in the count and hence this number can |
| 6561 | differ by one from details provided in <<#diff-info,DiffInfo>>. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6562 | |`lines_deleted` |optional| |
| 6563 | Number of deleted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 6564 | Not set for binary files or if no lines were deleted. + |
| 6565 | An empty last line is not included in the count and hence this number can |
| 6566 | differ by one from details provided in <<#diff-info,DiffInfo>>. |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 6567 | |`size_delta` || |
| 6568 | Number of bytes by which the file size increased/decreased. |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 6569 | |`size` || |
| 6570 | File size in bytes. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6571 | |============================= |
| 6572 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 6573 | [[fix-input]] |
| 6574 | === FixInput |
| 6575 | The `FixInput` entity contains options for fixing commits using the |
| 6576 | link:#fix-change[fix change] endpoint. |
| 6577 | |
| 6578 | [options="header",cols="1,6"] |
| 6579 | |========================== |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 6580 | |Field Name |Description |
| 6581 | |`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] | 6582 | database if they refer to missing commit options. |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 6583 | |`expect_merged_as` |If set, check that the change is |
Dave Borowitz | a828fed | 2015-05-05 14:43:40 -0700 | [diff] [blame] | 6584 | merged into the destination branch as this exact SHA-1. If not, insert |
| 6585 | a new patch set referring to this commit. |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 6586 | |========================== |
| 6587 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6588 | [[fix-suggestion-info]] |
| 6589 | === FixSuggestionInfo |
| 6590 | The `FixSuggestionInfo` entity represents a suggested fix. |
| 6591 | |
| 6592 | [options="header",cols="1,^1,5"] |
| 6593 | |========================== |
| 6594 | |Field Name ||Description |
| 6595 | |`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested |
| 6596 | fix. It will be generated automatically and hence will be ignored if it's set |
| 6597 | for input objects. |
| 6598 | |`description` ||A description of the suggested fix. |
| 6599 | |`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>> |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 6600 | entities indicating how the content of one or several files should be modified. |
| 6601 | Within a file, they should refer to non-overlapping regions. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6602 | |========================== |
| 6603 | |
| 6604 | [[fix-replacement-info]] |
| 6605 | === FixReplacementInfo |
Alice Kober-Sotzek | 110f60f | 2016-12-19 14:53:40 +0100 | [diff] [blame] | 6606 | The `FixReplacementInfo` entity describes how the content of a file should be |
| 6607 | replaced by another content. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6608 | |
| 6609 | [options="header",cols="1,6"] |
| 6610 | |========================== |
| 6611 | |Field Name |Description |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 6612 | |`path` |The path of the file which should be modified. Any file in |
| 6613 | the repository may be modified. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6614 | |`range` |A <<comment-range,CommentRange>> indicating which content |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 6615 | of the file should be replaced. Lines in the file are assumed to be separated |
| 6616 | by the line feed character, the carriage return character, the carriage return |
| 6617 | followed by the line feed character, or one of the other Unicode linebreak |
| 6618 | sequences supported by Java. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6619 | |`replacement` |The content which should be used instead of the current one. |
| 6620 | |========================== |
| 6621 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6622 | [[git-person-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6623 | === GitPersonInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6624 | The `GitPersonInfo` entity contains information about the |
| 6625 | author/committer of a commit. |
| 6626 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6627 | [options="header",cols="1,6"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6628 | |========================== |
| 6629 | |Field Name |Description |
| 6630 | |`name` |The name of the author/committer. |
| 6631 | |`email` |The email address of the author/committer. |
| 6632 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 6633 | this identity was constructed. |
| 6634 | |`tz` |The timezone offset from UTC of when this identity was |
| 6635 | constructed. |
| 6636 | |========================== |
| 6637 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6638 | [[group-base-info]] |
| 6639 | === GroupBaseInfo |
| 6640 | The `GroupBaseInfo` entity contains base information about the group. |
| 6641 | |
| 6642 | [options="header",cols="1,6"] |
| 6643 | |========================== |
| 6644 | |Field Name |Description |
Edwin Kempin | 703613c | 2016-11-25 16:06:04 +0100 | [diff] [blame] | 6645 | |`id` |The UUID of the group. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6646 | |`name` |The name of the group. |
| 6647 | |========================== |
| 6648 | |
David Pursehouse | d9dac37 | 2016-11-24 19:41:10 +0900 | [diff] [blame] | 6649 | [[hashtags-input]] |
| 6650 | === HashtagsInput |
| 6651 | |
| 6652 | The `HashtagsInput` entity contains information about hashtags to add to, |
| 6653 | and/or remove from, a change. |
| 6654 | |
| 6655 | [options="header",cols="1,^1,5"] |
| 6656 | |======================= |
| 6657 | |Field Name||Description |
| 6658 | |`add` |optional|The list of hashtags to be added to the change. |
| 6659 | |`remove |optional|The list of hashtags to be removed from the change. |
| 6660 | |======================= |
| 6661 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6662 | [[included-in-info]] |
| 6663 | === IncludedInInfo |
| 6664 | The `IncludedInInfo` entity contains information about the branches a |
| 6665 | change was merged into and tags it was tagged with. |
| 6666 | |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 6667 | [options="header",cols="1,^1,5"] |
| 6668 | |======================= |
| 6669 | |Field Name||Description |
| 6670 | |`branches`||The list of branches this change was merged into. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6671 | Each branch is listed without the 'refs/head/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 6672 | |`tags` ||The list of tags this change was tagged with. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6673 | Each tag is listed without the 'refs/tags/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 6674 | |`external`|optional|A map that maps a name to a list of external |
| 6675 | systems that include this change, e.g. a list of servers on which this |
| 6676 | change is deployed. |
| 6677 | |======================= |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6678 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6679 | [[label-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6680 | === LabelInfo |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6681 | The `LabelInfo` entity contains information about a label on a change, always |
| 6682 | corresponding to the current patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6683 | |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6684 | There are two options that control the contents of `LabelInfo`: |
Dave Borowitz | 7d6aa01 | 2013-06-14 16:53:48 -0700 | [diff] [blame] | 6685 | link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`]. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6686 | |
| 6687 | * For a quick summary of the state of labels, use `LABELS`. |
| 6688 | * For detailed information about labels, including exact numeric votes for all |
| 6689 | users and the allowed range of votes for the current user, use `DETAILED_LABELS`. |
| 6690 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6691 | ==== Common fields |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6692 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6693 | |=========================== |
| 6694 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6695 | |`optional` |not set if `false`| |
| 6696 | Whether the label is optional. Optional means the label may be set, but |
| 6697 | it's neither necessary for submission nor does it block submission if |
| 6698 | set. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6699 | |=========================== |
| 6700 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6701 | ==== Fields set by `LABELS` |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6702 | [options="header",cols="1,^1,5"] |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6703 | |=========================== |
| 6704 | |Field Name ||Description |
| 6705 | |`approved` |optional|One user who approved this label on the change |
| 6706 | (voted the maximum value) as an |
| 6707 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6708 | |`rejected` |optional|One user who rejected this label on the change |
| 6709 | (voted the minimum value) as an |
| 6710 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6711 | |`recommended` |optional|One user who recommended this label on the |
| 6712 | change (voted positively, but not the maximum value) as an |
| 6713 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6714 | |`disliked` |optional|One user who disliked this label on the change |
| 6715 | (voted negatively, but not the minimum value) as an |
| 6716 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
David Ostrovsky | 5292fd7 | 2014-02-27 21:56:35 +0100 | [diff] [blame] | 6717 | |`blocking` |optional|If `true`, the label blocks submit operation. |
| 6718 | If not set, the default is false. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6719 | |`value` |optional|The voting value of the user who |
| 6720 | recommended/disliked this label on the change if it is not |
| 6721 | "`+1`"/"`-1`". |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 6722 | |`default_value`|optional|The default voting value for the label. |
| 6723 | This value may be outside the range specified in permitted_labels. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6724 | |=========================== |
| 6725 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6726 | ==== Fields set by `DETAILED_LABELS` |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6727 | [options="header",cols="1,^1,5"] |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6728 | |=========================== |
| 6729 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6730 | |`all` |optional|List of all approvals for this label as a list |
Aaron Gable | ea8a211 | 2017-04-25 14:18:16 -0700 | [diff] [blame] | 6731 | of link:#approval-info[ApprovalInfo] entities. Items in this list may |
| 6732 | not represent actual votes cast by users; if a user votes on any label, |
| 6733 | a corresponding ApprovalInfo will appear in this list for all labels. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6734 | |`values` |optional|A map of all values that are allowed for this |
| 6735 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6736 | to the value descriptions. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6737 | |=========================== |
| 6738 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6739 | [[mergeable-info]] |
| 6740 | === MergeableInfo |
| 6741 | The `MergeableInfo` entity contains information about the mergeability of a |
| 6742 | change. |
| 6743 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6744 | [options="header",cols="1,^1,5"] |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6745 | |============================ |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 6746 | |Field Name ||Description |
| 6747 | |`submit_type` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6748 | Submit type used for this change, can be `MERGE_IF_NECESSARY`, |
Gert van Dijk | a4e49d0 | 2017-08-27 22:50:40 +0200 | [diff] [blame] | 6749 | `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6750 | `CHERRY_PICK`. |
Zhen Chen | ec13e45 | 2016-08-03 23:29:43 -0700 | [diff] [blame] | 6751 | |`strategy` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 6752 | The strategy of the merge, can be `recursive`, `resolve`, |
| 6753 | `simple-two-way-in-core`, `ours` or `theirs`. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 6754 | |`mergeable` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 6755 | `true` if this change is cleanly mergeable, `false` otherwise |
Zhen Chen | 8f00d55 | 2016-07-26 16:54:59 -0700 | [diff] [blame] | 6756 | |`commit_merged` |optional| |
| 6757 | `true` if this change is already merged, `false` otherwise |
| 6758 | |`content_merged` |optional| |
| 6759 | `true` if the content of this change is already merged, `false` otherwise |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 6760 | |`conflicts`|optional| |
| 6761 | A list of paths with conflicts |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 6762 | |`mergeable_into`|optional| |
| 6763 | 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] | 6764 | |============================ |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 6765 | |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 6766 | [[merge-input]] |
| 6767 | === MergeInput |
| 6768 | The `MergeInput` entity contains information about the merge |
| 6769 | |
| 6770 | [options="header",cols="1,^1,5"] |
| 6771 | |============================ |
| 6772 | |Field Name ||Description |
| 6773 | |`source` || |
| 6774 | 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] | 6775 | a complete reference name, a short reference name under `refs/heads`, `refs/tags`, |
| 6776 | or `refs/remotes` namespace, etc. |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 6777 | |`strategy` |optional| |
| 6778 | The strategy of the merge, can be `recursive`, `resolve`, |
| 6779 | `simple-two-way-in-core`, `ours` or `theirs`, default will use project settings. |
| 6780 | |============================ |
| 6781 | |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 6782 | [[merge-patch-set-input]] |
| 6783 | === MergePatchSetInput |
| 6784 | The `MergePatchSetInput` entity contains information about updating a new |
| 6785 | change by creating a new merge commit. |
| 6786 | |
| 6787 | [options="header",cols="1,^1,5"] |
| 6788 | |================================== |
| 6789 | |Field Name ||Description |
| 6790 | |`subject` |optional| |
| 6791 | The new subject for the change, if not specified, will reuse the current patch |
| 6792 | set's subject |
| 6793 | |`inheritParent` |optional, default to `false`| |
| 6794 | 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] | 6795 | |`base_change` |optional| |
| 6796 | A link:#change-id[\{change-id\}] that identifies a change. When `inheritParent` |
| 6797 | is `false`, the merge tip will be the current patch set of the `base_change` if |
| 6798 | 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] | 6799 | |`merge` || |
| 6800 | The detail of the source commit for merge as a link:#merge-input[MergeInput] |
| 6801 | entity. |
| 6802 | |================================== |
| 6803 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 6804 | [[move-input]] |
| 6805 | === MoveInput |
| 6806 | The `MoveInput` entity contains information for moving a change to a new branch. |
| 6807 | |
| 6808 | [options="header",cols="1,^1,5"] |
| 6809 | |=========================== |
Michael Zhou | d03fe28 | 2016-04-25 17:13:17 -0400 | [diff] [blame] | 6810 | |Field Name ||Description |
| 6811 | |`destination_branch`||Destination branch |
| 6812 | |`message` |optional| |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 6813 | A message to be posted in this change's comments |
| 6814 | |=========================== |
| 6815 | |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6816 | [[notify-info]] |
| 6817 | === NotifyInfo |
| 6818 | The `NotifyInfo` entity contains detailed information about who should |
| 6819 | be notified about an update. These notifications are sent out even if a |
| 6820 | `notify` option in the request input disables normal notifications. |
| 6821 | `NotifyInfo` entities are normally contained in a `notify_details` map |
| 6822 | in the request input where the key is the recipient type. The recipient |
| 6823 | type can be `TO`, `CC` and `BCC`. |
| 6824 | |
| 6825 | [options="header",cols="1,^1,5"] |
| 6826 | |======================= |
| 6827 | |Field Name||Description |
| 6828 | |`accounts`|optional| |
| 6829 | A list of link:rest-api-accounts.html#account-id[account IDs] that |
| 6830 | identify the accounts that should be should be notified. |
| 6831 | |======================= |
| 6832 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 6833 | [[private-input]] |
| 6834 | === PrivateInput |
| 6835 | The `PrivateInput` entity contains information for changing the private |
| 6836 | flag on a change. |
| 6837 | |
| 6838 | [options="header",cols="1,^1,5"] |
| 6839 | |======================= |
| 6840 | |Field Name||Description |
| 6841 | |`message` |optional|Message describing why the private flag was changed. |
| 6842 | |======================= |
| 6843 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6844 | [[problem-info]] |
| 6845 | === ProblemInfo |
| 6846 | The `ProblemInfo` entity contains a description of a potential consistency problem |
| 6847 | with a change. These are not related to the code review process, but rather |
| 6848 | indicate some inconsistency in Gerrit's database or repository metadata related |
| 6849 | to the enclosing change. |
| 6850 | |
| 6851 | [options="header",cols="1,^1,5"] |
| 6852 | |=========================== |
| 6853 | |Field Name||Description |
| 6854 | |`message` ||Plaintext message describing the problem with the change. |
| 6855 | |`status` |optional| |
| 6856 | The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a |
| 6857 | fix was attempted. |
| 6858 | |`outcome` |optional| |
| 6859 | If `status` is set, an additional plaintext message describing the |
| 6860 | outcome of the fix. |
| 6861 | |=========================== |
| 6862 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 6863 | [[publish-change-edit-input]] |
| 6864 | === PublishChangeEditInput |
| 6865 | The `PublishChangeEditInput` entity contains options for the publishing of |
| 6866 | change edit. |
| 6867 | |
| 6868 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6869 | |============================= |
| 6870 | |Field Name ||Description |
| 6871 | |`notify` |optional| |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 6872 | Notify handling that defines to whom email notifications should be sent |
| 6873 | after the change edit is published. + |
| 6874 | Allowed values are `NONE` and `ALL`. + |
| 6875 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6876 | |`notify_details`|optional| |
| 6877 | Additional information about whom to notify about the update as a map |
| 6878 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 6879 | |============================= |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 6880 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 6881 | [[pure-revert-info]] |
| 6882 | === PureRevertInfo |
| 6883 | The `PureRevertInfo` entity describes the result of a pure revert check. |
| 6884 | |
| 6885 | [options="header",cols="1,6"] |
| 6886 | |====================== |
| 6887 | |Field Name |Description |
| 6888 | |`is_pure_revert` |Outcome of the check as boolean. |
| 6889 | |====================== |
| 6890 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 6891 | [[push-certificate-info]] |
| 6892 | === PushCertificateInfo |
| 6893 | The `PushCertificateInfo` entity contains information about a push |
| 6894 | certificate provided when the user pushed for review with `git push |
| 6895 | --signed HEAD:refs/for/<branch>`. Only used when signed push is |
| 6896 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the server. |
| 6897 | |
| 6898 | [options="header",cols="1,6"] |
| 6899 | |=========================== |
| 6900 | |Field Name|Description |
| 6901 | |`certificate`|Signed certificate payload and GPG signature block. |
| 6902 | |`key` | |
| 6903 | Information about the key that signed the push, along with any problems |
| 6904 | found while checking the signature or the key itself, as a |
| 6905 | link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity. |
| 6906 | |=========================== |
| 6907 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 6908 | [[range-info]] |
| 6909 | === RangeInfo |
| 6910 | The `RangeInfo` entity stores the coordinates of a range. |
| 6911 | |
| 6912 | [options="header",cols="1,6"] |
| 6913 | |=========================== |
| 6914 | |Field Name | Description |
| 6915 | |`start` | First index. |
| 6916 | |`end` | Last index. |
| 6917 | |=========================== |
| 6918 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 6919 | [[rebase-input]] |
| 6920 | === RebaseInput |
| 6921 | The `RebaseInput` entity contains information for changing parent when rebasing. |
| 6922 | |
| 6923 | [options="header",width="50%",cols="1,^1,5"] |
| 6924 | |=========================== |
| 6925 | |Field Name ||Description |
| 6926 | |`base` |optional| |
| 6927 | The new parent revision. This can be a ref or a SHA1 to a concrete patchset. + |
| 6928 | Alternatively, a change number can be specified, in which case the current |
| 6929 | patch set is inferred. + |
| 6930 | Empty string is used for rebasing directly on top of the target branch, |
| 6931 | which effectively breaks dependency towards a parent change. |
| 6932 | |=========================== |
| 6933 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6934 | [[related-change-and-commit-info]] |
| 6935 | === RelatedChangeAndCommitInfo |
| 6936 | |
| 6937 | The `RelatedChangeAndCommitInfo` entity contains information about |
| 6938 | a related change and commit. |
| 6939 | |
| 6940 | [options="header",cols="1,^1,5"] |
| 6941 | |=========================== |
| 6942 | |Field Name ||Description |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 6943 | |`project` ||The project of the change or commit. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6944 | |`change_id` |optional|The Change-Id of the change. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6945 | |`commit` ||The commit as a |
| 6946 | link:#commit-info[CommitInfo] entity. |
| 6947 | |`_change_number` |optional|The change number. |
| 6948 | |`_revision_number` |optional|The revision number. |
| 6949 | |`_current_revision_number`|optional|The current revision number. |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 6950 | |`status` |optional|The status of the change. The status of |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 6951 | the change is one of (`NEW`, `MERGED`, `ABANDONED`). |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6952 | |=========================== |
| 6953 | |
| 6954 | [[related-changes-info]] |
| 6955 | === RelatedChangesInfo |
| 6956 | The `RelatedChangesInfo` entity contains information about related |
| 6957 | changes. |
| 6958 | |
| 6959 | [options="header",cols="1,6"] |
| 6960 | |=========================== |
| 6961 | |Field Name |Description |
| 6962 | |`changes` |A list of |
| 6963 | link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities |
| 6964 | describing the related changes. Sorted by git commit order, newest to |
| 6965 | oldest. Empty if there are no related changes. |
| 6966 | |=========================== |
| 6967 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 6968 | |
| 6969 | [[requirement]] |
| 6970 | === Requirement |
| 6971 | The `Requirement` entity contains information about a requirement relative to a change. |
| 6972 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 6973 | [options="header",cols="1,^1,5"] |
| 6974 | |=========================== |
| 6975 | |Field Name | |Description |
| 6976 | |`status` | | Status of the requirement. Can be either `OK`, `NOT_READY` or `RULE_ERROR`. |
| 6977 | |`fallbackText` | | A human readable reason |
| 6978 | |`type` | | |
| 6979 | Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it |
| 6980 | was triggered. Can be seen as a class: requirements sharing the same type were created for a similar |
| 6981 | reason, and the data structure will follow one set of rules. |
| 6982 | |`data` |optional| |
| 6983 | Holds custom key-value strings, used in templates to render richer status messages |
| 6984 | |=========================== |
| 6985 | |
| 6986 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6987 | [[restore-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6988 | === RestoreInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6989 | The `RestoreInput` entity contains information for restoring a change. |
| 6990 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6991 | [options="header",cols="1,^1,5"] |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6992 | |=========================== |
| 6993 | |Field Name ||Description |
| 6994 | |`message` |optional| |
| 6995 | Message to be added as review comment to the change when restoring the |
| 6996 | change. |
| 6997 | |=========================== |
| 6998 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 6999 | [[revert-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7000 | === RevertInput |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 7001 | The `RevertInput` entity contains information for reverting a change. |
| 7002 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7003 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 7004 | |============================= |
| 7005 | |Field Name ||Description |
| 7006 | |`message` |optional| |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 7007 | Message to be added as review comment to the change when reverting the |
| 7008 | change. |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 7009 | |`notify` |optional| |
| 7010 | Notify handling that defines to whom email notifications should be sent |
| 7011 | for reverting the change. + |
| 7012 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7013 | If not set, the default is `ALL`. |
| 7014 | |`notify_details`|optional| |
| 7015 | Additional information about whom to notify about the revert as a map |
| 7016 | of recipient type to link:#notify-info[NotifyInfo] entity. |
Gal Paikin | cc93c56 | 2019-10-09 13:24:12 +0200 | [diff] [blame] | 7017 | |`topic` |optional| |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 7018 | Name of the topic for the revert change. If not set, the default for Revert |
| 7019 | endpoint is the topic of the change being reverted, and the default for the |
| 7020 | RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`. |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 7021 | |============================= |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 7022 | |
| 7023 | [[revert-submission-info]] |
| 7024 | === RevertSubmissionInfo |
| 7025 | The `RevertSubmissionInfo` describes the revert changes. |
| 7026 | |
| 7027 | [options="header",cols="1,6"] |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 7028 | |============================== |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 7029 | |Field Name | Description |
| 7030 | |`revert_changes` | |
Edwin Kempin | 6e7fb4e | 2019-10-24 17:20:51 +0200 | [diff] [blame] | 7031 | A list of link:#change-info[ChangeInfo] that describes the revert changes. Each |
| 7032 | entity in that list is a revert change that was created in that revert |
| 7033 | submission. |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 7034 | |============================== |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 7035 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7036 | [[review-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7037 | === ReviewInfo |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7038 | The `ReviewInfo` entity contains information about a review. |
| 7039 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7040 | [options="header",cols="1,6"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7041 | |=========================== |
| 7042 | |Field Name |Description |
| 7043 | |`labels` | |
| 7044 | The labels of the review as a map that maps the label names to the |
| 7045 | voting values. |
| 7046 | |=========================== |
| 7047 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 7048 | [[review-update-info]] |
| 7049 | === ReviewerUpdateInfo |
| 7050 | The `ReviewerUpdateInfo` entity contains information about updates to |
| 7051 | change's reviewers set. |
| 7052 | |
| 7053 | [options="header",cols="1,6"] |
| 7054 | |=========================== |
| 7055 | |Field Name |Description |
| 7056 | |`updated`| |
| 7057 | Timestamp of the update. |
| 7058 | |`updated_by`| |
| 7059 | The account which modified state of the reviewer in question as |
| 7060 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 7061 | |`reviewer`| |
| 7062 | The reviewer account added or removed from the change as an |
| 7063 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 7064 | |`state`| |
| 7065 | The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`. |
| 7066 | |=========================== |
| 7067 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7068 | [[review-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7069 | === ReviewInput |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7070 | The `ReviewInput` entity contains information for adding a review to a |
| 7071 | revision. |
| 7072 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7073 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7074 | |============================ |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 7075 | |Field Name ||Description |
| 7076 | |`message` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7077 | The message to be added as review comment. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7078 | |`tag` |optional| |
| 7079 | Apply this tag to the review comment message, votes, and inline |
| 7080 | comments. Tags may be used by CI or other automated systems to |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 7081 | distinguish them from human reviews. Votes/comments that contain `tag` with |
| 7082 | 'autogenerated:' prefix can be filtered out in the web UI. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 7083 | |`labels` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7084 | The votes that should be added to the revision as a map that maps the |
| 7085 | label names to the voting values. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 7086 | |`comments` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7087 | The comments that should be added as a map that maps a file path to a |
| 7088 | list of link:#comment-input[CommentInput] entities. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7089 | |`robot_comments` |optional| |
| 7090 | The robot comments that should be added as a map that maps a file path |
| 7091 | to a list of link:#robot-comment-input[RobotCommentInput] entities. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 7092 | |`drafts` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7093 | Draft handling that defines how draft comments are handled that are |
| 7094 | already in the database but that were not also described in this |
| 7095 | input. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 7096 | Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values |
| 7097 | except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. + |
Dave Borowitz | c064054 | 2016-10-05 16:19:21 -0400 | [diff] [blame] | 7098 | Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 7099 | If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value |
| 7100 | besides `KEEP` is allowed. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 7101 | |`notify` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7102 | Notify handling that defines to whom email notifications should be sent |
| 7103 | after the review is stored. + |
| 7104 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7105 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7106 | |`notify_details` |optional| |
| 7107 | Additional information about whom to notify about the update as a map |
| 7108 | of recipient type to link:#notify-info[NotifyInfo] entity. |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 7109 | |`omit_duplicate_comments`|optional| |
| 7110 | If `true`, comments with the same content at the same place will be omitted. |
| 7111 | |`on_behalf_of` |optional| |
Shawn Pearce | 9d78312 | 2013-06-11 18:18:03 -0700 | [diff] [blame] | 7112 | link:rest-api-accounts.html#account-id[\{account-id\}] the review |
| 7113 | should be posted on behalf of. To use this option the caller must |
| 7114 | have been granted `labelAs-NAME` permission for all keys of labels. |
Patrick Hiesel | cf6d935 | 2017-04-13 10:15:42 +0200 | [diff] [blame] | 7115 | |`reviewers` |optional| |
| 7116 | A list of link:rest-api-changes.html#reviewer-input[ReviewerInput] |
| 7117 | representing reviewers that should be added to the change. |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 7118 | |`ready` |optional| |
| 7119 | If true, and if the change is work in progress, then start review. |
| 7120 | It is an error for both `ready` and `work_in_progress` to be true. |
| 7121 | |`work_in_progress` |optional| |
| 7122 | If true, mark the change as work in progress. It is an error for both |
| 7123 | `ready` and `work_in_progress` to be true. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7124 | |============================ |
| 7125 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 7126 | [[review-result]] |
| 7127 | === ReviewResult |
| 7128 | The `ReviewResult` entity contains information regarding the updates |
| 7129 | that were made to a review. |
| 7130 | |
| 7131 | [options="header",cols="1,^1,5"] |
| 7132 | |============================ |
| 7133 | |Field Name ||Description |
| 7134 | |`labels` |optional| |
| 7135 | Map of labels to values after the review was posted. Null if any reviewer |
| 7136 | additions were rejected. |
| 7137 | |`reviewers` |optional| |
| 7138 | Map of account or group identifier to |
| 7139 | link:rest-api-changes.html#add-reviewer-result[AddReviewerResult] |
| 7140 | representing the outcome of adding as a reviewer. |
| 7141 | Absent if no reviewer additions were requested. |
Logan Hanks | e81ad8e | 2017-07-18 09:45:46 -0700 | [diff] [blame] | 7142 | |`ready` |optional| |
| 7143 | If true, the change was moved from WIP to ready for review as a result of this |
| 7144 | action. Not set if false. |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 7145 | |============================ |
| 7146 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7147 | [[reviewer-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7148 | === ReviewerInfo |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7149 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 7150 | votes on a change. |
| 7151 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 7152 | `ReviewerInfo` has the same fields as |
| 7153 | link:rest-api-accounts.html#account-info[AccountInfo] and includes |
| 7154 | link:#detailed-accounts[detailed account information]. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7155 | In addition `ReviewerInfo` has the following fields: |
| 7156 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7157 | [options="header",cols="1,6"] |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7158 | |========================== |
| 7159 | |Field Name |Description |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7160 | |`approvals` | |
| 7161 | 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] | 7162 | approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`"). |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 7163 | |`_account_id` | |
| 7164 | This field is inherited from `AccountInfo` but is optional here if an |
| 7165 | unregistered reviewer was added by email. See |
| 7166 | link:rest-api-changes.html#add-reviewer[add-reviewer] for details. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7167 | |========================== |
| 7168 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7169 | [[reviewer-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7170 | === ReviewerInput |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7171 | The `ReviewerInput` entity contains information for adding a reviewer |
| 7172 | to a change. |
| 7173 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7174 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7175 | |============================= |
| 7176 | |Field Name ||Description |
| 7177 | |`reviewer` || |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7178 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 7179 | should be added as reviewer or the link:rest-api-groups.html#group-id[ |
| 7180 | ID] of one group for which all members should be added as reviewers. + |
| 7181 | If an ID identifies both an account and a group, only the account is |
| 7182 | added as reviewer to the change. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7183 | |`state` |optional| |
Logan Hanks | ee0a418 | 2016-07-06 14:39:26 -0700 | [diff] [blame] | 7184 | Add reviewer in this state. Possible reviewer states are `REVIEWER` |
| 7185 | and `CC`. If not given, defaults to `REVIEWER`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7186 | |`confirmed` |optional| |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7187 | Whether adding the reviewer is confirmed. + |
| 7188 | The Gerrit server may be configured to |
| 7189 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 7190 | confirmation] when adding a group as reviewer that has many members. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7191 | |`notify` |optional| |
Sven Selberg | 4d64f97 | 2016-09-26 16:15:02 +0200 | [diff] [blame] | 7192 | Notify handling that defines to whom email notifications should be sent |
| 7193 | after the reviewer is added. + |
| 7194 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7195 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7196 | |`notify_details`|optional| |
| 7197 | Additional information about whom to notify about the update as a map |
| 7198 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 7199 | |============================= |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7200 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7201 | [[revision-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7202 | === RevisionInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7203 | The `RevisionInfo` entity contains information about a patch set. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 7204 | Not all fields are returned by default. Additional fields can |
| 7205 | be obtained by adding `o` parameters as described in |
| 7206 | link:#list-changes[Query Changes]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7207 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7208 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7209 | |=========================== |
| 7210 | |Field Name ||Description |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 7211 | |`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`, |
| 7212 | `MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`. |
Kasper Nilsson | be3616d | 2018-01-23 14:10:36 -0800 | [diff] [blame] | 7213 | |`_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] | 7214 | |`created` || |
| 7215 | The link:rest-api.html#timestamp[timestamp] of when the patch set was |
| 7216 | created. |
| 7217 | |`uploader` || |
| 7218 | The uploader of the patch set as an |
| 7219 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 7220 | |`ref` ||The Git reference for the patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7221 | |`fetch` || |
| 7222 | Information about how to fetch this patch set. The fetch information is |
| 7223 | provided as a map that maps the protocol name ("`git`", "`http`", |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 7224 | "`ssh`") to link:#fetch-info[FetchInfo] entities. This information is |
| 7225 | only included if a plugin implementing the |
| 7226 | link:intro-project-owner.html#download-commands[download commands] |
| 7227 | interface is installed. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 7228 | |`commit` |optional|The commit of the patch set as |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7229 | link:#commit-info[CommitInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 7230 | |`files` |optional| |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7231 | 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] | 7232 | link:#file-info[FileInfo] entities. Only set if |
| 7233 | link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES] |
| 7234 | option is requested. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 7235 | |`actions` |optional| |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 7236 | Actions the caller might be able to perform on this revision. The |
| 7237 | information is a map of view name to link:#action-info[ActionInfo] |
| 7238 | entities. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 7239 | |`reviewed` |optional| |
| 7240 | Indicates whether the caller is authenticated and has commented on the |
| 7241 | current revision. Only set if link:#reviewed[REVIEWED] option is requested. |
Quinten Yearsley | 28cd212 | 2019-06-10 14:41:13 -0700 | [diff] [blame] | 7242 | |`commit_with_footers` |optional| |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 7243 | If the link:#commit-footers[COMMIT_FOOTERS] option is requested and |
| 7244 | this is the current patch set, contains the full commit message with |
| 7245 | Gerrit-specific commit footers, as if this revision were submitted |
| 7246 | using the link:project-configuration.html#cherry_pick[Cherry Pick] |
| 7247 | submit type. |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 7248 | |`push_certificate` |optional| |
| 7249 | If the link:#push-certificates[PUSH_CERTIFICATES] option is requested, |
| 7250 | contains the push certificate provided by the user when uploading this |
| 7251 | patch set as a link:#push-certificate-info[PushCertificateInfo] entity. |
| 7252 | This field is always set if the option is requested; if no push |
| 7253 | certificate was provided, it is set to an empty object. |
Aaron Gable | 621c9b6 | 2017-04-21 09:24:20 -0700 | [diff] [blame] | 7254 | |`description` |optional| |
| 7255 | The description of this patchset, as displayed in the patchset |
| 7256 | selector menu. May be null if no description is set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7257 | |=========================== |
| 7258 | |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7259 | [[robot-comment-info]] |
| 7260 | === RobotCommentInfo |
| 7261 | The `RobotCommentInfo` entity contains information about a robot inline |
| 7262 | comment. |
| 7263 | |
Alice Kober-Sotzek | 265805d | 2016-12-07 15:24:21 +0100 | [diff] [blame] | 7264 | `RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7265 | In addition `RobotCommentInfo` has the following fields: |
| 7266 | |
| 7267 | [options="header",cols="1,^1,5"] |
| 7268 | |=========================== |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7269 | |Field Name ||Description |
| 7270 | |`robot_id` ||The ID of the robot that generated this comment. |
| 7271 | |`robot_run_id` ||An ID of the run of the robot. |
| 7272 | |`url` |optional|URL to more information. |
| 7273 | |`properties` |optional|Robot specific properties as map that maps arbitrary |
| 7274 | keys to values. |
| 7275 | |`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of |
| 7276 | <<fix-suggestion-info,FixSuggestionInfo>> entities. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7277 | |=========================== |
| 7278 | |
| 7279 | [[robot-comment-input]] |
| 7280 | === RobotCommentInput |
| 7281 | The `RobotCommentInput` entity contains information for creating an inline |
| 7282 | robot comment. |
| 7283 | |
Alice Kober-Sotzek | 265805d | 2016-12-07 15:24:21 +0100 | [diff] [blame] | 7284 | `RobotCommentInput` has the same fields as |
| 7285 | <<robot-comment-info,RobotCommentInfo>>. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7286 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7287 | [[rule-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7288 | === RuleInput |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7289 | The `RuleInput` entity contains information to test a Prolog rule. |
| 7290 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7291 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7292 | |=========================== |
| 7293 | |Field Name ||Description |
| 7294 | |`rule`|| |
| 7295 | Prolog code to execute instead of the code in `refs/meta/config`. |
| 7296 | |`filters`|`RUN` if not set| |
| 7297 | When `RUN` filter rules in the parent projects are called to |
| 7298 | post-process the results of the project specific rule. This |
| 7299 | behavior matches how the rule will execute if installed. + |
| 7300 | If `SKIP` the parent filters are not called, allowing the test |
| 7301 | to return results from the input rule. |
| 7302 | |=========================== |
| 7303 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 7304 | [[submit-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7305 | === SubmitInfo |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 7306 | The `SubmitInfo` entity contains information about the change status |
| 7307 | after submitting. |
| 7308 | |
Stefan Beller | e4785b4 | 2015-06-18 12:31:03 -0700 | [diff] [blame] | 7309 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 7310 | |========================== |
Stefan Beller | e4785b4 | 2015-06-18 12:31:03 -0700 | [diff] [blame] | 7311 | |Field Name ||Description |
| 7312 | |`status` || |
Stefan Beller | 0d3cab0 | 2015-07-10 13:32:57 -0700 | [diff] [blame] | 7313 | The status of the change after submitting is `MERGED`. |
David Ostrovsky | 868e341 | 2014-01-30 19:50:57 +0100 | [diff] [blame] | 7314 | |`on_behalf_of`|optional| |
| 7315 | The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on |
| 7316 | 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] | 7317 | have been granted both `Submit` and `Submit (On Behalf Of)` permissions. |
| 7318 | The user named by `on_behalf_of` does not need to be granted the `Submit` |
| 7319 | 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] | 7320 | granted both permissions, so individual users don't need `Submit` permission |
| 7321 | 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] | 7322 | not with the identity of the CI account. |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 7323 | |========================== |
| 7324 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 7325 | [[submit-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7326 | === SubmitInput |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 7327 | The `SubmitInput` entity contains information for submitting a change. |
| 7328 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7329 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7330 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 7331 | |Field Name ||Description |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7332 | |`on_behalf_of` |optional| |
Dave Borowitz | c6d143d | 2016-02-24 12:32:23 -0500 | [diff] [blame] | 7333 | If set, submit the change on behalf of the given user. The value may take any |
| 7334 | format link:rest-api-accounts.html#account-id[accepted by the accounts REST |
| 7335 | API]. Using this option requires |
| 7336 | link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)] |
| 7337 | permission on the branch. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7338 | |`notify` |optional| |
Stephen Li | a5a5ef0 | 2016-03-31 16:55:53 -0700 | [diff] [blame] | 7339 | Notify handling that defines to whom email notifications should be sent after |
| 7340 | the change is submitted. + |
| 7341 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7342 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7343 | |`notify_details`|optional| |
| 7344 | Additional information about whom to notify about the update as a map |
| 7345 | of recipient type to link:#notify-info[NotifyInfo] entity. |
| 7346 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 7347 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7348 | [[submit-record]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7349 | === SubmitRecord |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7350 | The `SubmitRecord` entity describes results from a submit_rule. |
Dave Borowitz | 6453fce | 2016-09-22 16:11:56 +0200 | [diff] [blame] | 7351 | Fields in this entity roughly correspond to the fields set by `LABELS` |
| 7352 | in link:#label-info[LabelInfo]. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7353 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7354 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7355 | |=========================== |
| 7356 | |Field Name ||Description |
| 7357 | |`status`|| |
| 7358 | `OK`, the change can be submitted. + |
| 7359 | `NOT_READY`, additional labels are required before submit. + |
| 7360 | `CLOSED`, closed changes cannot be submitted. + |
| 7361 | `RULE_ERROR`, rule code failed with an error. |
| 7362 | |`ok`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 7363 | Map of labels that are approved; an |
| 7364 | link:rest-api-accounts.html#account-info[AccountInfo] identifies the |
| 7365 | voter chosen by the rule. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7366 | |`reject`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 7367 | Map of labels that are preventing submit; |
| 7368 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7369 | |`need`|optional| |
| 7370 | Map of labels that need to be given to submit. The value is |
| 7371 | currently an empty object. |
| 7372 | |`may`|optional| |
| 7373 | Map of labels that can be used, but do not affect submit. |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 7374 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter, |
| 7375 | if the label has been applied. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 7376 | |`impossible`|optional| |
| 7377 | Map of labels that should have been in `need` but cannot be |
| 7378 | used by any user because of access restrictions. The value |
| 7379 | is currently an empty object. |
| 7380 | |`error_message`|optional| |
| 7381 | When status is RULE_ERROR this message provides some text describing |
| 7382 | the failure of the rule predicate. |
| 7383 | |=========================== |
| 7384 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 7385 | [[submitted-together-info]] |
| 7386 | === SubmittedTogetherInfo |
| 7387 | The `SubmittedTogetherInfo` entity contains information about a |
| 7388 | collection of changes that would be submitted together. |
| 7389 | |
| 7390 | [options="header",cols="1,6"] |
| 7391 | |=========================== |
| 7392 | |Field Name |Description |
| 7393 | |`changes` | |
| 7394 | A list of ChangeInfo entities representing the changes to be submitted together. |
| 7395 | |`non_visible_changes`| |
| 7396 | The number of changes to be submitted together that the current user |
| 7397 | cannot see. (This count includes changes that are visible to the |
| 7398 | current user when their reason for being submitted together involves |
| 7399 | changes the user cannot see.) |
| 7400 | |=========================== |
| 7401 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7402 | [[suggested-reviewer-info]] |
| 7403 | === SuggestedReviewerInfo |
| 7404 | The `SuggestedReviewerInfo` entity contains information about a reviewer |
| 7405 | that can be added to a change (an account or a group). |
| 7406 | |
| 7407 | `SuggestedReviewerInfo` has either the `account` field that contains |
| 7408 | the link:rest-api-accounts.html#account-info[AccountInfo] entity, or |
| 7409 | the `group` field that contains the |
| 7410 | link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity. |
| 7411 | |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 7412 | [options="header",cols="1,^1,5"] |
| 7413 | |=========================== |
| 7414 | |Field Name ||Description |
| 7415 | |`account` |optional| |
| 7416 | An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the |
| 7417 | suggestion is an account. |
| 7418 | |`group` |optional| |
| 7419 | A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the |
| 7420 | suggestion is a group. |
| 7421 | |`count` || |
| 7422 | The total number of accounts in the suggestion. This is `1` if `account` is |
| 7423 | present. If `group` is present, the total number of accounts that are |
| 7424 | members of the group is returned (this count includes members of nested |
| 7425 | groups). |
| 7426 | |`confirm` |optional| |
| 7427 | True if `group` is present and `count` is above the threshold where the |
| 7428 | `confirmed` flag must be passed to add the group as a reviewer. |
| 7429 | |=========================== |
| 7430 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 7431 | [[topic-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7432 | === TopicInput |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 7433 | The `TopicInput` entity contains information for setting a topic. |
| 7434 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7435 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 7436 | |=========================== |
| 7437 | |Field Name ||Description |
| 7438 | |`topic` |optional|The topic. + |
| 7439 | The topic will be deleted if not set. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 7440 | |=========================== |
| 7441 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 7442 | [[tracking-id-info]] |
| 7443 | === TrackingIdInfo |
| 7444 | The `TrackingIdInfo` entity describes a reference to an external tracking system. |
| 7445 | |
| 7446 | [options="header",cols="1,6"] |
| 7447 | |====================== |
| 7448 | |Field Name|Description |
| 7449 | |`system` |The name of the external tracking system. |
| 7450 | |`id` |The tracking id. |
| 7451 | |====================== |
| 7452 | |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 7453 | [[voting-range-info]] |
| 7454 | === VotingRangeInfo |
| 7455 | The `VotingRangeInfo` entity describes the continuous voting range from min |
| 7456 | to max values. |
| 7457 | |
| 7458 | [options="header",cols="1,6"] |
| 7459 | |====================== |
| 7460 | |Field Name|Description |
| 7461 | |`min` |The minimum voting value. |
| 7462 | |`max` |The maximum voting value. |
| 7463 | |====================== |
| 7464 | |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 7465 | [[web-link-info]] |
| 7466 | === WebLinkInfo |
| 7467 | The `WebLinkInfo` entity describes a link to an external site. |
| 7468 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7469 | [options="header",cols="1,6"] |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 7470 | |====================== |
| 7471 | |Field Name|Description |
| 7472 | |`name` |The link name. |
| 7473 | |`url` |The link URL. |
Sven Selberg | 5548420 | 2014-06-26 08:48:51 +0200 | [diff] [blame] | 7474 | |`image_url`|URL to the icon of the link. |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 7475 | |====================== |
| 7476 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 7477 | [[work-in-progress-input]] |
| 7478 | === WorkInProgressInput |
| 7479 | The `WorkInProgressInput` entity contains additional information for a change |
| 7480 | set to WorkInProgress/ReadyForReview. |
| 7481 | |
| 7482 | [options="header",cols="1,^1,5"] |
| 7483 | |============================= |
| 7484 | |Field Name ||Description |
| 7485 | |`message` |optional| |
| 7486 | Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview. |
| 7487 | |============================= |
| 7488 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 7489 | GERRIT |
| 7490 | ------ |
| 7491 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 7492 | |
| 7493 | SEARCHBOX |
| 7494 | --------- |