Marian Harbach | ebeb154 | 2019-12-13 10:42:46 +0100 | [diff] [blame] | 1 | :linkattrs: |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2 | = Gerrit Code Review - /changes/ REST API |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 3 | |
| 4 | This page describes the change related REST endpoints. |
| 5 | Please also take note of the general information on the |
| 6 | link:rest-api.html[REST API]. |
| 7 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8 | [[change-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 9 | == Change Endpoints |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 10 | |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 11 | [[create-change]] |
| 12 | === Create Change |
| 13 | -- |
David Pursehouse | a92d2e9 | 2017-08-03 06:03:47 +0000 | [diff] [blame] | 14 | 'POST /changes/' |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 15 | -- |
| 16 | |
Han-Wen Nienhuys | 0a24132 | 2021-02-15 18:01:48 +0100 | [diff] [blame] | 17 | The change input link:#change-input[ChangeInput] entity must be |
| 18 | provided in the request body. It is not allowed to create changes |
| 19 | under `refs/tags/` or Gerrit internal ref namespaces such as |
| 20 | `refs/changes/`, `refs/meta/external-ids/`, and `refs/users/`. The |
| 21 | request would fail with `400 Bad Request` in this case. |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 22 | |
Edwin Kempin | 088eeb9a | 2018-01-25 08:39:41 +0100 | [diff] [blame] | 23 | To create a change the calling user must be allowed to |
| 24 | link:access-control.html#category_push_review[upload to code review]. |
| 25 | |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 26 | .Request |
| 27 | ---- |
Paladox none | 4bac195 | 2017-08-03 00:09:25 +0000 | [diff] [blame] | 28 | POST /changes/ HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 29 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 30 | |
| 31 | { |
| 32 | "project" : "myProject", |
| 33 | "subject" : "Let's support 100% Gerrit workflow direct in browser", |
| 34 | "branch" : "master", |
| 35 | "topic" : "create-change-in-browser", |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 36 | "status" : "NEW" |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 37 | } |
| 38 | ---- |
| 39 | |
| 40 | As response a link:#change-info[ChangeInfo] entity is returned that describes |
| 41 | the resulting change. |
| 42 | |
| 43 | .Response |
| 44 | ---- |
Paladox none | 4bac195 | 2017-08-03 00:09:25 +0000 | [diff] [blame] | 45 | HTTP/1.1 201 OK |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 46 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 47 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 48 | |
| 49 | )]}' |
| 50 | { |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 51 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 52 | "project": "myProject", |
| 53 | "branch": "master", |
| 54 | "topic": "create-change-in-browser", |
| 55 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 56 | "subject": "Let's support 100% Gerrit workflow direct in browser", |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 57 | "status": "NEW", |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 58 | "created": "2014-05-05 07:15:44.639000000", |
| 59 | "updated": "2014-05-05 07:15:44.639000000", |
| 60 | "mergeable": true, |
| 61 | "insertions": 0, |
| 62 | "deletions": 0, |
David Ostrovsky | 837c0ee | 2014-04-27 12:54:20 +0200 | [diff] [blame] | 63 | "_number": 4711, |
| 64 | "owner": { |
| 65 | "name": "John Doe" |
| 66 | } |
| 67 | } |
| 68 | ---- |
| 69 | |
Edwin Kempin | 7620274 | 2013-02-15 13:51:50 +0100 | [diff] [blame] | 70 | [[list-changes]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 71 | === Query Changes |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 72 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 73 | 'GET /changes/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 74 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 75 | |
Saša Živkov | dd80402 | 2014-06-23 16:44:03 +0200 | [diff] [blame] | 76 | Queries changes visible to the caller. The |
| 77 | link:user-search.html#_search_operators[query string] must be provided |
| 78 | by the `q` parameter. The `n` parameter can be used to limit the |
Patrick Hiesel | d6afdcf | 2020-01-07 15:03:28 +0100 | [diff] [blame] | 79 | returned results. The `no-limit` parameter can be used remove the default |
| 80 | limit on queries and return all results. This might not be supported by |
| 81 | all index backends. |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 82 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 83 | As result a list of link:#change-info[ChangeInfo] entries is returned. |
| 84 | The change output is sorted by the last update time, most recently |
| 85 | updated to oldest updated. |
| 86 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 87 | Query for open changes of watched projects: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 88 | |
| 89 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 90 | ---- |
Edwin Kempin | 2091edb | 2013-01-23 19:07:38 +0100 | [diff] [blame] | 91 | GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 92 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 93 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 94 | .Response |
| 95 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 96 | HTTP/1.1 200 OK |
| 97 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 98 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 99 | |
| 100 | )]}' |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 101 | [ |
| 102 | { |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 103 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 104 | "project": "demo", |
| 105 | "branch": "master", |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 106 | "attention_set": [ |
| 107 | { |
| 108 | "account": { |
| 109 | "name": "John Doe" |
| 110 | }, |
| 111 | "last_update": "2012-07-17 07:19:27.766000000", |
| 112 | "reason": "reviewer or cc replied" |
| 113 | } |
| 114 | ] |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 115 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 116 | "subject": "One change", |
| 117 | "status": "NEW", |
| 118 | "created": "2012-07-17 07:18:30.854000000", |
| 119 | "updated": "2012-07-17 07:19:27.766000000", |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 120 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 121 | "insertions": 26, |
| 122 | "deletions": 10, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 123 | "_number": 1756, |
| 124 | "owner": { |
| 125 | "name": "John Doe" |
| 126 | }, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 127 | }, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 128 | { |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 129 | "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 130 | "project": "demo", |
| 131 | "branch": "master", |
| 132 | "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 133 | "subject": "Another change", |
| 134 | "status": "NEW", |
| 135 | "created": "2012-07-17 07:18:30.884000000", |
| 136 | "updated": "2012-07-17 07:18:30.885000000", |
| 137 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 138 | "insertions": 12, |
| 139 | "deletions": 18, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 140 | "_number": 1757, |
| 141 | "owner": { |
| 142 | "name": "John Doe" |
| 143 | }, |
| 144 | "_more_changes": true |
| 145 | } |
| 146 | ] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 147 | ---- |
| 148 | |
Sebastian Schuberth | 02bafe0 | 2016-01-20 21:38:11 +0100 | [diff] [blame] | 149 | If the number of changes matching the query exceeds either the internal |
| 150 | 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] | 151 | `_more_changes: true` JSON field set. |
| 152 | |
| 153 | The `S` or `start` query parameter can be supplied to skip a number |
| 154 | of changes from the list. |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 155 | |
Matthias Sohn | 0b2bf61 | 2020-12-24 00:15:32 +0100 | [diff] [blame] | 156 | Administrators can use the `skip-visibility` query parameter to skip visibility filtering. |
| 157 | This can be used to ensure that no changes are missed e.g. when querying for changes which |
| 158 | need to be reindexed. Without this parameter query results the user has no permission to read |
| 159 | are filtered out. REST requests with the skip-visibility option are rejected when the current |
| 160 | user doesn't have the ADMINISTRATE_SERVER capability. |
| 161 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 162 | Clients are allowed to specify more than one query by setting the `q` |
| 163 | parameter multiple times. In this case the result is an array of |
| 164 | arrays, one per query in the same order the queries were given in. |
| 165 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 166 | .Query for the 25 most recent open changes of the projects that you watch |
| 167 | **** |
| 168 | get::/changes/?q=status:open+is:watched&n=25 |
| 169 | **** |
| 170 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 171 | Query that retrieves changes for a user's dashboard: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 172 | |
| 173 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 174 | ---- |
| 175 | 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] | 176 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 177 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 178 | .Response |
| 179 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 180 | HTTP/1.1 200 OK |
| 181 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 182 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 183 | |
| 184 | )]}' |
| 185 | [ |
| 186 | [ |
| 187 | { |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 188 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 189 | "project": "demo", |
| 190 | "branch": "master", |
| 191 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 192 | "subject": "One change", |
| 193 | "status": "NEW", |
| 194 | "created": "2012-07-17 07:18:30.854000000", |
| 195 | "updated": "2012-07-17 07:19:27.766000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 196 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 197 | "insertions": 4, |
| 198 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 199 | "_number": 1756, |
| 200 | "owner": { |
| 201 | "name": "John Doe" |
| 202 | }, |
| 203 | "labels": { |
| 204 | "Verified": {}, |
| 205 | "Code-Review": {} |
| 206 | } |
| 207 | } |
| 208 | ], |
| 209 | [], |
| 210 | [] |
| 211 | ] |
| 212 | ---- |
| 213 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 214 | .Query the changes for your user dashboard |
| 215 | **** |
| 216 | get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS |
| 217 | **** |
| 218 | |
David Pursehouse | 2cf2843 | 2016-08-21 23:20:08 +0900 | [diff] [blame] | 219 | [[query-options]] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 220 | Additional fields can be obtained by adding `o` parameters, each |
| 221 | option requires more database lookups and slows down the query |
| 222 | response time to the client so they are generally disabled by |
| 223 | default. Optional fields are: |
| 224 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 225 | [[labels]] |
| 226 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 227 | * `LABELS`: a summary of each label required for submit, and |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 228 | approvers that have granted (or rejected) with that label |
| 229 | as well as all reviewers by state, and reviewers that may |
| 230 | be removed by the current user. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 231 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 232 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 233 | [[detailed-labels]] |
| 234 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 235 | * `DETAILED_LABELS`: detailed label information, including numeric |
Dave Borowitz | 992ddd7 | 2013-02-13 11:53:17 -0800 | [diff] [blame] | 236 | values of all existing approvals, recognized label values, values |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 237 | permitted to be set by any reviewer and the change owner, all |
| 238 | reviewers by state, and reviewers that may be removed by the |
| 239 | current user. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 240 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 241 | |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 242 | [[submit-requirements]] |
| 243 | -- |
| 244 | * `SUBMIT_REQUIREMENTS`: detailed result of the evaluated submit requirements |
| 245 | for this change. |
| 246 | -- |
| 247 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 248 | [[current-revision]] |
| 249 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 250 | * `CURRENT_REVISION`: describe the current revision (patch set) |
| 251 | 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] | 252 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 253 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 254 | [[all-revisions]] |
| 255 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 256 | * `ALL_REVISIONS`: describe all revisions, not just current. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 257 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 258 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 259 | [[download-commands]] |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 260 | -- |
| 261 | * `DOWNLOAD_COMMANDS`: include the `commands` field in the |
| 262 | link:#fetch-info[FetchInfo] for revisions. Only valid when the |
| 263 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
| 264 | -- |
| 265 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 266 | [[current-commit]] |
| 267 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 268 | * `CURRENT_COMMIT`: parse and output all header fields from the |
David Pursehouse | 98006e8 | 2013-10-02 10:15:52 +0900 | [diff] [blame] | 269 | commit object, including message. Only valid when the |
| 270 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 271 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 272 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 273 | [[all-commits]] |
| 274 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 275 | * `ALL_COMMITS`: parse and output all header fields from the |
| 276 | output revisions. If only `CURRENT_REVISION` was requested |
| 277 | then only the current revision's commit data will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 278 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 279 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 280 | [[current-files]] |
| 281 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 282 | * `CURRENT_FILES`: list files modified by the commit and magic files, |
| 283 | including basic line counts inserted/deleted per file. Only valid |
| 284 | when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 285 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 286 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 287 | [[all-files]] |
| 288 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 289 | * `ALL_FILES`: list files modified by the commit and magic files, |
| 290 | including basic line counts inserted/deleted per file. If only the |
| 291 | `CURRENT_REVISION` was requested then only that commit's modified |
| 292 | files will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 293 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 294 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 295 | [[detailed-accounts]] |
| 296 | -- |
Edwin Kempin | 4a00e22 | 2013-10-16 14:34:24 +0200 | [diff] [blame] | 297 | * `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username` |
| 298 | fields when referencing accounts. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 299 | -- |
Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 300 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 301 | [[reviewer-updates]] |
| 302 | -- |
| 303 | * `REVIEWER_UPDATES`: include updates to reviewers set as |
| 304 | link:#review-update-info[ReviewerUpdateInfo] entities. |
| 305 | -- |
| 306 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 307 | [[messages]] |
| 308 | -- |
| 309 | * `MESSAGES`: include messages associated with the change. |
| 310 | -- |
| 311 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 312 | [[actions]] |
| 313 | -- |
| 314 | * `CURRENT_ACTIONS`: include information on available actions |
Stefan Beller | 09cd95d | 2015-02-12 13:40:23 -0800 | [diff] [blame] | 315 | for the change and its current revision. Ignored if the caller |
| 316 | is not authenticated. |
| 317 | -- |
| 318 | |
| 319 | [[change-actions]] |
| 320 | -- |
| 321 | * `CHANGE_ACTIONS`: include information on available |
| 322 | change actions for the change. Ignored if the caller |
| 323 | is not authenticated. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 324 | -- |
| 325 | |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 326 | [[reviewed]] |
| 327 | -- |
Dave Borowitz | 86669b3 | 2015-05-27 14:56:10 -0700 | [diff] [blame] | 328 | * `REVIEWED`: include the `reviewed` field if all of the following are |
| 329 | true: |
Ardo Septama | 505f9ad | 2016-12-06 16:28:00 +0100 | [diff] [blame] | 330 | - the change is open |
| 331 | - the caller is authenticated |
| 332 | - 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] | 333 | from the change owner, i.e. this change would show up in the results of |
| 334 | link:user-search.html#reviewedby[reviewedby:self]. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 335 | -- |
Gal Paikin | 3a2aa01 | 2019-06-21 18:30:01 +0200 | [diff] [blame] | 336 | [[skip_diffstat]] |
| 337 | -- |
| 338 | * `SKIP_DIFFSTAT`: skip the 'insertions' and 'deletions' field in link:#change-info[ChangeInfo]. |
| 339 | For large trees, their computation may be expensive. |
| 340 | -- |
Han-Wen Nienhuys | 19de6cd | 2018-01-16 13:15:38 +0100 | [diff] [blame] | 341 | |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 342 | [[submittable]] |
| 343 | -- |
Jonathan Nieder | ad5240f | 2016-10-04 11:03:23 -0700 | [diff] [blame] | 344 | * `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo], |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 345 | which can be used to tell if the change is reviewed and ready for submit. |
| 346 | -- |
| 347 | |
Khai Do | 2a23ec8 | 2014-09-19 16:33:02 -0700 | [diff] [blame] | 348 | [[web-links]] |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 349 | -- |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 350 | * `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo], |
| 351 | therefore only valid in combination with `CURRENT_COMMIT` or |
| 352 | `ALL_COMMITS`. |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 353 | -- |
| 354 | |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 355 | [[check]] |
| 356 | -- |
| 357 | * `CHECK`: include potential problems with the change. |
| 358 | -- |
| 359 | |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 360 | [[commit-footers]] |
| 361 | -- |
| 362 | * `COMMIT_FOOTERS`: include the full commit message with |
| 363 | Gerrit-specific commit footers in the |
| 364 | link:#revision-info[RevisionInfo]. |
Yuxuan 'fishy' Wang | 16baf21 | 2015-05-05 16:49:55 -0700 | [diff] [blame] | 365 | -- |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 366 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 367 | [[push-certificates]] |
| 368 | -- |
| 369 | * `PUSH_CERTIFICATES`: include push certificate information in the |
| 370 | link:#revision-info[RevisionInfo]. Ignored if signed push is not |
| 371 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the |
| 372 | server. |
| 373 | -- |
| 374 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 375 | [[tracking-ids]] |
| 376 | -- |
| 377 | * `TRACKING_IDS`: include references to external tracking systems |
| 378 | as link:#tracking-id-info[TrackingIdInfo]. |
| 379 | -- |
| 380 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 381 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 382 | ---- |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 383 | 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] | 384 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 385 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 386 | .Response |
| 387 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 388 | HTTP/1.1 200 OK |
| 389 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 390 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 391 | |
| 392 | )]}' |
| 393 | [ |
| 394 | { |
David Pursehouse | c3be6ad | 2014-07-18 12:03:06 +0900 | [diff] [blame] | 395 | "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 396 | "project": "gerrit", |
| 397 | "branch": "master", |
| 398 | "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 399 | "subject": "Use an EventBus to manage star icons", |
| 400 | "status": "NEW", |
| 401 | "created": "2012-04-25 00:52:25.580000000", |
| 402 | "updated": "2012-04-25 00:52:25.586000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 403 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 404 | "insertions": 16, |
| 405 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 406 | "_number": 97, |
| 407 | "owner": { |
| 408 | "name": "Shawn Pearce" |
| 409 | }, |
| 410 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", |
| 411 | "revisions": { |
| 412 | "184ebe53805e102605d11f6b143486d15c23a09c": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 413 | "kind": "REWORK", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 414 | "_number": 1, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 415 | "ref": "refs/changes/97/97/1", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 416 | "fetch": { |
| 417 | "git": { |
| 418 | "url": "git://localhost/gerrit", |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 419 | "ref": "refs/changes/97/97/1", |
| 420 | "commands": { |
| 421 | "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 422 | "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 423 | "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 424 | "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1" |
| 425 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 426 | }, |
| 427 | "http": { |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 428 | "url": "http://myuser@127.0.0.1:8080/gerrit", |
| 429 | "ref": "refs/changes/97/97/1", |
| 430 | "commands": { |
| 431 | "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 432 | "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 433 | "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", |
| 434 | "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1" |
| 435 | } |
| 436 | }, |
| 437 | "ssh": { |
| 438 | "url": "ssh://myuser@*:29418/gerrit", |
| 439 | "ref": "refs/changes/97/97/1", |
| 440 | "commands": { |
| 441 | "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 442 | "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 443 | "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 444 | "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1" |
| 445 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 446 | } |
| 447 | }, |
| 448 | "commit": { |
| 449 | "parents": [ |
| 450 | { |
| 451 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 452 | "subject": "Migrate contributor agreements to All-Projects." |
| 453 | } |
| 454 | ], |
| 455 | "author": { |
| 456 | "name": "Shawn O. Pearce", |
| 457 | "email": "sop@google.com", |
| 458 | "date": "2012-04-24 18:08:08.000000000", |
| 459 | "tz": -420 |
| 460 | }, |
| 461 | "committer": { |
| 462 | "name": "Shawn O. Pearce", |
| 463 | "email": "sop@google.com", |
| 464 | "date": "2012-04-24 18:08:08.000000000", |
| 465 | "tz": -420 |
| 466 | }, |
| 467 | "subject": "Use an EventBus to manage star icons", |
| 468 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 469 | }, |
| 470 | "files": { |
| 471 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 472 | "lines_deleted": 8, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 473 | "size_delta": -412, |
| 474 | "size": 7782 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 475 | }, |
| 476 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 477 | "lines_inserted": 1, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 478 | "size_delta": 23, |
| 479 | "size": 6762 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 480 | }, |
| 481 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { |
| 482 | "lines_inserted": 11, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 483 | "lines_deleted": 19, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 484 | "size_delta": -298, |
| 485 | "size": 47023 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 486 | }, |
| 487 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { |
| 488 | "lines_inserted": 23, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 489 | "lines_deleted": 20, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 490 | "size_delta": 132, |
| 491 | "size": 17727 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 492 | }, |
| 493 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { |
| 494 | "status": "D", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 495 | "lines_deleted": 139, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 496 | "size_delta": -5512, |
| 497 | "size": 13098 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 498 | }, |
| 499 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { |
| 500 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 501 | "lines_inserted": 204, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 502 | "size_delta": 8345, |
| 503 | "size": 8345 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 504 | }, |
| 505 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 506 | "lines_deleted": 9, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 507 | "size_delta": -343, |
| 508 | "size": 5385 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 509 | } |
| 510 | } |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | ] |
| 515 | ---- |
| 516 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 517 | [[get-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 518 | === Get Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 519 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 520 | 'GET /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 521 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 522 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 523 | Retrieves a change. |
| 524 | |
Dave Borowitz | 0314f73 | 2013-10-03 09:34:30 -0700 | [diff] [blame] | 525 | Additional fields can be obtained by adding `o` parameters, each |
| 526 | option requires more database lookups and slows down the query |
| 527 | response time to the client so they are generally disabled by |
| 528 | default. Fields are described in link:#list-changes[Query Changes]. |
| 529 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 530 | .Request |
| 531 | ---- |
| 532 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 533 | ---- |
| 534 | |
| 535 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 536 | describes the change. |
| 537 | |
| 538 | .Response |
| 539 | ---- |
| 540 | HTTP/1.1 200 OK |
| 541 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 542 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 543 | |
| 544 | )]}' |
| 545 | { |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 546 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 547 | "project": "myProject", |
| 548 | "branch": "master", |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 549 | "attention_set": [ |
| 550 | { |
| 551 | "account": { |
| 552 | "name": "John Doe" |
| 553 | }, |
| 554 | "last_update": "2013-02-21 11:16:36.775000000", |
| 555 | "reason": "reviewer or cc replied" |
| 556 | } |
| 557 | ] |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 558 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 559 | "subject": "Implementing Feature X", |
| 560 | "status": "NEW", |
| 561 | "created": "2013-02-01 09:59:32.126000000", |
| 562 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 563 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 564 | "insertions": 34, |
| 565 | "deletions": 101, |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 566 | "_number": 3965, |
| 567 | "owner": { |
| 568 | "name": "John Doe" |
| 569 | } |
| 570 | } |
| 571 | ---- |
| 572 | |
Han-Wen Nienhuys | 63b81f2 | 2021-02-17 10:31:01 +0100 | [diff] [blame] | 573 | Historical state of the change can be retrieved by specifying the |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 574 | `meta=SHA-1` parameter. This will use a historical NoteDb snapshot to |
| 575 | populate ChangeInfo. If the SHA-1 is not reachable as a NoteDb state, |
Han-Wen Nienhuys | 63b81f2 | 2021-02-17 10:31:01 +0100 | [diff] [blame] | 576 | status code 412 is returned. |
| 577 | |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 578 | [[get-meta-diff]] |
| 579 | === Get Meta Diff |
| 580 | -- |
Han-Wen Nienhuys | 524317a | 2021-04-08 12:12:35 +0200 | [diff] [blame] | 581 | 'GET /changes/link:#change-id[\{change-id\}]/meta_diff?old=SHA-1&meta=SHA-1' |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 582 | -- |
| 583 | |
| 584 | Retrieves the difference between two historical states of a change |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 585 | by specifying the `old=SHA-1` and the `meta=SHA-1` parameters. |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 586 | |
| 587 | If the `old` parameter is not provided, the parent of the `meta` |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 588 | SHA-1 is used. If the `meta` parameter is not provided, the current |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 589 | state of the change is used. If neither are provided, the |
| 590 | difference between the current state of the change and its previous |
| 591 | state is returned. |
| 592 | |
| 593 | Additional fields can be obtained by adding `o` parameters, analogous |
| 594 | to link:#get-change[Get Change], and the same concerns for Get Change hold for |
| 595 | this endpoint too. Fields are described in link:#list-changes[Query Changes]. |
| 596 | |
| 597 | .Request |
| 598 | ---- |
| 599 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/meta_diff?old=b083abc34eb6dbdb9e154ba092fc198000e997b4&meta=63b81f2bde703ae07787a940e8fdf9a1828605b1 HTTP/1.0 |
| 600 | ---- |
| 601 | |
| 602 | As a response, two link:#change-info[ChangeInfo] entities are returned |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 603 | that describe information added and removed from the `old` change state, and |
| 604 | the two link:#change-info[ChangeInfo] entities that generated the diff are |
| 605 | returned. Only fields that differ between the change's two states are returned. |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 606 | |
| 607 | .Response |
| 608 | ---- |
| 609 | HTTP/1.1 200 OK |
| 610 | Content-Disposition: attachment |
| 611 | Content-Type: application/json; charset=UTF-8 |
| 612 | |
| 613 | )]}' |
| 614 | { |
| 615 | "added": { |
| 616 | "attention_set": [ |
| 617 | { |
| 618 | "account": { |
| 619 | "name": "John Doe" |
| 620 | }, |
| 621 | "last_update": "2013-02-21 11:16:36.775000000", |
| 622 | "reason": "reviewer or cc replied" |
| 623 | } |
| 624 | ] |
| 625 | "updated": "2013-02-21 11:16:36.775000000", |
| 626 | "topic": "new-topic" |
| 627 | }, |
| 628 | "removed": { |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 629 | "updated": "2013-02-01 09:59:32.126000000", |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 630 | "topic": "old-topic" |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 631 | }, |
| 632 | "old_change_info": { |
| 633 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 634 | "project": "myProject", |
| 635 | "branch": "master", |
| 636 | "attention_set": [], |
| 637 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 638 | "subject": "Implementing Feature X", |
| 639 | "status": "NEW", |
| 640 | "topic": "old-topic", |
| 641 | "created": "2013-02-01 09:59:32.126000000", |
| 642 | "updated": "2013-02-01 09:59:32.126000000", |
| 643 | "mergeable": true, |
| 644 | "insertions": 34, |
| 645 | "deletions": 101, |
| 646 | "_number": 3965, |
| 647 | "owner": { |
| 648 | "name": "John Doe" |
| 649 | } |
| 650 | }, |
| 651 | "new_change_info": { |
| 652 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 653 | "project": "myProject", |
| 654 | "branch": "master", |
| 655 | "attention_set": [ |
| 656 | { |
| 657 | "account": { |
| 658 | "name": "John Doe" |
| 659 | }, |
| 660 | "last_update": "2013-02-21 11:16:36.775000000", |
| 661 | "reason": "reviewer or cc replied" |
| 662 | } |
| 663 | ], |
| 664 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 665 | "subject": "Implementing Feature X", |
| 666 | "status": "NEW", |
| 667 | "topic": "new-topic", |
| 668 | "created": "2013-02-01 09:59:32.126000000", |
| 669 | "updated": "2013-02-21 11:16:36.775000000", |
| 670 | "mergeable": true, |
| 671 | "insertions": 34, |
| 672 | "deletions": 101, |
| 673 | "_number": 3965, |
| 674 | "owner": { |
| 675 | "name": "John Doe" |
| 676 | } |
| 677 | }, |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 678 | } |
| 679 | ---- |
| 680 | |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 681 | If the provided SHA-1 for `meta` is not reachable as a NoteDb |
| 682 | state, the status code 412 is returned. If the SHA-1 for `old` |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 683 | is not reachable, the difference between the change at state |
| 684 | `meta` and an empty change is returned. |
Han-Wen Nienhuys | 63b81f2 | 2021-02-17 10:31:01 +0100 | [diff] [blame] | 685 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 686 | [[get-change-detail]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 687 | === Get Change Detail |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 688 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 689 | 'GET /changes/link:#change-id[\{change-id\}]/detail' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 690 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 691 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 692 | Retrieves a change with link:#labels[labels], link:#detailed-labels[ |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 693 | detailed labels], link:#detailed-accounts[detailed accounts], |
| 694 | link:#reviewer-updates[reviewer updates], and link:#messages[messages]. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 695 | |
Shawn Pearce | 7f3dccf | 2013-07-06 19:24:29 -0700 | [diff] [blame] | 696 | Additional fields can be obtained by adding `o` parameters, each |
| 697 | option requires more database lookups and slows down the query |
| 698 | response time to the client so they are generally disabled by |
| 699 | default. Fields are described in link:#list-changes[Query Changes]. |
| 700 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 701 | .Request |
| 702 | ---- |
| 703 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0 |
| 704 | ---- |
| 705 | |
| 706 | As response a link:#change-info[ChangeInfo] entity is returned that |
Khai Do | ad63201 | 2014-06-22 08:29:57 -0700 | [diff] [blame] | 707 | describes the change. This response will contain all votes for each |
| 708 | label and include one combined vote. The combined label vote is |
| 709 | calculated in the following order (from highest to lowest): |
| 710 | REJECTED > APPROVED > DISLIKED > RECOMMENDED. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 711 | |
| 712 | .Response |
| 713 | ---- |
| 714 | HTTP/1.1 200 OK |
| 715 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 716 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 717 | |
| 718 | )]}' |
| 719 | { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 720 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 721 | "project": "myProject", |
| 722 | "branch": "master", |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 723 | "attention_set": [ |
| 724 | { |
| 725 | "account": { |
| 726 | "_account_id": 1000096, |
| 727 | "name": "John Doe", |
| 728 | "email": "john.doe@example.com", |
| 729 | "username": "jdoe" |
| 730 | }, |
| 731 | "last_update": "2013-02-21 11:16:36.775000000", |
| 732 | "reason": "reviewer or cc replied" |
| 733 | } |
| 734 | ] |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 735 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 736 | "subject": "Implementing Feature X", |
| 737 | "status": "NEW", |
| 738 | "created": "2013-02-01 09:59:32.126000000", |
| 739 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 740 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 741 | "insertions": 126, |
| 742 | "deletions": 11, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 743 | "_number": 3965, |
| 744 | "owner": { |
| 745 | "_account_id": 1000096, |
| 746 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 747 | "email": "john.doe@example.com", |
| 748 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 749 | }, |
| 750 | "labels": { |
| 751 | "Verified": { |
| 752 | "all": [ |
| 753 | { |
| 754 | "value": 0, |
| 755 | "_account_id": 1000096, |
| 756 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 757 | "email": "john.doe@example.com", |
| 758 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 759 | }, |
| 760 | { |
| 761 | "value": 0, |
| 762 | "_account_id": 1000097, |
| 763 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 764 | "email": "jane.roe@example.com", |
| 765 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 766 | } |
| 767 | ], |
| 768 | "values": { |
| 769 | "-1": "Fails", |
| 770 | " 0": "No score", |
| 771 | "+1": "Verified" |
| 772 | } |
| 773 | }, |
| 774 | "Code-Review": { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 775 | "disliked": { |
| 776 | "_account_id": 1000096, |
| 777 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 778 | "email": "john.doe@example.com", |
| 779 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 780 | }, |
| 781 | "all": [ |
| 782 | { |
| 783 | "value": -1, |
| 784 | "_account_id": 1000096, |
| 785 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 786 | "email": "john.doe@example.com", |
| 787 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 788 | }, |
| 789 | { |
| 790 | "value": 1, |
| 791 | "_account_id": 1000097, |
| 792 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 793 | "email": "jane.roe@example.com", |
| 794 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 795 | } |
| 796 | ] |
| 797 | "values": { |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame] | 798 | "-2": "This shall not be merged", |
| 799 | "-1": "I would prefer this is not merged as is", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 800 | " 0": "No score", |
| 801 | "+1": "Looks good to me, but someone else must approve", |
| 802 | "+2": "Looks good to me, approved" |
| 803 | } |
| 804 | } |
| 805 | }, |
| 806 | "permitted_labels": { |
| 807 | "Verified": [ |
| 808 | "-1", |
| 809 | " 0", |
| 810 | "+1" |
| 811 | ], |
| 812 | "Code-Review": [ |
| 813 | "-2", |
| 814 | "-1", |
| 815 | " 0", |
| 816 | "+1", |
| 817 | "+2" |
| 818 | ] |
| 819 | }, |
| 820 | "removable_reviewers": [ |
| 821 | { |
| 822 | "_account_id": 1000096, |
| 823 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 824 | "email": "john.doe@example.com", |
| 825 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 826 | }, |
| 827 | { |
| 828 | "_account_id": 1000097, |
| 829 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 830 | "email": "jane.roe@example.com", |
| 831 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 832 | } |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 833 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 834 | "reviewers": { |
| 835 | "REVIEWER": [ |
| 836 | { |
| 837 | "_account_id": 1000096, |
| 838 | "name": "John Doe", |
| 839 | "email": "john.doe@example.com", |
| 840 | "username": "jdoe" |
| 841 | }, |
| 842 | { |
| 843 | "_account_id": 1000097, |
| 844 | "name": "Jane Roe", |
| 845 | "email": "jane.roe@example.com", |
| 846 | "username": "jroe" |
| 847 | } |
| 848 | ] |
| 849 | }, |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 850 | "reviewer_updates": [ |
| 851 | { |
| 852 | "state": "REVIEWER", |
| 853 | "reviewer": { |
| 854 | "_account_id": 1000096, |
| 855 | "name": "John Doe", |
| 856 | "email": "john.doe@example.com", |
| 857 | "username": "jdoe" |
| 858 | }, |
| 859 | "updated_by": { |
| 860 | "_account_id": 1000096, |
| 861 | "name": "John Doe", |
| 862 | "email": "john.doe@example.com", |
| 863 | "username": "jdoe" |
| 864 | }, |
| 865 | "updated": "2016-07-21 20:12:39.000000000" |
| 866 | }, |
| 867 | { |
| 868 | "state": "REMOVED", |
| 869 | "reviewer": { |
| 870 | "_account_id": 1000096, |
| 871 | "name": "John Doe", |
| 872 | "email": "john.doe@example.com", |
| 873 | "username": "jdoe" |
| 874 | }, |
| 875 | "updated_by": { |
| 876 | "_account_id": 1000096, |
| 877 | "name": "John Doe", |
| 878 | "email": "john.doe@example.com", |
| 879 | "username": "jdoe" |
| 880 | }, |
| 881 | "updated": "2016-07-21 20:12:33.000000000" |
| 882 | }, |
| 883 | { |
| 884 | "state": "CC", |
| 885 | "reviewer": { |
| 886 | "_account_id": 1000096, |
| 887 | "name": "John Doe", |
| 888 | "email": "john.doe@example.com", |
| 889 | "username": "jdoe" |
| 890 | }, |
| 891 | "updated_by": { |
| 892 | "_account_id": 1000096, |
| 893 | "name": "John Doe", |
| 894 | "email": "john.doe@example.com", |
| 895 | "username": "jdoe" |
| 896 | }, |
| 897 | "updated": "2016-03-23 21:34:02.419000000", |
| 898 | }, |
| 899 | ], |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 900 | "messages": [ |
| 901 | { |
| 902 | "id": "YH-egE", |
| 903 | "author": { |
| 904 | "_account_id": 1000096, |
| 905 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 906 | "email": "john.doe@example.com", |
| 907 | "username": "jdoe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 908 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 909 | "date": "2013-03-23 21:34:02.419000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 910 | "message": "Patch Set 1:\n\nThis is the first message.", |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 911 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 912 | }, |
| 913 | { |
| 914 | "id": "WEEdhU", |
| 915 | "author": { |
| 916 | "_account_id": 1000097, |
| 917 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 918 | "email": "jane.roe@example.com", |
| 919 | "username": "jroe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 920 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 921 | "date": "2013-03-23 21:36:52.332000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 922 | "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] | 923 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 924 | } |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 925 | ] |
| 926 | } |
| 927 | ---- |
| 928 | |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 929 | [[create-merge-patch-set-for-change]] |
| 930 | === Create Merge Patch Set For Change |
| 931 | -- |
| 932 | 'POST /changes/link:#change-id[\{change-id\}]/merge' |
| 933 | -- |
| 934 | |
| 935 | Update an existing change by using a |
| 936 | link:#merge-patch-set-input[MergePatchSetInput] entity. |
| 937 | |
| 938 | Gerrit will create a merge commit based on the information of |
| 939 | MergePatchSetInput and add a new patch set to the change corresponding |
| 940 | to the new merge commit. |
| 941 | |
| 942 | .Request |
| 943 | ---- |
| 944 | POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0 |
| 945 | Content-Type: application/json; charset=UTF-8 |
| 946 | |
| 947 | { |
| 948 | "subject": "Merge dev_branch into master", |
| 949 | "merge": { |
David Pursehouse | f4fb104 | 2018-03-18 23:03:46 +0900 | [diff] [blame] | 950 | "source": "refs/changes/34/1234/1" |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 951 | } |
| 952 | } |
| 953 | ---- |
| 954 | |
| 955 | As response a link:#change-info[ChangeInfo] entity with current revision is |
| 956 | returned that describes the resulting change. |
| 957 | |
| 958 | .Response |
| 959 | ---- |
| 960 | HTTP/1.1 200 OK |
| 961 | Content-Disposition: attachment |
| 962 | Content-Type: application/json; charset=UTF-8 |
| 963 | |
| 964 | )]}' |
| 965 | { |
| 966 | "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 967 | "project": "test", |
| 968 | "branch": "master", |
| 969 | "hashtags": [], |
| 970 | "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 971 | "subject": "Merge dev_branch into master", |
| 972 | "status": "NEW", |
| 973 | "created": "2016-09-23 18:08:53.238000000", |
| 974 | "updated": "2016-09-23 18:09:25.934000000", |
| 975 | "submit_type": "MERGE_IF_NECESSARY", |
| 976 | "mergeable": true, |
| 977 | "insertions": 5, |
| 978 | "deletions": 0, |
| 979 | "_number": 72, |
| 980 | "owner": { |
| 981 | "_account_id": 1000000 |
| 982 | }, |
| 983 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822" |
| 984 | } |
| 985 | ---- |
| 986 | |
| 987 | [[set-message]] |
| 988 | === Set Commit Message |
| 989 | -- |
| 990 | 'PUT /changes/link:#change-id[\{change-id\}]/message' |
| 991 | -- |
| 992 | |
| 993 | Creates a new patch set with a new commit message. |
| 994 | |
| 995 | 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] | 996 | link:#commit-message-input[CommitMessageInput] entity. If a Change-Id |
| 997 | footer is specified, it must match the current Change-Id footer. If |
| 998 | the Change-Id footer is absent, the current Change-Id is added to the |
| 999 | message. |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 1000 | |
| 1001 | .Request |
| 1002 | ---- |
| 1003 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0 |
| 1004 | Content-Type: application/json; charset=UTF-8 |
| 1005 | |
| 1006 | { |
| 1007 | "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n" |
| 1008 | } |
| 1009 | ---- |
| 1010 | |
| 1011 | .Notifications |
| 1012 | |
| 1013 | An email will be sent using the "newpatchset" template. |
| 1014 | |
| 1015 | [options="header",cols="1,1"] |
| 1016 | |============================= |
| 1017 | |WIP State |Default |
| 1018 | |Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers |
| 1019 | |Work in progress|owner |
| 1020 | |============================= |
| 1021 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1022 | [[get-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1023 | === Get Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1024 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1025 | 'GET /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1026 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1027 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1028 | Retrieves the topic of a change. |
| 1029 | |
| 1030 | .Request |
| 1031 | ---- |
| 1032 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 1033 | ---- |
| 1034 | |
| 1035 | .Response |
| 1036 | ---- |
| 1037 | HTTP/1.1 200 OK |
| 1038 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1039 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1040 | |
| 1041 | )]}' |
| 1042 | "Documentation" |
| 1043 | ---- |
| 1044 | |
| 1045 | If the change does not have a topic an empty string is returned. |
| 1046 | |
| 1047 | [[set-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1048 | === Set Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1049 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1050 | 'PUT /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1051 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1052 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1053 | Sets the topic of a change. |
| 1054 | |
| 1055 | The new topic must be provided in the request body inside a |
Patrick Hiesel | 4aa1456 | 2018-06-19 15:07:50 +0200 | [diff] [blame] | 1056 | link:#topic-input[TopicInput] entity. Any leading or trailing whitespace |
| 1057 | in the topic name will be removed. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1058 | |
| 1059 | .Request |
| 1060 | ---- |
| 1061 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1062 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1063 | |
| 1064 | { |
| 1065 | "topic": "Documentation" |
| 1066 | } |
| 1067 | ---- |
| 1068 | |
| 1069 | As response the new topic is returned. |
| 1070 | |
| 1071 | .Response |
| 1072 | ---- |
| 1073 | HTTP/1.1 200 OK |
| 1074 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1075 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1076 | |
| 1077 | )]}' |
| 1078 | "Documentation" |
| 1079 | ---- |
| 1080 | |
| 1081 | If the topic was deleted the response is "`204 No Content`". |
| 1082 | |
| 1083 | [[delete-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1084 | === Delete Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1085 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1086 | 'DELETE /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1087 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1088 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1089 | Deletes the topic of a change. |
| 1090 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1091 | .Request |
| 1092 | ---- |
| 1093 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 1094 | ---- |
| 1095 | |
| 1096 | .Response |
| 1097 | ---- |
| 1098 | HTTP/1.1 204 No Content |
| 1099 | ---- |
| 1100 | |
Sven Selberg | 273a4aa | 2016-09-21 16:28:10 +0200 | [diff] [blame] | 1101 | [[get-assignee]] |
| 1102 | === Get Assignee |
| 1103 | -- |
| 1104 | 'GET /changes/link:#change-id[\{change-id\}]/assignee' |
| 1105 | -- |
| 1106 | |
| 1107 | Retrieves the account of the user assigned to a change. |
| 1108 | |
| 1109 | .Request |
| 1110 | ---- |
| 1111 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0 |
| 1112 | ---- |
| 1113 | |
| 1114 | As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity |
| 1115 | describing the assigned account is returned. |
| 1116 | |
| 1117 | .Response |
| 1118 | ---- |
| 1119 | HTTP/1.1 200 OK |
| 1120 | Content-Disposition: attachment |
| 1121 | Content-Type: application/json; charset=UTF-8 |
| 1122 | |
| 1123 | )]}' |
| 1124 | { |
| 1125 | "_account_id": 1000096, |
| 1126 | "name": "John Doe", |
| 1127 | "email": "john.doe@example.com", |
| 1128 | "username": "jdoe" |
| 1129 | } |
| 1130 | ---- |
| 1131 | |
| 1132 | If the change has no assignee the response is "`204 No Content`". |
| 1133 | |
| 1134 | [[get-past-assignees]] |
| 1135 | === Get Past Assignees |
| 1136 | -- |
| 1137 | 'GET /changes/link:#change-id[\{change-id\}]/past_assignees' |
| 1138 | -- |
| 1139 | |
| 1140 | Returns a list of every user ever assigned to a change, in the order in which |
| 1141 | they were first assigned. |
| 1142 | |
| 1143 | .Request |
| 1144 | ---- |
| 1145 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/past_assignees HTTP/1.0 |
| 1146 | ---- |
| 1147 | |
| 1148 | As a response a list of link:rest-api-accounts.html#account-info[AccountInfo] |
| 1149 | entities is returned. |
| 1150 | |
| 1151 | .Response |
| 1152 | ---- |
| 1153 | HTTP/1.1 200 OK |
| 1154 | Content-Disposition: attachment |
| 1155 | Content-Type: application/json; charset=UTF-8 |
| 1156 | |
| 1157 | )]}' |
| 1158 | [ |
| 1159 | { |
| 1160 | "_account_id": 1000051, |
| 1161 | "name": "Jane Doe", |
| 1162 | "email": "jane.doe@example.com", |
| 1163 | "username": "janed" |
| 1164 | }, |
| 1165 | { |
| 1166 | "_account_id": 1000096, |
| 1167 | "name": "John Doe", |
| 1168 | "email": "john.doe@example.com", |
| 1169 | "username": "jdoe" |
| 1170 | } |
| 1171 | ] |
| 1172 | |
| 1173 | ---- |
| 1174 | |
| 1175 | |
| 1176 | [[set-assignee]] |
| 1177 | === Set Assignee |
| 1178 | -- |
| 1179 | 'PUT /changes/link:#change-id[\{change-id\}]/assignee' |
| 1180 | -- |
| 1181 | |
| 1182 | Sets the assignee of a change. |
| 1183 | |
| 1184 | The new assignee must be provided in the request body inside a |
| 1185 | link:#assignee-input[AssigneeInput] entity. |
| 1186 | |
| 1187 | .Request |
| 1188 | ---- |
| 1189 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0 |
| 1190 | Content-Type: application/json; charset=UTF-8 |
| 1191 | |
| 1192 | { |
| 1193 | "assignee": "jdoe" |
| 1194 | } |
| 1195 | ---- |
| 1196 | |
| 1197 | As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity |
| 1198 | describing the assigned account is returned. |
| 1199 | |
| 1200 | .Response |
| 1201 | ---- |
| 1202 | HTTP/1.1 200 OK |
| 1203 | Content-Disposition: attachment |
| 1204 | Content-Type: application/json; charset=UTF-8 |
| 1205 | |
| 1206 | )]}' |
| 1207 | { |
| 1208 | "_account_id": 1000096, |
| 1209 | "name": "John Doe", |
| 1210 | "email": "john.doe@example.com", |
| 1211 | "username": "jdoe" |
| 1212 | } |
| 1213 | ---- |
| 1214 | |
| 1215 | [[delete-assignee]] |
| 1216 | === Delete Assignee |
| 1217 | -- |
| 1218 | 'DELETE /changes/link:#change-id[\{change-id\}]/assignee' |
| 1219 | -- |
| 1220 | |
| 1221 | Deletes the assignee of a change. |
| 1222 | |
| 1223 | |
| 1224 | .Request |
| 1225 | ---- |
| 1226 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0 |
| 1227 | ---- |
| 1228 | |
| 1229 | As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity |
| 1230 | describing the account of the deleted assignee is returned. |
| 1231 | |
| 1232 | .Response |
| 1233 | ---- |
| 1234 | HTTP/1.1 200 OK |
| 1235 | Content-Disposition: attachment |
| 1236 | Content-Type: application/json; charset=UTF-8 |
| 1237 | |
| 1238 | )]}' |
| 1239 | { |
| 1240 | "_account_id": 1000096, |
| 1241 | "name": "John Doe", |
| 1242 | "email": "john.doe@example.com", |
| 1243 | "username": "jdoe" |
| 1244 | } |
| 1245 | ---- |
| 1246 | |
| 1247 | If the change had no assignee the response is "`204 No Content`". |
| 1248 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 1249 | [[get-pure-revert]] |
| 1250 | === Get Pure Revert |
| 1251 | -- |
| 1252 | 'GET /changes/link:#change-id[\{change-id\}]/pure_revert' |
| 1253 | -- |
| 1254 | |
| 1255 | Check if the given change is a pure revert of the change it references in `revertOf`. |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 1256 | Optionally, the query parameter `o` can be passed in to specify a commit (SHA-1 in |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 1257 | 40 digit hex representation) to check against. It takes precedence over `revertOf`. |
| 1258 | If the change has no reference in `revertOf`, the parameter is mandatory. |
| 1259 | |
| 1260 | As response a link:#pure-revert-info[PureRevertInfo] entity is returned. |
| 1261 | |
| 1262 | .Request |
| 1263 | ---- |
| 1264 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0 |
| 1265 | ---- |
| 1266 | |
| 1267 | .Response |
| 1268 | ---- |
| 1269 | HTTP/1.1 200 OK |
| 1270 | Content-Disposition: attachment |
| 1271 | Content-Type: application/json; charset=UTF-8 |
| 1272 | |
| 1273 | )]}' |
| 1274 | { |
| 1275 | "is_pure_revert" : false |
| 1276 | } |
| 1277 | ---- |
| 1278 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1279 | [[abandon-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1280 | === Abandon Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1281 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1282 | 'POST /changes/link:#change-id[\{change-id\}]/abandon' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1283 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1284 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1285 | Abandons a change. |
| 1286 | |
| 1287 | The request body does not need to include a link:#abandon-input[ |
| 1288 | AbandonInput] entity if no review comment is added. |
| 1289 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 1290 | Abandoning a change also removes all users from the link:#attention-set[attention set]. |
| 1291 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1292 | .Request |
| 1293 | ---- |
| 1294 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0 |
| 1295 | ---- |
| 1296 | |
| 1297 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1298 | describes the abandoned change. |
| 1299 | |
| 1300 | .Response |
| 1301 | ---- |
| 1302 | HTTP/1.1 200 OK |
| 1303 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1304 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1305 | |
| 1306 | )]}' |
| 1307 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1308 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1309 | "project": "myProject", |
| 1310 | "branch": "master", |
| 1311 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1312 | "subject": "Implementing Feature X", |
| 1313 | "status": "ABANDONED", |
| 1314 | "created": "2013-02-01 09:59:32.126000000", |
| 1315 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1316 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1317 | "insertions": 3, |
| 1318 | "deletions": 310, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1319 | "_number": 3965, |
| 1320 | "owner": { |
| 1321 | "name": "John Doe" |
| 1322 | } |
| 1323 | } |
| 1324 | ---- |
| 1325 | |
| 1326 | If the change cannot be abandoned because the change state doesn't |
| 1327 | allow abandoning of the change, the response is "`409 Conflict`" and |
| 1328 | the error message is contained in the response body. |
| 1329 | |
| 1330 | .Response |
| 1331 | ---- |
| 1332 | HTTP/1.1 409 Conflict |
| 1333 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1334 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1335 | |
| 1336 | change is merged |
| 1337 | ---- |
| 1338 | |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1339 | .Notifications |
| 1340 | |
| 1341 | An email will be sent using the "abandon" template. The notify handling is ALL. |
| 1342 | Notifications are suppressed on WIP changes that have never started review. |
| 1343 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1344 | [options="header",cols="1,2"] |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1345 | |============================= |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1346 | |WIP State |notify=ALL |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1347 | |Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1348 | |Work in progress|not sent |
| 1349 | |Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1350 | |============================= |
| 1351 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1352 | [[restore-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1353 | === Restore Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1354 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1355 | 'POST /changes/link:#change-id[\{change-id\}]/restore' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1356 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1357 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1358 | Restores a change. |
| 1359 | |
| 1360 | The request body does not need to include a link:#restore-input[ |
| 1361 | RestoreInput] entity if no review comment is added. |
| 1362 | |
| 1363 | .Request |
| 1364 | ---- |
| 1365 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0 |
| 1366 | ---- |
| 1367 | |
| 1368 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1369 | describes the restored change. |
| 1370 | |
| 1371 | .Response |
| 1372 | ---- |
| 1373 | HTTP/1.1 200 OK |
| 1374 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1375 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1376 | |
| 1377 | )]}' |
| 1378 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1379 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1380 | "project": "myProject", |
| 1381 | "branch": "master", |
| 1382 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1383 | "subject": "Implementing Feature X", |
| 1384 | "status": "NEW", |
| 1385 | "created": "2013-02-01 09:59:32.126000000", |
| 1386 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1387 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1388 | "insertions": 2, |
| 1389 | "deletions": 13, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1390 | "_number": 3965, |
| 1391 | "owner": { |
| 1392 | "name": "John Doe" |
| 1393 | } |
| 1394 | } |
| 1395 | ---- |
| 1396 | |
| 1397 | If the change cannot be restored because the change state doesn't |
| 1398 | allow restoring the change, the response is "`409 Conflict`" and |
| 1399 | the error message is contained in the response body. |
| 1400 | |
| 1401 | .Response |
| 1402 | ---- |
| 1403 | HTTP/1.1 409 Conflict |
| 1404 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1405 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1406 | |
| 1407 | change is new |
| 1408 | ---- |
| 1409 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1410 | [[rebase-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1411 | === Rebase Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1412 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1413 | 'POST /changes/link:#change-id[\{change-id\}]/rebase' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1414 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1415 | |
| 1416 | Rebases a change. |
| 1417 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1418 | Optionally, the parent revision can be changed to another patch set through the |
| 1419 | link:#rebase-input[RebaseInput] entity. |
| 1420 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1421 | .Request |
| 1422 | ---- |
| 1423 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1424 | Content-Type: application/json;charset=UTF-8 |
| 1425 | |
| 1426 | { |
| 1427 | "base" : "1234", |
| 1428 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1429 | ---- |
| 1430 | |
| 1431 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1432 | describes the rebased change. Information about the current patch set |
| 1433 | is included. |
| 1434 | |
| 1435 | .Response |
| 1436 | ---- |
| 1437 | HTTP/1.1 200 OK |
| 1438 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1439 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1440 | |
| 1441 | )]}' |
| 1442 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1443 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1444 | "project": "myProject", |
| 1445 | "branch": "master", |
| 1446 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1447 | "subject": "Implement Feature X", |
| 1448 | "status": "NEW", |
| 1449 | "created": "2013-02-01 09:59:32.126000000", |
| 1450 | "updated": "2013-02-21 11:16:36.775000000", |
| 1451 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1452 | "insertions": 33, |
| 1453 | "deletions": 9, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1454 | "_number": 4799, |
| 1455 | "owner": { |
| 1456 | "name": "John Doe" |
| 1457 | }, |
| 1458 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 1459 | "revisions": { |
| 1460 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1461 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1462 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 1463 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1464 | "fetch": { |
| 1465 | "http": { |
| 1466 | "url": "http://gerrit:8080/myProject", |
| 1467 | "ref": "refs/changes/99/4799/2" |
| 1468 | } |
| 1469 | }, |
| 1470 | "commit": { |
| 1471 | "parents": [ |
| 1472 | { |
| 1473 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 1474 | "subject": "Implement Feature A" |
| 1475 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 1476 | ], |
| 1477 | "author": { |
| 1478 | "name": "John Doe", |
| 1479 | "email": "john.doe@example.com", |
| 1480 | "date": "2013-05-07 15:21:27.000000000", |
| 1481 | "tz": 120 |
| 1482 | }, |
| 1483 | "committer": { |
| 1484 | "name": "Gerrit Code Review", |
| 1485 | "email": "gerrit-server@example.com", |
| 1486 | "date": "2013-05-07 15:35:43.000000000", |
| 1487 | "tz": 120 |
| 1488 | }, |
| 1489 | "subject": "Implement Feature X", |
| 1490 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1491 | } |
| 1492 | } |
| 1493 | } |
| 1494 | ---- |
| 1495 | |
| 1496 | If the change cannot be rebased, e.g. due to conflicts, the response is |
| 1497 | "`409 Conflict`" and the error message is contained in the response |
| 1498 | body. |
| 1499 | |
| 1500 | .Response |
| 1501 | ---- |
| 1502 | HTTP/1.1 409 Conflict |
| 1503 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1504 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1505 | |
| 1506 | The change could not be rebased due to a path conflict during merge. |
| 1507 | ---- |
| 1508 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1509 | [[move-change]] |
| 1510 | === Move Change |
| 1511 | -- |
| 1512 | 'POST /changes/link:#change-id[\{change-id\}]/move' |
| 1513 | -- |
| 1514 | |
| 1515 | Move a change. |
| 1516 | |
| 1517 | The destination branch must be provided in the request body inside a |
| 1518 | link:#move-input[MoveInput] entity. |
Marija Savtchouk | cee6a8f | 2020-12-03 12:58:04 +0000 | [diff] [blame] | 1519 | Only veto votes that are blocking the change from submission are moved to |
| 1520 | the destination branch by default. |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1521 | |
| 1522 | .Request |
| 1523 | ---- |
| 1524 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0 |
| 1525 | Content-Type: application/json; charset=UTF-8 |
| 1526 | |
| 1527 | { |
| 1528 | "destination_branch" : "release-branch" |
| 1529 | } |
| 1530 | |
| 1531 | ---- |
| 1532 | |
| 1533 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1534 | describes the moved change. |
| 1535 | |
| 1536 | .Response |
| 1537 | ---- |
| 1538 | HTTP/1.1 200 OK |
| 1539 | Content-Disposition: attachment |
| 1540 | Content-Type: application/json; charset=UTF-8 |
| 1541 | |
| 1542 | )]}' |
| 1543 | { |
| 1544 | "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1545 | "project": "myProject", |
| 1546 | "branch": "release-branch", |
| 1547 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1548 | "subject": "Implementing Feature X", |
| 1549 | "status": "NEW", |
| 1550 | "created": "2013-02-01 09:59:32.126000000", |
| 1551 | "updated": "2013-02-21 11:16:36.775000000", |
| 1552 | "mergeable": true, |
| 1553 | "insertions": 2, |
| 1554 | "deletions": 13, |
| 1555 | "_number": 3965, |
| 1556 | "owner": { |
| 1557 | "name": "John Doe" |
| 1558 | } |
| 1559 | } |
| 1560 | ---- |
| 1561 | |
Changcheng Xiao | 6dc9042 | 2017-08-09 10:21:58 +0200 | [diff] [blame] | 1562 | Note that this endpoint will not update the change's parents, which is |
| 1563 | different from the link:#cherry-pick[cherry-pick] endpoint. |
| 1564 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1565 | If the change cannot be moved because the change state doesn't |
| 1566 | allow moving the change, the response is "`409 Conflict`" and |
| 1567 | the error message is contained in the response body. |
| 1568 | |
| 1569 | .Response |
| 1570 | ---- |
| 1571 | HTTP/1.1 409 Conflict |
| 1572 | Content-Disposition: attachment |
| 1573 | Content-Type: text/plain; charset=UTF-8 |
| 1574 | |
| 1575 | change is merged |
| 1576 | ---- |
| 1577 | |
| 1578 | If the change cannot be moved because the user doesn't have |
| 1579 | abandon permission on the change or upload permission on the destination, |
| 1580 | the response is "`409 Conflict`" and the error message is contained in the |
| 1581 | response body. |
| 1582 | |
| 1583 | .Response |
| 1584 | ---- |
| 1585 | HTTP/1.1 409 Conflict |
| 1586 | Content-Disposition: attachment |
| 1587 | Content-Type: text/plain; charset=UTF-8 |
| 1588 | |
| 1589 | move not permitted |
| 1590 | ---- |
| 1591 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1592 | [[revert-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1593 | === Revert Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1594 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1595 | 'POST /changes/link:#change-id[\{change-id\}]/revert' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1596 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1597 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1598 | Reverts a change. |
| 1599 | |
Gal Paikin | 006d52b | 2019-12-19 11:22:09 +0100 | [diff] [blame] | 1600 | The subject of the newly created change will be |
| 1601 | 'Revert "<subject-of-reverted-change>"'. If the subject of the change reverted is |
| 1602 | above 63 characters, it will be cut down to 59 characters with "..." in the end. |
| 1603 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1604 | The request body does not need to include a link:#revert-input[ |
| 1605 | RevertInput] entity if no review comment is added. |
| 1606 | |
| 1607 | .Request |
| 1608 | ---- |
Michael Zhou | 1027049 | 2016-03-24 22:35:40 -0400 | [diff] [blame] | 1609 | POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1610 | ---- |
| 1611 | |
| 1612 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1613 | describes the reverting change. |
| 1614 | |
| 1615 | .Response |
| 1616 | ---- |
| 1617 | HTTP/1.1 200 OK |
| 1618 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1619 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1620 | |
| 1621 | )]}' |
| 1622 | { |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1623 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1624 | "project": "myProject", |
| 1625 | "branch": "master", |
| 1626 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1627 | "subject": "Revert \"Implementing Feature X\"", |
| 1628 | "status": "NEW", |
| 1629 | "created": "2013-02-01 09:59:32.126000000", |
| 1630 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1631 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1632 | "insertions": 6, |
| 1633 | "deletions": 4, |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1634 | "_number": 3965, |
| 1635 | "owner": { |
| 1636 | "name": "John Doe" |
| 1637 | } |
| 1638 | } |
| 1639 | ---- |
| 1640 | |
Gal Paikin | 6c9ed95 | 2020-01-22 10:36:35 +0100 | [diff] [blame] | 1641 | If the user doesn't have revert permission on the change or upload permission on |
| 1642 | the destination branch, the response is "`403 Forbidden`", and the error message is |
| 1643 | contained in the response body. |
| 1644 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1645 | If the change cannot be reverted because the change state doesn't |
Gal Paikin | 6c9ed95 | 2020-01-22 10:36:35 +0100 | [diff] [blame] | 1646 | allow reverting the change the response is "`409 Conflict`", and the error |
| 1647 | message is contained in the response body. |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1648 | |
| 1649 | .Response |
| 1650 | ---- |
| 1651 | HTTP/1.1 409 Conflict |
| 1652 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1653 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1654 | |
| 1655 | change is new |
| 1656 | ---- |
| 1657 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1658 | [[revert-submission]] |
| 1659 | === Revert Submission |
| 1660 | -- |
| 1661 | 'POST /changes/link:#change-id[\{change-id\}]/revert_submission' |
| 1662 | -- |
| 1663 | |
| 1664 | Creates open revert changes for all of the changes of a certain submission. |
| 1665 | |
Gal Paikin | 006d52b | 2019-12-19 11:22:09 +0100 | [diff] [blame] | 1666 | The subject of each revert change will be 'Revert "<subject-of-reverted-change"'. |
Gal Paikin | 100bf60 | 2019-12-23 14:50:41 +0100 | [diff] [blame] | 1667 | If the subject is above 60 characters, the subject will be cut to 56 characters |
| 1668 | with "..." in the end. However, whenever reverting the submission of a revert |
| 1669 | submission, the subject will be shortened from |
| 1670 | 'Revert "Revert "<subject-of-reverted-change""' to |
| 1671 | 'Revert^2 "<subject-of-reverted-change"'. Also, for every future revert submission, |
| 1672 | the only difference in the subject will be the number of the revert (instead of |
| 1673 | Revert^2 the subject will change to Revert^3 and so on). |
| 1674 | There are no guarantees about the subjects if the users change the default subjects. |
Gal Paikin | affd024 | 2019-12-18 18:10:08 +0100 | [diff] [blame] | 1675 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1676 | Details for the revert can be specified in the request body inside a link:#revert-input[ |
| 1677 | RevertInput] The topic of all created revert changes will be |
| 1678 | `revert-{submission_id}-{random_string_of_size_10}`. |
| 1679 | |
| 1680 | The changes will not be rebased on onto the destination branch so the users may still |
| 1681 | have to manually rebase them to resolve conflicts and make them submittable. |
| 1682 | |
Gal Paikin | 653a852 | 2019-11-25 11:40:10 +0100 | [diff] [blame] | 1683 | However, the changes that have the same project and branch will be rebased on top |
| 1684 | of each other. E.g, the first revert change will have the original change as a |
| 1685 | parent, and the second revert change will have the first revert change as a |
| 1686 | parent. |
| 1687 | |
| 1688 | There is one special case that involves merge commits; if a user has multiple |
| 1689 | changes in the same project and branch, but not in the same change series, those |
| 1690 | changes can still get submitted together if they have the same topic and |
| 1691 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] in |
| 1692 | gerrit.config is set to true. In the case, Gerrit may create merge commits on |
| 1693 | submit (depending on the link:config-project-config.html#submit-type[submit types] |
| 1694 | of the project). |
| 1695 | The first parent for the reverts will be the most recent merge commit that was |
| 1696 | created by Gerrit to merge the different change series into the target branch. |
| 1697 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1698 | .Request |
| 1699 | ---- |
| 1700 | POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0 |
| 1701 | ---- |
| 1702 | |
| 1703 | As response link:#revert-submission-info[RevertSubmissionInfo] entity |
| 1704 | is returned. That entity describes the revert changes. |
| 1705 | |
| 1706 | .Response |
| 1707 | ---- |
| 1708 | HTTP/1.1 200 OK |
| 1709 | Content-Disposition: attachment |
| 1710 | Content-Type: application/json; charset=UTF-8 |
| 1711 | |
| 1712 | )]}' |
| 1713 | "revert_changes": |
| 1714 | [ |
| 1715 | { |
| 1716 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1717 | "project": "myProject", |
| 1718 | "branch": "master", |
| 1719 | "topic": "revert--1571043962462-3640749-ABCEEZGHIJ", |
| 1720 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1721 | "subject": "Revert \"Implementing Feature X\"", |
| 1722 | "status": "NEW", |
| 1723 | "created": "2013-02-01 09:59:32.126000000", |
| 1724 | "updated": "2013-02-21 11:16:36.775000000", |
| 1725 | "mergeable": true, |
| 1726 | "insertions": 6, |
| 1727 | "deletions": 4, |
| 1728 | "_number": 3965, |
| 1729 | "owner": { |
| 1730 | "name": "John Doe" |
| 1731 | } |
| 1732 | }, |
| 1733 | { |
| 1734 | "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 1735 | "project": "anyProject", |
| 1736 | "branch": "master", |
| 1737 | "topic": "revert--1571043962462-3640749-ABCEEZGHIJ", |
| 1738 | "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 1739 | "subject": "Revert \"Implementing Feature Y\"", |
| 1740 | "status": "NEW", |
| 1741 | "created": "2013-02-04 09:59:33.126000000", |
| 1742 | "updated": "2013-02-21 11:16:37.775000000", |
| 1743 | "mergeable": true, |
| 1744 | "insertions": 62, |
| 1745 | "deletions": 11, |
| 1746 | "_number": 3966, |
| 1747 | "owner": { |
| 1748 | "name": "Jane Doe" |
| 1749 | } |
| 1750 | } |
| 1751 | ] |
| 1752 | ---- |
| 1753 | |
Gal Paikin | 6c9ed95 | 2020-01-22 10:36:35 +0100 | [diff] [blame] | 1754 | If the user doesn't have revert permission on the change or upload permission on |
| 1755 | the destination, the response is "`403 Forbidden`", and the error message is |
| 1756 | contained in the response body. |
| 1757 | |
| 1758 | If the change cannot be reverted because the change state doesn't |
| 1759 | allow reverting the change the response is "`409 Conflict`", and the error |
| 1760 | message is contained in the response body. |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1761 | |
| 1762 | .Response |
| 1763 | ---- |
| 1764 | HTTP/1.1 409 Conflict |
| 1765 | Content-Disposition: attachment |
| 1766 | Content-Type: text/plain; charset=UTF-8 |
| 1767 | |
| 1768 | change is new |
| 1769 | ---- |
| 1770 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1771 | [[submit-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1772 | === Submit Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1773 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1774 | 'POST /changes/link:#change-id[\{change-id\}]/submit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1775 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1776 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1777 | Submits a change. |
| 1778 | |
| 1779 | The request body only needs to include a link:#submit-input[ |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 1780 | SubmitInput] entity if submitting on behalf of another user. |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1781 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 1782 | Submitting a change also removes all users from the link:#attention-set[attention set]. |
| 1783 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1784 | .Request |
| 1785 | ---- |
| 1786 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1787 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1788 | |
| 1789 | { |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 1790 | "on_behalf_of": 1001439 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1791 | } |
| 1792 | ---- |
| 1793 | |
| 1794 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1795 | describes the submitted/merged change. |
| 1796 | |
Gal Paikin | e2849a8 | 2021-04-19 13:41:10 +0200 | [diff] [blame] | 1797 | Submission may submit multiple changes, but we still only return one ChangeInfo |
| 1798 | object. To query for all submitted changes, please use the submission_id that is |
| 1799 | part of the response. |
| 1800 | |
| 1801 | Changes that will also be submitted: |
| 1802 | 1. All changes of the same topic if |
| 1803 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 1804 | configuration is set to true. |
| 1805 | 2. All dependent changes. |
| 1806 | 3. The closure of the above (e.g if a dependent change has a topic, all changes |
| 1807 | of *that* topic will also be submitted). |
| 1808 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1809 | .Response |
| 1810 | ---- |
| 1811 | HTTP/1.1 200 OK |
| 1812 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1813 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1814 | |
| 1815 | )]}' |
| 1816 | { |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1817 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1818 | "project": "myProject", |
| 1819 | "branch": "master", |
| 1820 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1821 | "subject": "Implementing Feature X", |
| 1822 | "status": "MERGED", |
| 1823 | "created": "2013-02-01 09:59:32.126000000", |
| 1824 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 1825 | "submitted": "2013-02-21 11:16:36.615000000", |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1826 | "_number": 3965, |
| 1827 | "owner": { |
| 1828 | "name": "John Doe" |
| 1829 | } |
| 1830 | } |
| 1831 | ---- |
| 1832 | |
| 1833 | If the change cannot be submitted because the submit rule doesn't allow |
| 1834 | submitting the change, the response is "`409 Conflict`" and the error |
| 1835 | message is contained in the response body. |
| 1836 | |
| 1837 | .Response |
| 1838 | ---- |
| 1839 | HTTP/1.1 409 Conflict |
| 1840 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1841 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1842 | |
| 1843 | blocked by Verified |
| 1844 | ---- |
| 1845 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 1846 | [[submitted-together]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1847 | === Changes Submitted Together |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1848 | -- |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1849 | '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] | 1850 | -- |
| 1851 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1852 | Computes list of all changes which are submitted when |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1853 | link:#submit-change[Submit] is called for this change, |
Stefan Beller | 460f354 | 2015-07-20 14:10:41 -0700 | [diff] [blame] | 1854 | including the current change itself. |
| 1855 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1856 | The list consists of: |
| 1857 | |
| 1858 | * The given change. |
| 1859 | * If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 1860 | is enabled, include all open changes with the same topic. |
| 1861 | * For each change whose submit type is not CHERRY_PICK, include unmerged |
| 1862 | ancestors targeting the same branch. |
| 1863 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1864 | As a special case, the list is empty if this change would be |
| 1865 | submitted by itself (without other changes). |
| 1866 | |
| 1867 | .Request |
| 1868 | ---- |
| 1869 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0 |
| 1870 | Content-Type: application/json; charset=UTF-8 |
| 1871 | ---- |
| 1872 | |
| 1873 | As a response a link:#submitted-together-info[SubmittedTogetherInfo] |
| 1874 | entity is returned that describes what would happen if the change were |
| 1875 | submitted. This response contains a list of changes and a count of |
| 1876 | changes that are not visible to the caller that are part of the set of |
| 1877 | changes to be merged. |
| 1878 | |
| 1879 | The listed changes use the same format as in |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1880 | link:#list-changes[Query Changes] with the |
| 1881 | link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`], |
Patrick Hiesel | 6fbbdaa | 2018-04-05 15:10:13 +0200 | [diff] [blame] | 1882 | link:#current-revision[`CURRENT_REVISION`],and |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 1883 | link:#submittable[`SUBMITTABLE`] options set. |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1884 | |
Shawn Pearce | 8080c3d | 2016-09-19 19:15:04 -0700 | [diff] [blame] | 1885 | Standard link:#query-options[formatting options] can be specified |
| 1886 | with the `o` parameter, as well as the `submitted_together` specific |
| 1887 | option `NON_VISIBLE_CHANGES`. |
| 1888 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1889 | .Response |
| 1890 | ---- |
| 1891 | HTTP/1.1 200 OK |
| 1892 | Content-Disposition: attachment |
| 1893 | Content-Type: application/json; charset=UTF-8 |
| 1894 | |
| 1895 | )]}' |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1896 | { |
| 1897 | "changes": [ |
| 1898 | { |
| 1899 | "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 1900 | "project": "gerrit", |
| 1901 | "branch": "master", |
| 1902 | "hashtags": [], |
| 1903 | "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 1904 | "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes", |
| 1905 | "status": "NEW", |
| 1906 | "created": "2015-05-01 15:39:57.979000000", |
| 1907 | "updated": "2015-05-20 19:25:21.592000000", |
| 1908 | "mergeable": true, |
| 1909 | "insertions": 303, |
| 1910 | "deletions": 210, |
| 1911 | "_number": 1779, |
| 1912 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1913 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1914 | }, |
| 1915 | "labels": { |
| 1916 | "Code-Review": { |
| 1917 | "approved": { |
| 1918 | "_account_id": 1000000 |
| 1919 | }, |
| 1920 | "all": [ |
| 1921 | { |
| 1922 | "value": 2, |
| 1923 | "date": "2015-05-20 19:25:21.592000000", |
| 1924 | "_account_id": 1000000 |
| 1925 | } |
| 1926 | ], |
| 1927 | "values": { |
| 1928 | "-2": "This shall not be merged", |
| 1929 | "-1": "I would prefer this is not merged as is", |
| 1930 | " 0": "No score", |
| 1931 | "+1": "Looks good to me, but someone else must approve", |
| 1932 | "+2": "Looks good to me, approved" |
| 1933 | }, |
| 1934 | "default_value": 0 |
| 1935 | }, |
| 1936 | "Verified": { |
| 1937 | "approved": { |
| 1938 | "_account_id": 1000000 |
| 1939 | }, |
| 1940 | "all": [ |
| 1941 | { |
| 1942 | "value": 1, |
| 1943 | "date": "2015-05-20 19:25:21.592000000", |
| 1944 | "_account_id": 1000000 |
| 1945 | } |
| 1946 | ], |
| 1947 | "values": { |
| 1948 | "-1": "Fails", |
| 1949 | " 0": "No score", |
| 1950 | "+1": "Verified" |
| 1951 | }, |
| 1952 | "default_value": 0 |
| 1953 | } |
| 1954 | }, |
| 1955 | "permitted_labels": { |
| 1956 | "Code-Review": [ |
| 1957 | "-2", |
| 1958 | "-1", |
| 1959 | " 0", |
| 1960 | "+1", |
| 1961 | "+2" |
| 1962 | ], |
| 1963 | "Verified": [ |
| 1964 | "-1", |
| 1965 | " 0", |
| 1966 | "+1" |
| 1967 | ] |
| 1968 | }, |
| 1969 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 1970 | { |
| 1971 | "_account_id": 1000000 |
| 1972 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1973 | ], |
| 1974 | "reviewers": { |
| 1975 | "REVIEWER": [ |
| 1976 | { |
| 1977 | "_account_id": 1000000 |
| 1978 | } |
| 1979 | ] |
| 1980 | }, |
| 1981 | "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379", |
| 1982 | "revisions": { |
| 1983 | "9adb9f4c7b40eeee0646e235de818d09164d7379": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1984 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1985 | "_number": 1, |
| 1986 | "created": "2015-05-01 15:39:57.979000000", |
| 1987 | "uploader": { |
| 1988 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1989 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1990 | "ref": "refs/changes/79/1779/1", |
| 1991 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1992 | } |
| 1993 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1994 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1995 | { |
| 1996 | "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 1997 | "project": "gerrit", |
| 1998 | "branch": "master", |
| 1999 | "hashtags": [], |
| 2000 | "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 2001 | "subject": "AbstractSubmoduleSubscription: Split up createSubscription", |
| 2002 | "status": "NEW", |
| 2003 | "created": "2015-05-01 15:39:57.979000000", |
| 2004 | "updated": "2015-05-20 19:25:21.546000000", |
| 2005 | "mergeable": true, |
| 2006 | "insertions": 15, |
| 2007 | "deletions": 6, |
| 2008 | "_number": 1780, |
| 2009 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2010 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2011 | }, |
| 2012 | "labels": { |
| 2013 | "Code-Review": { |
| 2014 | "approved": { |
| 2015 | "_account_id": 1000000 |
| 2016 | }, |
| 2017 | "all": [ |
| 2018 | { |
| 2019 | "value": 2, |
| 2020 | "date": "2015-05-20 19:25:21.546000000", |
| 2021 | "_account_id": 1000000 |
| 2022 | } |
| 2023 | ], |
| 2024 | "values": { |
| 2025 | "-2": "This shall not be merged", |
| 2026 | "-1": "I would prefer this is not merged as is", |
| 2027 | " 0": "No score", |
| 2028 | "+1": "Looks good to me, but someone else must approve", |
| 2029 | "+2": "Looks good to me, approved" |
| 2030 | }, |
| 2031 | "default_value": 0 |
| 2032 | }, |
| 2033 | "Verified": { |
| 2034 | "approved": { |
| 2035 | "_account_id": 1000000 |
| 2036 | }, |
| 2037 | "all": [ |
| 2038 | { |
| 2039 | "value": 1, |
| 2040 | "date": "2015-05-20 19:25:21.546000000", |
| 2041 | "_account_id": 1000000 |
| 2042 | } |
| 2043 | ], |
| 2044 | "values": { |
| 2045 | "-1": "Fails", |
| 2046 | " 0": "No score", |
| 2047 | "+1": "Verified" |
| 2048 | }, |
| 2049 | "default_value": 0 |
| 2050 | } |
| 2051 | }, |
| 2052 | "permitted_labels": { |
| 2053 | "Code-Review": [ |
| 2054 | "-2", |
| 2055 | "-1", |
| 2056 | " 0", |
| 2057 | "+1", |
| 2058 | "+2" |
| 2059 | ], |
| 2060 | "Verified": [ |
| 2061 | "-1", |
| 2062 | " 0", |
| 2063 | "+1" |
| 2064 | ] |
| 2065 | }, |
| 2066 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 2067 | { |
| 2068 | "_account_id": 1000000 |
| 2069 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2070 | ], |
| 2071 | "reviewers": { |
| 2072 | "REVIEWER": [ |
| 2073 | { |
| 2074 | "_account_id": 1000000 |
| 2075 | } |
| 2076 | ] |
| 2077 | }, |
| 2078 | "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4", |
| 2079 | "revisions": { |
| 2080 | "1bd7c12a38854a2c6de426feec28800623f492c4": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 2081 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2082 | "_number": 1, |
| 2083 | "created": "2015-05-01 15:39:57.979000000", |
| 2084 | "uploader": { |
| 2085 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2086 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2087 | "ref": "refs/changes/80/1780/1", |
| 2088 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2089 | } |
| 2090 | } |
| 2091 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2092 | ], |
| 2093 | "non_visible_changes": 0 |
| 2094 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2095 | ---- |
| 2096 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2097 | If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then |
| 2098 | instead of a link:#submitted-together-info[SubmittedTogetherInfo] |
| 2099 | entity, the response is a list of changes, or a 403 response with a |
| 2100 | message if the set of changes to be submitted with this change |
| 2101 | includes changes the caller cannot read. |
| 2102 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2103 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 2104 | [[delete-change]] |
| 2105 | === Delete Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2106 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2107 | 'DELETE /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2108 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2109 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 2110 | Deletes a change. |
| 2111 | |
Paladox none | 580ae0e | 2017-02-12 18:15:48 +0000 | [diff] [blame] | 2112 | New or abandoned changes can be deleted by their owner if the user is granted |
| 2113 | the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission, |
| 2114 | otherwise only by administrators. |
| 2115 | |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2116 | .Request |
| 2117 | ---- |
| 2118 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2119 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2120 | ---- |
| 2121 | |
| 2122 | .Response |
| 2123 | ---- |
| 2124 | HTTP/1.1 204 No Content |
| 2125 | ---- |
| 2126 | |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2127 | [[get-included-in]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2128 | === Get Included In |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2129 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2130 | 'GET /changes/link:#change-id[\{change-id\}]/in' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2131 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2132 | |
| 2133 | Retrieves the branches and tags in which a change is included. As result |
| 2134 | an link:#included-in-info[IncludedInInfo] entity is returned. |
| 2135 | |
| 2136 | .Request |
| 2137 | ---- |
| 2138 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0 |
| 2139 | ---- |
| 2140 | |
| 2141 | .Response |
| 2142 | ---- |
| 2143 | HTTP/1.1 200 OK |
| 2144 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2145 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2146 | |
| 2147 | )]}' |
| 2148 | { |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2149 | "branches": [ |
| 2150 | "master" |
| 2151 | ], |
| 2152 | "tags": [] |
| 2153 | } |
| 2154 | ---- |
| 2155 | |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 2156 | [[index-change]] |
| 2157 | === Index Change |
| 2158 | -- |
| 2159 | 'POST /changes/link:#change-id[\{change-id\}]/index' |
| 2160 | -- |
| 2161 | |
| 2162 | Adds or updates the change in the secondary index. |
| 2163 | |
| 2164 | .Request |
| 2165 | ---- |
| 2166 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0 |
| 2167 | ---- |
| 2168 | |
| 2169 | .Response |
| 2170 | ---- |
| 2171 | HTTP/1.1 204 No Content |
| 2172 | ---- |
| 2173 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2174 | [[list-change-comments]] |
| 2175 | === List Change Comments |
| 2176 | -- |
| 2177 | 'GET /changes/link:#change-id[\{change-id\}]/comments' |
| 2178 | -- |
| 2179 | |
| 2180 | Lists the published comments of all revisions of the change. |
| 2181 | |
| 2182 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 2183 | entries. The entries in the map are sorted by file path, and the |
| 2184 | comments for each path are sorted by patch set number. Each comment has |
| 2185 | the `patch_set` and `author` fields set. |
| 2186 | |
Youssef Elghareeb | 68e87b6 | 2021-01-11 13:20:03 +0100 | [diff] [blame] | 2187 | If the `enable-context` request parameter is set to true, the comment entries |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 2188 | will contain a list of link:#context-line[ContextLine] containing the lines of |
| 2189 | the source file where the comment was written. |
| 2190 | |
Youssef Elghareeb | 87b7450 | 2021-02-05 18:53:05 +0100 | [diff] [blame] | 2191 | The `context-padding` request parameter can be used to specify an extra number |
| 2192 | of context lines to be added before and after the comment range. This parameter |
| 2193 | only works if `enable-context` is set to true. |
| 2194 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2195 | .Request |
| 2196 | ---- |
| 2197 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0 |
| 2198 | ---- |
| 2199 | |
| 2200 | .Response |
| 2201 | ---- |
| 2202 | HTTP/1.1 200 OK |
| 2203 | Content-Disposition: attachment |
| 2204 | Content-Type: application/json; charset=UTF-8 |
| 2205 | |
| 2206 | )]}' |
| 2207 | { |
| 2208 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2209 | { |
| 2210 | "patch_set": 1, |
| 2211 | "id": "TvcXrmjM", |
| 2212 | "line": 23, |
| 2213 | "message": "[nit] trailing whitespace", |
| 2214 | "updated": "2013-02-26 15:40:43.986000000" |
| 2215 | "author": { |
| 2216 | "_account_id": 1000096, |
| 2217 | "name": "John Doe", |
| 2218 | "email": "john.doe@example.com" |
| 2219 | } |
| 2220 | }, |
| 2221 | { |
| 2222 | "patch_set": 2, |
| 2223 | "id": "TveXwFiA", |
| 2224 | "line": 49, |
| 2225 | "in_reply_to": "TfYX-Iuo", |
| 2226 | "message": "Done", |
| 2227 | "updated": "2013-02-26 15:40:45.328000000" |
| 2228 | "author": { |
| 2229 | "_account_id": 1000097, |
| 2230 | "name": "Jane Roe", |
| 2231 | "email": "jane.roe@example.com" |
| 2232 | } |
| 2233 | } |
| 2234 | ] |
| 2235 | } |
| 2236 | ---- |
| 2237 | |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2238 | [[list-change-robot-comments]] |
| 2239 | === List Change Robot Comments |
| 2240 | -- |
| 2241 | 'GET /changes/link:#change-id[\{change-id\}]/robotcomments' |
| 2242 | -- |
| 2243 | |
| 2244 | Lists the robot comments of all revisions of the change. |
| 2245 | |
| 2246 | Return a map that maps the file path to a list of |
| 2247 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 2248 | map are sorted by file path. |
| 2249 | |
| 2250 | .Request |
| 2251 | ---- |
| 2252 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0 |
| 2253 | ---- |
| 2254 | |
| 2255 | .Response |
| 2256 | ---- |
| 2257 | HTTP/1.1 200 OK |
| 2258 | Content-Disposition: attachment |
| 2259 | Content-Type: application/json; charset=UTF-8 |
| 2260 | |
| 2261 | )]}' |
| 2262 | { |
| 2263 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2264 | { |
| 2265 | "id": "TvcXrmjM", |
| 2266 | "line": 23, |
| 2267 | "message": "unused import", |
| 2268 | "updated": "2016-02-26 15:40:43.986000000", |
| 2269 | "author": { |
| 2270 | "_account_id": 1000110, |
| 2271 | "name": "Code Analyzer", |
| 2272 | "email": "code.analyzer@example.com" |
| 2273 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 2274 | "robot_id": "importChecker", |
| 2275 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2276 | }, |
| 2277 | { |
| 2278 | "id": "TveXwFiA", |
| 2279 | "line": 49, |
| 2280 | "message": "wrong indention", |
| 2281 | "updated": "2016-02-26 15:40:45.328000000", |
| 2282 | "author": { |
| 2283 | "_account_id": 1000110, |
| 2284 | "name": "Code Analyzer", |
| 2285 | "email": "code.analyzer@example.com" |
| 2286 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 2287 | "robot_id": "styleChecker", |
| 2288 | "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2289 | } |
| 2290 | ] |
| 2291 | } |
| 2292 | ---- |
| 2293 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2294 | [[list-change-drafts]] |
| 2295 | === List Change Drafts |
| 2296 | -- |
| 2297 | 'GET /changes/link:#change-id[\{change-id\}]/drafts' |
| 2298 | -- |
| 2299 | |
| 2300 | Lists the draft comments of all revisions of the change that belong to |
| 2301 | the calling user. |
| 2302 | |
| 2303 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 2304 | entries. The entries in the map are sorted by file path, and the |
| 2305 | comments for each path are sorted by patch set number. Each comment has |
| 2306 | the `patch_set` field set, and no `author`. |
| 2307 | |
Youssef Elghareeb | 59580cb | 2021-03-17 15:02:49 +0100 | [diff] [blame] | 2308 | The `enable-context` and `context-padding` request parameters can be used to |
| 2309 | request comment context. See link:#list-change-comments[List Change Comments] |
| 2310 | for more details. |
| 2311 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2312 | .Request |
| 2313 | ---- |
| 2314 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0 |
| 2315 | ---- |
| 2316 | |
| 2317 | .Response |
| 2318 | ---- |
| 2319 | HTTP/1.1 200 OK |
| 2320 | Content-Disposition: attachment |
| 2321 | Content-Type: application/json; charset=UTF-8 |
| 2322 | |
| 2323 | )]}' |
| 2324 | { |
| 2325 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2326 | { |
| 2327 | "patch_set": 1, |
| 2328 | "id": "TvcXrmjM", |
| 2329 | "line": 23, |
| 2330 | "message": "[nit] trailing whitespace", |
| 2331 | "updated": "2013-02-26 15:40:43.986000000" |
| 2332 | }, |
| 2333 | { |
| 2334 | "patch_set": 2, |
| 2335 | "id": "TveXwFiA", |
| 2336 | "line": 49, |
| 2337 | "in_reply_to": "TfYX-Iuo", |
| 2338 | "message": "Done", |
| 2339 | "updated": "2013-02-26 15:40:45.328000000" |
| 2340 | } |
| 2341 | ] |
| 2342 | } |
| 2343 | ---- |
| 2344 | |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2345 | [[check-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2346 | === Check Change |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2347 | -- |
| 2348 | 'GET /changes/link:#change-id[\{change-id\}]/check' |
| 2349 | -- |
| 2350 | |
| 2351 | Performs consistency checks on the change, and returns a |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2352 | link:#change-info[ChangeInfo] entity with the `problems` field set to a |
| 2353 | list of link:#problem-info[ProblemInfo] entities. |
| 2354 | |
| 2355 | Depending on the type of problem, some fields not marked optional may be |
| 2356 | missing from the result. At least `id`, `project`, `branch`, and |
| 2357 | `_number` will be present. |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2358 | |
| 2359 | .Request |
| 2360 | ---- |
| 2361 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2362 | ---- |
| 2363 | |
| 2364 | .Response |
| 2365 | ---- |
| 2366 | HTTP/1.1 200 OK |
| 2367 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2368 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2369 | |
| 2370 | )]}' |
| 2371 | { |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2372 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2373 | "project": "myProject", |
| 2374 | "branch": "master", |
| 2375 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2376 | "subject": "Implementing Feature X", |
| 2377 | "status": "NEW", |
| 2378 | "created": "2013-02-01 09:59:32.126000000", |
| 2379 | "updated": "2013-02-21 11:16:36.775000000", |
| 2380 | "mergeable": true, |
| 2381 | "insertions": 34, |
| 2382 | "deletions": 101, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2383 | "_number": 3965, |
| 2384 | "owner": { |
| 2385 | "name": "John Doe" |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2386 | }, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2387 | "problems": [ |
| 2388 | { |
| 2389 | "message": "Current patch set 1 not found" |
| 2390 | } |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2391 | ] |
| 2392 | } |
| 2393 | ---- |
| 2394 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2395 | [[fix-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2396 | === Fix Change |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2397 | -- |
| 2398 | 'POST /changes/link:#change-id[\{change-id\}]/check' |
| 2399 | -- |
| 2400 | |
| 2401 | Performs consistency checks on the change as with link:#check-change[GET |
| 2402 | /check], and additionally fixes any problems that can be fixed |
| 2403 | automatically. The returned field values reflect any fixes. |
| 2404 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 2405 | Some fixes have options controlling their behavior, which can be set in the |
| 2406 | link:#fix-input[FixInput] entity body. |
| 2407 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2408 | Only the change owner, a project owner, or an administrator may fix changes. |
| 2409 | |
| 2410 | .Request |
| 2411 | ---- |
| 2412 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2413 | ---- |
| 2414 | |
| 2415 | .Response |
| 2416 | ---- |
| 2417 | HTTP/1.1 200 OK |
| 2418 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2419 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2420 | |
| 2421 | )]}' |
| 2422 | { |
| 2423 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2424 | "project": "myProject", |
| 2425 | "branch": "master", |
| 2426 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2427 | "subject": "Implementing Feature X", |
| 2428 | "status": "MERGED", |
| 2429 | "created": "2013-02-01 09:59:32.126000000", |
| 2430 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 2431 | "submitted": "2013-02-21 11:16:36.615000000", |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2432 | "mergeable": true, |
| 2433 | "insertions": 34, |
| 2434 | "deletions": 101, |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2435 | "_number": 3965, |
| 2436 | "owner": { |
| 2437 | "name": "John Doe" |
| 2438 | }, |
| 2439 | "problems": [ |
| 2440 | { |
| 2441 | "message": "Current patch set 2 not found" |
| 2442 | }, |
| 2443 | { |
| 2444 | "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW", |
| 2445 | "status": FIXED, |
| 2446 | "outcome": "Marked change as merged" |
| 2447 | } |
| 2448 | ] |
| 2449 | } |
| 2450 | ---- |
| 2451 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2452 | [[set-work-in-pogress]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2453 | === Set Work-In-Progress |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2454 | -- |
| 2455 | 'POST /changes/link:#change-id[\{change-id\}]/wip' |
| 2456 | -- |
| 2457 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2458 | Marks the change as not ready for review yet. Changes may only be marked not |
| 2459 | ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2460 | |
| 2461 | The request body does not need to include a |
| 2462 | link:#work-in-progress-input[WorkInProgressInput] entity if no review comment |
| 2463 | is added. Actions that create a new patch set in a WIP change default to |
| 2464 | notifying *OWNER* instead of *ALL*. |
| 2465 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 2466 | Marking a change work in progress also removes all users from the |
| 2467 | link:#attention-set[attention set]. |
| 2468 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2469 | .Request |
| 2470 | ---- |
| 2471 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0 |
| 2472 | Content-Type: application/json; charset=UTF-8 |
| 2473 | |
| 2474 | { |
| 2475 | "message": "Refactoring needs to be done before we can proceed here." |
| 2476 | } |
| 2477 | ---- |
| 2478 | |
| 2479 | .Response |
| 2480 | ---- |
| 2481 | HTTP/1.1 200 OK |
| 2482 | ---- |
| 2483 | |
| 2484 | [[set-ready-for-review]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2485 | === Set Ready-For-Review |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2486 | -- |
| 2487 | 'POST /changes/link:#change-id[\{change-id\}]/ready' |
| 2488 | -- |
| 2489 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2490 | Marks the change as ready for review (set WIP property to false). Changes may |
| 2491 | only be marked ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2492 | |
| 2493 | Activates notifications of reviewer. The request body does not need |
| 2494 | to include a link:#work-in-progress-input[WorkInProgressInput] entity |
| 2495 | if no review comment is added. |
| 2496 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 2497 | Marking a change ready for review also adds all of the reviewers of the change |
| 2498 | to the link:#attention-set[attention set]. |
| 2499 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2500 | .Request |
| 2501 | ---- |
| 2502 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0 |
| 2503 | Content-Type: application/json;charset=UTF-8 |
| 2504 | |
| 2505 | { |
| 2506 | "message": "Refactoring is done." |
| 2507 | } |
| 2508 | |
| 2509 | ---- |
| 2510 | |
| 2511 | .Response |
| 2512 | ---- |
| 2513 | HTTP/1.1 200 OK |
| 2514 | ---- |
| 2515 | |
David Pursehouse | 7c5c3a5 | 2017-04-10 11:37:23 +0900 | [diff] [blame] | 2516 | [[mark-private]] |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2517 | === Mark Private |
| 2518 | -- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2519 | 'POST /changes/link:#change-id[\{change-id\}]/private' |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2520 | -- |
| 2521 | |
Patrick Hiesel | 707e61a | 2019-02-13 18:28:48 +0100 | [diff] [blame] | 2522 | Marks the change to be private. Only open changes can be marked private. |
| 2523 | Changes may only be marked private by the owner or site administrators. |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2524 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2525 | A message can be specified in the request body inside a |
| 2526 | link:#private-input[PrivateInput] entity. |
| 2527 | |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2528 | .Request |
| 2529 | ---- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2530 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2531 | Content-Type: application/json; charset=UTF-8 |
| 2532 | |
| 2533 | { |
| 2534 | "message": "After this security fix has been released we can make it public now." |
| 2535 | } |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2536 | ---- |
| 2537 | |
| 2538 | .Response |
| 2539 | ---- |
| 2540 | HTTP/1.1 201 Created |
| 2541 | ---- |
| 2542 | |
| 2543 | If the change was already private the response is "`200 OK`". |
| 2544 | |
| 2545 | [[unmark-private]] |
| 2546 | === Unmark Private |
| 2547 | -- |
| 2548 | 'DELETE /changes/link:#change-id[\{change-id\}]/private' |
| 2549 | -- |
| 2550 | |
| 2551 | Marks the change to be non-private. Note users can only unmark own private |
| 2552 | changes. |
| 2553 | |
| 2554 | .Request |
| 2555 | ---- |
| 2556 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2557 | ---- |
| 2558 | |
| 2559 | .Response |
| 2560 | ---- |
| 2561 | HTTP/1.1 204 No Content |
| 2562 | ---- |
| 2563 | |
| 2564 | If the change was already not private, the response is "`409 Conflict`". |
| 2565 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 2566 | A message can be specified in the request body inside a |
| 2567 | link:#private-input[PrivateInput] entity. Historically, this method allowed |
| 2568 | a body in the DELETE, but that behavior is |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 2569 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank]. |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 2570 | In this case, use a POST request instead: |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2571 | |
| 2572 | .Request |
| 2573 | ---- |
| 2574 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0 |
| 2575 | Content-Type: application/json; charset=UTF-8 |
| 2576 | |
| 2577 | { |
| 2578 | "message": "This is a security fix that must not be public." |
| 2579 | } |
| 2580 | ---- |
| 2581 | |
David Pursehouse | d656fa8 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 2582 | [[ignore]] |
| 2583 | === Ignore |
| 2584 | -- |
| 2585 | 'PUT /changes/link:#change-id[\{change-id\}]/ignore' |
| 2586 | -- |
| 2587 | |
| 2588 | 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] | 2589 | reviews dashboard, and email notifications will be suppressed. Ignoring |
| 2590 | a change does not cause the change's "updated" timestamp to be modified, |
| 2591 | and the owner is not notified. |
David Pursehouse | d656fa8 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 2592 | |
| 2593 | .Request |
| 2594 | ---- |
| 2595 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ignore HTTP/1.0 |
| 2596 | ---- |
| 2597 | |
| 2598 | [[unignore]] |
| 2599 | === Unignore |
| 2600 | -- |
| 2601 | 'PUT /changes/link:#change-id[\{change-id\}]/unignore' |
| 2602 | -- |
| 2603 | |
| 2604 | Un-marks a change as ignored. |
| 2605 | |
| 2606 | .Request |
| 2607 | ---- |
| 2608 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unignore HTTP/1.0 |
| 2609 | ---- |
| 2610 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2611 | [[get-hashtags]] |
| 2612 | === Get Hashtags |
| 2613 | -- |
| 2614 | 'GET /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2615 | -- |
| 2616 | |
| 2617 | Gets the hashtags associated with a change. |
| 2618 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2619 | .Request |
| 2620 | ---- |
| 2621 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2622 | ---- |
| 2623 | |
| 2624 | As response the change's hashtags are returned as a list of strings. |
| 2625 | |
| 2626 | .Response |
| 2627 | ---- |
| 2628 | HTTP/1.1 200 OK |
| 2629 | Content-Disposition: attachment |
| 2630 | Content-Type: application/json; charset=UTF-8 |
| 2631 | |
| 2632 | )]}' |
| 2633 | [ |
| 2634 | "hashtag1", |
| 2635 | "hashtag2" |
| 2636 | ] |
| 2637 | ---- |
| 2638 | |
| 2639 | [[set-hashtags]] |
| 2640 | === Set Hashtags |
| 2641 | -- |
| 2642 | 'POST /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2643 | -- |
| 2644 | |
| 2645 | Adds and/or removes hashtags from a change. |
| 2646 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2647 | The hashtags to add or remove must be provided in the request body inside a |
| 2648 | link:#hashtags-input[HashtagsInput] entity. |
| 2649 | |
| 2650 | .Request |
| 2651 | ---- |
| 2652 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2653 | Content-Type: application/json; charset=UTF-8 |
| 2654 | |
| 2655 | { |
| 2656 | "add" : [ |
| 2657 | "hashtag3" |
| 2658 | ], |
| 2659 | "remove" : [ |
| 2660 | "hashtag2" |
| 2661 | ] |
| 2662 | } |
| 2663 | ---- |
| 2664 | |
| 2665 | As response the change's hashtags are returned as a list of strings. |
| 2666 | |
| 2667 | .Response |
| 2668 | ---- |
| 2669 | HTTP/1.1 200 OK |
| 2670 | Content-Disposition: attachment |
| 2671 | Content-Type: application/json; charset=UTF-8 |
| 2672 | |
| 2673 | )]}' |
| 2674 | [ |
| 2675 | "hashtag1", |
| 2676 | "hashtag3" |
| 2677 | ] |
| 2678 | ---- |
| 2679 | |
Changcheng Xiao | 7fb7329 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2680 | [[list-change-messages]] |
| 2681 | === List Change Messages |
| 2682 | -- |
| 2683 | 'GET /changes/link:#change-id[\{change-id\}]/messages' |
| 2684 | -- |
| 2685 | |
| 2686 | Lists all the messages of a change including link:#detailed-accounts[detailed account information]. |
| 2687 | |
| 2688 | .Request |
| 2689 | ---- |
| 2690 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages |
| 2691 | ---- |
| 2692 | |
| 2693 | As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned. |
| 2694 | |
| 2695 | .Response |
| 2696 | ---- |
| 2697 | HTTP/1.1 200 OK |
| 2698 | Content-Disposition: attachment |
| 2699 | Content-Type: application/json; charset=UTF-8 |
| 2700 | |
| 2701 | )]}' |
| 2702 | [ |
| 2703 | { |
| 2704 | "id": "YH-egE", |
| 2705 | "author": { |
| 2706 | "_account_id": 1000096, |
| 2707 | "name": "John Doe", |
| 2708 | "email": "john.doe@example.com", |
| 2709 | "username": "jdoe" |
| 2710 | }, |
| 2711 | "date": "2013-03-23 21:34:02.419000000", |
| 2712 | "message": "Patch Set 1:\n\nThis is the first message.", |
| 2713 | "_revision_number": 1 |
| 2714 | }, |
| 2715 | { |
| 2716 | "id": "WEEdhU", |
| 2717 | "author": { |
| 2718 | "_account_id": 1000097, |
| 2719 | "name": "Jane Roe", |
| 2720 | "email": "jane.roe@example.com", |
| 2721 | "username": "jroe" |
| 2722 | }, |
| 2723 | "date": "2013-03-23 21:36:52.332000000", |
| 2724 | "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.", |
| 2725 | "_revision_number": 1 |
| 2726 | } |
| 2727 | ] |
| 2728 | ---- |
David Pursehouse | c32050d | 2017-08-25 16:27:47 +0900 | [diff] [blame] | 2729 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 2730 | [[get-change-message]] |
| 2731 | === Get Change Message |
| 2732 | |
| 2733 | Retrieves a change message including link:#detailed-accounts[detailed account information]. |
| 2734 | |
| 2735 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2736 | '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] | 2737 | -- |
| 2738 | |
| 2739 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned. |
| 2740 | |
| 2741 | .Response |
| 2742 | ---- |
| 2743 | HTTP/1.1 200 OK |
| 2744 | Content-Disposition: attachment |
| 2745 | Content-Type: application/json; charset=UTF-8 |
| 2746 | |
| 2747 | )]}' |
| 2748 | { |
| 2749 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 2750 | "author": { |
| 2751 | "_account_id": 1000096, |
| 2752 | "name": "John Doe", |
| 2753 | "email": "john.doe@example.com", |
| 2754 | "username": "jdoe" |
| 2755 | }, |
| 2756 | "date": "2013-03-23 21:34:02.419000000", |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2757 | "message": "a change message", |
| 2758 | "_revision_number": 1 |
| 2759 | } |
| 2760 | ---- |
| 2761 | |
| 2762 | [[delete-change-message]] |
| 2763 | === Delete Change Message |
| 2764 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2765 | 'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' + |
| 2766 | '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] | 2767 | -- |
| 2768 | |
| 2769 | Deletes a change message by replacing the change message with a new message, |
| 2770 | which contains the name of the user who deleted the change message and the |
| 2771 | reason why it was deleted. The reason can be provided in the request body as a |
| 2772 | link:#delete-change-message-input[DeleteChangeMessageInput] entity. |
| 2773 | |
| 2774 | Note that only users with the |
| 2775 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 2776 | global capability are permitted to delete a change message. |
| 2777 | |
| 2778 | To delete a change message, send a DELETE request: |
| 2779 | |
| 2780 | .Request |
| 2781 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2782 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2783 | ---- |
| 2784 | |
| 2785 | To provide a reason for the deletion, use a POST request: |
| 2786 | |
| 2787 | .Request |
| 2788 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2789 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2790 | Content-Type: application/json; charset=UTF-8 |
| 2791 | |
| 2792 | { |
| 2793 | "reason": "spam" |
| 2794 | } |
| 2795 | ---- |
| 2796 | |
| 2797 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned that |
| 2798 | describes the updated change message. |
| 2799 | |
| 2800 | .Response |
| 2801 | ---- |
| 2802 | HTTP/1.1 200 OK |
| 2803 | Content-Disposition: attachment |
| 2804 | Content-Type: application/json; charset=UTF-8 |
| 2805 | |
| 2806 | )]}' |
| 2807 | { |
| 2808 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 2809 | "author": { |
| 2810 | "_account_id": 1000096, |
| 2811 | "name": "John Doe", |
| 2812 | "email": "john.doe@example.com", |
| 2813 | "username": "jdoe" |
| 2814 | }, |
| 2815 | "date": "2013-03-23 21:34:02.419000000", |
| 2816 | "message": "Change message removed by: Administrator\nReason: spam", |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 2817 | "_revision_number": 1 |
| 2818 | } |
| 2819 | ---- |
Gustaf Lundh | e8647c6 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 2820 | |
Youssef Elghareeb | d598693 | 2021-10-15 11:45:23 +0200 | [diff] [blame] | 2821 | [[check-submit-requirement]] |
| 2822 | === Check Submit Requirement |
| 2823 | -- |
| 2824 | 'POST /changes/link:#change-id[\{change-id\}]/check.submit_requirement' |
| 2825 | -- |
| 2826 | |
| 2827 | Tests a submit requirement and returns the result as a |
| 2828 | link:#submit-requirement-result-info[SubmitRequirementResultInfo]. The request |
| 2829 | body must contain a link:#submit-requirement-input[SubmitRequirementInput]. |
| 2830 | |
| 2831 | Note that this endpoint does not modify the change resource. |
| 2832 | |
| 2833 | .Request |
| 2834 | ---- |
| 2835 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check.submit_requirement HTTP/1.0 |
| 2836 | Content-Type: application/json; charset=UTF-8 |
| 2837 | |
| 2838 | { |
| 2839 | "name": "Code-Review", |
| 2840 | "submittability_expression": "label:Code-Review=+2" |
| 2841 | } |
| 2842 | ---- |
| 2843 | |
| 2844 | As response a link:#submit-requirement-result-info[SubmitRequirementResultInfo] |
| 2845 | entity is returned that describes the submit requirement result. |
| 2846 | |
| 2847 | .Response |
| 2848 | ---- |
| 2849 | HTTP/1.1 200 OK |
| 2850 | Content-Disposition: attachment |
| 2851 | Content-Type: application/json; charset=UTF-8 |
| 2852 | |
| 2853 | )]}' |
| 2854 | { |
| 2855 | "name": "Code-Review", |
| 2856 | "status": "SATISFIED", |
| 2857 | "submittability_expression_result": { |
| 2858 | "expression": "label:Code-Review=+2", |
| 2859 | "fulfilled": true, |
| 2860 | "passingAtoms": [ |
| 2861 | "label:Code-Review=+2" |
| 2862 | ] |
| 2863 | }, |
| 2864 | "is_legacy": false |
| 2865 | } |
| 2866 | ---- |
| 2867 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2868 | [[edit-endpoints]] |
| 2869 | == Change Edit Endpoints |
| 2870 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2871 | [[get-edit-detail]] |
| 2872 | === Get Change Edit Details |
| 2873 | -- |
| 2874 | 'GET /changes/link:#change-id[\{change-id\}]/edit |
| 2875 | -- |
| 2876 | |
| 2877 | Retrieves a change edit details. |
| 2878 | |
| 2879 | .Request |
| 2880 | ---- |
| 2881 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 2882 | ---- |
| 2883 | |
| 2884 | As response an link:#edit-info[EditInfo] entity is returned that |
| 2885 | describes the change edit, or "`204 No Content`" when change edit doesn't |
| 2886 | exist for this change. Change edits are stored on special branches and there |
| 2887 | 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] | 2888 | When request parameter `list` is provided the response also includes the file |
| 2889 | list. When `base` request parameter is provided the file list is computed |
David Ostrovsky | 5562fe5 | 2014-08-12 22:36:27 +0200 | [diff] [blame] | 2890 | against this base revision. When request parameter `download-commands` is |
| 2891 | provided fetch info map is also included. |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2892 | |
| 2893 | .Response |
| 2894 | ---- |
| 2895 | HTTP/1.1 200 OK |
| 2896 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2897 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2898 | |
| 2899 | )]}' |
| 2900 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2901 | "commit": { |
| 2902 | "parents": [ |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2903 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2904 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2905 | } |
| 2906 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2907 | "author": { |
| 2908 | "name": "Shawn O. Pearce", |
| 2909 | "email": "sop@google.com", |
| 2910 | "date": "2012-04-24 18:08:08.000000000", |
| 2911 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2912 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2913 | "committer": { |
| 2914 | "name": "Shawn O. Pearce", |
| 2915 | "email": "sop@google.com", |
| 2916 | "date": "2012-04-24 18:08:08.000000000", |
| 2917 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2918 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2919 | "subject": "Use an EventBus to manage star icons", |
| 2920 | "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] | 2921 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 2922 | "base_patch_set_number": 1, |
| 2923 | "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3", |
| 2924 | "ref": "refs/users/01/1000001/edit-76482/1" |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 2925 | } |
| 2926 | ---- |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 2927 | |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 2928 | [[put-edit-file]] |
| 2929 | === Change file content in Change Edit |
| 2930 | -- |
| 2931 | 'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile |
| 2932 | -- |
| 2933 | |
| 2934 | Put content of a file to a change edit. |
| 2935 | |
| 2936 | .Request |
| 2937 | ---- |
| 2938 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 2939 | ---- |
| 2940 | |
Paladox none | 28920b4 | 2020-02-22 19:28:21 +0000 | [diff] [blame] | 2941 | To upload a file as binary data in the request body: |
| 2942 | |
| 2943 | .Request |
| 2944 | ---- |
| 2945 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 2946 | Content-Type: application/json; charset=UTF-8 |
| 2947 | |
| 2948 | { |
| 2949 | "binary_content": "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==" |
| 2950 | } |
| 2951 | ---- |
| 2952 | |
| 2953 | Note that it must be base-64 encoded data uri. |
| 2954 | |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 2955 | When change edit doesn't exist for this change yet it is created. When file |
| 2956 | content isn't provided, it is wiped out for that file. As response |
| 2957 | "`204 No Content`" is returned. |
| 2958 | |
| 2959 | .Response |
| 2960 | ---- |
| 2961 | HTTP/1.1 204 No Content |
| 2962 | ---- |
| 2963 | |
Gal Paikin | 68d217b | 2019-10-07 21:01:22 +0200 | [diff] [blame] | 2964 | When the change edit is a no-op, for example when providing the same file |
| 2965 | content that the file already has, '409 no changes were made' is returned. |
| 2966 | |
| 2967 | .Response |
| 2968 | ---- |
| 2969 | HTTP/1.1 409 no changes were made |
| 2970 | ---- |
| 2971 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2972 | [[post-edit]] |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2973 | === Restore file content or rename files in Change Edit |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2974 | -- |
| 2975 | 'POST /changes/link:#change-id[\{change-id\}]/edit |
| 2976 | -- |
| 2977 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2978 | Creates empty change edit, restores file content or renames files in change |
| 2979 | edit. The request body needs to include a |
| 2980 | link:#change-edit-input[ChangeEditInput] entity when a file within change |
| 2981 | 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] | 2982 | |
| 2983 | .Request |
| 2984 | ---- |
| 2985 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2986 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2987 | |
| 2988 | { |
David Ostrovsky | bd12e17 | 2014-08-21 23:08:15 +0200 | [diff] [blame] | 2989 | "restore_path": "foo" |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 2990 | } |
| 2991 | ---- |
| 2992 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 2993 | or for rename: |
| 2994 | |
| 2995 | .Request |
| 2996 | ---- |
| 2997 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 2998 | Content-Type: application/json; charset=UTF-8 |
| 2999 | |
| 3000 | { |
| 3001 | "old_path": "foo", |
| 3002 | "new_path": "bar" |
| 3003 | } |
| 3004 | ---- |
| 3005 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3006 | 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] | 3007 | and restore flag are provided in request body, this file is restored. When |
| 3008 | old and new file names are provided, the file is renamed. As response |
| 3009 | "`204 No Content`" is returned. |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3010 | |
| 3011 | .Response |
| 3012 | ---- |
| 3013 | HTTP/1.1 204 No Content |
| 3014 | ---- |
| 3015 | |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 3016 | [[put-change-edit-message]] |
| 3017 | === Change commit message in Change Edit |
| 3018 | -- |
| 3019 | 'PUT /changes/link:#change-id[\{change-id\}]/edit:message |
| 3020 | -- |
| 3021 | |
| 3022 | Modify commit message. The request body needs to include a |
| 3023 | link:#change-edit-message-input[ChangeEditMessageInput] |
| 3024 | entity. |
| 3025 | |
| 3026 | .Request |
| 3027 | ---- |
| 3028 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3029 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 3030 | |
| 3031 | { |
| 3032 | "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444" |
| 3033 | } |
| 3034 | ---- |
| 3035 | |
| 3036 | If a change edit doesn't exist for this change yet, it is created. As |
| 3037 | response "`204 No Content`" is returned. |
| 3038 | |
| 3039 | .Response |
| 3040 | ---- |
| 3041 | HTTP/1.1 204 No Content |
| 3042 | ---- |
| 3043 | |
David Ostrovsky | 2830c29 | 2014-08-01 02:24:31 +0200 | [diff] [blame] | 3044 | [[delete-edit-file]] |
| 3045 | === Delete file in Change Edit |
| 3046 | -- |
| 3047 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile' |
| 3048 | -- |
| 3049 | |
| 3050 | Deletes a file from a change edit. This deletes the file from the repository |
| 3051 | completely. This is not the same as reverting or restoring a file to its |
| 3052 | previous contents. |
| 3053 | |
| 3054 | .Request |
| 3055 | ---- |
| 3056 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3057 | ---- |
| 3058 | |
| 3059 | When change edit doesn't exist for this change yet it is created. |
| 3060 | |
| 3061 | .Response |
| 3062 | ---- |
| 3063 | HTTP/1.1 204 No Content |
| 3064 | ---- |
| 3065 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3066 | [[get-edit-file]] |
| 3067 | === Retrieve file content from Change Edit |
| 3068 | -- |
| 3069 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile |
| 3070 | -- |
| 3071 | |
| 3072 | Retrieves content of a file from a change edit. |
| 3073 | |
| 3074 | .Request |
| 3075 | ---- |
| 3076 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3077 | ---- |
| 3078 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 3079 | The content of the file is returned as text encoded inside base64. |
| 3080 | The Content-Type header will always be `text/plain` reflecting the |
| 3081 | outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header |
| 3082 | can be examined to find the server detected content type of the file. |
| 3083 | |
| 3084 | When the specified file was deleted in the change edit |
| 3085 | "`204 No Content`" is returned. |
| 3086 | |
| 3087 | If only the content type is required, callers should use HEAD to |
| 3088 | avoid downloading the encoded file contents. |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3089 | |
Michael Zhou | 551ad0c | 2016-04-26 01:21:42 -0400 | [diff] [blame] | 3090 | If the `base` parameter is set to true, the returned content is from the |
| 3091 | revision that the edit is based on. |
| 3092 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3093 | .Response |
| 3094 | ---- |
| 3095 | HTTP/1.1 200 OK |
| 3096 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3097 | Content-Type: text/plain; charset=ISO-8859-1 |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3098 | X-FYI-Content-Encoding: base64 |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 3099 | X-FYI-Content-Type: text/xml |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3100 | |
| 3101 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
| 3102 | ---- |
| 3103 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 3104 | Alternatively, if the only value of the Accept request header is |
| 3105 | `application/json` the content is returned as JSON string and |
| 3106 | `X-FYI-Content-Encoding` is set to `json`. |
| 3107 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 3108 | [[get-edit-meta-data]] |
| 3109 | === Retrieve meta data of a file from Change Edit |
| 3110 | -- |
| 3111 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta |
| 3112 | -- |
| 3113 | |
| 3114 | Retrieves meta data of a file from a change edit. Currently only |
| 3115 | web links are returned. |
| 3116 | |
| 3117 | .Request |
| 3118 | ---- |
| 3119 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0 |
| 3120 | ---- |
| 3121 | |
| 3122 | This REST endpoint retrieves additional information for a file in a |
| 3123 | change edit. As result an link:#edit-file-info[EditFileInfo] entity is |
| 3124 | returned. |
| 3125 | |
| 3126 | .Response |
| 3127 | ---- |
| 3128 | HTTP/1.1 200 OK |
| 3129 | Content-Disposition: attachment |
| 3130 | Content-Type: application/json; charset=UTF-8 |
| 3131 | |
| 3132 | )]}' |
| 3133 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3134 | "web_links": [ |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 3135 | { |
| 3136 | "show_on_side_by_side_diff_view": true, |
| 3137 | "name": "side-by-side preview diff", |
| 3138 | "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png", |
| 3139 | "url": "#/x/xdocs/c/42/1..0/README.md", |
| 3140 | "target": "_self" |
| 3141 | }, |
| 3142 | { |
| 3143 | "show_on_unified_diff_view": true, |
| 3144 | "name": "unified preview diff", |
| 3145 | "image_url": "plugins/xdocs/static/unifiedDiffPreview.png", |
| 3146 | "url": "#/x/xdocs/c/42/1..0/README.md,unified", |
| 3147 | "target": "_self" |
| 3148 | } |
| 3149 | ]} |
| 3150 | ---- |
| 3151 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 3152 | [[get-edit-message]] |
| 3153 | === Retrieve commit message from Change Edit or current patch set of the change |
| 3154 | -- |
| 3155 | 'GET /changes/link:#change-id[\{change-id\}]/edit:message |
| 3156 | -- |
| 3157 | |
David Ostrovsky | 25ad15e | 2014-12-15 21:18:59 +0100 | [diff] [blame] | 3158 | Retrieves commit message from change edit. |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 3159 | |
David Ostrovsky | 0ee0bb2 | 2016-05-31 22:47:47 +0200 | [diff] [blame] | 3160 | If the `base` parameter is set to true, the returned message is from the |
| 3161 | revision that the edit is based on. |
| 3162 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 3163 | .Request |
| 3164 | ---- |
| 3165 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
| 3166 | ---- |
| 3167 | |
| 3168 | The commit message is returned as base64 encoded string. |
| 3169 | |
| 3170 | .Response |
| 3171 | ---- |
| 3172 | HTTP/1.1 200 OK |
| 3173 | |
| 3174 | VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz |
| 3175 | M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg== |
| 3176 | ---- |
| 3177 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 3178 | Alternatively, if the only value of the Accept request header is |
| 3179 | `application/json` the commit message is returned as JSON string: |
| 3180 | |
| 3181 | .Response |
| 3182 | ---- |
| 3183 | HTTP/1.1 200 OK |
| 3184 | |
| 3185 | )]}' |
| 3186 | "Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n" |
| 3187 | ---- |
| 3188 | |
| 3189 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3190 | [[publish-edit]] |
| 3191 | === Publish Change Edit |
| 3192 | -- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3193 | 'POST /changes/link:#change-id[\{change-id\}]/edit:publish |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3194 | -- |
| 3195 | |
| 3196 | Promotes change edit to a regular patch set. |
| 3197 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 3198 | Options can be provided in the request body as a |
| 3199 | link:#publish-change-edit-input[PublishChangeEditInput] entity. |
| 3200 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3201 | .Request |
| 3202 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3203 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0 |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 3204 | Content-Type: application/json; charset=UTF-8 |
| 3205 | |
| 3206 | { |
| 3207 | "notify": "NONE" |
| 3208 | } |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3209 | ---- |
| 3210 | |
| 3211 | As response "`204 No Content`" is returned. |
| 3212 | |
| 3213 | .Response |
| 3214 | ---- |
| 3215 | HTTP/1.1 204 No Content |
| 3216 | ---- |
| 3217 | |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3218 | [[rebase-edit]] |
| 3219 | === Rebase Change Edit |
| 3220 | -- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3221 | 'POST /changes/link:#change-id[\{change-id\}]/edit:rebase |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3222 | -- |
| 3223 | |
| 3224 | Rebases change edit on top of latest patch set. |
| 3225 | |
| 3226 | .Request |
| 3227 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3228 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0 |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3229 | ---- |
| 3230 | |
| 3231 | When change was rebased on top of latest patch set, response |
David Pursehouse | 56fbc08 | 2015-05-19 16:33:03 +0900 | [diff] [blame] | 3232 | "`204 No Content`" is returned. When change edit is already |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3233 | based on top of the latest patch set, the response |
| 3234 | "`409 Conflict`" is returned. |
| 3235 | |
| 3236 | .Response |
| 3237 | ---- |
| 3238 | HTTP/1.1 204 No Content |
| 3239 | ---- |
| 3240 | |
David Ostrovsky | 8e75f50 | 2014-08-10 00:36:31 +0200 | [diff] [blame] | 3241 | [[delete-edit]] |
| 3242 | === Delete Change Edit |
| 3243 | -- |
| 3244 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit' |
| 3245 | -- |
| 3246 | |
| 3247 | Deletes change edit. |
| 3248 | |
| 3249 | .Request |
| 3250 | ---- |
| 3251 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 3252 | ---- |
| 3253 | |
| 3254 | As response "`204 No Content`" is returned. |
| 3255 | |
| 3256 | .Response |
| 3257 | ---- |
| 3258 | HTTP/1.1 204 No Content |
| 3259 | ---- |
| 3260 | |
Edwin Kempin | 9a9f1c0 | 2017-01-02 15:10:49 +0100 | [diff] [blame] | 3261 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3262 | [[reviewer-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3263 | == Reviewer Endpoints |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3264 | |
| 3265 | [[list-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3266 | === List Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3267 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3268 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3269 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3270 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3271 | Lists the reviewers of a change. |
| 3272 | |
| 3273 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 3274 | |
| 3275 | .Request |
| 3276 | ---- |
| 3277 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0 |
| 3278 | ---- |
| 3279 | |
| 3280 | .Response |
| 3281 | ---- |
| 3282 | HTTP/1.1 200 OK |
| 3283 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3284 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3285 | |
| 3286 | )]}' |
| 3287 | [ |
| 3288 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3289 | "approvals": { |
| 3290 | "Verified": "+1", |
| 3291 | "Code-Review": "+2" |
| 3292 | }, |
| 3293 | "_account_id": 1000096, |
| 3294 | "name": "John Doe", |
| 3295 | "email": "john.doe@example.com" |
| 3296 | }, |
| 3297 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3298 | "approvals": { |
| 3299 | "Verified": " 0", |
| 3300 | "Code-Review": "-1" |
| 3301 | }, |
| 3302 | "_account_id": 1000097, |
| 3303 | "name": "Jane Roe", |
| 3304 | "email": "jane.roe@example.com" |
| 3305 | } |
| 3306 | ] |
| 3307 | ---- |
| 3308 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3309 | [[suggest-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3310 | === Suggest Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3311 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3312 | '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] | 3313 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3314 | |
| 3315 | Suggest the reviewers for a given query `q` and result limit `n`. If result |
| 3316 | limit is not passed, then the default 10 is used. |
| 3317 | |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3318 | This REST endpoint only suggests accounts that |
| 3319 | |
| 3320 | * are active |
| 3321 | * can see the change |
| 3322 | * are visible to the calling user |
| 3323 | * are not already reviewer on the change |
| 3324 | * don't own the change |
Edwin Kempin | ad55dde | 2021-09-28 11:30:55 +0200 | [diff] [blame] | 3325 | * are not service users (unless |
| 3326 | link:config.html#suggest.skipServiceUsers[skipServiceUsers] is set to `false`) |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3327 | |
Edwin Kempin | ec02a55 | 2019-08-27 09:30:15 +0200 | [diff] [blame] | 3328 | Groups can be excluded from the results by specifying the 'exclude-groups' |
| 3329 | request parameter: |
| 3330 | |
| 3331 | -- |
| 3332 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups' |
| 3333 | -- |
Patrick Hiesel | c79ae0e | 2017-06-28 14:50:53 +0200 | [diff] [blame] | 3334 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3335 | As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned. |
| 3336 | |
| 3337 | .Request |
| 3338 | ---- |
| 3339 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0 |
| 3340 | ---- |
| 3341 | |
| 3342 | .Response |
| 3343 | ---- |
| 3344 | HTTP/1.1 200 OK |
| 3345 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3346 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3347 | |
| 3348 | )]}' |
| 3349 | [ |
| 3350 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3351 | "account": { |
| 3352 | "_account_id": 1000097, |
| 3353 | "name": "Jane Roe", |
| 3354 | "email": "jane.roe@example.com" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3355 | }, |
| 3356 | "count": 1 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3357 | }, |
| 3358 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3359 | "group": { |
| 3360 | "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279", |
| 3361 | "name": "Joiner" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3362 | }, |
| 3363 | "count": 5 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3364 | } |
| 3365 | ] |
| 3366 | ---- |
| 3367 | |
Edwin Kempin | 0ca3f72 | 2019-08-27 09:43:31 +0200 | [diff] [blame] | 3368 | To suggest CCs `reviewer-state=CC` can be specified as additional URL |
| 3369 | parameter. This includes existing reviewers in the result, but excludes |
| 3370 | existing CCs. |
| 3371 | |
| 3372 | -- |
| 3373 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC' |
| 3374 | -- |
| 3375 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3376 | [[get-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3377 | === Get Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3378 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3379 | '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] | 3380 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3381 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3382 | Retrieves a reviewer of a change. |
| 3383 | |
| 3384 | As response a link:#reviewer-info[ReviewerInfo] entity is returned that |
| 3385 | describes the reviewer. |
| 3386 | |
| 3387 | .Request |
| 3388 | ---- |
| 3389 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0 |
| 3390 | ---- |
| 3391 | |
| 3392 | .Response |
| 3393 | ---- |
| 3394 | HTTP/1.1 200 OK |
| 3395 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3396 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3397 | |
| 3398 | )]}' |
| 3399 | { |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3400 | "approvals": { |
| 3401 | "Verified": "+1", |
| 3402 | "Code-Review": "+2" |
| 3403 | }, |
| 3404 | "_account_id": 1000096, |
| 3405 | "name": "John Doe", |
| 3406 | "email": "john.doe@example.com" |
| 3407 | } |
| 3408 | ---- |
| 3409 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3410 | [[add-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3411 | === Add Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3412 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3413 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3414 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3415 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3416 | Adds one user or all members of one group as reviewer to the change. |
| 3417 | |
| 3418 | The reviewer to be added to the change must be provided in the request |
| 3419 | body as a link:#reviewer-input[ReviewerInput] entity. |
| 3420 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3421 | Users can be moved from reviewer to CC and vice versa. This means if a |
| 3422 | user is added as CC that is already a reviewer on the change, the |
| 3423 | reviewer state of that user is updated to CC. If a user that is already |
| 3424 | a CC on the change is added as reviewer, the reviewer state of that |
| 3425 | user is updated to reviewer. |
| 3426 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 3427 | Adding a new reviewer also adds that reviewer to the attention set, unless |
| 3428 | the change is work in progress. |
| 3429 | Also, moving a reviewer to CC removes that user from the attention set. |
| 3430 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3431 | .Request |
| 3432 | ---- |
| 3433 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3434 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3435 | |
| 3436 | { |
| 3437 | "reviewer": "john.doe@example.com" |
| 3438 | } |
| 3439 | ---- |
| 3440 | |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 3441 | As response an link:#reviewer-result[ReviewerResult] entity is |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3442 | returned that describes the newly added reviewers. |
| 3443 | |
| 3444 | .Response |
| 3445 | ---- |
| 3446 | HTTP/1.1 200 OK |
| 3447 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3448 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3449 | |
| 3450 | )]}' |
| 3451 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3452 | "input": "john.doe@example.com", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3453 | "reviewers": [ |
| 3454 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3455 | "_account_id": 1000096, |
| 3456 | "name": "John Doe", |
| 3457 | "email": "john.doe@example.com" |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3458 | "approvals": { |
| 3459 | "Verified": " 0", |
| 3460 | "Code-Review": " 0" |
| 3461 | }, |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3462 | } |
| 3463 | ] |
| 3464 | } |
| 3465 | ---- |
| 3466 | |
| 3467 | If a group is specified, adding the group members as reviewers is an |
| 3468 | atomic operation. This means if an error is returned, none of the |
| 3469 | members are added as reviewer. |
| 3470 | |
| 3471 | If a group with many members is added as reviewer a confirmation may be |
| 3472 | required. |
| 3473 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3474 | If a group is added as CC and members of this group are already |
| 3475 | reviewers on the change, these members stay reviewers on the change |
| 3476 | (they are not downgraded to CC). However if a group is added as |
| 3477 | reviewer, all group members become reviewer of the change, even if they |
| 3478 | have been added as CC before. |
| 3479 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3480 | .Request |
| 3481 | ---- |
| 3482 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3483 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3484 | |
| 3485 | { |
| 3486 | "reviewer": "MyProjectVerifiers" |
| 3487 | } |
| 3488 | ---- |
| 3489 | |
| 3490 | .Response |
| 3491 | ---- |
| 3492 | HTTP/1.1 200 OK |
| 3493 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3494 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3495 | |
| 3496 | )]}' |
| 3497 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3498 | "input": "MyProjectVerifiers", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3499 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 3500 | "confirm": true |
| 3501 | } |
| 3502 | ---- |
| 3503 | |
| 3504 | To confirm the addition of the reviewers, resend the request with the |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3505 | `confirmed` flag being set. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3506 | |
| 3507 | .Request |
| 3508 | ---- |
| 3509 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3510 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3511 | |
| 3512 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3513 | "input": "MyProjectVerifiers", |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3514 | "confirmed": true |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3515 | } |
| 3516 | ---- |
| 3517 | |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 3518 | If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set |
| 3519 | for the project, reviewers and CCs are not required to have a Gerrit account. If you POST |
| 3520 | an email address of a reviewer or CC then, they will be added to the change even if they |
| 3521 | don't have a Gerrit account. |
| 3522 | |
| 3523 | If this option is disabled, the request would fail with `400 Bad Request` if the email |
| 3524 | address can't be resolved to an active Gerrit account. |
| 3525 | |
| 3526 | Note that the name is optional so both "un.registered@reviewer.com" and |
| 3527 | "John Doe <un.registered@reviewer.com>" are valid inputs. |
| 3528 | |
| 3529 | Reviewers without Gerrit accounts can only be added on changes visible to anonymous users. |
| 3530 | |
| 3531 | .Request |
| 3532 | ---- |
| 3533 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 3534 | Content-Type: application/json; charset=UTF-8 |
| 3535 | |
| 3536 | { |
| 3537 | "reviewer": "John Doe <un.registered@reviewer.com>" |
| 3538 | } |
| 3539 | ---- |
| 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 | { |
| 3549 | "input": "John Doe <un.registered@reviewer.com>" |
| 3550 | } |
| 3551 | ---- |
| 3552 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3553 | .Notifications |
| 3554 | |
| 3555 | An email will be sent using the "newchange" template. |
| 3556 | |
| 3557 | [options="header",cols="1,1,1"] |
| 3558 | |============================= |
| 3559 | |WIP State |Default|notify=ALL |
| 3560 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 3561 | |Work in progress|not sent|owner, reviewers, CCs |
| 3562 | |============================= |
| 3563 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3564 | [[delete-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3565 | === Delete Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3566 | -- |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3567 | 'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' + |
| 3568 | '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] | 3569 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3570 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3571 | Deletes a reviewer from a change. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 3572 | Deleting a reviewer also removes that user from the attention set. |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3573 | |
| 3574 | .Request |
| 3575 | ---- |
| 3576 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0 |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3577 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3578 | ---- |
| 3579 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3580 | Options can be provided in the request body as a |
| 3581 | link:#delete-reviewer-input[DeleteReviewerInput] entity. |
| 3582 | Historically, this method allowed a body in the DELETE, but that behavior is |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 3583 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank]. |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3584 | In this case, use a POST request instead: |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3585 | |
| 3586 | .Request |
| 3587 | ---- |
| 3588 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3589 | Content-Type: application/json; charset=UTF-8 |
| 3590 | |
| 3591 | { |
| 3592 | "notify": "NONE" |
| 3593 | } |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3594 | ---- |
| 3595 | |
| 3596 | .Response |
| 3597 | ---- |
| 3598 | HTTP/1.1 204 No Content |
| 3599 | ---- |
| 3600 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 3601 | .Notifications |
| 3602 | |
| 3603 | An email will be sent using the "deleteReviewer" template. If deleting the |
| 3604 | reviewer resulted in one or more approvals being removed, then the deleted |
| 3605 | reviewer will also receive a notification (unless notify=NONE). |
| 3606 | |
| 3607 | [options="header",cols="1,5"] |
| 3608 | |============================= |
| 3609 | |WIP State |Default Recipients |
| 3610 | |Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers |
| 3611 | |Work in progress|notify=NONE: deleted reviewer (if voted) |
| 3612 | |============================= |
| 3613 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3614 | [[list-votes]] |
| 3615 | === List Votes |
| 3616 | -- |
| 3617 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 3618 | -- |
| 3619 | |
| 3620 | Lists the votes for a specific reviewer of the change. |
| 3621 | |
| 3622 | .Request |
| 3623 | ---- |
Edwin Kempin | 314f10a | 2016-07-11 11:39:05 +0200 | [diff] [blame] | 3624 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0 |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3625 | ---- |
| 3626 | |
| 3627 | As result a map is returned that maps the label name to the label value. |
| 3628 | The entries in the map are sorted by label name. |
| 3629 | |
| 3630 | .Response |
| 3631 | ---- |
| 3632 | HTTP/1.1 200 OK |
| 3633 | Content-Disposition: attachment |
| 3634 | Content-Type: application/json;charset=UTF-8 |
| 3635 | |
| 3636 | )]}' |
| 3637 | { |
| 3638 | "Code-Review": -1, |
| 3639 | "Verified": 1 |
| 3640 | "Work-In-Progress": 1, |
| 3641 | } |
| 3642 | ---- |
| 3643 | |
| 3644 | [[delete-vote]] |
| 3645 | === Delete Vote |
| 3646 | -- |
Edwin Kempin | 5488dc1 | 2016-08-29 11:13:31 +0200 | [diff] [blame] | 3647 | '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] | 3648 | '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] | 3649 | -- |
| 3650 | |
| 3651 | Deletes a single vote from a change. Note, that even when the last vote of |
| 3652 | a reviewer is removed the reviewer itself is still listed on the change. |
| 3653 | |
Gal Paikin | 6ce56dc | 2021-03-29 12:28:43 +0200 | [diff] [blame] | 3654 | If another user removed a user's vote, the user with the deleted vote will be |
| 3655 | added to the attention set. |
| 3656 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3657 | .Request |
| 3658 | ---- |
| 3659 | 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] | 3660 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 3661 | ---- |
| 3662 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3663 | Options can be provided in the request body as a |
| 3664 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 3665 | Historically, this method allowed a body in the DELETE, but that behavior is |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 3666 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank]. |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3667 | In this case, use a POST request instead: |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 3668 | |
| 3669 | .Request |
| 3670 | ---- |
| 3671 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 3672 | Content-Type: application/json; charset=UTF-8 |
| 3673 | |
| 3674 | { |
| 3675 | "notify": "NONE" |
| 3676 | } |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3677 | ---- |
| 3678 | |
| 3679 | .Response |
| 3680 | ---- |
| 3681 | HTTP/1.1 204 No Content |
| 3682 | ---- |
| 3683 | |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 3684 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3685 | [[revision-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3686 | == Revision Endpoints |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3687 | |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3688 | [[get-commit]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3689 | === Get Commit |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3690 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3691 | '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] | 3692 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3693 | |
| 3694 | Retrieves a parsed commit of a revision. |
| 3695 | |
| 3696 | .Request |
| 3697 | ---- |
| 3698 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0 |
| 3699 | ---- |
| 3700 | |
| 3701 | As response a link:#commit-info[CommitInfo] entity is returned that |
| 3702 | describes the revision. |
| 3703 | |
| 3704 | .Response |
| 3705 | ---- |
| 3706 | HTTP/1.1 200 OK |
| 3707 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3708 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3709 | |
| 3710 | )]}' |
| 3711 | { |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 3712 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3713 | "parents": [ |
| 3714 | { |
| 3715 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 3716 | "subject": "Migrate contributor agreements to All-Projects." |
| 3717 | } |
| 3718 | ], |
| 3719 | "author": { |
| 3720 | "name": "Shawn O. Pearce", |
| 3721 | "email": "sop@google.com", |
| 3722 | "date": "2012-04-24 18:08:08.000000000", |
| 3723 | "tz": -420 |
| 3724 | }, |
| 3725 | "committer": { |
| 3726 | "name": "Shawn O. Pearce", |
| 3727 | "email": "sop@google.com", |
| 3728 | "date": "2012-04-24 18:08:08.000000000", |
| 3729 | "tz": -420 |
| 3730 | }, |
| 3731 | "subject": "Use an EventBus to manage star icons", |
| 3732 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 3733 | } |
| 3734 | ---- |
| 3735 | |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 3736 | Adding query parameter `links` (for example `/changes/.../commit?links`) |
| 3737 | returns a link:#commit-info[CommitInfo] with the additional field `web_links`. |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3738 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 3739 | [[get-description]] |
| 3740 | === Get Description |
| 3741 | -- |
| 3742 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 3743 | -- |
| 3744 | |
| 3745 | Retrieves the description of a patch set. |
| 3746 | |
| 3747 | .Request |
| 3748 | ---- |
| 3749 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 3750 | ---- |
| 3751 | |
| 3752 | .Response |
| 3753 | ---- |
| 3754 | HTTP/1.1 200 OK |
| 3755 | Content-Disposition: attachment |
| 3756 | Content-Type: application/json; charset=UTF-8 |
| 3757 | |
| 3758 | )]}' |
| 3759 | "Added Documentation" |
| 3760 | ---- |
| 3761 | |
| 3762 | If the patch set does not have a description an empty string is returned. |
| 3763 | |
| 3764 | [[set-description]] |
| 3765 | === Set Description |
| 3766 | -- |
| 3767 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 3768 | -- |
| 3769 | |
| 3770 | Sets the description of a patch set. |
| 3771 | |
| 3772 | The new description must be provided in the request body inside a |
| 3773 | link:#description-input[DescriptionInput] entity. |
| 3774 | |
| 3775 | .Request |
| 3776 | ---- |
| 3777 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 3778 | Content-Type: application/json; charset=UTF-8 |
| 3779 | |
| 3780 | { |
| 3781 | "description": "Added Documentation" |
| 3782 | } |
| 3783 | ---- |
| 3784 | |
| 3785 | As response the new description is returned. |
| 3786 | |
| 3787 | .Response |
| 3788 | ---- |
| 3789 | HTTP/1.1 200 OK |
| 3790 | Content-Disposition: attachment |
| 3791 | Content-Type: application/json; charset=UTF-8 |
| 3792 | |
| 3793 | )]}' |
| 3794 | "Added Documentation" |
| 3795 | ---- |
| 3796 | |
Edwin Kempin | 0f22944 | 2016-09-09 13:06:12 +0200 | [diff] [blame] | 3797 | [[get-merge-list]] |
| 3798 | === Get Merge List |
| 3799 | -- |
| 3800 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist' |
| 3801 | -- |
| 3802 | |
| 3803 | Returns the list of commits that are being integrated into a target |
| 3804 | branch by a merge commit. By default the first parent is assumed to be |
| 3805 | uninteresting. By using the `parent` option another parent can be set |
| 3806 | as uninteresting (parents are 1-based). |
| 3807 | |
| 3808 | The list of commits is returned as a list of |
| 3809 | link:#commit-info[CommitInfo] entities. Web links are only included if |
| 3810 | the `links` option was set. |
| 3811 | |
| 3812 | .Request |
| 3813 | ---- |
| 3814 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0 |
| 3815 | ---- |
| 3816 | |
| 3817 | .Response |
| 3818 | ---- |
| 3819 | HTTP/1.1 200 OK |
| 3820 | Content-Disposition: attachment |
| 3821 | Content-Type: application/json; charset=UTF-8 |
| 3822 | |
| 3823 | )]}' |
| 3824 | [ |
| 3825 | { |
| 3826 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 3827 | "parents": [ |
| 3828 | { |
| 3829 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 3830 | "subject": "Migrate contributor agreements to All-Projects." |
| 3831 | } |
| 3832 | ], |
| 3833 | "author": { |
| 3834 | "name": "Shawn O. Pearce", |
| 3835 | "email": "sop@google.com", |
| 3836 | "date": "2012-04-24 18:08:08.000000000", |
| 3837 | "tz": -420 |
| 3838 | }, |
| 3839 | "committer": { |
| 3840 | "name": "Shawn O. Pearce", |
| 3841 | "email": "sop@google.com", |
| 3842 | "date": "2012-04-24 18:08:08.000000000", |
| 3843 | "tz": -420 |
| 3844 | }, |
| 3845 | "subject": "Use an EventBus to manage star icons", |
| 3846 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 3847 | } |
| 3848 | ] |
| 3849 | ---- |
| 3850 | |
Stefan Beller | c725966 | 2015-02-12 17:23:05 -0800 | [diff] [blame] | 3851 | [[get-revision-actions]] |
| 3852 | === Get Revision Actions |
| 3853 | -- |
| 3854 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions' |
| 3855 | -- |
| 3856 | |
| 3857 | Retrieves revision link:#action-info[actions] of the revision of a change. |
| 3858 | |
| 3859 | .Request |
| 3860 | ---- |
| 3861 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0 |
| 3862 | ---- |
| 3863 | |
| 3864 | .Response |
| 3865 | ---- |
| 3866 | HTTP/1.1 200 OK |
| 3867 | Content-Disposition: attachment |
| 3868 | Content-Type: application/json; charset=UTF-8 |
| 3869 | |
| 3870 | )]}' |
| 3871 | |
| 3872 | { |
| 3873 | "submit": { |
| 3874 | "method": "POST", |
| 3875 | "label": "Submit", |
| 3876 | "title": "Submit patch set 1 into master", |
| 3877 | "enabled": true |
| 3878 | }, |
| 3879 | "cherrypick": { |
| 3880 | "method": "POST", |
| 3881 | "label": "Cherry Pick", |
| 3882 | "title": "Cherry pick change to a different branch", |
| 3883 | "enabled": true |
| 3884 | } |
| 3885 | } |
| 3886 | ---- |
| 3887 | |
Han-Wen Nienhuys | 86db767 | 2021-08-10 12:45:58 +0200 | [diff] [blame] | 3888 | The response is a flat map of possible revision REST endpoint names |
| 3889 | mapped to their link:#action-info[ActionInfo]. |
Stefan Beller | c725966 | 2015-02-12 17:23:05 -0800 | [diff] [blame] | 3890 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3891 | [[get-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3892 | === Get Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3893 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3894 | '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] | 3895 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3896 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3897 | Retrieves a review of a revision. |
| 3898 | |
| 3899 | .Request |
| 3900 | ---- |
| 3901 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 3902 | ---- |
| 3903 | |
| 3904 | As response a link:#change-info[ChangeInfo] entity with |
| 3905 | link:#detailed-labels[detailed labels] and link:#detailed-accounts[ |
| 3906 | detailed accounts] is returned that describes the review of the |
| 3907 | revision. The revision for which the review is retrieved is contained |
| 3908 | in the `revisions` field. In addition the `current_revision` field is |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 3909 | 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] | 3910 | revision of the change. Please note that the returned labels are always |
| 3911 | for the current patch set. |
| 3912 | |
| 3913 | .Response |
| 3914 | ---- |
| 3915 | HTTP/1.1 200 OK |
| 3916 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3917 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3918 | |
| 3919 | )]}' |
| 3920 | { |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3921 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 3922 | "project": "myProject", |
| 3923 | "branch": "master", |
| 3924 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 3925 | "subject": "Implementing Feature X", |
| 3926 | "status": "NEW", |
| 3927 | "created": "2013-02-01 09:59:32.126000000", |
| 3928 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3929 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 3930 | "insertions": 34, |
| 3931 | "deletions": 45, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3932 | "_number": 3965, |
| 3933 | "owner": { |
| 3934 | "_account_id": 1000096, |
| 3935 | "name": "John Doe", |
| 3936 | "email": "john.doe@example.com" |
| 3937 | }, |
| 3938 | "labels": { |
| 3939 | "Verified": { |
| 3940 | "all": [ |
| 3941 | { |
| 3942 | "value": 0, |
| 3943 | "_account_id": 1000096, |
| 3944 | "name": "John Doe", |
| 3945 | "email": "john.doe@example.com" |
| 3946 | }, |
| 3947 | { |
| 3948 | "value": 0, |
| 3949 | "_account_id": 1000097, |
| 3950 | "name": "Jane Roe", |
| 3951 | "email": "jane.roe@example.com" |
| 3952 | } |
| 3953 | ], |
| 3954 | "values": { |
| 3955 | "-1": "Fails", |
| 3956 | " 0": "No score", |
| 3957 | "+1": "Verified" |
| 3958 | } |
| 3959 | }, |
| 3960 | "Code-Review": { |
| 3961 | "all": [ |
| 3962 | { |
| 3963 | "value": -1, |
| 3964 | "_account_id": 1000096, |
| 3965 | "name": "John Doe", |
| 3966 | "email": "john.doe@example.com" |
| 3967 | }, |
| 3968 | { |
| 3969 | "value": 1, |
| 3970 | "_account_id": 1000097, |
| 3971 | "name": "Jane Roe", |
| 3972 | "email": "jane.roe@example.com" |
| 3973 | } |
| 3974 | ] |
| 3975 | "values": { |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame] | 3976 | "-2": "This shall not be merged", |
| 3977 | "-1": "I would prefer this is not merged as is", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3978 | " 0": "No score", |
| 3979 | "+1": "Looks good to me, but someone else must approve", |
| 3980 | "+2": "Looks good to me, approved" |
| 3981 | } |
| 3982 | } |
| 3983 | }, |
| 3984 | "permitted_labels": { |
| 3985 | "Verified": [ |
| 3986 | "-1", |
| 3987 | " 0", |
| 3988 | "+1" |
| 3989 | ], |
| 3990 | "Code-Review": [ |
| 3991 | "-2", |
| 3992 | "-1", |
| 3993 | " 0", |
| 3994 | "+1", |
| 3995 | "+2" |
| 3996 | ] |
| 3997 | }, |
| 3998 | "removable_reviewers": [ |
| 3999 | { |
| 4000 | "_account_id": 1000096, |
| 4001 | "name": "John Doe", |
| 4002 | "email": "john.doe@example.com" |
| 4003 | }, |
| 4004 | { |
| 4005 | "_account_id": 1000097, |
| 4006 | "name": "Jane Roe", |
| 4007 | "email": "jane.roe@example.com" |
| 4008 | } |
| 4009 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 4010 | "reviewers": { |
| 4011 | "REVIEWER": [ |
| 4012 | { |
| 4013 | "_account_id": 1000096, |
| 4014 | "name": "John Doe", |
| 4015 | "email": "john.doe@example.com" |
| 4016 | }, |
| 4017 | { |
| 4018 | "_account_id": 1000097, |
| 4019 | "name": "Jane Roe", |
| 4020 | "email": "jane.roe@example.com" |
| 4021 | } |
| 4022 | ] |
| 4023 | }, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4024 | "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 4025 | "revisions": { |
| 4026 | "674ac754f91e64a0efb8087e59a176484bd534d1": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 4027 | "kind": "REWORK", |
| 4028 | "_number": 2, |
| 4029 | "ref": "refs/changes/65/3965/2", |
| 4030 | "fetch": { |
| 4031 | "http": { |
| 4032 | "url": "http://gerrit/myProject", |
| 4033 | "ref": "refs/changes/65/3965/2" |
| 4034 | } |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4035 | } |
| 4036 | } |
| 4037 | } |
| 4038 | } |
| 4039 | ---- |
| 4040 | |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4041 | [[get-related-changes]] |
| 4042 | === Get Related Changes |
| 4043 | -- |
| 4044 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related' |
| 4045 | -- |
| 4046 | |
| 4047 | Retrieves related changes of a revision. Related changes are changes that either |
| 4048 | depend on, or are dependencies of the revision. |
| 4049 | |
| 4050 | .Request |
| 4051 | ---- |
| 4052 | GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0 |
| 4053 | ---- |
| 4054 | |
| 4055 | As result a link:#related-changes-info[RelatedChangesInfo] entity is returned |
| 4056 | describing the related changes. |
| 4057 | |
| 4058 | .Response |
| 4059 | ---- |
| 4060 | HTTP/1.1 200 OK |
| 4061 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4062 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4063 | |
| 4064 | )]}' |
| 4065 | { |
| 4066 | "changes": [ |
| 4067 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 4068 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4069 | "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5", |
| 4070 | "commit": { |
| 4071 | "commit": "78847477532e386f5a2185a4e8c90b2509e354e3", |
| 4072 | "parents": [ |
| 4073 | { |
| 4074 | "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e" |
| 4075 | } |
| 4076 | ], |
| 4077 | "author": { |
| 4078 | "name": "David Ostrovsky", |
| 4079 | "email": "david@ostrovsky.org", |
| 4080 | "date": "2014-07-12 15:04:24.000000000", |
| 4081 | "tz": 120 |
| 4082 | }, |
| 4083 | "subject": "Remove Solr" |
| 4084 | }, |
| 4085 | "_change_number": 58478, |
| 4086 | "_revision_number": 2, |
| 4087 | "_current_revision_number": 2 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 4088 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4089 | }, |
| 4090 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 4091 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4092 | "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774", |
| 4093 | "commit": { |
| 4094 | "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe", |
| 4095 | "parents": [ |
| 4096 | { |
| 4097 | "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad" |
| 4098 | } |
| 4099 | ], |
| 4100 | "author": { |
| 4101 | "name": "David Pursehouse", |
| 4102 | "email": "david.pursehouse@sonymobile.com", |
| 4103 | "date": "2014-06-24 02:01:28.000000000", |
| 4104 | "tz": 540 |
| 4105 | }, |
| 4106 | "subject": "Add support for secondary index with Elasticsearch" |
| 4107 | }, |
| 4108 | "_change_number": 58081, |
| 4109 | "_revision_number": 10, |
| 4110 | "_current_revision_number": 10 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 4111 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4112 | } |
| 4113 | ] |
| 4114 | } |
| 4115 | ---- |
| 4116 | |
| 4117 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4118 | [[set-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4119 | === Set Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4120 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4121 | '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] | 4122 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4123 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 4124 | Sets a review on a revision, optionally also publishing draft comments, setting |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 4125 | labels, adding reviewers or CCs, and modifying the work in progress property. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4126 | |
| 4127 | The review must be provided in the request body as a |
| 4128 | link:#review-input[ReviewInput] entity. |
| 4129 | |
Youssef Elghareeb | 12add16 | 2019-12-18 18:43:23 +0100 | [diff] [blame] | 4130 | If the labels are set, the user sending the request will automatically be |
| 4131 | added as a reviewer, otherwise (if they only commented) they are added to |
| 4132 | the CC list. |
| 4133 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 4134 | Some updates to the attention set occur here. If more than one update should |
| 4135 | occur, only the first update in the order of the below documentation occurs: |
| 4136 | |
| 4137 | If a user is part of remove_from_attention_set, the user will be explicitly |
| 4138 | removed from the attention set. |
| 4139 | |
| 4140 | If a user is part of add_to_attention_set, the user will be explicitly |
| 4141 | added to the attention set. |
| 4142 | |
| 4143 | If the boolean ignore_default_attention_set_rules is set to true, all |
| 4144 | other rules below will be ignored: |
| 4145 | |
| 4146 | The user who created the review is removed from the attention set. |
| 4147 | |
| 4148 | If the change is ready for review, the following also apply: |
| 4149 | |
| 4150 | When the uploader replies, the owner is added to the attention set. |
| 4151 | |
| 4152 | When the owner or uploader replies, all the reviewers are added to |
| 4153 | the attention set. |
| 4154 | |
| 4155 | When neither the owner nor the uploader replies, add the owner and the |
| 4156 | uploader to the attention set. |
| 4157 | |
| 4158 | Then, new reviewers are added to the attention set, and removed reviewers |
| 4159 | (by becoming CC) are removed from the attention set. |
| 4160 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4161 | A review cannot be set on a change edit. Trying to post a review for a |
| 4162 | change edit fails with `409 Conflict`. |
| 4163 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 4164 | Here is an example of using this method to set labels: |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4165 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4166 | .Request |
| 4167 | ---- |
| 4168 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4169 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4170 | |
| 4171 | { |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 4172 | "tag": "jenkins", |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4173 | "message": "Some nits need to be fixed.", |
| 4174 | "labels": { |
| 4175 | "Code-Review": -1 |
| 4176 | }, |
| 4177 | "comments": { |
| 4178 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4179 | { |
| 4180 | "line": 23, |
| 4181 | "message": "[nit] trailing whitespace" |
| 4182 | }, |
| 4183 | { |
| 4184 | "line": 49, |
| 4185 | "message": "[nit] s/conrtol/control" |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 4186 | }, |
| 4187 | { |
| 4188 | "range": { |
| 4189 | "start_line": 50, |
| 4190 | "start_character": 0, |
| 4191 | "end_line": 55, |
| 4192 | "end_character": 20 |
| 4193 | }, |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 4194 | "message": "Incorrect indentation" |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4195 | } |
| 4196 | ] |
| 4197 | } |
| 4198 | } |
| 4199 | ---- |
| 4200 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 4201 | As response a link:#review-result[ReviewResult] entity is returned that |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4202 | describes the applied labels and any added reviewers (e.g. yourself, |
| 4203 | 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] | 4204 | |
| 4205 | .Response |
| 4206 | ---- |
| 4207 | HTTP/1.1 200 OK |
| 4208 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4209 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4210 | |
| 4211 | )]}' |
| 4212 | { |
| 4213 | "labels": { |
| 4214 | "Code-Review": -1 |
| 4215 | } |
| 4216 | } |
| 4217 | ---- |
| 4218 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4219 | It is also possible to add one or more reviewers or CCs |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 4220 | to a change simultaneously with a review: |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4221 | |
| 4222 | .Request |
| 4223 | ---- |
| 4224 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 4225 | Content-Type: application/json; charset=UTF-8 |
| 4226 | |
| 4227 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4228 | "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] | 4229 | "reviewers": [ |
| 4230 | { |
| 4231 | "reviewer": "jane.roe@example.com" |
| 4232 | }, |
| 4233 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4234 | "reviewer": "john.doe@example.com", |
| 4235 | "state": "CC" |
| 4236 | } |
| 4237 | { |
| 4238 | "reviewer": "MyProjectVerifiers", |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4239 | } |
| 4240 | ] |
| 4241 | } |
| 4242 | ---- |
| 4243 | |
| 4244 | Each element of the `reviewers` list is an instance of |
| 4245 | link:#reviewer-input[ReviewerInput]. The corresponding result of |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4246 | adding each reviewer will be returned in a map of inputs to |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 4247 | link:#reviewer-result[ReviewerResult]s. |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4248 | |
| 4249 | .Response |
| 4250 | ---- |
| 4251 | HTTP/1.1 200 OK |
| 4252 | Content-Disposition: attachment |
| 4253 | Content-Type: application/json; charset=UTF-8 |
| 4254 | |
| 4255 | )]}' |
| 4256 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4257 | "reviewers": { |
| 4258 | "jane.roe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4259 | "input": "jane.roe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4260 | "reviewers": [ |
| 4261 | { |
| 4262 | "_account_id": 1000097, |
| 4263 | "name": "Jane Roe", |
| 4264 | "email": "jane.roe@example.com" |
| 4265 | "approvals": { |
| 4266 | "Verified": " 0", |
| 4267 | "Code-Review": " 0" |
| 4268 | }, |
| 4269 | }, |
| 4270 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4271 | }, |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4272 | "john.doe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4273 | "input": "john.doe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4274 | "ccs": [ |
| 4275 | { |
| 4276 | "_account_id": 1000096, |
| 4277 | "name": "John Doe", |
| 4278 | "email": "john.doe@example.com" |
| 4279 | "approvals": { |
| 4280 | "Verified": " 0", |
| 4281 | "Code-Review": " 0" |
| 4282 | }, |
| 4283 | } |
| 4284 | ] |
| 4285 | }, |
| 4286 | "MyProjectVerifiers": { |
| 4287 | "input": "MyProjectVerifiers", |
| 4288 | "reviewers": [ |
| 4289 | { |
| 4290 | "_account_id": 1000098, |
| 4291 | "name": "Alice Ansel", |
| 4292 | "email": "alice.ansel@example.com" |
| 4293 | "approvals": { |
| 4294 | "Verified": " 0", |
| 4295 | "Code-Review": " 0" |
| 4296 | }, |
| 4297 | }, |
| 4298 | { |
| 4299 | "_account_id": 1000099, |
| 4300 | "name": "Bob Bollard", |
| 4301 | "email": "bob.bollard@example.com" |
| 4302 | "approvals": { |
| 4303 | "Verified": " 0", |
| 4304 | "Code-Review": " 0" |
| 4305 | }, |
| 4306 | }, |
| 4307 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4308 | } |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4309 | } |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4310 | } |
| 4311 | ---- |
| 4312 | |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4313 | 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] | 4314 | be rejected with `400 Bad Request`. None of the entries will have the |
| 4315 | `reviewers` or `ccs` field set, and those which specifically failed will have |
| 4316 | the `errors` field set containing details of why they failed. |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4317 | |
| 4318 | .Error Response |
| 4319 | ---- |
| 4320 | HTTP/1.1 400 Bad Request |
| 4321 | Content-Disposition: attachment |
| 4322 | Content-Type: application/json; charset=UTF-8 |
| 4323 | |
| 4324 | )]}' |
| 4325 | { |
| 4326 | "reviewers": { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4327 | "jane.roe@example.com": { |
| 4328 | "input": "jane.roe@example.com", |
| 4329 | "error": "Account of jane.roe@example.com is inactive." |
| 4330 | }, |
| 4331 | "john.doe@example.com": { |
| 4332 | "input": "john.doe@example.com" |
| 4333 | }, |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4334 | "MyProjectVerifiers": { |
| 4335 | "input": "MyProjectVerifiers", |
| 4336 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 4337 | "confirm": true |
| 4338 | } |
| 4339 | } |
| 4340 | } |
| 4341 | ---- |
| 4342 | |
Dave Borowitz | d2e4145 | 2017-10-26 08:06:23 -0400 | [diff] [blame] | 4343 | [[set-review-notifications]] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4344 | .Notifications |
| 4345 | |
| 4346 | An email will be sent using the "comment" template. |
| 4347 | |
| 4348 | If the top-level notify property is null or not set, then notification behavior |
| 4349 | depends on whether the change is WIP, whether it has started review, and whether |
| 4350 | the tag property is null. |
| 4351 | |
| 4352 | NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*. |
| 4353 | Use the notify property of the top-level link:#review-input[ReviewInput] instead. |
| 4354 | |
| 4355 | For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS |
| 4356 | watchers*. |
| 4357 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4358 | [options="header",cols="2,1,1,2,2"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4359 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4360 | |WIP State |Review Started|Tag Given|Default |notify=ALL |
| 4361 | |Ready for review|N/A |N/A |everyone|everyone |
| 4362 | |Work in progress|no |no |not sent|everyone |
| 4363 | |Work in progress|no |yes |owner |everyone |
| 4364 | |Work in progress|yes |no |everyone|everyone |
| 4365 | |Work in progress|yes |yes |owner |everyone |
| 4366 | |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4367 | |============================= |
| 4368 | |
| 4369 | If reviewers are added, then a second email will be sent using the "newchange" |
| 4370 | template. The notification logic for this email is the same as for |
| 4371 | link:#add-reviewer[Add Reviewer]. |
| 4372 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4373 | [options="header",cols="1,1,1"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4374 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4375 | |WIP State |Default |notify=ALL |
| 4376 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 4377 | |Work in progress|not sent |owner, reviewers, CCs |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4378 | |============================= |
| 4379 | |
| 4380 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4381 | [[rebase-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4382 | === Rebase Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4383 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4384 | '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] | 4385 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4386 | |
| 4387 | Rebases a revision. |
| 4388 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4389 | Optionally, the parent revision can be changed to another patch set through the |
| 4390 | link:#rebase-input[RebaseInput] entity. |
| 4391 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4392 | .Request |
| 4393 | ---- |
| 4394 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4395 | Content-Type: application/json;charset=UTF-8 |
| 4396 | |
| 4397 | { |
| 4398 | "base" : "1234", |
| 4399 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4400 | ---- |
| 4401 | |
| 4402 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 4403 | describes the rebased change. Information about the current patch set |
| 4404 | is included. |
| 4405 | |
| 4406 | .Response |
| 4407 | ---- |
| 4408 | HTTP/1.1 200 OK |
| 4409 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4410 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4411 | |
| 4412 | )]}' |
| 4413 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4414 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4415 | "project": "myProject", |
| 4416 | "branch": "master", |
| 4417 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4418 | "subject": "Implement Feature X", |
| 4419 | "status": "NEW", |
| 4420 | "created": "2013-02-01 09:59:32.126000000", |
| 4421 | "updated": "2013-02-21 11:16:36.775000000", |
| 4422 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 4423 | "insertions": 21, |
| 4424 | "deletions": 21, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4425 | "_number": 4799, |
| 4426 | "owner": { |
| 4427 | "name": "John Doe" |
| 4428 | }, |
| 4429 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 4430 | "revisions": { |
| 4431 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 4432 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4433 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 4434 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4435 | "fetch": { |
| 4436 | "http": { |
| 4437 | "url": "http://gerrit:8080/myProject", |
| 4438 | "ref": "refs/changes/99/4799/2" |
| 4439 | } |
| 4440 | }, |
| 4441 | "commit": { |
| 4442 | "parents": [ |
| 4443 | { |
| 4444 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 4445 | "subject": "Implement Feature A" |
| 4446 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 4447 | ], |
| 4448 | "author": { |
| 4449 | "name": "John Doe", |
| 4450 | "email": "john.doe@example.com", |
| 4451 | "date": "2013-05-07 15:21:27.000000000", |
| 4452 | "tz": 120 |
| 4453 | }, |
| 4454 | "committer": { |
| 4455 | "name": "Gerrit Code Review", |
| 4456 | "email": "gerrit-server@example.com", |
| 4457 | "date": "2013-05-07 15:35:43.000000000", |
| 4458 | "tz": 120 |
| 4459 | }, |
| 4460 | "subject": "Implement Feature X", |
| 4461 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4462 | } |
| 4463 | } |
| 4464 | } |
| 4465 | ---- |
| 4466 | |
| 4467 | If the revision cannot be rebased, e.g. due to conflicts, the response is |
| 4468 | "`409 Conflict`" and the error message is contained in the response |
| 4469 | body. |
| 4470 | |
| 4471 | .Response |
| 4472 | ---- |
| 4473 | HTTP/1.1 409 Conflict |
| 4474 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4475 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4476 | |
| 4477 | The change could not be rebased due to a path conflict during merge. |
| 4478 | ---- |
| 4479 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4480 | [[submit-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4481 | === Submit Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4482 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4483 | '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] | 4484 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4485 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4486 | Submits a revision. |
Gal Paikin | c85d352 | 2021-04-19 13:34:54 +0200 | [diff] [blame] | 4487 | Submitting a change also removes all users from the link:#attention-set[attention set]. |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4488 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4489 | .Request |
| 4490 | ---- |
| 4491 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4492 | ---- |
| 4493 | |
Gal Paikin | 3d6cdec | 2021-04-19 13:32:13 +0200 | [diff] [blame] | 4494 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 4495 | describes the submitted/merged change. |
| 4496 | |
Gal Paikin | e2849a8 | 2021-04-19 13:41:10 +0200 | [diff] [blame] | 4497 | Submission may submit multiple changes, but we still only return one ChangeInfo |
| 4498 | object. To query for all submitted changes, please use the submission_id that is |
| 4499 | part of the response. |
| 4500 | |
| 4501 | Changes that will also be submitted: |
| 4502 | 1. All changes of the same topic if |
| 4503 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 4504 | configuration is set to true. |
| 4505 | 2. All dependent changes. |
| 4506 | 3. The closure of the above (e.g if a dependent change has a topic, all changes |
| 4507 | of *that* topic will also be submitted). |
| 4508 | |
Gal Paikin | 3d6cdec | 2021-04-19 13:32:13 +0200 | [diff] [blame] | 4509 | .Response |
| 4510 | ---- |
| 4511 | HTTP/1.1 200 OK |
| 4512 | Content-Disposition: attachment |
| 4513 | Content-Type: application/json; charset=UTF-8 |
| 4514 | |
| 4515 | )]}' |
| 4516 | { |
| 4517 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4518 | "project": "myProject", |
| 4519 | "branch": "master", |
| 4520 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4521 | "subject": "Implementing Feature X", |
| 4522 | "status": "MERGED", |
| 4523 | "created": "2013-02-01 09:59:32.126000000", |
| 4524 | "updated": "2013-02-21 11:16:36.775000000", |
| 4525 | "submitted": "2013-02-21 11:16:36.615000000", |
| 4526 | "_number": 3965, |
| 4527 | "owner": { |
| 4528 | "name": "John Doe" |
| 4529 | } |
| 4530 | } |
| 4531 | ---- |
| 4532 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4533 | If the revision cannot be submitted, e.g. because the submit rule |
| 4534 | doesn't allow submitting the revision or the revision is not the |
| 4535 | current revision, the response is "`409 Conflict`" and the error |
| 4536 | message is contained in the response body. |
| 4537 | |
| 4538 | .Response |
| 4539 | ---- |
| 4540 | HTTP/1.1 409 Conflict |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4541 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4542 | |
| 4543 | "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision" |
| 4544 | ---- |
| 4545 | |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4546 | [[get-patch]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4547 | === Get Patch |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4548 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4549 | '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] | 4550 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4551 | |
| 4552 | Gets the formatted patch for one revision. |
| 4553 | |
| 4554 | .Request |
| 4555 | ---- |
| 4556 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0 |
| 4557 | ---- |
| 4558 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4559 | The formatted patch is returned as text encoded inside base64: |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4560 | |
| 4561 | .Response |
| 4562 | ---- |
| 4563 | HTTP/1.1 200 OK |
| 4564 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4565 | Content-Type: text/plain; charset=ISO-8859-1 |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4566 | X-FYI-Content-Encoding: base64 |
| 4567 | X-FYI-Content-Type: application/mbox |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4568 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4569 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4570 | ---- |
| 4571 | |
David Ostrovsky | 973f38b | 2013-08-22 00:24:51 -0700 | [diff] [blame] | 4572 | Adding query parameter `zip` (for example `/changes/.../patch?zip`) |
| 4573 | returns the patch as a single file inside of a ZIP archive. Clients |
| 4574 | can expand the ZIP to obtain the plain text patch, avoiding the |
| 4575 | need for a base64 decoding step. This option implies `download`. |
| 4576 | |
| 4577 | Query parameter `download` (e.g. `/changes/.../patch?download`) |
| 4578 | will suggest the browser save the patch as `commitsha1.diff.base64`, |
| 4579 | for later processing by command line tools. |
| 4580 | |
Kasper Nilsson | 8144807 | 2016-10-17 15:04:33 -0700 | [diff] [blame] | 4581 | If the `path` parameter is set, the returned content is a diff of the single |
| 4582 | file that the path refers to. |
| 4583 | |
Stefan Beller | dfa1ef3 | 2016-09-16 12:20:02 -0700 | [diff] [blame] | 4584 | [[submit-preview]] |
Edwin Kempin | 807eb4b | 2016-10-18 15:49:41 +0200 | [diff] [blame] | 4585 | === Submit Preview |
Stefan Beller | dfa1ef3 | 2016-09-16 12:20:02 -0700 | [diff] [blame] | 4586 | -- |
| 4587 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit' |
| 4588 | -- |
| 4589 | Gets a file containing thin bundles of all modified projects if this |
| 4590 | change was submitted. The bundles are named `${ProjectName}.git`. |
| 4591 | Each thin bundle contains enough to construct the state in which a project would |
| 4592 | be in if this change were submitted. The base of the thin bundles are the |
| 4593 | current target branches, so to make use of this call in a non-racy way, first |
| 4594 | get the bundles and then fetch all projects contained in the bundle. |
| 4595 | (This assumes no non-fastforward pushes). |
| 4596 | |
| 4597 | 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] | 4598 | format for the outer container. It is always possible to use tgz, even if |
| 4599 | tgz is not in the list of allowed archive formats. |
Stefan Beller | dfa1ef3 | 2016-09-16 12:20:02 -0700 | [diff] [blame] | 4600 | |
| 4601 | To make good use of this call, you would roughly need code as found at: |
| 4602 | ---- |
| 4603 | $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh |
| 4604 | ---- |
| 4605 | .Request |
| 4606 | ---- |
| 4607 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0 |
| 4608 | ---- |
| 4609 | |
| 4610 | .Response |
| 4611 | ---- |
| 4612 | HTTP/1.1 200 OK |
| 4613 | Date: Tue, 13 Sep 2016 19:13:46 GMT |
| 4614 | Content-Disposition: attachment; filename="submit-preview-147.zip" |
| 4615 | X-Content-Type-Options: nosniff |
| 4616 | Cache-Control: no-cache, no-store, max-age=0, must-revalidate |
| 4617 | Pragma: no-cache |
| 4618 | Expires: Mon, 01 Jan 1990 00:00:00 GMT |
| 4619 | Content-Type: application/x-zip |
| 4620 | Transfer-Encoding: chunked |
| 4621 | |
| 4622 | [binary stuff] |
| 4623 | ---- |
| 4624 | |
| 4625 | In case of an error, the response is not a zip file but a regular json response, |
| 4626 | containing only the error message: |
| 4627 | |
| 4628 | .Response |
| 4629 | ---- |
| 4630 | HTTP/1.1 200 OK |
| 4631 | Content-Disposition: attachment |
| 4632 | Content-Type: application/json; charset=UTF-8 |
| 4633 | |
| 4634 | )]}' |
| 4635 | "Anonymous users cannot submit" |
| 4636 | ---- |
| 4637 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4638 | [[get-mergeable]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4639 | === Get Mergeable |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4640 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4641 | '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] | 4642 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4643 | |
| 4644 | Gets the method the server will use to submit (merge) the change and |
| 4645 | an indicator if the change is currently mergeable. |
| 4646 | |
| 4647 | .Request |
| 4648 | ---- |
| 4649 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0 |
| 4650 | ---- |
| 4651 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 4652 | As response a link:#mergeable-info[MergeableInfo] entity is returned. |
| 4653 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4654 | .Response |
| 4655 | ---- |
| 4656 | HTTP/1.1 200 OK |
| 4657 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4658 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4659 | |
| 4660 | )]}' |
| 4661 | { |
| 4662 | submit_type: "MERGE_IF_NECESSARY", |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 4663 | strategy: "recursive", |
| 4664 | mergeable: true |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4665 | } |
| 4666 | ---- |
| 4667 | |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4668 | If the `other-branches` parameter is specified, the mergeability will also be |
Zhen Chen | 6729b63 | 2016-11-11 17:32:32 -0800 | [diff] [blame] | 4669 | checked for all other branches which are listed in the |
| 4670 | link:config-project-config.html#branchOrder-section[branchOrder] section in the |
| 4671 | project.config file. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4672 | |
| 4673 | .Request |
| 4674 | ---- |
| 4675 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0 |
| 4676 | ---- |
| 4677 | |
| 4678 | The response will then contain a list of all other branches where this changes |
| 4679 | could merge cleanly. |
| 4680 | |
| 4681 | .Response |
| 4682 | ---- |
| 4683 | HTTP/1.1 200 OK |
| 4684 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4685 | Content-Type: application/json; charset=UTF-8 |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4686 | |
| 4687 | )]}' |
| 4688 | { |
| 4689 | submit_type: "MERGE_IF_NECESSARY", |
| 4690 | mergeable: true, |
| 4691 | mergeable_into: [ |
| 4692 | "refs/heads/stable-2.7", |
| 4693 | "refs/heads/stable-2.8", |
| 4694 | ] |
| 4695 | } |
| 4696 | ---- |
| 4697 | |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4698 | [[get-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4699 | === Get Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4700 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4701 | '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] | 4702 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4703 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4704 | Gets the method the server will use to submit (merge) the change. |
| 4705 | |
| 4706 | .Request |
| 4707 | ---- |
| 4708 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0 |
| 4709 | ---- |
| 4710 | |
| 4711 | .Response |
| 4712 | ---- |
| 4713 | HTTP/1.1 200 OK |
| 4714 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4715 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4716 | |
| 4717 | )]}' |
| 4718 | "MERGE_IF_NECESSARY" |
| 4719 | ---- |
| 4720 | |
| 4721 | [[test-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4722 | === Test Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4723 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4724 | '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] | 4725 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4726 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4727 | Tests the submit_type Prolog rule in the project, or the one given. |
| 4728 | |
| 4729 | Request body may be either the Prolog code as `text/plain` or a |
| 4730 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 4731 | may be set to `SKIP` to bypass parent project filters while testing |
| 4732 | a project-specific rule. |
| 4733 | |
| 4734 | .Request |
| 4735 | ---- |
| 4736 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0 |
David Pursehouse | 4d7f991 | 2020-06-18 13:02:56 +0900 | [diff] [blame] | 4737 | Content-Type: text/plain; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4738 | |
| 4739 | submit_type(cherry_pick). |
| 4740 | ---- |
| 4741 | |
| 4742 | .Response |
| 4743 | ---- |
| 4744 | HTTP/1.1 200 OK |
| 4745 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4746 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4747 | |
| 4748 | )]}' |
Shawn Pearce | 7076f4e | 2013-08-20 22:11:51 -0700 | [diff] [blame] | 4749 | "CHERRY_PICK" |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4750 | ---- |
| 4751 | |
| 4752 | [[test-submit-rule]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4753 | === Test Submit Rule |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4754 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4755 | '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] | 4756 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4757 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4758 | Tests the submit_rule Prolog rule in the project, or the one given. |
| 4759 | |
| 4760 | Request body may be either the Prolog code as `text/plain` or a |
| 4761 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 4762 | may be set to `SKIP` to bypass parent project filters while testing |
| 4763 | a project-specific rule. |
| 4764 | |
| 4765 | .Request |
| 4766 | ---- |
Shawn Pearce | a3cce71 | 2014-03-21 08:16:11 -0700 | [diff] [blame] | 4767 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0 |
David Pursehouse | 4d7f991 | 2020-06-18 13:02:56 +0900 | [diff] [blame] | 4768 | Content-Type: text/plain; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4769 | |
| 4770 | submit_rule(submit(R)) :- |
| 4771 | R = label('Any-Label-Name', reject(_)). |
| 4772 | ---- |
| 4773 | |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4774 | The response is a link:#submit-record[SubmitRecord] describing the |
| 4775 | permutations that satisfy the tested submit rule. |
| 4776 | |
David Pursehouse | 87a3fb0 | 2019-10-29 16:01:27 +0900 | [diff] [blame] | 4777 | 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] | 4778 | |
| 4779 | .Response |
| 4780 | ---- |
| 4781 | HTTP/1.1 200 OK |
| 4782 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4783 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4784 | |
| 4785 | )]}' |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4786 | { |
| 4787 | "status": "NOT_READY", |
| 4788 | "reject": { |
| 4789 | "Any-Label-Name": {} |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4790 | } |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4791 | } |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4792 | ---- |
| 4793 | |
Shawn Pearce | b42e303 | 2015-04-02 10:28:10 -0700 | [diff] [blame] | 4794 | When testing with the `curl` command line client the |
| 4795 | `--data-binary @rules.pl` flag should be used to ensure |
| 4796 | all LFs are included in the Prolog code: |
| 4797 | |
| 4798 | ---- |
| 4799 | curl -X POST \ |
| 4800 | -H 'Content-Type: text/plain; charset=UTF-8' \ |
| 4801 | --data-binary @rules.pl \ |
| 4802 | http://.../test.submit_rule |
| 4803 | ---- |
| 4804 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4805 | [[list-drafts]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 4806 | === List Revision Drafts |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4807 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4808 | '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] | 4809 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4810 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4811 | Lists the draft comments of a revision that belong to the calling |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4812 | user. |
| 4813 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 4814 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 4815 | entries. The entries in the map are sorted by file path. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4816 | |
| 4817 | .Request |
| 4818 | ---- |
| 4819 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0 |
| 4820 | ---- |
| 4821 | |
| 4822 | .Response |
| 4823 | ---- |
| 4824 | HTTP/1.1 200 OK |
| 4825 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4826 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4827 | |
| 4828 | )]}' |
| 4829 | { |
| 4830 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4831 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4832 | "id": "TvcXrmjM", |
| 4833 | "line": 23, |
| 4834 | "message": "[nit] trailing whitespace", |
| 4835 | "updated": "2013-02-26 15:40:43.986000000" |
| 4836 | }, |
| 4837 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 4838 | "id": "TveXwFiA", |
| 4839 | "line": 49, |
| 4840 | "in_reply_to": "TfYX-Iuo", |
| 4841 | "message": "Done", |
| 4842 | "updated": "2013-02-26 15:40:45.328000000" |
| 4843 | } |
| 4844 | ] |
| 4845 | } |
| 4846 | ---- |
| 4847 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4848 | [[create-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4849 | === Create Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4850 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4851 | '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] | 4852 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4853 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4854 | Creates a draft comment on a revision. |
| 4855 | |
| 4856 | The new draft comment must be provided in the request body inside a |
| 4857 | link:#comment-input[CommentInput] entity. |
| 4858 | |
| 4859 | .Request |
| 4860 | ---- |
| 4861 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4862 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4863 | |
| 4864 | { |
| 4865 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4866 | "line": 23, |
| 4867 | "message": "[nit] trailing whitespace" |
| 4868 | } |
| 4869 | ---- |
| 4870 | |
| 4871 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4872 | describes the draft comment. |
| 4873 | |
| 4874 | .Response |
| 4875 | ---- |
| 4876 | HTTP/1.1 200 OK |
| 4877 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4878 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4879 | |
| 4880 | )]}' |
| 4881 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4882 | "id": "TvcXrmjM", |
| 4883 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4884 | "line": 23, |
| 4885 | "message": "[nit] trailing whitespace", |
| 4886 | "updated": "2013-02-26 15:40:43.986000000" |
| 4887 | } |
| 4888 | ---- |
| 4889 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4890 | [[get-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4891 | === Get Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4892 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4893 | '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] | 4894 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4895 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4896 | Retrieves a draft comment of a revision that belongs to the calling |
| 4897 | user. |
| 4898 | |
| 4899 | .Request |
| 4900 | ---- |
| 4901 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 4902 | ---- |
| 4903 | |
| 4904 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4905 | describes the draft comment. |
| 4906 | |
| 4907 | .Response |
| 4908 | ---- |
| 4909 | HTTP/1.1 200 OK |
| 4910 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4911 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4912 | |
| 4913 | )]}' |
| 4914 | { |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 4915 | "id": "TvcXrmjM", |
| 4916 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4917 | "line": 23, |
| 4918 | "message": "[nit] trailing whitespace", |
| 4919 | "updated": "2013-02-26 15:40:43.986000000" |
| 4920 | } |
| 4921 | ---- |
| 4922 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4923 | [[update-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4924 | === Update Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4925 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4926 | '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] | 4927 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4928 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4929 | Updates a draft comment on a revision. |
| 4930 | |
| 4931 | The new draft comment must be provided in the request body inside a |
| 4932 | link:#comment-input[CommentInput] entity. |
| 4933 | |
| 4934 | .Request |
| 4935 | ---- |
| 4936 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4937 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4938 | |
| 4939 | { |
| 4940 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4941 | "line": 23, |
| 4942 | "message": "[nit] trailing whitespace" |
| 4943 | } |
| 4944 | ---- |
| 4945 | |
| 4946 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 4947 | describes the draft comment. |
| 4948 | |
| 4949 | .Response |
| 4950 | ---- |
| 4951 | HTTP/1.1 200 OK |
| 4952 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4953 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4954 | |
| 4955 | )]}' |
| 4956 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4957 | "id": "TvcXrmjM", |
| 4958 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 4959 | "line": 23, |
| 4960 | "message": "[nit] trailing whitespace", |
| 4961 | "updated": "2013-02-26 15:40:43.986000000" |
| 4962 | } |
| 4963 | ---- |
| 4964 | |
| 4965 | [[delete-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4966 | === Delete Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4967 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4968 | '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] | 4969 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4970 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 4971 | Deletes a draft comment from a revision. |
| 4972 | |
| 4973 | .Request |
| 4974 | ---- |
| 4975 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 4976 | ---- |
| 4977 | |
| 4978 | .Response |
| 4979 | ---- |
| 4980 | HTTP/1.1 204 No Content |
| 4981 | ---- |
| 4982 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4983 | [[list-comments]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 4984 | === List Revision Comments |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4985 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4986 | '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] | 4987 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4988 | |
| 4989 | Lists the published comments of a revision. |
| 4990 | |
| 4991 | As result a map is returned that maps the file path to a list of |
| 4992 | link:#comment-info[CommentInfo] entries. The entries in the map are |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 4993 | sorted by file path and only include file (or inline) comments. Use |
| 4994 | the link:#get-change-detail[Get Change Detail] endpoint to retrieve |
| 4995 | the general change message (or comment). |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 4996 | |
| 4997 | .Request |
| 4998 | ---- |
| 4999 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0 |
| 5000 | ---- |
| 5001 | |
| 5002 | .Response |
| 5003 | ---- |
| 5004 | HTTP/1.1 200 OK |
| 5005 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5006 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5007 | |
| 5008 | )]}' |
| 5009 | { |
| 5010 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5011 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5012 | "id": "TvcXrmjM", |
| 5013 | "line": 23, |
| 5014 | "message": "[nit] trailing whitespace", |
| 5015 | "updated": "2013-02-26 15:40:43.986000000", |
| 5016 | "author": { |
| 5017 | "_account_id": 1000096, |
| 5018 | "name": "John Doe", |
| 5019 | "email": "john.doe@example.com" |
| 5020 | } |
| 5021 | }, |
| 5022 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5023 | "id": "TveXwFiA", |
| 5024 | "line": 49, |
| 5025 | "in_reply_to": "TfYX-Iuo", |
| 5026 | "message": "Done", |
| 5027 | "updated": "2013-02-26 15:40:45.328000000", |
| 5028 | "author": { |
| 5029 | "_account_id": 1000097, |
| 5030 | "name": "Jane Roe", |
| 5031 | "email": "jane.roe@example.com" |
| 5032 | } |
| 5033 | } |
| 5034 | ] |
| 5035 | } |
| 5036 | ---- |
| 5037 | |
| 5038 | [[get-comment]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5039 | === Get Comment |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5040 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5041 | '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] | 5042 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5043 | |
| 5044 | Retrieves a published comment of a revision. |
| 5045 | |
| 5046 | .Request |
| 5047 | ---- |
| 5048 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0 |
| 5049 | ---- |
| 5050 | |
| 5051 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5052 | describes the published comment. |
| 5053 | |
| 5054 | .Response |
| 5055 | ---- |
| 5056 | HTTP/1.1 200 OK |
| 5057 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5058 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5059 | |
| 5060 | )]}' |
| 5061 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5062 | "id": "TvcXrmjM", |
| 5063 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5064 | "line": 23, |
| 5065 | "message": "[nit] trailing whitespace", |
| 5066 | "updated": "2013-02-26 15:40:43.986000000", |
| 5067 | "author": { |
| 5068 | "_account_id": 1000096, |
| 5069 | "name": "John Doe", |
| 5070 | "email": "john.doe@example.com" |
| 5071 | } |
| 5072 | } |
| 5073 | ---- |
| 5074 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5075 | [[delete-comment]] |
| 5076 | === Delete Comment |
| 5077 | -- |
| 5078 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' + |
| 5079 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete' |
| 5080 | -- |
| 5081 | |
| 5082 | Deletes a published comment of a revision. Instead of deleting the |
| 5083 | whole comment, this endpoint just replaces the comment's message |
| 5084 | 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] | 5085 | the comment and the reason why it's deleted. |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5086 | |
| 5087 | Note that only users with the |
| 5088 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 5089 | global capability are permitted to delete a comment. |
| 5090 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 5091 | Deletion reason can be provided in the request body as a |
| 5092 | link:#delete-comment-input[DeleteCommentInput] entity. |
| 5093 | Historically, this method allowed a body in the DELETE, but that behavior is |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 5094 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank]. |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 5095 | In this case, use a POST request instead: |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5096 | |
| 5097 | .Request |
| 5098 | ---- |
| 5099 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0 |
| 5100 | Content-Type: application/json; charset=UTF-8 |
| 5101 | |
| 5102 | { |
| 5103 | "reason": "contains confidential information" |
| 5104 | } |
| 5105 | ---- |
| 5106 | |
| 5107 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5108 | describes the updated comment. |
| 5109 | |
| 5110 | .Response |
| 5111 | ---- |
| 5112 | HTTP/1.1 200 OK |
| 5113 | Content-Disposition: attachment |
| 5114 | Content-Type: application/json; charset=UTF-8 |
| 5115 | |
| 5116 | )]}' |
| 5117 | { |
| 5118 | "id": "TvcXrmjM", |
| 5119 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5120 | "line": 23, |
| 5121 | "message": "Comment removed by: Administrator; Reason: contains confidential information", |
| 5122 | "updated": "2013-02-26 15:40:43.986000000", |
| 5123 | "author": { |
| 5124 | "_account_id": 1000096, |
| 5125 | "name": "John Doe", |
| 5126 | "email": "john.doe@example.com" |
| 5127 | } |
| 5128 | } |
| 5129 | ---- |
| 5130 | |
Edwin Kempin | b050a48 | 2016-12-01 09:11:19 +0100 | [diff] [blame] | 5131 | [[list-robot-comments]] |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5132 | === List Robot Comments |
| 5133 | -- |
| 5134 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/' |
| 5135 | -- |
| 5136 | |
| 5137 | Lists the link:config-robot-comments.html[robot comments] of a |
| 5138 | revision. |
| 5139 | |
| 5140 | As result a map is returned that maps the file path to a list of |
| 5141 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 5142 | map are sorted by file path. |
| 5143 | |
| 5144 | .Request |
| 5145 | ---- |
| 5146 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0 |
| 5147 | ---- |
| 5148 | |
| 5149 | .Response |
| 5150 | ---- |
| 5151 | HTTP/1.1 200 OK |
| 5152 | Content-Disposition: attachment |
| 5153 | Content-Type: application/json; charset=UTF-8 |
| 5154 | |
| 5155 | )]}' |
| 5156 | { |
| 5157 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5158 | { |
| 5159 | "id": "TvcXrmjM", |
| 5160 | "line": 23, |
| 5161 | "message": "unused import", |
| 5162 | "updated": "2016-02-26 15:40:43.986000000", |
| 5163 | "author": { |
| 5164 | "_account_id": 1000110, |
| 5165 | "name": "Code Analyzer", |
| 5166 | "email": "code.analyzer@example.com" |
| 5167 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 5168 | "robot_id": "importChecker", |
| 5169 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5170 | }, |
| 5171 | { |
| 5172 | "id": "TveXwFiA", |
| 5173 | "line": 49, |
| 5174 | "message": "wrong indention", |
| 5175 | "updated": "2016-02-26 15:40:45.328000000", |
| 5176 | "author": { |
| 5177 | "_account_id": 1000110, |
| 5178 | "name": "Code Analyzer", |
| 5179 | "email": "code.analyzer@example.com" |
| 5180 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 5181 | "robot_id": "styleChecker", |
| 5182 | "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5183 | } |
| 5184 | ] |
| 5185 | } |
| 5186 | ---- |
| 5187 | |
| 5188 | [[get-robot-comment]] |
| 5189 | === Get Robot Comment |
| 5190 | -- |
| 5191 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]' |
| 5192 | -- |
| 5193 | |
| 5194 | Retrieves a link:config-robot-comments.html[robot comment] of a |
| 5195 | revision. |
| 5196 | |
| 5197 | .Request |
| 5198 | ---- |
| 5199 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0 |
| 5200 | ---- |
| 5201 | |
| 5202 | As response a link:#robot-comment-info[RobotCommentInfo] entity is |
| 5203 | returned that describes the robot comment. |
| 5204 | |
| 5205 | .Response |
| 5206 | ---- |
| 5207 | HTTP/1.1 200 OK |
| 5208 | Content-Disposition: attachment |
| 5209 | Content-Type: application/json; charset=UTF-8 |
| 5210 | |
| 5211 | )]}' |
| 5212 | { |
| 5213 | "id": "TvcXrmjM", |
| 5214 | "line": 23, |
| 5215 | "message": "unused import", |
| 5216 | "updated": "2016-02-26 15:40:43.986000000", |
| 5217 | "author": { |
| 5218 | "_account_id": 1000110, |
| 5219 | "name": "Code Analyzer", |
| 5220 | "email": "code.analyzer@example.com" |
| 5221 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 5222 | "robot_id": "importChecker", |
| 5223 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5224 | } |
| 5225 | ---- |
| 5226 | |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5227 | [[get-ported-comments]] |
| 5228 | === Get Ported Comments |
| 5229 | -- |
| 5230 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_comments' |
| 5231 | -- |
| 5232 | |
| 5233 | Ports comments of other revisions to the requested revision. |
| 5234 | |
| 5235 | Only comments added on earlier patchsets are ported. That set of comments is filtered even further |
| 5236 | due to some additional rules. Callers of this endpoint shouldn't rely on the exact logic of which |
| 5237 | comments are ported as that logic might change in the future. Instead, callers must be able to |
| 5238 | handle any smaller/larger set of comments returned by this endpoint. |
| 5239 | |
| 5240 | Typically, a comment thread is returned fully or excluded fully. However, draft comments and |
| 5241 | robot comments are ignored and not returned via this endpoint. Hence, it's possible to get ported |
| 5242 | comments from this endpoint which are a reply to a non-ported robot comment. Callers must be |
| 5243 | able to deal with this situation. |
| 5244 | |
| 5245 | The returned comments are organized in a map of file path to link:#comment-info[CommentInfo] entries |
| 5246 | in the same fashion as for the link:#list-comments[List Revision Comments] endpoint. |
| 5247 | The map is filled with the original comment attributes except for these attributes: `path`, `line`, |
| 5248 | and `range` point to the computed position in the target revision. If the exactly correct position |
| 5249 | can't be determined, those fields will be filled with the next best position. That can also mean |
| 5250 | not filling the `line` or `range` attribute anymore and thus converting the comment to a file |
| 5251 | comment (or even moving the comment to a different file or the patchset level). Callers of this |
| 5252 | endpoint must be able to deal with this and not rely on the original comment position. |
| 5253 | |
| 5254 | It's possible that this endpoint returns different link:#comment-info[CommentInfo] entries with |
| 5255 | the same comment UUID. This is not a bug but a feature. If a comment appears on a file which Gerrit |
| 5256 | recognizes as copied between patchsets, the ported version of this comment consists of two ported |
| 5257 | instances having the same UUID but different `file`/`line`/`range` positions. Callers must be able |
| 5258 | to handle this situation. |
| 5259 | |
| 5260 | Repeated calls of this endpoint might produce different results. Internal errors during the |
| 5261 | position computation are mapped to fallback locations for affected comments. Those errors might |
| 5262 | have vanished on later calls, upon which this endpoint returns the actually mapped position. In |
| 5263 | addition, comments can be deleted and draft comments can be published, upon which the set of ported |
| 5264 | comments may change. |
| 5265 | |
| 5266 | .Request |
| 5267 | ---- |
| 5268 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/4/ported_comments/ HTTP/1.0 |
| 5269 | ---- |
| 5270 | |
| 5271 | .Response |
| 5272 | ---- |
| 5273 | HTTP/1.1 200 OK |
| 5274 | Content-Disposition: attachment |
| 5275 | Content-Type: application/json; charset=UTF-8 |
| 5276 | |
| 5277 | )]}' |
| 5278 | { |
| 5279 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5280 | { |
| 5281 | "id": "TvcXrmjM", |
| 5282 | "patch_set": 2, |
| 5283 | "line": 23, |
| 5284 | "message": "[nit] trailing whitespace", |
| 5285 | "updated": "2013-02-26 15:40:43.986000000", |
| 5286 | "author": { |
| 5287 | "_account_id": 1000096, |
| 5288 | "name": "John Doe", |
| 5289 | "email": "john.doe@example.com" |
| 5290 | }, |
| 5291 | "unresolved": true |
| 5292 | }, |
| 5293 | { |
| 5294 | "id": "TveXwFiA", |
| 5295 | "patch_set": 2, |
| 5296 | "line": 23, |
| 5297 | "in_reply_to": "TvcXrmjM", |
| 5298 | "message": "Done", |
| 5299 | "updated": "2013-02-26 15:40:45.328000000", |
| 5300 | "author": { |
| 5301 | "_account_id": 1000097, |
| 5302 | "name": "Jane Roe", |
| 5303 | "email": "jane.roe@example.com" |
| 5304 | }, |
| 5305 | "unresolved": true |
| 5306 | } |
| 5307 | ] |
| 5308 | } |
| 5309 | ---- |
| 5310 | |
| 5311 | [[get-ported-drafts]] |
| 5312 | === Get Ported Drafts |
| 5313 | -- |
| 5314 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_drafts' |
| 5315 | -- |
| 5316 | |
| 5317 | Ports draft comments of other revisions to the requested revision. |
| 5318 | |
| 5319 | This endpoint behaves similarly to the link:#get-ported-comments[Get Ported Comments] endpoint. |
| 5320 | With this endpoint, only draft comments of the calling user are ported, though. If a draft comment |
| 5321 | is a reply to a published comment, only the ported draft comment is returned. |
| 5322 | |
| 5323 | Depending on the filtering rules, it's possible that this endpoint returns a draft comment which is |
| 5324 | a reply to a comment thread which is not returned by the |
| 5325 | link:#get-ported-comments[Get Ported Comments] endpoint. That's intended behavior. Callers must be |
| 5326 | able to handle this situation. The same holds for drafts which are a reply to a robot comment. |
| 5327 | |
| 5328 | Different than the link:#get-ported-comments[Get Ported Comments] endpoint, the `author` of the |
| 5329 | returned comments is not filled for this endpoint as only comments of the calling user are returned. |
| 5330 | |
Patrick Hiesel | afd6c70 | 2020-11-06 10:21:47 +0100 | [diff] [blame] | 5331 | This endpoint requires authentication. |
| 5332 | |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5333 | .Request |
| 5334 | ---- |
| 5335 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/ported_drafts/ HTTP/1.0 |
| 5336 | ---- |
| 5337 | |
| 5338 | .Response |
| 5339 | ---- |
| 5340 | HTTP/1.1 200 OK |
| 5341 | Content-Disposition: attachment |
| 5342 | Content-Type: application/json; charset=UTF-8 |
| 5343 | |
| 5344 | )]}' |
| 5345 | { |
| 5346 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5347 | { |
| 5348 | "id": "TveXwFiA", |
| 5349 | "patch_set": 2, |
| 5350 | "line": 23, |
| 5351 | "in_reply_to": "TvcXrmjM", |
| 5352 | "message": "Done", |
| 5353 | "updated": "2013-02-26 15:40:45.328000000", |
| 5354 | "unresolved": true |
| 5355 | } |
| 5356 | ] |
| 5357 | } |
| 5358 | ---- |
| 5359 | |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5360 | [[apply-fix]] |
| 5361 | === Apply Fix |
| 5362 | -- |
| 5363 | 'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply' |
| 5364 | -- |
| 5365 | |
| 5366 | Applies a suggested fix by creating a change edit which includes the |
| 5367 | modifications indicated by the fix suggestion. If a change edit already exists, |
| 5368 | it will be updated accordingly. A fix can only be applied if no change edit |
| 5369 | exists and the fix refers to the current patch set, or the fix refers to the |
| 5370 | patch set on which the change edit is based. |
| 5371 | |
| 5372 | .Request |
| 5373 | ---- |
| 5374 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0 |
| 5375 | ---- |
| 5376 | |
| 5377 | If the fix was successfully applied, an <<edit-info,EditInfo>> describing the |
| 5378 | resulting change edit is returned. |
| 5379 | |
| 5380 | .Response |
| 5381 | ---- |
| 5382 | HTTP/1.1 200 OK |
| 5383 | Content-Disposition: attachment |
| 5384 | Content-Type: application/json; charset=UTF-8 |
| 5385 | |
| 5386 | )]}' |
| 5387 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5388 | "commit": { |
| 5389 | "parents": [ |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5390 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5391 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5392 | } |
| 5393 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5394 | "author": { |
| 5395 | "name": "John Doe", |
| 5396 | "email": "john.doe@example.com", |
| 5397 | "date": "2013-05-07 15:21:27.000000000", |
| 5398 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5399 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5400 | "committer": { |
| 5401 | "name": "Jane Doe", |
| 5402 | "email": "jane.doe@example.com", |
| 5403 | "date": "2013-05-07 15:35:43.000000000", |
| 5404 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5405 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5406 | "subject": "Implement feature X", |
| 5407 | "message": "Implement feature X\n\nWith this feature ..." |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5408 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5409 | "base_patch_set_number": 1, |
| 5410 | "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1" |
| 5411 | "ref": "refs/users/01/1000001/edit-42622/1" |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5412 | } |
| 5413 | ---- |
| 5414 | |
| 5415 | If the application failed e.g. due to conflicts with an existing change edit, |
| 5416 | the response "`409 Conflict`" including an error message in the response body |
| 5417 | is returned. |
| 5418 | |
| 5419 | .Response |
| 5420 | ---- |
| 5421 | HTTP/1.1 409 Conflict |
| 5422 | Content-Disposition: attachment |
| 5423 | Content-Type: text/plain; charset=UTF-8 |
| 5424 | |
| 5425 | The existing change edit could not be merged with another tree. |
| 5426 | ---- |
| 5427 | |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5428 | [[list-files]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5429 | === List Files |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5430 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5431 | '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] | 5432 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5433 | |
| 5434 | Lists the files that were modified, added or deleted in a revision. |
| 5435 | |
| 5436 | .Request |
| 5437 | ---- |
| 5438 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0 |
| 5439 | ---- |
| 5440 | |
Makson Lee | faf05c2 | 2018-07-26 22:42:59 +0000 | [diff] [blame] | 5441 | As result a map is returned that maps the link:#file-id[file path] to a |
| 5442 | link:#file-info[FileInfo] entry. The entries in the map are |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5443 | sorted by file path. |
| 5444 | |
| 5445 | .Response |
| 5446 | ---- |
| 5447 | HTTP/1.1 200 OK |
| 5448 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5449 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5450 | |
| 5451 | )]}' |
| 5452 | { |
| 5453 | "/COMMIT_MSG": { |
| 5454 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 5455 | "lines_inserted": 7, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 5456 | "size_delta": 551, |
| 5457 | "size": 551 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5458 | }, |
| 5459 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": { |
| 5460 | "lines_inserted": 5, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 5461 | "lines_deleted": 3, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 5462 | "size_delta": 98, |
| 5463 | "size": 23348 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5464 | } |
| 5465 | } |
| 5466 | ---- |
| 5467 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5468 | The request parameter `reviewed` changes the response to return a list |
| 5469 | of the paths the caller has marked as reviewed. Clients that also |
| 5470 | need the FileInfo should make two requests. |
| 5471 | |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 5472 | The request parameter `q` changes the response to return a list |
| 5473 | of all files (modified or unmodified) that contain that substring |
| 5474 | in the path name. This is useful to implement suggestion services |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 5475 | finding a file by partial name. Clients that also need the FileInfo |
| 5476 | should make two requests. |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 5477 | |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 5478 | For merge commits only, the integer-valued request parameter `parent` |
| 5479 | changes the response to return a map of the files which are different |
| 5480 | 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] | 5481 | 1-based index of the parent's position in the commit object, |
| 5482 | with the first parent always belonging to the target branch. If not |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 5483 | specified, the response contains a map of the files different in the |
| 5484 | auto merge result. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 5485 | |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 5486 | The request parameter `base` changes the response to return a map of the |
| 5487 | files which are different in this commit compared to the given revision. The |
| 5488 | revision must correspond to a patch set in the change. |
| 5489 | |
| 5490 | The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive. |
| 5491 | That is, only one of them may be used at a time. |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5492 | |
| 5493 | .Request |
| 5494 | ---- |
| 5495 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0 |
| 5496 | ---- |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5497 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5498 | .Response |
| 5499 | ---- |
| 5500 | HTTP/1.1 200 OK |
| 5501 | Content-Disposition: attachment |
| 5502 | Content-Type: application/json; charset=UTF-8 |
| 5503 | |
| 5504 | )]}' |
| 5505 | [ |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5506 | "/COMMIT_MSG", |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5507 | "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] | 5508 | ] |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5509 | ---- |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5510 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5511 | [[get-content]] |
| 5512 | === Get Content |
| 5513 | -- |
| 5514 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content' |
| 5515 | -- |
| 5516 | |
| 5517 | Gets the content of a file from a certain revision. |
| 5518 | |
Patrick Hiesel | 38667d4 | 2017-05-02 13:12:48 +0200 | [diff] [blame] | 5519 | The optional, integer-valued `parent` parameter can be specified to request |
| 5520 | the named file from a parent commit of the specified revision. The value is |
| 5521 | the 1-based index of the parent's position in the commit object. If the |
| 5522 | parameter is omitted or the value is non-positive, the patch set is referenced. |
| 5523 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5524 | .Request |
| 5525 | ---- |
| 5526 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0 |
| 5527 | ---- |
| 5528 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5529 | The content is returned as base64 encoded string. The HTTP response |
| 5530 | Content-Type is always `text/plain`, reflecting the base64 wrapping. |
| 5531 | A Gerrit-specific `X-FYI-Content-Type` header is returned describing |
| 5532 | the server detected content type of the file. |
| 5533 | |
| 5534 | If only the content type is required, callers should use HEAD to |
| 5535 | avoid downloading the encoded file contents. |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5536 | |
| 5537 | .Response |
| 5538 | ---- |
| 5539 | HTTP/1.1 200 OK |
| 5540 | Content-Disposition: attachment |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5541 | Content-Type: text/plain; charset=ISO-8859-1 |
| 5542 | X-FYI-Content-Encoding: base64 |
| 5543 | X-FYI-Content-Type: text/xml |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5544 | |
| 5545 | Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY... |
| 5546 | ---- |
| 5547 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 5548 | Alternatively, if the only value of the Accept request header is |
| 5549 | `application/json` the content is returned as JSON string and |
| 5550 | `X-FYI-Content-Encoding` is set to `json`. |
| 5551 | |
David Pletcher | d1efb45 | 2015-09-01 17:45:55 -0700 | [diff] [blame] | 5552 | [[get-safe-content]] |
| 5553 | === Download Content |
| 5554 | -- |
| 5555 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download' |
| 5556 | -- |
| 5557 | |
| 5558 | Downloads the content of a file from a certain revision, in a safe format |
| 5559 | that poses no risk for inadvertent execution of untrusted code. |
| 5560 | |
| 5561 | If the content type is defined as safe, the binary file content is returned |
| 5562 | verbatim. If the content type is not safe, the file is stored inside a ZIP |
| 5563 | file, containing a single entry with a random, unpredictable name having the |
| 5564 | same base and suffix as the true filename. The ZIP file is returned in |
| 5565 | verbatim binary form. |
| 5566 | |
| 5567 | See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation] |
| 5568 | for information about safe file type configuration. |
| 5569 | |
| 5570 | The HTTP resource Content-Type is dependent on the file type: the |
| 5571 | applicable type for safe files, or "application/zip" for unsafe files. |
| 5572 | |
David Pletcher | ec622bf | 2015-09-18 14:30:05 -0700 | [diff] [blame] | 5573 | The optional, integer-valued `parent` parameter can be specified to request |
| 5574 | the named file from a parent commit of the specified revision. The value is |
| 5575 | the 1-based index of the parent's position in the commit object. If the |
| 5576 | parameter is omitted or the value non-positive, the patch set is referenced. |
| 5577 | |
| 5578 | Filenames are decorated with a suffix of `_new` for the current patch, |
| 5579 | `_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] | 5580 | |
| 5581 | .Request |
| 5582 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 5583 | 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] | 5584 | ---- |
| 5585 | |
| 5586 | .Response |
| 5587 | ---- |
| 5588 | HTTP/1.1 200 OK |
| 5589 | Content-Disposition: attachment; filename="logo.png" |
| 5590 | Content-Type: image/png |
| 5591 | |
| 5592 | `[binary data for logo.png]` |
| 5593 | ---- |
| 5594 | |
| 5595 | .Request |
| 5596 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 5597 | 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] | 5598 | ---- |
| 5599 | |
| 5600 | .Response |
| 5601 | ---- |
| 5602 | HTTP/1.1 200 OK |
| 5603 | Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip" |
| 5604 | Content-Type:application/zip |
| 5605 | |
| 5606 | `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]` |
| 5607 | ---- |
| 5608 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5609 | [[get-diff]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5610 | === Get Diff |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5611 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5612 | '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] | 5613 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5614 | |
| 5615 | Gets the diff of a file from a certain revision. |
| 5616 | |
| 5617 | .Request |
| 5618 | ---- |
| 5619 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0 |
| 5620 | ---- |
| 5621 | |
| 5622 | As response a link:#diff-info[DiffInfo] entity is returned that describes the diff. |
| 5623 | |
| 5624 | .Response |
| 5625 | ---- |
| 5626 | HTTP/1.1 200 OK |
| 5627 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5628 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5629 | |
| 5630 | )] |
| 5631 | { |
| 5632 | "meta_a": { |
| 5633 | "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] | 5634 | "content_type": "text/x-java-source", |
| 5635 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5636 | }, |
| 5637 | "meta_b": { |
| 5638 | "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] | 5639 | "content_type": "text/x-java-source", |
| 5640 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5641 | }, |
| 5642 | "change_type": "MODIFIED", |
| 5643 | "diff_header": [ |
| 5644 | "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", |
| 5645 | "index 59b7670..9faf81c 100644", |
| 5646 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5647 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 5648 | ], |
| 5649 | "content": [ |
| 5650 | { |
| 5651 | "ab": [ |
| 5652 | "// Copyright (C) 2010 The Android Open Source Project", |
| 5653 | "//", |
| 5654 | "// Licensed under the Apache License, Version 2.0 (the \"License\");", |
| 5655 | "// you may not use this file except in compliance with the License.", |
| 5656 | "// You may obtain a copy of the License at", |
| 5657 | "//", |
| 5658 | "// http://www.apache.org/licenses/LICENSE-2.0", |
| 5659 | "//", |
| 5660 | "// Unless required by applicable law or agreed to in writing, software", |
| 5661 | "// distributed under the License is distributed on an \"AS IS\" BASIS,", |
| 5662 | "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", |
| 5663 | "// See the License for the specific language governing permissions and", |
| 5664 | "// limitations under the License." |
| 5665 | ] |
| 5666 | }, |
| 5667 | { |
| 5668 | "b": [ |
| 5669 | "//", |
| 5670 | "// Add some more lines in the header." |
| 5671 | ] |
| 5672 | }, |
| 5673 | { |
| 5674 | "ab": [ |
| 5675 | "", |
| 5676 | "package com.google.gerrit.server.project;", |
| 5677 | "", |
| 5678 | "import com.google.common.collect.Maps;", |
| 5679 | ... |
| 5680 | ] |
| 5681 | } |
| 5682 | ... |
| 5683 | ] |
| 5684 | } |
| 5685 | ---- |
| 5686 | |
| 5687 | If the `intraline` parameter is specified, intraline differences are included in the diff. |
| 5688 | |
| 5689 | .Request |
| 5690 | ---- |
| 5691 | 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 |
| 5692 | ---- |
| 5693 | |
| 5694 | .Response |
| 5695 | ---- |
| 5696 | HTTP/1.1 200 OK |
| 5697 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5698 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5699 | |
| 5700 | )] |
| 5701 | { |
| 5702 | "meta_a": { |
| 5703 | "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] | 5704 | "content_type": "text/x-java-source", |
| 5705 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5706 | }, |
| 5707 | "meta_b": { |
| 5708 | "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] | 5709 | "content_type": "text/x-java-source", |
| 5710 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5711 | }, |
| 5712 | "change_type": "MODIFIED", |
| 5713 | "diff_header": [ |
| 5714 | "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", |
| 5715 | "index 59b7670..9faf81c 100644", |
| 5716 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5717 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 5718 | ], |
| 5719 | "content": [ |
| 5720 | ... |
| 5721 | { |
| 5722 | "a": [ |
| 5723 | "/** Manages access control for Git references (aka branches, tags). */" |
| 5724 | ], |
| 5725 | "b": [ |
| 5726 | "/** Manages access control for the Git references (aka branches, tags). */" |
| 5727 | ], |
| 5728 | "edit_a": [], |
| 5729 | "edit_b": [ |
| 5730 | [ |
| 5731 | 31, |
| 5732 | 4 |
| 5733 | ] |
| 5734 | ] |
| 5735 | } |
| 5736 | ] |
| 5737 | } |
| 5738 | ---- |
| 5739 | |
| 5740 | The `base` parameter can be specified to control the base patch set from which the diff should |
| 5741 | be generated. |
| 5742 | |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 5743 | The integer-valued request parameter `parent` can be specified to control the |
| 5744 | parent commit number against which the diff should be generated. This is useful |
| 5745 | for supporting review of merge commits. The value is the 1-based index of the |
| 5746 | parent's position in the commit object. |
| 5747 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5748 | .Request |
| 5749 | ---- |
| 5750 | 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 |
| 5751 | ---- |
| 5752 | |
| 5753 | .Response |
| 5754 | ---- |
| 5755 | HTTP/1.1 200 OK |
| 5756 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5757 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5758 | |
| 5759 | )] |
| 5760 | { |
| 5761 | "meta_a": { |
| 5762 | "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] | 5763 | "content_type": "text/x-java-source", |
| 5764 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5765 | }, |
| 5766 | "meta_b": { |
| 5767 | "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] | 5768 | "content_type": "text/x-java-source", |
| 5769 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5770 | }, |
| 5771 | "change_type": "MODIFIED", |
| 5772 | "content": [ |
| 5773 | { |
| 5774 | "skip": 578 |
| 5775 | } |
| 5776 | ] |
| 5777 | } |
| 5778 | ---- |
| 5779 | |
Edwin Kempin | 0b7c40f | 2016-02-09 17:13:23 +0100 | [diff] [blame] | 5780 | The `whitespace` parameter can be specified to control how whitespace |
| 5781 | differences are reported in the result. Valid values are `IGNORE_NONE`, |
| 5782 | `IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5783 | |
Dmitrii Filippov | bf3f08b | 2019-12-06 03:13:06 +0100 | [diff] [blame] | 5784 | [[preview-fix]] |
| 5785 | === Preview fix |
| 5786 | -- |
| 5787 | 'GET /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/preview' |
| 5788 | -- |
| 5789 | |
| 5790 | Gets the diffs of all files for a certain <<fix-id,\{fix-id\}>>. |
| 5791 | As response, a map of link:#diff-info[DiffInfo] entities is returned that describes the diffs. |
| 5792 | |
| 5793 | Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id and a virtual patch set with the applied fix. |
| 5794 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 5795 | [[get-blame]] |
| 5796 | === Get Blame |
| 5797 | -- |
| 5798 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame' |
| 5799 | -- |
| 5800 | |
| 5801 | Gets the blame of a file from a certain revision. |
| 5802 | |
| 5803 | .Request |
| 5804 | ---- |
| 5805 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0 |
| 5806 | ---- |
| 5807 | |
| 5808 | As response a link:#blame-info[BlameInfo] entity is returned that describes the |
| 5809 | blame. |
| 5810 | |
| 5811 | .Response |
| 5812 | ---- |
| 5813 | HTTP/1.1 200 OK |
| 5814 | Content-Disposition: attachment |
| 5815 | Content-Type: application/json; charset=UTF-8 |
| 5816 | |
| 5817 | )] |
| 5818 | { |
| 5819 | [ |
| 5820 | { |
| 5821 | "author": "Joe Daw", |
| 5822 | "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7", |
| 5823 | "time": 1421441349, |
| 5824 | "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n", |
| 5825 | "ranges": [ |
| 5826 | { |
| 5827 | "start": 1, |
| 5828 | "end": 10 |
| 5829 | }, |
| 5830 | { |
| 5831 | "start": 16, |
| 5832 | "end": 296 |
| 5833 | } |
| 5834 | ] |
| 5835 | }, |
| 5836 | { |
| 5837 | "author": "Jane Daw", |
| 5838 | "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7", |
| 5839 | "time": 1421825421, |
| 5840 | "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n", |
| 5841 | "ranges": [ |
| 5842 | { |
| 5843 | "start": 13, |
| 5844 | "end": 13 |
| 5845 | } |
| 5846 | ] |
| 5847 | } |
| 5848 | ] |
| 5849 | } |
| 5850 | ---- |
| 5851 | |
| 5852 | The `base` parameter can be specified to control the base patch set from which |
| 5853 | the blame should be generated. |
| 5854 | |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5855 | [[set-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5856 | === Set Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5857 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5858 | '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] | 5859 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5860 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5861 | Marks a file of a revision as reviewed by the calling user. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 5862 | |
| 5863 | .Request |
| 5864 | ---- |
| 5865 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 5866 | ---- |
| 5867 | |
| 5868 | .Response |
| 5869 | ---- |
| 5870 | HTTP/1.1 201 Created |
| 5871 | ---- |
| 5872 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5873 | 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] | 5874 | response is "`200 OK`". |
| 5875 | |
| 5876 | [[delete-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5877 | === Delete Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5878 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5879 | '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] | 5880 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5881 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5882 | 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] | 5883 | |
| 5884 | .Request |
| 5885 | ---- |
| 5886 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 5887 | ---- |
| 5888 | |
| 5889 | .Response |
| 5890 | ---- |
| 5891 | HTTP/1.1 204 No Content |
| 5892 | ---- |
| 5893 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5894 | [[cherry-pick]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5895 | === Cherry Pick Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5896 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5897 | '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] | 5898 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5899 | |
| 5900 | Cherry picks a revision to a destination branch. |
| 5901 | |
Changcheng Xiao | 54b6c0c | 2017-10-23 14:57:42 +0200 | [diff] [blame] | 5902 | To cherry pick a commit with no change-id associated with it, see |
| 5903 | link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit]. |
| 5904 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5905 | 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] | 5906 | link:#cherrypick-input[CherryPickInput] entity. If the commit message |
| 5907 | 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] | 5908 | |
Gal Paikin | 8dadd42 | 2021-05-07 10:21:54 +0200 | [diff] [blame] | 5909 | When cherry-picking a change into a branch that already contains the Change-Id |
| 5910 | that we want to cherry-pick, the cherry-pick will create a new patch-set on the |
| 5911 | destination's branch's appropriate Change-Id. If the change is closed on the |
| 5912 | destination branch, the cherry-pick will fail. |
| 5913 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5914 | .Request |
| 5915 | ---- |
| 5916 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5917 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5918 | |
| 5919 | { |
Gustaf Lundh | 98df5b5 | 2013-05-07 19:22:13 +0100 | [diff] [blame] | 5920 | "message" : "Implementing Feature X", |
| 5921 | "destination" : "release-branch" |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5922 | } |
| 5923 | ---- |
| 5924 | |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 5925 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 5926 | describes the resulting cherry-pick change. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5927 | |
| 5928 | .Response |
| 5929 | ---- |
| 5930 | HTTP/1.1 200 OK |
| 5931 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5932 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5933 | |
| 5934 | )]}' |
| 5935 | { |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5936 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 5937 | "project": "myProject", |
| 5938 | "branch": "release-branch", |
| 5939 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 5940 | "subject": "Implementing Feature X", |
| 5941 | "status": "NEW", |
| 5942 | "created": "2013-02-01 09:59:32.126000000", |
| 5943 | "updated": "2013-02-21 11:16:36.775000000", |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5944 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 5945 | "insertions": 12, |
| 5946 | "deletions": 11, |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 5947 | "_number": 3965, |
| 5948 | "owner": { |
| 5949 | "name": "John Doe" |
| 5950 | } |
| 5951 | } |
| 5952 | ---- |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 5953 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 5954 | [[revision-reviewer-endpoints]] |
| 5955 | == Revision Reviewer Endpoints |
| 5956 | |
| 5957 | [[list-revision-reviewers]] |
| 5958 | === List Revision Reviewers |
| 5959 | -- |
| 5960 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/' |
| 5961 | -- |
| 5962 | |
| 5963 | Lists the reviewers of a revision. |
| 5964 | |
| 5965 | Please note that only the current revision is supported. |
| 5966 | |
| 5967 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 5968 | |
| 5969 | .Request |
| 5970 | ---- |
| 5971 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0 |
| 5972 | ---- |
| 5973 | |
| 5974 | .Response |
| 5975 | ---- |
| 5976 | HTTP/1.1 200 OK |
| 5977 | Content-Disposition: attachment |
| 5978 | Content-Type: application/json; charset=UTF-8 |
| 5979 | |
| 5980 | )]}' |
| 5981 | [ |
| 5982 | { |
| 5983 | "approvals": { |
| 5984 | "Verified": "+1", |
| 5985 | "Code-Review": "+2" |
| 5986 | }, |
| 5987 | "_account_id": 1000096, |
| 5988 | "name": "John Doe", |
| 5989 | "email": "john.doe@example.com" |
| 5990 | }, |
| 5991 | { |
| 5992 | "approvals": { |
| 5993 | "Verified": " 0", |
| 5994 | "Code-Review": "-1" |
| 5995 | }, |
| 5996 | "_account_id": 1000097, |
| 5997 | "name": "Jane Roe", |
| 5998 | "email": "jane.roe@example.com" |
| 5999 | } |
| 6000 | ] |
| 6001 | ---- |
| 6002 | |
| 6003 | [[list-revision-votes]] |
| 6004 | === List Revision Votes |
| 6005 | -- |
| 6006 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 6007 | -- |
| 6008 | |
| 6009 | Lists the votes for a specific reviewer of the revision. |
| 6010 | |
| 6011 | Please note that only the current revision is supported. |
| 6012 | |
| 6013 | .Request |
| 6014 | ---- |
| 6015 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0 |
| 6016 | ---- |
| 6017 | |
| 6018 | As result a map is returned that maps the label name to the label value. |
| 6019 | The entries in the map are sorted by label name. |
| 6020 | |
| 6021 | .Response |
| 6022 | ---- |
| 6023 | HTTP/1.1 200 OK |
| 6024 | Content-Disposition: attachment |
| 6025 | Content-Type: application/json;charset=UTF-8 |
| 6026 | |
| 6027 | )]}' |
| 6028 | { |
| 6029 | "Code-Review": -1, |
| 6030 | "Verified": 1, |
| 6031 | "Work-In-Progress": 1 |
| 6032 | } |
| 6033 | ---- |
| 6034 | |
| 6035 | [[delete-revision-vote]] |
| 6036 | === Delete Revision Vote |
| 6037 | -- |
| 6038 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 6039 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' + |
| 6040 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 6041 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete' |
| 6042 | -- |
| 6043 | |
| 6044 | Deletes a single vote from a revision. The deletion will be possible only |
| 6045 | if the revision is the current revision. By using this endpoint you can prevent |
| 6046 | deleting the vote (with same label) from a newer patch set by mistake. |
| 6047 | |
| 6048 | Note, that even when the last vote of a reviewer is removed the reviewer itself |
| 6049 | is still listed on the change. |
| 6050 | |
Gal Paikin | 6ce56dc | 2021-03-29 12:28:43 +0200 | [diff] [blame] | 6051 | If another user removed a user's vote, the user with the deleted vote will be |
| 6052 | added to the attention set. |
| 6053 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 6054 | .Request |
| 6055 | ---- |
| 6056 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0 |
| 6057 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 6058 | ---- |
| 6059 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 6060 | Options can be provided in the request body as a |
| 6061 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 6062 | Historically, this method allowed a body in the DELETE, but that behavior is |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 6063 | link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank]. |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 6064 | In this case, use a POST request instead: |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 6065 | |
| 6066 | .Request |
| 6067 | ---- |
| 6068 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 6069 | Content-Type: application/json; charset=UTF-8 |
| 6070 | |
| 6071 | { |
| 6072 | "notify": "NONE" |
| 6073 | } |
| 6074 | ---- |
| 6075 | |
| 6076 | .Response |
| 6077 | ---- |
| 6078 | HTTP/1.1 204 No Content |
| 6079 | ---- |
| 6080 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6081 | [[attention-set-endpoints]] |
| 6082 | == Attention Set Endpoints |
| 6083 | |
| 6084 | [[get-attention-set]] |
| 6085 | === Get Attention Set |
| 6086 | -- |
| 6087 | 'GET /changes/link:#change-id[\{change-id\}]/attention' |
| 6088 | -- |
| 6089 | |
| 6090 | Returns all users that are currently in the attention set. |
| 6091 | As response a list of link:#attention-set-info[AttentionSetInfo] |
| 6092 | entity is returned. |
| 6093 | |
| 6094 | .Request |
| 6095 | ---- |
| 6096 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0 |
| 6097 | ---- |
| 6098 | |
| 6099 | .Response |
| 6100 | ---- |
| 6101 | HTTP/1.1 200 OK |
| 6102 | Content-Disposition: attachment |
| 6103 | Content-Type: application/json; charset=UTF-8 |
| 6104 | |
| 6105 | )]}' |
| 6106 | [ |
| 6107 | { |
| 6108 | "account": { |
| 6109 | "_account_id": 1000096, |
| 6110 | "name": "John Doe", |
| 6111 | "email": "john.doe@example.com", |
| 6112 | "username": "jdoe" |
| 6113 | }, |
| 6114 | "last_update": "2013-02-01 09:59:32.126000000", |
| 6115 | "reason": "reviewer or cc replied" |
| 6116 | }, |
| 6117 | { |
| 6118 | "account": { |
| 6119 | "_account_id": 1000097, |
| 6120 | "name": "Jane Doe", |
| 6121 | "email": "jane.doe@example.com", |
| 6122 | "username": "janedoe" |
| 6123 | }, |
| 6124 | "last_update": "2013-02-01 09:59:32.126000000", |
| 6125 | "reason": "Reviewer was added" |
| 6126 | } |
| 6127 | ] |
| 6128 | ---- |
| 6129 | |
| 6130 | [[add-to-attention-set]] |
| 6131 | === Add To Attention Set |
| 6132 | -- |
| 6133 | 'POST /changes/link:#change-id[\{change-id\}]/attention' |
| 6134 | -- |
| 6135 | |
| 6136 | Adds a single user to the attention set of a change. |
| 6137 | |
| 6138 | A user can only be added if they are not in the attention set. |
| 6139 | If a user is added while already in the attention set, the |
| 6140 | request is silently ignored. |
| 6141 | |
Gal Paikin | e631de2 | 2020-10-29 12:19:11 +0100 | [diff] [blame] | 6142 | The user must be a reviewer, cc, uploader, or owner on the change. |
| 6143 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6144 | .Request |
| 6145 | ---- |
| 6146 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0 |
| 6147 | ---- |
| 6148 | |
| 6149 | Details should be provided in the request body as an |
| 6150 | link:#attention-set-input[AttentionSetInput] entity. |
| 6151 | |
| 6152 | .Request |
| 6153 | ---- |
| 6154 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0 |
| 6155 | Content-Type: application/json; charset=UTF-8 |
| 6156 | |
| 6157 | { |
| 6158 | "user": "John Doe", |
| 6159 | "reason": "reason" |
| 6160 | } |
| 6161 | ---- |
| 6162 | |
| 6163 | .Response |
| 6164 | ---- |
| 6165 | HTTP/1.1 200 OK |
| 6166 | Content-Disposition: attachment |
| 6167 | Content-Type: application/json; charset=UTF-8 |
| 6168 | |
| 6169 | )]}' |
| 6170 | { |
| 6171 | "_account_id": 1000096, |
| 6172 | "name": "John Doe", |
| 6173 | "email": "john.doe@example.com", |
| 6174 | "username": "jdoe" |
| 6175 | } |
| 6176 | ---- |
| 6177 | |
| 6178 | [[remove-from-attention-set]] |
| 6179 | === Remove from Attention Set |
| 6180 | -- |
| 6181 | 'DELETE /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]' + |
| 6182 | 'POST /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]/delete' |
| 6183 | -- |
| 6184 | |
| 6185 | Deletes a single user from the attention set of a change. |
| 6186 | |
| 6187 | A user can only be removed from the attention set if they |
| 6188 | are currently in the attention set. Otherwise, the request |
| 6189 | is silently ignored. |
| 6190 | |
| 6191 | .Request |
| 6192 | ---- |
| 6193 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe HTTP/1.0 |
| 6194 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0 |
| 6195 | ---- |
| 6196 | |
| 6197 | Reason can be provided in the request body as an |
| 6198 | link:#attention-set-input[AttentionSetInput] entity. |
| 6199 | |
| 6200 | User must be left empty, or the user must be exactly |
| 6201 | the same user as in the request header. |
| 6202 | |
| 6203 | .Request |
| 6204 | ---- |
| 6205 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0 |
| 6206 | Content-Type: application/json; charset=UTF-8 |
| 6207 | |
| 6208 | { |
| 6209 | "reason": "reason" |
| 6210 | } |
| 6211 | ---- |
| 6212 | |
| 6213 | .Response |
| 6214 | ---- |
| 6215 | HTTP/1.1 204 No Content |
| 6216 | ---- |
| 6217 | |
| 6218 | [[attention-set]] |
| 6219 | == Attention Set |
| 6220 | Attention Set is the set of users that should perform some action on the |
| 6221 | change. E.g, reviewers should review the change, owner/uploader should |
| 6222 | add a new patchset or respond to comments. |
| 6223 | |
| 6224 | Users are added to the attention set if one the following apply: |
| 6225 | |
| 6226 | * They are manually added in link:#review-input[ReviewInput] in |
| 6227 | add_to_attention_set. |
| 6228 | * They are added as reviewers. |
| 6229 | * The change is marked ready for review. |
| 6230 | * As an owner/uploader, when someone replies on your change. |
| 6231 | * As a reviewer, when the owner/uploader replies. |
Gal Paikin | 6ce56dc | 2021-03-29 12:28:43 +0200 | [diff] [blame] | 6232 | * When the user's vote is deleted by another user. |
Gal Paikin | 102f6d8 | 2021-04-13 15:21:51 +0200 | [diff] [blame] | 6233 | * The rules above (except manually adding to the attention set) don't apply |
| 6234 | for changes that are work in progress. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6235 | |
| 6236 | Users are removed from the attention set if one the following apply: |
| 6237 | |
| 6238 | * They are manually removed in link:#review-input[ReviewInput] in |
| 6239 | remove_from_attention_set. |
| 6240 | * They are removed from reviewers. |
| 6241 | * The change is marked work in progress, abandoned, or submitted. |
| 6242 | * When the user replies on a change. |
| 6243 | |
| 6244 | If the ignore_default_attention_set_rules in link:#review-input[ReviewInput] |
| 6245 | is set to true, no other changes to the attention set will occur during the |
| 6246 | link:#set-review[set-review]. |
| 6247 | Also, users specified in the list will occur instead of any of the implicit |
| 6248 | changes to the attention set. E.g, if a user is added by add_to_attention_set |
| 6249 | in link:#review-input[ReviewInput], but also the change is marked work in |
| 6250 | progress, the user will still be added. |
| 6251 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6252 | [[ids]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6253 | == IDs |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6254 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 6255 | [[account-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6256 | === link:rest-api-accounts.html#account-id[\{account-id\}] |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 6257 | -- |
| 6258 | -- |
| 6259 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6260 | [[change-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6261 | === \{change-id\} |
Patrick Hiesel | 18da045 | 2017-12-21 14:02:05 +0100 | [diff] [blame] | 6262 | Identifier that uniquely identifies one change. It contains the URL-encoded |
| 6263 | project name as well as the change number: "'$$<project>~<numericId>$$'" |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6264 | |
David Pursehouse | a592397 | 2020-02-26 09:39:38 +0900 | [diff] [blame] | 6265 | Gerrit also supports the following identifiers: |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6266 | |
| 6267 | * an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'", |
| 6268 | where for the branch the `refs/heads/` prefix can be omitted |
| 6269 | ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$") |
| 6270 | * a Change-Id if it uniquely identifies one change |
| 6271 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
Patrick Hiesel | 4d2dd18 | 2017-05-09 17:35:18 +0200 | [diff] [blame] | 6272 | * a numeric change ID ("4247") |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6273 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 6274 | [[change-message-id]] |
| 6275 | === \{change-message-id\} |
| 6276 | ID of a change message returned in a link:#change-message-info[ChangeMessageInfo]. |
| 6277 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6278 | [[comment-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6279 | === \{comment-id\} |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6280 | UUID of a published comment. |
| 6281 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 6282 | [[draft-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6283 | === \{draft-id\} |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 6284 | UUID of a draft comment. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6285 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 6286 | [[label-id]] |
| 6287 | === \{label-id\} |
| 6288 | The name of the label. |
| 6289 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6290 | [[file-id]] |
David Pursehouse | b10c266 | 2016-12-06 08:41:33 +0900 | [diff] [blame] | 6291 | === \{file-id\} |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6292 | The path of the file. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 6293 | |
David Pursehouse | 11badbb | 2017-03-27 10:58:05 +0900 | [diff] [blame] | 6294 | The following magic paths are supported: |
| 6295 | |
| 6296 | * `/COMMIT_MSG`: |
| 6297 | + |
| 6298 | The commit message and headers with the parent commit(s), the author |
| 6299 | information and the committer information. |
| 6300 | |
| 6301 | * `/MERGE_LIST` (for merge commits only): |
| 6302 | + |
| 6303 | The list of commits that are being integrated into the destination |
| 6304 | branch by submitting the merge commit. |
| 6305 | |
Gal Paikin | 3edc142 | 2020-03-19 12:04:52 +0100 | [diff] [blame] | 6306 | * `/PATCHSET_LEVEL`: |
| 6307 | + |
| 6308 | This file path is used exclusively for posting and indicating |
| 6309 | patchset-level comments, thus not relevant for other use-cases. |
| 6310 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6311 | [[fix-id]] |
| 6312 | === \{fix-id\} |
| 6313 | UUID of a suggested fix. |
| 6314 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6315 | [[revision-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6316 | === \{revision-id\} |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6317 | Identifier that uniquely identifies one revision of a change. |
| 6318 | |
| 6319 | This can be: |
| 6320 | |
Shawn Pearce | 9c0722a | 2013-03-02 15:30:31 -0800 | [diff] [blame] | 6321 | * the literal `current` to name the current patch set/revision |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6322 | * a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1") |
| 6323 | * an abbreviated commit ID that uniquely identifies one revision of the |
| 6324 | change ("674ac754"), at least 4 digits are required |
| 6325 | * 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] | 6326 | * "0" or the literal `edit` for a change edit |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6327 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6328 | [[json-entities]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6329 | == JSON Entities |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6330 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6331 | [[abandon-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6332 | === AbandonInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6333 | The `AbandonInput` entity contains information for abandoning a change. |
| 6334 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6335 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6336 | |============================= |
| 6337 | |Field Name ||Description |
| 6338 | |`message` |optional| |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6339 | Message to be added as review comment to the change when abandoning the |
| 6340 | change. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6341 | |`notify` |optional| |
Stephen Li | e5fcdf7 | 2016-08-02 11:05:11 -0700 | [diff] [blame] | 6342 | Notify handling that defines to whom email notifications should be sent after |
| 6343 | the change is abandoned. + |
| 6344 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6345 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6346 | |`notify_details`|optional| |
| 6347 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 6348 | of link:user-notify.html#recipient-types[recipient type] to |
| 6349 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6350 | |============================= |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6351 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6352 | [[action-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6353 | === ActionInfo |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6354 | The `ActionInfo` entity describes a REST API call the client can |
| 6355 | make to manipulate a resource. These are frequently implemented by |
| 6356 | plugins and may be discovered at runtime. |
| 6357 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6358 | [options="header",cols="1,^1,5"] |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6359 | |==================================== |
| 6360 | |Field Name ||Description |
| 6361 | |`method` |optional| |
| 6362 | HTTP method to use with the action. Most actions use `POST`, `PUT` |
| 6363 | or `DELETE` to cause state changes. |
| 6364 | |`label` |optional| |
| 6365 | Short title to display to a user describing the action. In the |
| 6366 | Gerrit web interface the label is used as the text on the button |
| 6367 | presented in the UI. |
| 6368 | |`title` |optional| |
| 6369 | Longer text to display describing the action. In a web UI this |
| 6370 | should be the title attribute of the element, displaying when |
| 6371 | the user hovers the mouse. |
| 6372 | |`enabled` |optional| |
| 6373 | If true the action is permitted at this time and the caller is |
| 6374 | likely allowed to execute it. This may change if state is updated |
| 6375 | at the server or permissions are modified. Not present if false. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6376 | |==================================== |
| 6377 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6378 | [[approval-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6379 | === ApprovalInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6380 | The `ApprovalInfo` entity contains information about an approval from a |
| 6381 | user for a label on a change. |
| 6382 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 6383 | `ApprovalInfo` has the same fields as |
| 6384 | link:rest-api-accounts.html#account-info[AccountInfo]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6385 | In addition `ApprovalInfo` has the following fields: |
| 6386 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6387 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6388 | |=========================== |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 6389 | |Field Name ||Description |
| 6390 | |`value` |optional| |
Dave Borowitz | a30db91 | 2013-03-22 14:20:33 -0700 | [diff] [blame] | 6391 | The vote that the user has given for the label. If present and zero, the |
| 6392 | user is permitted to vote on the label. If absent, the user is not |
| 6393 | permitted to vote on that label. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 6394 | |`permitted_voting_range` |optional| |
| 6395 | The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote |
| 6396 | on that label. If present, the user is permitted to vote on the label |
| 6397 | regarding the range values. If absent, the user is not permitted to vote |
| 6398 | on that label. |
| 6399 | |`date` |optional| |
Gustaf Lundh | 2e07d502 | 2013-05-08 17:07:42 +0100 | [diff] [blame] | 6400 | The time and date describing when the approval was made. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 6401 | |`tag` |optional| |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6402 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 6403 | while posting the review. Votes/comments that contain `tag` with |
| 6404 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 6405 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6406 | invocations of the REST call are required. |
Dave Borowitz | e47fe47 | 2016-09-09 13:57:14 -0400 | [diff] [blame] | 6407 | |`post_submit` |not set if `false`| |
| 6408 | If true, this vote was made after the change was submitted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6409 | |=========================== |
| 6410 | |
Sven Selberg | 273a4aa | 2016-09-21 16:28:10 +0200 | [diff] [blame] | 6411 | [[assignee-input]] |
| 6412 | === AssigneeInput |
| 6413 | The `AssigneeInput` entity contains the identity of the user to be set as assignee. |
| 6414 | |
| 6415 | [options="header",cols="1,^1,5"] |
| 6416 | |=========================== |
| 6417 | |Field Name ||Description |
| 6418 | |`assignee` || |
| 6419 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 6420 | should be added as assignee. |
| 6421 | |=========================== |
| 6422 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6423 | [[attention-set-info]] |
| 6424 | === AttentionSetInfo |
| 6425 | The `AttentionSetInfo` entity contains details of users that are in |
| 6426 | the link:#attention-set[attention set]. |
| 6427 | |
| 6428 | [options="header",cols="1,^1,5"] |
| 6429 | |=========================== |
| 6430 | |Field Name ||Description |
| 6431 | |`account` || link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6432 | |`last_update` || The link:rest-api.html#timestamp[timestamp] of the last update. |
Marija Savtchouk | 25a5fd5a | 2021-08-06 17:26:24 +0100 | [diff] [blame] | 6433 | |`reason` || |
| 6434 | The reason for adding or removing the user. |
| 6435 | If the update was caused by another user, that account is represented by |
| 6436 | account ID in reason as `<GERRIT_ACCOUNT_18419>` and the corresponding |
| 6437 | link:rest-api-accounts.html#account-info[AccountInfo] can be found in `reason_account` field. |
| 6438 | |`reason_account` || |
| 6439 | link:rest-api-accounts.html#account-info[AccountInfo] of the user who caused the update. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6440 | |
| 6441 | |=========================== |
| 6442 | [[attention-set-input]] |
| 6443 | === AttentionSetInput |
| 6444 | The `AttentionSetInput` entity contains details for adding users to the |
| 6445 | link:#attention-set[attention set] and removing them from it. |
| 6446 | |
| 6447 | [options="header",cols="1,^1,5"] |
| 6448 | |=========================== |
Gal Paikin | f2b1b33 | 2020-07-06 16:34:36 +0300 | [diff] [blame] | 6449 | |Field Name ||Description |
| 6450 | |`user` |optional| link:rest-api-accounts.html#account-id[ID] |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6451 | of the account that should be added to the attention set. For removals, |
| 6452 | this field should be empty or the same as the field in the request header. |
Gal Paikin | f2b1b33 | 2020-07-06 16:34:36 +0300 | [diff] [blame] | 6453 | |`reason` || The reason of for adding or removing the user. |
| 6454 | |`notify` |optional| |
| 6455 | Notify handling that defines to whom email notifications should be sent |
| 6456 | after the change is created. + |
| 6457 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6458 | If not set, the default is `OWNER`. |
| 6459 | |`notify_details` |optional| |
| 6460 | Additional information about whom to notify about the change creation |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 6461 | as a map of link:user-notify.html#recipient-types[recipient type] to |
| 6462 | link:#notify-info[NotifyInfo] entity. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6463 | |=========================== |
| 6464 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 6465 | [[blame-info]] |
| 6466 | === BlameInfo |
| 6467 | The `BlameInfo` entity stores the commit metadata with the row coordinates where |
| 6468 | it applies. |
| 6469 | |
| 6470 | [options="header",cols="1,6"] |
| 6471 | |=========================== |
| 6472 | |Field Name | Description |
| 6473 | |`author` | The author of the commit. |
| 6474 | |`id` | The id of the commit. |
| 6475 | |`time` | Commit time. |
| 6476 | |`commit_msg` | The commit message. |
| 6477 | |`ranges` | |
| 6478 | The blame row coordinates as link:#range-info[RangeInfo] entities. |
| 6479 | |=========================== |
| 6480 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6481 | [[change-edit-input]] |
| 6482 | === ChangeEditInput |
| 6483 | The `ChangeEditInput` entity contains information for restoring a |
| 6484 | path within change edit. |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 6485 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6486 | [options="header",cols="1,^1,5"] |
| 6487 | |=========================== |
| 6488 | |Field Name ||Description |
| 6489 | |`restore_path`|optional|Path to file to restore. |
| 6490 | |`old_path` |optional|Old path to file to rename. |
| 6491 | |`new_path` |optional|New path to file to rename. |
| 6492 | |=========================== |
| 6493 | |
| 6494 | [[change-edit-message-input]] |
| 6495 | === ChangeEditMessageInput |
| 6496 | The `ChangeEditMessageInput` entity contains information for changing |
| 6497 | the commit message within a change edit. |
| 6498 | |
| 6499 | [options="header",cols="1,^1,5"] |
| 6500 | |=========================== |
| 6501 | |Field Name ||Description |
| 6502 | |`message` ||New commit message. |
| 6503 | |=========================== |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 6504 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6505 | [[change-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6506 | === ChangeInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6507 | The `ChangeInfo` entity contains information about a change. |
| 6508 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6509 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6510 | |================================== |
| 6511 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6512 | |`id` || |
| 6513 | The ID of the change in the format "'<project>\~<branch>~<Change-Id>'", |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 6514 | where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6515 | `refs/heads/` prefix is omitted. |
| 6516 | |`project` ||The name of the project. |
| 6517 | |`branch` || |
| 6518 | The name of the target branch. + |
| 6519 | The `refs/heads/` prefix is omitted. |
Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 6520 | |`topic` |optional|The topic to which this change belongs. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6521 | |`attention_set` |optional| |
| 6522 | The map that maps link:rest-api-accounts.html#account-id[account IDs] |
| 6523 | to link:#attention-set-info[AttentionSetInfo] of that account. |
Edwin Kempin | 93b74fb | 2017-08-25 10:42:56 +0200 | [diff] [blame] | 6524 | |`assignee` |optional| |
| 6525 | The assignee of the change as an link:rest-api-accounts.html#account-info[ |
| 6526 | AccountInfo] entity. |
| 6527 | |`hashtags` |optional| |
Gal Paikin | 07a580c | 2021-04-15 09:47:36 +0200 | [diff] [blame] | 6528 | List of hashtags that are set on the change. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6529 | |`change_id` ||The Change-Id of the change. |
| 6530 | |`subject` || |
| 6531 | The subject of the change (header line of the commit message). |
| 6532 | |`status` || |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 6533 | The status of the change (`NEW`, `MERGED`, `ABANDONED`). |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6534 | |`created` || |
| 6535 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 6536 | created. |
| 6537 | |`updated` || |
| 6538 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 6539 | updated. |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 6540 | |`submitted` |only set for merged changes| |
| 6541 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 6542 | submitted. |
Dave Borowitz | 8ec31f9 | 2017-08-23 10:28:34 -0400 | [diff] [blame] | 6543 | |`submitter` |only set for merged changes| |
| 6544 | The user who submitted the change, as an |
| 6545 | link:rest-api-accounts.html#account-info[ AccountInfo] entity. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6546 | |`starred` |not set if `false`| |
Edwin Kempin | 9e972cc | 2016-04-15 10:39:13 +0200 | [diff] [blame] | 6547 | Whether the calling user has starred this change with the default label. |
| 6548 | |`stars` |optional| |
| 6549 | A list of star labels that are applied by the calling user to this |
| 6550 | change. The labels are lexicographically sorted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6551 | |`reviewed` |not set if `false`| |
| 6552 | Whether the change was reviewed by the calling user. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 6553 | Only set if link:#reviewed[reviewed] is requested. |
Dave Borowitz | ace3210 | 2015-12-17 13:08:25 -0500 | [diff] [blame] | 6554 | |`submit_type` |optional| |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 6555 | 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] | 6556 | Not set for merged changes. |
Edwin Kempin | baf70e1 | 2013-02-27 10:36:13 +0100 | [diff] [blame] | 6557 | |`mergeable` |optional| |
| 6558 | Whether the change is mergeable. + |
Patrick Hiesel | a4824db | 2019-12-20 10:55:26 +0100 | [diff] [blame] | 6559 | Only set for open changes if |
| 6560 | link:config-gerrit.html#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior] |
| 6561 | is `API_REF_UPDATED_AND_CHANGE_REINDEX`. |
Shawn Pearce | 4cd05b2 | 2016-09-17 22:45:33 -0700 | [diff] [blame] | 6562 | |`submittable` |optional| |
| 6563 | Whether the change has been approved by the project submit rules. + |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 6564 | Only set if link:#submittable[requested]. |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 6565 | |`insertions` || |
| 6566 | Number of inserted lines. |
| 6567 | |`deletions` || |
| 6568 | Number of deleted lines. |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 6569 | |`total_comment_count` |optional| |
| 6570 | Total number of inline comments across all patch sets. Not set if the current |
| 6571 | change index doesn't have the data. |
Changcheng Xiao | 81c4809 | 2017-02-08 13:04:07 +0100 | [diff] [blame] | 6572 | |`unresolved_comment_count` |optional| |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 6573 | Number of unresolved inline comment threads across all patch sets. Not set if |
| 6574 | the current change index doesn't have the data. |
Ben Rohlfs | b56e355 | 2021-09-10 09:04:19 +0200 | [diff] [blame] | 6575 | |`_number` || |
| 6576 | The numeric ID of the change. (The underscore is just a relict of a prior |
| 6577 | attempt to deprecate the numeric ID.) |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6578 | |`owner` || |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 6579 | The owner of the change as an link:rest-api-accounts.html#account-info[ |
| 6580 | AccountInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 6581 | |`actions` |optional| |
| 6582 | Actions the caller might be able to perform on this revision. The |
| 6583 | information is a map of view name to link:#action-info[ActionInfo] |
| 6584 | entities. |
Youssef Elghareeb | 02d33aa | 2021-10-04 13:24:52 +0200 | [diff] [blame] | 6585 | |`submit_records` || |
| 6586 | List of the link:rest-api-changes.html#submit-record-info[SubmitRecordInfo] |
| 6587 | containing the submit records for the change at the latest patchset. |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 6588 | |`requirements` |optional| |
| 6589 | List of the link:rest-api-changes.html#requirement[requirements] to be met before this change |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 6590 | can be submitted. This field is deprecated in favour of `submit_requirements`. |
| 6591 | |`submit_requirements` |optional| |
| 6592 | List of the link:#submit-requirement-result-info[SubmitRequirementResultInfo] |
| 6593 | containing the evaluated submit requirements for the change. |
| 6594 | Only set if link:#submit-requirements[`SUBMIT_REQUIREMENTS`] is requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6595 | |`labels` |optional| |
| 6596 | The labels of the change as a map that maps the label names to |
| 6597 | link:#label-info[LabelInfo] entries. + |
| 6598 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 6599 | labels] are requested. |
| 6600 | |`permitted_labels` |optional| |
| 6601 | A map of the permitted labels that maps a label name to the list of |
| 6602 | values that are allowed for that label. + |
| 6603 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 6604 | |`removable_reviewers`|optional| |
| 6605 | 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] | 6606 | link:rest-api-accounts.html#account-info[AccountInfo] entities. + |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 6607 | Only set if link:#labels[labels] or |
| 6608 | link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 6609 | |`reviewers` |optional| |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 6610 | The reviewers as a map that maps a reviewer state to a list of |
| 6611 | link:rest-api-accounts.html#account-info[AccountInfo] entities. |
| 6612 | Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. + |
| 6613 | `REVIEWER`: Users with at least one non-zero vote on the change. + |
| 6614 | `CC`: Users that were added to the change, but have not voted. + |
| 6615 | `REMOVED`: Users that were previously reviewers on the change, but have |
| 6616 | been removed. + |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 6617 | Only set if link:#labels[labels] or |
| 6618 | link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 6619 | |`pending_reviewers` |optional| |
| 6620 | Updates to `reviewers` that have been made while the change was in the |
| 6621 | WIP state. Only present on WIP changes and only if there are pending |
| 6622 | reviewer updates to report. These are reviewers who have not yet been |
| 6623 | notified about being added to or removed from the change. + |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 6624 | Only set if link:#labels[labels] or |
| 6625 | link:#detailed-labels[detailed labels] are requested. |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 6626 | |`reviewer_updates`|optional| |
| 6627 | Updates to reviewers set for the change as |
| 6628 | link:#review-update-info[ReviewerUpdateInfo] entities. |
Han-Wen Nienhuys | 3c670be | 2020-06-30 19:17:07 +0200 | [diff] [blame] | 6629 | Only set if link:#reviewer-updates[reviewer updates] are requested. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6630 | |`messages`|optional| |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 6631 | Messages associated with the change as a list of |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6632 | link:#change-message-info[ChangeMessageInfo] entities. + |
| 6633 | Only set if link:#messages[messages] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6634 | |`current_revision` |optional| |
| 6635 | The commit ID of the current patch set of this change. + |
| 6636 | Only set if link:#current-revision[the current revision] is requested |
| 6637 | or if link:#all-revisions[all revisions] are requested. |
| 6638 | |`revisions` |optional| |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 6639 | 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] | 6640 | patch set to a link:#revision-info[RevisionInfo] entity. + |
Dave Borowitz | 0adf270 | 2014-01-22 10:41:52 -0800 | [diff] [blame] | 6641 | Only set if link:#current-revision[the current revision] is requested |
| 6642 | (in which case it will only contain a key for the current revision) or |
| 6643 | if link:#all-revisions[all revisions] are requested. |
Han-Wen Nienhuys | 4ec526a | 2021-02-16 19:20:26 +0100 | [diff] [blame] | 6644 | |`meta_rev_id` |optional| |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 6645 | The SHA-1 of the NoteDb meta ref. |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 6646 | |`tracking_ids` |optional| |
| 6647 | A list of link:#tracking-id-info[TrackingIdInfo] entities describing |
| 6648 | references to external tracking systems. Only set if |
| 6649 | link:#tracking-ids[tracking ids] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6650 | |`_more_changes` |optional, not set if `false`| |
| 6651 | Whether the query would deliver more results if not limited. + |
Dave Borowitz | 4241459 | 2014-12-19 11:27:14 -0800 | [diff] [blame] | 6652 | Only set on the last change that is returned. |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 6653 | |`problems` |optional| |
| 6654 | A list of link:#problem-info[ProblemInfo] entities describing potential |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 6655 | problems with this change. Only set if link:#check[CHECK] is set. |
David Ostrovsky | cb19cec | 2017-04-28 11:55:45 +0200 | [diff] [blame] | 6656 | |`is_private` |optional, not set if `false`| |
| 6657 | When present, change is marked as private. |
David Ostrovsky | 258849b | 2017-03-09 23:21:03 +0100 | [diff] [blame] | 6658 | |`work_in_progress` |optional, not set if `false`| |
| 6659 | When present, change is marked as Work In Progress. |
Logan Hanks | 724b24c | 2017-07-14 10:01:05 -0700 | [diff] [blame] | 6660 | |`has_review_started` |optional, not set if `false`| |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 6661 | When present, change has been marked Ready at some point in time. |
Patrick Hiesel | 828f322 | 2017-07-13 14:18:38 +0200 | [diff] [blame] | 6662 | |`revert_of` |optional| |
| 6663 | The numeric Change-Id of the change that this change reverts. |
Gal Paikin | f57225a | 2019-11-13 12:39:12 -0800 | [diff] [blame] | 6664 | |`submission_id` |optional| |
| 6665 | ID of the submission of this change. Only set if the status is `MERGED`. |
Gal Paikin | dd31db9 | 2019-12-06 14:43:35 +0100 | [diff] [blame] | 6666 | This ID is equal to the numeric ID of the change that triggered the submission. |
| 6667 | If the change that triggered the submission also has a topic, it will be |
| 6668 | "<id>-<topic>" of the change that triggered the submission. |
| 6669 | The callers must not rely on the format of the submission ID. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 6670 | |`cherry_pick_of_change` |optional| |
Kaushik Lingarkar | 73bcb41 | 2020-01-29 13:00:46 -0800 | [diff] [blame] | 6671 | The numeric Change-Id of the change that this change was cherry-picked from. |
Edwin Kempin | 4529d64 | 2021-02-01 13:03:08 +0100 | [diff] [blame] | 6672 | Only set if the cherry-pick has been done through the Gerrit REST API (and |
| 6673 | not if a cherry-picked commit was pushed). |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 6674 | |`cherry_pick_of_patch_set`|optional| |
Kaushik Lingarkar | 73bcb41 | 2020-01-29 13:00:46 -0800 | [diff] [blame] | 6675 | The patchset number of the change that this change was cherry-picked from. |
Edwin Kempin | 4529d64 | 2021-02-01 13:03:08 +0100 | [diff] [blame] | 6676 | Only set if the cherry-pick has been done through the Gerrit REST API (and |
| 6677 | not if a cherry-picked commit was pushed). |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 6678 | |`contains_git_conflicts` |optional, not set if `false`| |
| 6679 | Whether the change contains conflicts. + |
| 6680 | If `true`, some of the file contents of the change contain git conflict |
| 6681 | markers to indicate the conflicts. + |
| 6682 | Only set if this change info is returned in response to a request that |
| 6683 | creates a new change or patch set and conflicts are allowed. In |
| 6684 | particular this field is only populated if the change info is returned |
| 6685 | by one of the following REST endpoints: link:#create-change[Create |
| 6686 | Change], link:#create-merge-patch-set-for-change[Create Merge Patch Set |
| 6687 | For Change], link:#cherry-pick[Cherry Pick Revision], |
| 6688 | link:rest-api-project.html#cherry-pick-commit[Cherry Pick Commit] |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 6689 | |================================== |
| 6690 | |
| 6691 | [[change-input]] |
| 6692 | === ChangeInput |
| 6693 | The `ChangeInput` entity contains information about creating a new change. |
| 6694 | |
| 6695 | [options="header",cols="1,^1,5"] |
| 6696 | |================================== |
| 6697 | |Field Name ||Description |
| 6698 | |`project` ||The name of the project. |
| 6699 | |`branch` || |
| 6700 | The name of the target branch. + |
| 6701 | The `refs/heads/` prefix is omitted. |
| 6702 | |`subject` || |
Edwin Kempin | ba8388c | 2020-03-06 08:46:59 +0100 | [diff] [blame] | 6703 | The commit message of the change. Comment lines (beginning with `#`) |
| 6704 | will be removed. If the commit message contains a Change-Id (as a |
| 6705 | "Change-Id: I..." footer) that Change-Id will be used for the newly |
| 6706 | created changed. If a change with this Change-Id already exists for |
| 6707 | same repository and branch, the request is rejected since Change-Ids |
| 6708 | must be unique per repository and branch. If the commit message doesn't |
| 6709 | contain a Change-Id, a newly generated Change-Id is automatically |
| 6710 | inserted into the commit message. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 6711 | |`topic` |optional|The topic to which this change belongs. |
Gal Paikin | 44dbd7e | 2020-04-15 15:23:44 +0200 | [diff] [blame] | 6712 | Topic can't contain quotation marks. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 6713 | |`status` |optional, default to `NEW`| |
David Ostrovsky | 4b44bdc | 2017-07-27 08:05:43 +0200 | [diff] [blame] | 6714 | The status of the change (only `NEW` accepted here). |
Edwin Kempin | 14d50ed | 2017-05-03 13:26:30 +0200 | [diff] [blame] | 6715 | |`is_private` |optional, default to `false`| |
| 6716 | Whether the new change should be marked as private. |
| 6717 | |`work_in_progress` |optional, default to `false`| |
| 6718 | Whether the new change should be set to work in progress. |
David Ostrovsky | 9d8ec42 | 2014-12-24 00:52:09 +0100 | [diff] [blame] | 6719 | |`base_change` |optional| |
| 6720 | 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] | 6721 | change operation. Mutually exclusive with `base_commit`. |
| 6722 | |`base_commit` |optional| |
| 6723 | A 40-digit hex SHA-1 of the commit which will be the parent commit of the newly |
| 6724 | created change. If set, it must be a merged commit on the destination branch. |
| 6725 | Mutually exclusive with `base_change`. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 6726 | |`new_branch` |optional, default to `false`| |
Edwin Kempin | e94bb87 | 2019-10-08 13:47:41 +0200 | [diff] [blame] | 6727 | Allow creating a new branch when set to `true`. Using this option is |
| 6728 | only possible for non-merge commits (if the `merge` field is not set). |
Edwin Kempin | ed8a6bf | 2021-06-15 14:00:31 +0200 | [diff] [blame] | 6729 | |`validation_options` |optional| |
| 6730 | Map with key-value pairs that are forwarded as options to the commit validation |
| 6731 | listeners (e.g. can be used to skip certain validations). Which validation |
| 6732 | options are supported depends on the installed commit validation listeners. |
| 6733 | Gerrit core doesn't support any validation options, but commit validation |
| 6734 | listeners that are implemented in plugins may. Please refer to the |
| 6735 | documentation of the installed plugins to learn whether they support validation |
| 6736 | options. Unknown validation options are silently ignored. |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 6737 | |`merge` |optional| |
| 6738 | 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] | 6739 | If set, the target branch (see `branch` field) must exist (it is not |
| 6740 | possible to create it automatically by setting the `new_branch` field |
| 6741 | to `true`. |
Han-Wen Nienhuys | 2a1029e | 2020-01-30 18:52:45 +0100 | [diff] [blame] | 6742 | |`author` |optional| |
| 6743 | An link:rest-api-accounts.html#account-input[AccountInput] entity |
| 6744 | that will set the author of the commit to create. The author must be |
| 6745 | specified as name/email combination. |
| 6746 | The caller needs "Forge Author" permission when using this field. |
| 6747 | This field does not affect the owner of the change, which will |
| 6748 | continue to use the identity of the caller. |
Edwin Kempin | 5f8c383 | 2017-01-13 11:45:06 +0100 | [diff] [blame] | 6749 | |`notify` |optional| |
| 6750 | Notify handling that defines to whom email notifications should be sent |
| 6751 | after the change is created. + |
| 6752 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6753 | If not set, the default is `ALL`. |
| 6754 | |`notify_details` |optional| |
| 6755 | Additional information about whom to notify about the change creation |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 6756 | as a map of link:user-notify.html#recipient-types[recipient type] to |
| 6757 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6758 | |================================== |
| 6759 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6760 | [[change-message-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6761 | === ChangeMessageInfo |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6762 | The `ChangeMessageInfo` entity contains information about a message |
| 6763 | attached to a change. |
| 6764 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6765 | [options="header",cols="1,^1,5"] |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6766 | |================================== |
| 6767 | |Field Name ||Description |
| 6768 | |`id` ||The ID of the message. |
| 6769 | |`author` |optional| |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 6770 | Author of the message as an |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6771 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 6772 | Unset if written by the Gerrit system. |
Patrick Hiesel | 9221ef1 | 2017-03-23 16:44:36 +0100 | [diff] [blame] | 6773 | |`real_author` |optional| |
| 6774 | Real author of the message as an |
| 6775 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 6776 | Set if the message was posted on behalf of another user. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6777 | |`date` || |
| 6778 | The link:rest-api.html#timestamp[timestamp] this message was posted. |
Marija Savtchouk | e40dc1a | 2021-04-07 09:56:12 +0100 | [diff] [blame] | 6779 | |`message` || |
| 6780 | The text left by the user or Gerrit system. Accounts are served as account IDs |
| 6781 | inlined in the text as `<GERRIT_ACCOUNT_18419>`. |
| 6782 | All accounts, used in message, can be found in `accountsInMessage` |
| 6783 | field. |
| 6784 | |`accountsInMessage` ||Accounts, used in `message`. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6785 | |`tag` |optional| |
| 6786 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 6787 | while posting the review. Votes/comments that contain `tag` with |
| 6788 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 6789 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6790 | invocations of the REST call are required. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 6791 | |`_revision_number` |optional| |
| 6792 | Which patchset (if any) generated this message. |
| 6793 | |================================== |
| 6794 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6795 | [[cherrypick-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6796 | === CherryPickInput |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6797 | The `CherryPickInput` entity contains information for cherry-picking a change to a new branch. |
| 6798 | |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6799 | [options="header",cols="1,^1,5"] |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6800 | |=========================== |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6801 | |Field Name ||Description |
Edwin Kempin | 159804b | 2019-09-23 11:09:39 +0200 | [diff] [blame] | 6802 | |`message` |optional| |
| 6803 | Commit message for the cherry-pick change. If not set, the commit message of |
| 6804 | the cherry-picked commit is used. |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 6805 | |`destination` ||Destination branch |
Changcheng Xiao | e333258 | 2017-05-26 15:29:41 +0200 | [diff] [blame] | 6806 | |`base` |optional| |
| 6807 | 40-hex digit SHA-1 of the commit which will be the parent commit of the newly created change. |
| 6808 | 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] | 6809 | |`parent` |optional, defaults to 1| |
| 6810 | 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] | 6811 | |`notify` |optional| |
| 6812 | Notify handling that defines to whom email notifications should be sent |
| 6813 | after the cherry-pick. + |
| 6814 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Saša Živkov | 357e2bd | 2020-06-12 12:06:07 +0200 | [diff] [blame] | 6815 | If not set, the default is `ALL`. |
Changcheng Xiao | e04e846 | 2017-05-23 09:39:03 +0200 | [diff] [blame] | 6816 | |`notify_details` |optional| |
| 6817 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 6818 | of link:user-notify.html#recipient-types[recipient type] to |
| 6819 | link:#notify-info[NotifyInfo] entity. |
Aaron Gable | 54bc983 | 2017-07-05 14:44:36 -0700 | [diff] [blame] | 6820 | |`keep_reviewers` |optional, defaults to false| |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 6821 | If `true`, carries reviewers and ccs over from original change to newly created one. |
| 6822 | |`allow_conflicts` |optional, defaults to false| |
| 6823 | If `true`, the cherry-pick uses content merge and succeeds also if |
| 6824 | there are conflicts. If there are conflicts the file contents of the |
| 6825 | created change contain git conflict markers to indicate the conflicts. |
| 6826 | Callers can find out if there were conflicts by checking the |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 6827 | `contains_git_conflicts` field in the link:#change-info[ChangeInfo]. If |
| 6828 | there are conflicts the cherry-pick change is marked as |
Edwin Kempin | 3c4113a | 2018-10-12 10:49:33 +0200 | [diff] [blame] | 6829 | work-in-progress. |
Gal Paikin | f3abd3c | 2020-03-24 16:39:20 +0100 | [diff] [blame] | 6830 | |`topic` |optional| |
| 6831 | The topic of the created cherry-picked change. If not set, the default depends |
| 6832 | on the source. If the source is a change with a topic, the resulting topic |
| 6833 | of the cherry-picked change will be {source_change_topic}-{destination_branch}. |
| 6834 | Otherwise, if the source change has no topic, or the source is a commit, |
| 6835 | the created change will have no topic. |
Gal Paikin | 1f83c20 | 2020-03-31 16:23:41 +0200 | [diff] [blame] | 6836 | If the change already exists, the topic will not change if not set. If set, the |
| 6837 | topic will be overridden. |
Gal Paikin | 626abe0 | 2020-04-07 12:21:26 +0200 | [diff] [blame] | 6838 | |`allow_empty` |optional, defaults to false| |
| 6839 | If `true`, the cherry-pick succeeds also if the created commit will be empty. |
| 6840 | If `false`, a cherry-pick that would create an empty commit fails without creating |
| 6841 | the commit. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6842 | |=========================== |
| 6843 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6844 | [[comment-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6845 | === CommentInfo |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 6846 | The `CommentInfo` entity contains information about an inline comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6847 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6848 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6849 | |=========================== |
| 6850 | |Field Name ||Description |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 6851 | |`patch_set` |optional| |
| 6852 | The patch set number for the comment; only set in contexts where + |
| 6853 | comments may be returned for multiple patch sets. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6854 | |`id` ||The URL encoded UUID of the comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6855 | |`path` |optional| |
Gal Paikin | 3edc142 | 2020-03-19 12:04:52 +0100 | [diff] [blame] | 6856 | link:#file-id[The file path] for which the inline comment was done. + |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6857 | Not set if returned in a map where the key is the file path. |
| 6858 | |`side` |optional| |
| 6859 | The side on which the comment was added. + |
| 6860 | Allowed values are `REVISION` and `PARENT`. + |
| 6861 | If not set, the default is `REVISION`. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 6862 | |`parent` |optional| |
| 6863 | The 1-based parent number. Used only for merge commits when `side == PARENT`. |
| 6864 | When not set the comment is for the auto-merge tree. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6865 | |`line` |optional| |
| 6866 | The number of the line for which the comment was done. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6867 | If range is set, this equals the end line of the range. + |
| 6868 | If neither line nor range is set, it's a file comment. |
| 6869 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 6870 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6871 | entity. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6872 | |`in_reply_to` |optional| |
| 6873 | The URL encoded UUID of the comment to which this comment is a reply. |
| 6874 | |`message` |optional|The comment message. |
| 6875 | |`updated` || |
| 6876 | The link:rest-api.html#timestamp[timestamp] of when this comment was |
| 6877 | written. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6878 | |`author` |optional| |
David Pursehouse | c633a57 | 2013-08-26 14:01:59 +0900 | [diff] [blame] | 6879 | The author of the message as an |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6880 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 6881 | Unset for draft comments, assumed to be the calling user. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6882 | |`tag` |optional| |
| 6883 | Value of the `tag` field from link:#review-input[ReviewInput] set |
| 6884 | while posting the review. |
Sven Selberg | 1a6728d | 2018-09-28 12:30:12 +0200 | [diff] [blame] | 6885 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6886 | invocations of the REST call are required. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 6887 | |`unresolved` |optional| |
| 6888 | Whether or not the comment must be addressed by the user. The state of |
| 6889 | resolution of a comment thread is stored in the last comment in that thread |
| 6890 | chronologically. |
Youssef Elghareeb | 7fdfa44 | 2020-02-03 12:00:52 +0100 | [diff] [blame] | 6891 | |`change_message_id` |optional| |
Youssef Elghareeb | 5bd4e4e | 2020-08-13 17:09:42 +0200 | [diff] [blame] | 6892 | Available with the link:#list-change-comments[list change comments] endpoint. |
| 6893 | Contains the link:rest-api-changes.html#change-message-info[id] of the change |
| 6894 | message that this comment is linked to. |
Youssef Elghareeb | b5e4208 | 2020-07-09 15:24:01 +0200 | [diff] [blame] | 6895 | |`commit_id` |optional| |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 6896 | Hex commit SHA-1 (40 characters string) of the commit of the patchset to which |
Youssef Elghareeb | b5e4208 | 2020-07-09 15:24:01 +0200 | [diff] [blame] | 6897 | this comment applies. |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 6898 | |`context_lines` |optional| |
| 6899 | A list of link:#context-line[ContextLine] containing the lines of the source |
Youssef Elghareeb | 68e87b6 | 2021-01-11 13:20:03 +0100 | [diff] [blame] | 6900 | file where the comment was written. Available only if the "enable-context" |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 6901 | parameter (see link:#list-change-comments[List Change Comments]) is set. |
Youssef Elghareeb | 27d6201 | 2021-02-23 18:21:46 +0100 | [diff] [blame] | 6902 | |`source_content_type` |optional| |
| 6903 | Mime type of the file where the comment is written. Available only if the |
| 6904 | "enable-context" parameter (see link:#list-change-comments[List Change Comments]) |
| 6905 | is set. |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 6906 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 6907 | |=========================== |
| 6908 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6909 | [[comment-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6910 | === CommentInput |
Orgad Shaneh | c99da3a | 2014-06-13 14:57:54 +0300 | [diff] [blame] | 6911 | The `CommentInput` entity contains information for creating an inline |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6912 | comment. |
| 6913 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6914 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6915 | |=========================== |
| 6916 | |Field Name ||Description |
| 6917 | |`id` |optional| |
Edwin Kempin | c09826d7 | 2013-02-26 16:10:39 +0100 | [diff] [blame] | 6918 | The URL encoded UUID of the comment if an existing draft comment should |
| 6919 | be updated. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 6920 | |`path` |optional| |
Gal Paikin | 3edc142 | 2020-03-19 12:04:52 +0100 | [diff] [blame] | 6921 | link:#file-id[The file path] for which the inline comment should be added. + |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 6922 | Doesn't need to be set if contained in a map where the key is the file |
| 6923 | path. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6924 | |`side` |optional| |
| 6925 | The side on which the comment should be added. + |
| 6926 | Allowed values are `REVISION` and `PARENT`. + |
| 6927 | If not set, the default is `REVISION`. |
| 6928 | |`line` |optional| |
| 6929 | The number of the line for which the comment should be added. + |
| 6930 | `0` if it is a file comment. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6931 | If neither line nor range is set, a file comment is added. + |
David Pursehouse | 4a159a1 | 2014-08-26 15:45:14 +0900 | [diff] [blame] | 6932 | 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] | 6933 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 6934 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6935 | entity. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6936 | |`in_reply_to` |optional| |
| 6937 | 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] | 6938 | |`updated` |optional| |
| 6939 | The link:rest-api.html#timestamp[timestamp] of this comment. + |
| 6940 | Accepted but ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6941 | |`message` |optional| |
| 6942 | The comment message. + |
| 6943 | If not set and an existing draft comment is updated, the existing draft |
| 6944 | comment is deleted. |
Dave Borowitz | 3dd203b | 2016-04-19 13:52:41 -0400 | [diff] [blame] | 6945 | |`tag` |optional, drafts only| |
| 6946 | Value of the `tag` field. Only allowed on link:#create-draft[draft comment] + |
| 6947 | inputs; for published comments, use the `tag` field in + |
Gal Paikin | b2b81f2 | 2020-02-26 13:14:08 +0100 | [diff] [blame] | 6948 | link:#review-input[ReviewInput]. Votes/comments that contain `tag` with |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 6949 | 'autogenerated:' prefix can be filtered out in the web UI. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 6950 | |`unresolved` |optional| |
| 6951 | Whether or not the comment must be addressed by the user. This value will |
| 6952 | default to false if the comment is an orphan, or the value of the `in_reply_to` |
| 6953 | comment if it is supplied. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 6954 | |=========================== |
| 6955 | |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6956 | [[comment-range]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6957 | === CommentRange |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6958 | The `CommentRange` entity describes the range of an inline comment. |
| 6959 | |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 6960 | The comment range is a range from the start position, specified by `start_line` |
| 6961 | and `start_character`, to the end position, specified by `end_line` and |
| 6962 | `end_character`. The start position is *inclusive* and the end position is |
| 6963 | *exclusive*. |
| 6964 | |
| 6965 | So, a range over part of a line will have `start_line` equal to |
| 6966 | `end_line`; however a range with `end_line` set to 5 and `end_character` equal |
| 6967 | to 0 will not include any characters on line 5, |
| 6968 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6969 | [options="header",cols="1,^1,5"] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6970 | |=========================== |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 6971 | |Field Name ||Description |
| 6972 | |`start_line` ||The start line number of the range. (1-based) |
| 6973 | |`start_character` ||The character position in the start line. (0-based) |
| 6974 | |`end_line` ||The end line number of the range. (1-based) |
| 6975 | |`end_character` ||The character position in the end line. (0-based) |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 6976 | |=========================== |
| 6977 | |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 6978 | [[context-line]] |
| 6979 | === ContextLine |
| 6980 | The `ContextLine` entity contains the line number and line text of a single |
| 6981 | line of the source file content. |
| 6982 | |
| 6983 | [options="header",cols="1,6"] |
| 6984 | |=========================== |
| 6985 | |Field Name |Description |
| 6986 | |`line_number` |The line number of the source line. |
| 6987 | |`context_line` |String containing the line text. |
| 6988 | |=========================== |
| 6989 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6990 | [[commit-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6991 | === CommitInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6992 | The `CommitInfo` entity contains information about a commit. |
| 6993 | |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 6994 | [options="header",cols="1,^1,5"] |
| 6995 | |=========================== |
| 6996 | |Field Name ||Description |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 6997 | |`commit` |Optional| |
| 6998 | The commit ID. Not set if included in a link:#revision-info[ |
| 6999 | RevisionInfo] entity that is contained in a map which has the commit ID |
| 7000 | as key. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7001 | |`parents` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7002 | The parent commits of this commit as a list of |
Edwin Kempin | cecf90a | 2014-04-09 14:58:35 +0200 | [diff] [blame] | 7003 | link:#commit-info[CommitInfo] entities. In each parent |
| 7004 | only the `commit` and `subject` fields are populated. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7005 | |`author` ||The author of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7006 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7007 | |`committer` ||The committer of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7008 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7009 | |`subject` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7010 | The subject of the commit (header line of the commit message). |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7011 | |`message` ||The commit message. |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 7012 | |`web_links` |optional| |
Frank Borden | df69edb | 2021-05-05 17:00:15 +0200 | [diff] [blame] | 7013 | Links to the patch set in external sites as a list of |
| 7014 | link:#web-link-info[WebLinkInfo] entities. |
| 7015 | |`resolve_conflicts_web_links` |optional| |
| 7016 | Links to the commit in external sites for resolving conflicts as a list of |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 7017 | link:#web-link-info[WebLinkInfo] entities. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7018 | |=========================== |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7019 | |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 7020 | [[commit-message-input]] |
| 7021 | === CommitMessageInput |
| 7022 | The `CommitMessageInput` entity contains information for changing |
| 7023 | the commit message of a change. |
| 7024 | |
| 7025 | [options="header",cols="1,^1,5"] |
| 7026 | |============================= |
| 7027 | |Field Name ||Description |
| 7028 | |`message` ||New commit message. |
| 7029 | |`notify` |optional| |
| 7030 | Notify handling that defines to whom email notifications should be sent |
| 7031 | after the commit message was updated. + |
| 7032 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 7033 | 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] | 7034 | |`notify_details`|optional| |
| 7035 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7036 | of link:user-notify.html#recipient-types[recipient type] to |
| 7037 | link:#notify-info[NotifyInfo] entity. |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 7038 | |============================= |
| 7039 | |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 7040 | [[delete-change-message-input]] |
| 7041 | === DeleteChangeMessageInput |
| 7042 | The `DeleteChangeMessageInput` entity contains the options for deleting a change message. |
| 7043 | |
| 7044 | [options="header",cols="1,^1,5"] |
| 7045 | |============================= |
| 7046 | |Field Name ||Description |
| 7047 | |`reason` |optional| |
| 7048 | The reason why the change message should be deleted. + |
| 7049 | If set, the change message will be replaced with |
| 7050 | "Change message removed by: `name`\nReason: `reason`", |
| 7051 | or just "Change message removed by: `name`." if not set. |
| 7052 | |============================= |
| 7053 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 7054 | [[delete-comment-input]] |
| 7055 | === DeleteCommentInput |
| 7056 | The `DeleteCommentInput` entity contains the option for deleting a comment. |
| 7057 | |
| 7058 | [options="header",cols="1,^1,5"] |
| 7059 | |============================= |
| 7060 | |Field Name ||Description |
| 7061 | |`reason` |optional| |
| 7062 | The reason why the comment should be deleted. + |
| 7063 | If set, the comment's message will be replaced with |
| 7064 | "Comment removed by: `name`; Reason: `reason`", |
| 7065 | or just "Comment removed by: `name`." if not set. |
| 7066 | |============================= |
| 7067 | |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 7068 | [[delete-reviewer-input]] |
| 7069 | === DeleteReviewerInput |
| 7070 | The `DeleteReviewerInput` entity contains options for the deletion of a |
| 7071 | reviewer. |
| 7072 | |
| 7073 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7074 | |============================= |
| 7075 | |Field Name ||Description |
| 7076 | |`notify` |optional| |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 7077 | Notify handling that defines to whom email notifications should be sent |
| 7078 | after the reviewer is deleted. + |
| 7079 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7080 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7081 | |`notify_details`|optional| |
| 7082 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7083 | of link:user-notify.html#recipient-types[recipient type] to |
| 7084 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7085 | |============================= |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 7086 | |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7087 | [[delete-vote-input]] |
| 7088 | === DeleteVoteInput |
| 7089 | The `DeleteVoteInput` entity contains options for the deletion of a |
| 7090 | vote. |
| 7091 | |
| 7092 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7093 | |============================= |
| 7094 | |Field Name ||Description |
| 7095 | |`label` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7096 | The label for which the vote should be deleted. + |
| 7097 | If set, must match the label in the URL. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7098 | |`notify` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7099 | Notify handling that defines to whom email notifications should be sent |
| 7100 | after the vote is deleted. + |
| 7101 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7102 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7103 | |`notify_details`|optional| |
| 7104 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7105 | of link:user-notify.html#recipient-types[recipient type] to |
| 7106 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7107 | |============================= |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7108 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 7109 | [[description-input]] |
| 7110 | === DescriptionInput |
| 7111 | The `DescriptionInput` entity contains information for setting a description. |
| 7112 | |
| 7113 | [options="header",cols="1,6"] |
| 7114 | |=========================== |
| 7115 | |Field Name |Description |
| 7116 | |`description` |The description text. |
| 7117 | |=========================== |
| 7118 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7119 | [[diff-content]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7120 | === DiffContent |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7121 | The `DiffContent` entity contains information about the content differences |
| 7122 | in a file. |
| 7123 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7124 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7125 | |========================== |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7126 | |Field Name ||Description |
| 7127 | |`a` |optional|Content only in the file on side A (deleted in B). |
| 7128 | |`b` |optional|Content only in the file on side B (added in B). |
| 7129 | |`ab` |optional|Content in the file on both sides (unchanged). |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 7130 | |`edit_a` |only present when the `intraline` parameter is set and the |
| 7131 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7132 | Text sections deleted from side A as a |
| 7133 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 7134 | |`edit_b` |only present when the `intraline` parameter is set and the |
| 7135 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7136 | Text sections inserted in side B as a |
| 7137 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7138 | |`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a |
| 7139 | rebase. |
Renan Oliveira | c5077aa | 2020-09-25 18:11:54 +0200 | [diff] [blame] | 7140 | |`due_to_move`|not set if `false`|Indicates whether this entry was introduced by a |
| 7141 | move operation. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7142 | |`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] | 7143 | too large to include all common lines. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7144 | |`common` |optional|Set to `true` if the region is common according |
Shawn Pearce | 425a2be | 2014-01-02 16:00:58 -0800 | [diff] [blame] | 7145 | to the requested ignore-whitespace parameter, but a and b contain |
| 7146 | differing amounts of whitespace. When present and true a and b are |
| 7147 | used instead of ab. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7148 | |========================== |
| 7149 | |
| 7150 | [[diff-file-meta-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7151 | === DiffFileMetaInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7152 | The `DiffFileMetaInfo` entity contains meta information about a file diff. |
| 7153 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7154 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7155 | |========================== |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 7156 | |Field Name ||Description |
| 7157 | |`name` ||The name of the file. |
| 7158 | |`content_type`||The content type of the file. |
| 7159 | |`lines` ||The total number of lines in the file. |
Edwin Kempin | 26c95a4 | 2014-11-25 16:29:47 +0100 | [diff] [blame] | 7160 | |`web_links` |optional| |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 7161 | Links to the file in external sites as a list of |
Shawn Pearce | b62414c | 2014-10-16 22:48:33 -0700 | [diff] [blame] | 7162 | link:rest-api-changes.html#web-link-info[WebLinkInfo] entries. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7163 | |========================== |
| 7164 | |
| 7165 | [[diff-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7166 | === DiffInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7167 | The `DiffInfo` entity contains information about the diff of a file |
| 7168 | in a revision. |
| 7169 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7170 | If the link:#weblinks-only[weblinks-only] parameter is specified, only |
| 7171 | the `web_links` field is set. |
| 7172 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7173 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7174 | |========================== |
| 7175 | |Field Name ||Description |
| 7176 | |`meta_a` |not present when the file is added| |
| 7177 | Meta information about the file on side A as a |
| 7178 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 7179 | |`meta_b` |not present when the file is deleted| |
| 7180 | Meta information about the file on side B as a |
| 7181 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 7182 | |`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED` |
| 7183 | `COPIED`, `REWRITE`). |
| 7184 | |`intraline_status`|only set when the `intraline` parameter was specified in the request| |
| 7185 | Intraline status (`OK`, `ERROR`, `TIMEOUT`). |
| 7186 | |`diff_header` ||A list of strings representing the patch set diff header. |
| 7187 | |`content` ||The content differences in the file as a list of |
| 7188 | link:#diff-content[DiffContent] entities. |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7189 | |`web_links` |optional| |
| 7190 | Links to the file diff in external sites as a list of |
| 7191 | link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries. |
Frank Borden | 1952492 | 2021-05-04 11:40:44 +0200 | [diff] [blame] | 7192 | |`edit_web_links` |optional| |
| 7193 | Links to edit the file in external sites as a list of |
| 7194 | link:rest-api-changes.html#web-link-info[WebLinkInfo] entries. |
David Ostrovsky | cdbef23 | 2015-02-13 01:16:37 +0100 | [diff] [blame] | 7195 | |`binary` |not set if `false`|Whether the file is binary. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7196 | |========================== |
| 7197 | |
| 7198 | [[diff-intraline-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7199 | === DiffIntralineInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7200 | The `DiffIntralineInfo` entity contains information about intraline edits in a |
| 7201 | file. |
| 7202 | |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 7203 | 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] | 7204 | 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] | 7205 | 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] | 7206 | 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] | 7207 | diff content lines. If the list is empty, the entire DiffContent should be considered |
| 7208 | as unedited. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7209 | |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 7210 | 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] | 7211 | 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] | 7212 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7213 | [[diff-web-link-info]] |
| 7214 | === DiffWebLinkInfo |
| 7215 | The `DiffWebLinkInfo` entity describes a link on a diff screen to an |
| 7216 | external site. |
| 7217 | |
| 7218 | [options="header",cols="1,6"] |
| 7219 | |======================= |
| 7220 | |Field Name|Description |
| 7221 | |`name` |The link name. |
| 7222 | |`url` |The link URL. |
| 7223 | |`image_url`|URL to the icon of the link. |
| 7224 | |show_on_side_by_side_diff_view| |
| 7225 | Whether the web link should be shown on the side-by-side diff screen. |
| 7226 | |show_on_unified_diff_view| |
| 7227 | Whether the web link should be shown on the unified diff screen. |
| 7228 | |======================= |
| 7229 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 7230 | [[edit-file-info]] |
| 7231 | === EditFileInfo |
| 7232 | The `EditFileInfo` entity contains additional information |
| 7233 | of a file within a change edit. |
| 7234 | |
| 7235 | [options="header",cols="1,^1,5"] |
| 7236 | |=========================== |
| 7237 | |Field Name ||Description |
| 7238 | |`web_links` |optional| |
| 7239 | Links to the diff info in external sites as a list of |
| 7240 | link:#web-link-info[WebLinkInfo] entities. |
| 7241 | |=========================== |
| 7242 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7243 | [[edit-info]] |
| 7244 | === EditInfo |
| 7245 | The `EditInfo` entity contains information about a change edit. |
| 7246 | |
| 7247 | [options="header",cols="1,^1,5"] |
| 7248 | |=========================== |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7249 | |Field Name ||Description |
| 7250 | |`commit` ||The commit of change edit as |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7251 | link:#commit-info[CommitInfo] entity. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7252 | |`base_patch_set_number`||The patch set number of the patch set the change edit is based on. |
| 7253 | |`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] | 7254 | |`ref` ||The ref of the change edit. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7255 | |`fetch` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7256 | Information about how to fetch this patch set. The fetch information is |
| 7257 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 7258 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7259 | |`files` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7260 | The files of the change edit as a map that maps the file names to |
| 7261 | link:#file-info[FileInfo] entities. |
| 7262 | |=========================== |
| 7263 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7264 | [[fetch-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7265 | === FetchInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7266 | The `FetchInfo` entity contains information about how to fetch a patch |
| 7267 | set via a certain protocol. |
| 7268 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7269 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7270 | |========================== |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 7271 | |Field Name ||Description |
| 7272 | |`url` ||The URL of the project. |
| 7273 | |`ref` ||The ref of the patch set. |
| 7274 | |`commands` |optional| |
| 7275 | The download commands for this patch set as a map that maps the command |
| 7276 | names to the commands. + |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 7277 | Only set if link:#download-commands[download commands] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7278 | |========================== |
| 7279 | |
| 7280 | [[file-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7281 | === FileInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7282 | The `FileInfo` entity contains information about a file in a patch set. |
| 7283 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7284 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7285 | |============================= |
| 7286 | |Field Name ||Description |
| 7287 | |`status` |optional| |
| 7288 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 7289 | "`C`"=Copied, "`W`"=Rewritten). + |
| 7290 | Not set if the file was Modified ("`M`"). |
| 7291 | |`binary` |not set if `false`|Whether the file is binary. |
| 7292 | |`old_path` |optional| |
| 7293 | The old file path. + |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 7294 | Only set if the file was renamed or copied. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7295 | |`lines_inserted`|optional| |
| 7296 | Number of inserted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 7297 | Not set for binary files or if no lines were inserted. + |
| 7298 | An empty last line is not included in the count and hence this number can |
| 7299 | differ by one from details provided in <<#diff-info,DiffInfo>>. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7300 | |`lines_deleted` |optional| |
| 7301 | Number of deleted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 7302 | Not set for binary files or if no lines were deleted. + |
| 7303 | An empty last line is not included in the count and hence this number can |
| 7304 | differ by one from details provided in <<#diff-info,DiffInfo>>. |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 7305 | |`size_delta` || |
| 7306 | Number of bytes by which the file size increased/decreased. |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 7307 | |`size` || |
| 7308 | File size in bytes. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7309 | |============================= |
| 7310 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 7311 | [[fix-input]] |
| 7312 | === FixInput |
| 7313 | The `FixInput` entity contains options for fixing commits using the |
| 7314 | link:#fix-change[fix change] endpoint. |
| 7315 | |
| 7316 | [options="header",cols="1,6"] |
| 7317 | |========================== |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 7318 | |Field Name |Description |
| 7319 | |`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] | 7320 | database if they refer to missing commit options. |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 7321 | |`expect_merged_as` |If set, check that the change is |
Dave Borowitz | a828fed | 2015-05-05 14:43:40 -0700 | [diff] [blame] | 7322 | merged into the destination branch as this exact SHA-1. If not, insert |
| 7323 | a new patch set referring to this commit. |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 7324 | |========================== |
| 7325 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7326 | [[fix-suggestion-info]] |
| 7327 | === FixSuggestionInfo |
| 7328 | The `FixSuggestionInfo` entity represents a suggested fix. |
| 7329 | |
| 7330 | [options="header",cols="1,^1,5"] |
| 7331 | |========================== |
| 7332 | |Field Name ||Description |
| 7333 | |`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested |
| 7334 | fix. It will be generated automatically and hence will be ignored if it's set |
| 7335 | for input objects. |
| 7336 | |`description` ||A description of the suggested fix. |
| 7337 | |`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>> |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 7338 | entities indicating how the content of one or several files should be modified. |
| 7339 | Within a file, they should refer to non-overlapping regions. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7340 | |========================== |
| 7341 | |
| 7342 | [[fix-replacement-info]] |
| 7343 | === FixReplacementInfo |
Alice Kober-Sotzek | 110f60f | 2016-12-19 14:53:40 +0100 | [diff] [blame] | 7344 | The `FixReplacementInfo` entity describes how the content of a file should be |
| 7345 | replaced by another content. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7346 | |
| 7347 | [options="header",cols="1,6"] |
| 7348 | |========================== |
| 7349 | |Field Name |Description |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 7350 | |`path` |The path of the file which should be modified. Any file in |
Alice Kober-Sotzek | 368547f | 2020-03-13 22:00:41 +0100 | [diff] [blame] | 7351 | the repository may be modified. The commit message can be modified via the |
| 7352 | magic file `/COMMIT_MSG` though only the part below the generated header of |
| 7353 | that magic file can be modified. References to the header lines will result in |
| 7354 | errors when the fix is applied. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7355 | |`range` |A <<comment-range,CommentRange>> indicating which content |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 7356 | of the file should be replaced. Lines in the file are assumed to be separated |
Alice Kober-Sotzek | f0a3f34 | 2020-09-24 14:16:06 +0200 | [diff] [blame] | 7357 | by the line feed character. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7358 | |`replacement` |The content which should be used instead of the current one. |
| 7359 | |========================== |
| 7360 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7361 | [[git-person-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7362 | === GitPersonInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7363 | The `GitPersonInfo` entity contains information about the |
| 7364 | author/committer of a commit. |
| 7365 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7366 | [options="header",cols="1,6"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7367 | |========================== |
| 7368 | |Field Name |Description |
| 7369 | |`name` |The name of the author/committer. |
| 7370 | |`email` |The email address of the author/committer. |
| 7371 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 7372 | this identity was constructed. |
| 7373 | |`tz` |The timezone offset from UTC of when this identity was |
| 7374 | constructed. |
| 7375 | |========================== |
| 7376 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7377 | [[group-base-info]] |
| 7378 | === GroupBaseInfo |
| 7379 | The `GroupBaseInfo` entity contains base information about the group. |
| 7380 | |
| 7381 | [options="header",cols="1,6"] |
| 7382 | |========================== |
| 7383 | |Field Name |Description |
Edwin Kempin | 703613c | 2016-11-25 16:06:04 +0100 | [diff] [blame] | 7384 | |`id` |The UUID of the group. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7385 | |`name` |The name of the group. |
| 7386 | |========================== |
| 7387 | |
David Pursehouse | d9dac37 | 2016-11-24 19:41:10 +0900 | [diff] [blame] | 7388 | [[hashtags-input]] |
| 7389 | === HashtagsInput |
| 7390 | |
| 7391 | The `HashtagsInput` entity contains information about hashtags to add to, |
| 7392 | and/or remove from, a change. |
| 7393 | |
| 7394 | [options="header",cols="1,^1,5"] |
| 7395 | |======================= |
| 7396 | |Field Name||Description |
| 7397 | |`add` |optional|The list of hashtags to be added to the change. |
Mike Frysinger | 136ecbd | 2021-02-09 14:26:02 -0500 | [diff] [blame] | 7398 | |`remove` |optional|The list of hashtags to be removed from the change. |
David Pursehouse | d9dac37 | 2016-11-24 19:41:10 +0900 | [diff] [blame] | 7399 | |======================= |
| 7400 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7401 | [[included-in-info]] |
| 7402 | === IncludedInInfo |
| 7403 | The `IncludedInInfo` entity contains information about the branches a |
Xinan Lin | dc40ff1 | 2021-07-26 23:26:28 -0700 | [diff] [blame] | 7404 | change was merged into and tags it was tagged with. The branch or tag |
| 7405 | must have 'refs/head/' or 'refs/tags/' prefix respectively. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7406 | |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 7407 | [options="header",cols="1,^1,5"] |
| 7408 | |======================= |
| 7409 | |Field Name||Description |
| 7410 | |`branches`||The list of branches this change was merged into. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7411 | Each branch is listed without the 'refs/head/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 7412 | |`tags` ||The list of tags this change was tagged with. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7413 | Each tag is listed without the 'refs/tags/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 7414 | |`external`|optional|A map that maps a name to a list of external |
| 7415 | systems that include this change, e.g. a list of servers on which this |
| 7416 | change is deployed. |
| 7417 | |======================= |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7418 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7419 | [[label-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7420 | === LabelInfo |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7421 | The `LabelInfo` entity contains information about a label on a change, always |
| 7422 | corresponding to the current patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7423 | |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7424 | There are two options that control the contents of `LabelInfo`: |
Dave Borowitz | 7d6aa01 | 2013-06-14 16:53:48 -0700 | [diff] [blame] | 7425 | link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`]. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7426 | |
| 7427 | * For a quick summary of the state of labels, use `LABELS`. |
| 7428 | * For detailed information about labels, including exact numeric votes for all |
| 7429 | users and the allowed range of votes for the current user, use `DETAILED_LABELS`. |
| 7430 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7431 | ==== Common fields |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7432 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7433 | |=========================== |
| 7434 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7435 | |`optional` |not set if `false`| |
| 7436 | Whether the label is optional. Optional means the label may be set, but |
| 7437 | it's neither necessary for submission nor does it block submission if |
| 7438 | set. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7439 | |=========================== |
| 7440 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7441 | ==== Fields set by `LABELS` |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7442 | [options="header",cols="1,^1,5"] |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7443 | |=========================== |
| 7444 | |Field Name ||Description |
| 7445 | |`approved` |optional|One user who approved this label on the change |
| 7446 | (voted the maximum value) as an |
| 7447 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 7448 | |`rejected` |optional|One user who rejected this label on the change |
| 7449 | (voted the minimum value) as an |
| 7450 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 7451 | |`recommended` |optional|One user who recommended this label on the |
| 7452 | change (voted positively, but not the maximum value) as an |
| 7453 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 7454 | |`disliked` |optional|One user who disliked this label on the change |
| 7455 | (voted negatively, but not the minimum value) as an |
| 7456 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
David Ostrovsky | 5292fd7 | 2014-02-27 21:56:35 +0100 | [diff] [blame] | 7457 | |`blocking` |optional|If `true`, the label blocks submit operation. |
| 7458 | If not set, the default is false. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7459 | |`value` |optional|The voting value of the user who |
| 7460 | recommended/disliked this label on the change if it is not |
| 7461 | "`+1`"/"`-1`". |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 7462 | |`default_value`|optional|The default voting value for the label. |
| 7463 | This value may be outside the range specified in permitted_labels. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7464 | |=========================== |
| 7465 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7466 | ==== Fields set by `DETAILED_LABELS` |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7467 | [options="header",cols="1,^1,5"] |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7468 | |=========================== |
| 7469 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7470 | |`all` |optional|List of all approvals for this label as a list |
Aaron Gable | ea8a211 | 2017-04-25 14:18:16 -0700 | [diff] [blame] | 7471 | of link:#approval-info[ApprovalInfo] entities. Items in this list may |
| 7472 | not represent actual votes cast by users; if a user votes on any label, |
| 7473 | a corresponding ApprovalInfo will appear in this list for all labels. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7474 | |`values` |optional|A map of all values that are allowed for this |
| 7475 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7476 | to the value descriptions. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7477 | |=========================== |
| 7478 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 7479 | [[mergeable-info]] |
| 7480 | === MergeableInfo |
| 7481 | The `MergeableInfo` entity contains information about the mergeability of a |
| 7482 | change. |
| 7483 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7484 | [options="header",cols="1,^1,5"] |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 7485 | |============================ |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 7486 | |Field Name ||Description |
| 7487 | |`submit_type` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 7488 | Submit type used for this change, can be `MERGE_IF_NECESSARY`, |
Gert van Dijk | a4e49d0 | 2017-08-27 22:50:40 +0200 | [diff] [blame] | 7489 | `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 7490 | `CHERRY_PICK`. |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 7491 | |`strategy` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 7492 | The strategy of the merge, can be `recursive`, `resolve`, |
| 7493 | `simple-two-way-in-core`, `ours` or `theirs`. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 7494 | |`mergeable` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 7495 | `true` if this change is cleanly mergeable, `false` otherwise |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 7496 | |`commit_merged` |optional| |
Zhen Chen | 8f00d55 | 2016-07-26 16:54:59 -0700 | [diff] [blame] | 7497 | `true` if this change is already merged, `false` otherwise |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 7498 | |`content_merged`|optional| |
Zhen Chen | 8f00d55 | 2016-07-26 16:54:59 -0700 | [diff] [blame] | 7499 | `true` if the content of this change is already merged, `false` otherwise |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 7500 | |`conflicts` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 7501 | A list of paths with conflicts |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 7502 | |`mergeable_into`|optional| |
| 7503 | 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] | 7504 | |============================ |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 7505 | |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 7506 | [[merge-input]] |
| 7507 | === MergeInput |
| 7508 | The `MergeInput` entity contains information about the merge |
| 7509 | |
| 7510 | [options="header",cols="1,^1,5"] |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7511 | |============================== |
| 7512 | |Field Name ||Description |
| 7513 | |`source` || |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 7514 | 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] | 7515 | a complete reference name, a short reference name under `refs/heads`, `refs/tags`, |
| 7516 | or `refs/remotes` namespace, etc. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7517 | |`source_branch` |optional| |
Han-Wen Nienhuys | 9ec1f6a | 2020-01-07 17:32:08 +0100 | [diff] [blame] | 7518 | A branch from which `source` is reachable. If specified, |
| 7519 | `source` is checked for visibility and reachability against only this |
| 7520 | branch. This speeds up the operation, especially for large repos with |
| 7521 | many branches. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7522 | |`strategy` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 7523 | The strategy of the merge, can be `recursive`, `resolve`, |
| 7524 | `simple-two-way-in-core`, `ours` or `theirs`, default will use project settings. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7525 | |`allow_conflicts`|optional, defaults to false| |
| 7526 | If `true`, creating the merge succeeds also if there are conflicts. + |
| 7527 | If there are conflicts the file contents of the created change contain |
| 7528 | git conflict markers to indicate the conflicts. + |
| 7529 | Callers can find out whether there were conflicts by checking the |
| 7530 | `contains_git_conflicts` field in the link:#change-info[ChangeInfo]. + |
| 7531 | If there are conflicts the change is marked as work-in-progress. + |
| 7532 | This option is not supported for all merge strategies (e.g. it's |
| 7533 | supported for `recursive` and `resolve`, but not for |
| 7534 | `simple-two-way-in-core`). |
| 7535 | |============================== |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 7536 | |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 7537 | [[merge-patch-set-input]] |
| 7538 | === MergePatchSetInput |
| 7539 | The `MergePatchSetInput` entity contains information about updating a new |
| 7540 | change by creating a new merge commit. |
| 7541 | |
| 7542 | [options="header",cols="1,^1,5"] |
| 7543 | |================================== |
| 7544 | |Field Name ||Description |
| 7545 | |`subject` |optional| |
| 7546 | The new subject for the change, if not specified, will reuse the current patch |
| 7547 | set's subject |
Han-Wen Nienhuys | bd2af0c | 2020-01-09 16:39:26 +0100 | [diff] [blame] | 7548 | |`inherit_parent` |optional, default to `false`| |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 7549 | 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] | 7550 | |`base_change` |optional| |
Han-Wen Nienhuys | 69917fe | 2020-01-09 16:39:26 +0100 | [diff] [blame] | 7551 | A link:#change-id[\{change-id\}] that identifies a change. When `inherit_parent` |
Changcheng Xiao | 9bdedaf | 2017-10-24 09:34:42 +0200 | [diff] [blame] | 7552 | is `false`, the merge tip will be the current patch set of the `base_change` if |
| 7553 | 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] | 7554 | |`merge` || |
| 7555 | The detail of the source commit for merge as a link:#merge-input[MergeInput] |
| 7556 | entity. |
Patrick Hiesel | e8fc797 | 2020-10-06 13:22:07 +0200 | [diff] [blame] | 7557 | |`author` |optional| |
| 7558 | An link:rest-api-accounts.html#account-input[AccountInput] entity |
| 7559 | that will set the author of the commit to create. The author must be |
| 7560 | specified as name/email combination. |
| 7561 | The caller needs "Forge Author" permission when using this field. |
| 7562 | This field does not affect the owner of the change, which will |
| 7563 | continue to use the identity of the caller. |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 7564 | |================================== |
| 7565 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 7566 | [[move-input]] |
| 7567 | === MoveInput |
| 7568 | The `MoveInput` entity contains information for moving a change to a new branch. |
| 7569 | |
| 7570 | [options="header",cols="1,^1,5"] |
| 7571 | |=========================== |
Michael Zhou | d03fe28 | 2016-04-25 17:13:17 -0400 | [diff] [blame] | 7572 | |Field Name ||Description |
| 7573 | |`destination_branch`||Destination branch |
| 7574 | |`message` |optional| |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 7575 | A message to be posted in this change's comments |
Marija Savtchouk | d89fefc | 2020-12-15 06:46:15 +0000 | [diff] [blame] | 7576 | |`keep_all_votes` |optional, defaults to false| |
Marija Savtchouk | cee6a8f | 2020-12-03 12:58:04 +0000 | [diff] [blame] | 7577 | By default, only veto votes that are blocking the change from submission are moved to |
| 7578 | the destination branch. Using this option is only allowed for administrators, |
| 7579 | because it can affect the submission behaviour of the change (depending on the label access |
| 7580 | configuration and submissions rules). |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 7581 | |=========================== |
| 7582 | |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7583 | [[notify-info]] |
| 7584 | === NotifyInfo |
| 7585 | The `NotifyInfo` entity contains detailed information about who should |
| 7586 | be notified about an update. These notifications are sent out even if a |
| 7587 | `notify` option in the request input disables normal notifications. |
| 7588 | `NotifyInfo` entities are normally contained in a `notify_details` map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7589 | in the request input where the key is the |
| 7590 | link:user-notify.html#recipient-types[recipient type]. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7591 | |
| 7592 | [options="header",cols="1,^1,5"] |
| 7593 | |======================= |
| 7594 | |Field Name||Description |
| 7595 | |`accounts`|optional| |
| 7596 | A list of link:rest-api-accounts.html#account-id[account IDs] that |
| 7597 | identify the accounts that should be should be notified. |
| 7598 | |======================= |
| 7599 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 7600 | [[private-input]] |
| 7601 | === PrivateInput |
| 7602 | The `PrivateInput` entity contains information for changing the private |
| 7603 | flag on a change. |
| 7604 | |
| 7605 | [options="header",cols="1,^1,5"] |
| 7606 | |======================= |
| 7607 | |Field Name||Description |
| 7608 | |`message` |optional|Message describing why the private flag was changed. |
| 7609 | |======================= |
| 7610 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7611 | [[problem-info]] |
| 7612 | === ProblemInfo |
| 7613 | The `ProblemInfo` entity contains a description of a potential consistency problem |
| 7614 | with a change. These are not related to the code review process, but rather |
| 7615 | indicate some inconsistency in Gerrit's database or repository metadata related |
| 7616 | to the enclosing change. |
| 7617 | |
| 7618 | [options="header",cols="1,^1,5"] |
| 7619 | |=========================== |
| 7620 | |Field Name||Description |
| 7621 | |`message` ||Plaintext message describing the problem with the change. |
| 7622 | |`status` |optional| |
| 7623 | The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a |
| 7624 | fix was attempted. |
| 7625 | |`outcome` |optional| |
| 7626 | If `status` is set, an additional plaintext message describing the |
| 7627 | outcome of the fix. |
| 7628 | |=========================== |
| 7629 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 7630 | [[publish-change-edit-input]] |
| 7631 | === PublishChangeEditInput |
| 7632 | The `PublishChangeEditInput` entity contains options for the publishing of |
| 7633 | change edit. |
| 7634 | |
| 7635 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7636 | |============================= |
| 7637 | |Field Name ||Description |
| 7638 | |`notify` |optional| |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 7639 | Notify handling that defines to whom email notifications should be sent |
| 7640 | after the change edit is published. + |
| 7641 | Allowed values are `NONE` and `ALL`. + |
| 7642 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7643 | |`notify_details`|optional| |
| 7644 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7645 | of link:user-notify.html#recipient-types[recipient type] to |
| 7646 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7647 | |============================= |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 7648 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 7649 | [[pure-revert-info]] |
| 7650 | === PureRevertInfo |
| 7651 | The `PureRevertInfo` entity describes the result of a pure revert check. |
| 7652 | |
| 7653 | [options="header",cols="1,6"] |
| 7654 | |====================== |
| 7655 | |Field Name |Description |
| 7656 | |`is_pure_revert` |Outcome of the check as boolean. |
| 7657 | |====================== |
| 7658 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 7659 | [[push-certificate-info]] |
| 7660 | === PushCertificateInfo |
| 7661 | The `PushCertificateInfo` entity contains information about a push |
| 7662 | certificate provided when the user pushed for review with `git push |
| 7663 | --signed HEAD:refs/for/<branch>`. Only used when signed push is |
| 7664 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the server. |
| 7665 | |
| 7666 | [options="header",cols="1,6"] |
| 7667 | |=========================== |
| 7668 | |Field Name|Description |
| 7669 | |`certificate`|Signed certificate payload and GPG signature block. |
| 7670 | |`key` | |
| 7671 | Information about the key that signed the push, along with any problems |
| 7672 | found while checking the signature or the key itself, as a |
| 7673 | link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity. |
| 7674 | |=========================== |
| 7675 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 7676 | [[range-info]] |
| 7677 | === RangeInfo |
| 7678 | The `RangeInfo` entity stores the coordinates of a range. |
| 7679 | |
| 7680 | [options="header",cols="1,6"] |
| 7681 | |=========================== |
| 7682 | |Field Name | Description |
| 7683 | |`start` | First index. |
| 7684 | |`end` | Last index. |
| 7685 | |=========================== |
| 7686 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 7687 | [[rebase-input]] |
| 7688 | === RebaseInput |
| 7689 | The `RebaseInput` entity contains information for changing parent when rebasing. |
| 7690 | |
| 7691 | [options="header",width="50%",cols="1,^1,5"] |
| 7692 | |=========================== |
| 7693 | |Field Name ||Description |
| 7694 | |`base` |optional| |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 7695 | The new parent revision. This can be a ref or a SHA-1 to a concrete patchset. + |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 7696 | Alternatively, a change number can be specified, in which case the current |
| 7697 | patch set is inferred. + |
| 7698 | Empty string is used for rebasing directly on top of the target branch, |
| 7699 | which effectively breaks dependency towards a parent change. |
Edwin Kempin | 9a6f054 | 2021-01-13 13:51:42 +0100 | [diff] [blame] | 7700 | |`allow_conflicts`|optional, defaults to false| |
| 7701 | If `true`, the rebase also succeeds if there are conflicts. + |
| 7702 | If there are conflicts the file contents of the rebased patch set contain |
| 7703 | git conflict markers to indicate the conflicts. + |
| 7704 | Callers can find out whether there were conflicts by checking the |
| 7705 | `contains_git_conflicts` field in the returned link:#change-info[ChangeInfo]. + |
| 7706 | If there are conflicts the change is marked as work-in-progress. |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 7707 | |=========================== |
| 7708 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7709 | [[related-change-and-commit-info]] |
| 7710 | === RelatedChangeAndCommitInfo |
| 7711 | |
| 7712 | The `RelatedChangeAndCommitInfo` entity contains information about |
| 7713 | a related change and commit. |
| 7714 | |
| 7715 | [options="header",cols="1,^1,5"] |
| 7716 | |=========================== |
| 7717 | |Field Name ||Description |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 7718 | |`project` ||The project of the change or commit. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7719 | |`change_id` |optional|The Change-Id of the change. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7720 | |`commit` ||The commit as a |
| 7721 | link:#commit-info[CommitInfo] entity. |
| 7722 | |`_change_number` |optional|The change number. |
| 7723 | |`_revision_number` |optional|The revision number. |
| 7724 | |`_current_revision_number`|optional|The current revision number. |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 7725 | |`status` |optional|The status of the change. The status of |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 7726 | the change is one of (`NEW`, `MERGED`, `ABANDONED`). |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7727 | |=========================== |
| 7728 | |
| 7729 | [[related-changes-info]] |
| 7730 | === RelatedChangesInfo |
| 7731 | The `RelatedChangesInfo` entity contains information about related |
| 7732 | changes. |
| 7733 | |
| 7734 | [options="header",cols="1,6"] |
| 7735 | |=========================== |
| 7736 | |Field Name |Description |
| 7737 | |`changes` |A list of |
| 7738 | link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities |
| 7739 | describing the related changes. Sorted by git commit order, newest to |
| 7740 | oldest. Empty if there are no related changes. |
| 7741 | |=========================== |
| 7742 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 7743 | |
| 7744 | [[requirement]] |
| 7745 | === Requirement |
| 7746 | The `Requirement` entity contains information about a requirement relative to a change. |
| 7747 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 7748 | [options="header",cols="1,^1,5"] |
| 7749 | |=========================== |
| 7750 | |Field Name | |Description |
| 7751 | |`status` | | Status of the requirement. Can be either `OK`, `NOT_READY` or `RULE_ERROR`. |
Sven Selberg | e748e3f | 2020-09-24 13:44:56 +0200 | [diff] [blame] | 7752 | |`fallback_text` | | A human readable reason |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 7753 | |`type` | | |
| 7754 | Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it |
| 7755 | was triggered. Can be seen as a class: requirements sharing the same type were created for a similar |
| 7756 | reason, and the data structure will follow one set of rules. |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 7757 | |=========================== |
| 7758 | |
| 7759 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 7760 | [[restore-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7761 | === RestoreInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 7762 | The `RestoreInput` entity contains information for restoring a change. |
| 7763 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7764 | [options="header",cols="1,^1,5"] |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 7765 | |=========================== |
| 7766 | |Field Name ||Description |
| 7767 | |`message` |optional| |
| 7768 | Message to be added as review comment to the change when restoring the |
| 7769 | change. |
| 7770 | |=========================== |
| 7771 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 7772 | [[revert-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7773 | === RevertInput |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 7774 | The `RevertInput` entity contains information for reverting a change. |
| 7775 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7776 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 7777 | |============================= |
| 7778 | |Field Name ||Description |
| 7779 | |`message` |optional| |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 7780 | Message to be added as review comment to the change when reverting the |
| 7781 | change. |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 7782 | |`notify` |optional| |
| 7783 | Notify handling that defines to whom email notifications should be sent |
| 7784 | for reverting the change. + |
| 7785 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7786 | If not set, the default is `ALL`. |
| 7787 | |`notify_details`|optional| |
| 7788 | Additional information about whom to notify about the revert as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7789 | of link:user-notify.html#recipient-types[recipient type] to |
| 7790 | link:#notify-info[NotifyInfo] entity. |
Gal Paikin | cc93c56 | 2019-10-09 13:24:12 +0200 | [diff] [blame] | 7791 | |`topic` |optional| |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 7792 | Name of the topic for the revert change. If not set, the default for Revert |
| 7793 | endpoint is the topic of the change being reverted, and the default for the |
| 7794 | RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`. |
Gal Paikin | 44dbd7e | 2020-04-15 15:23:44 +0200 | [diff] [blame] | 7795 | Topic can't contain quotation marks. |
Youssef Elghareeb | fd02dae | 2020-09-03 21:56:30 +0200 | [diff] [blame] | 7796 | |`work_in_progress` |optional| |
Youssef Elghareeb | 8609544 | 2021-08-02 18:18:22 +0200 | [diff] [blame] | 7797 | When present, change is marked as Work In Progress. The `notify` input is |
| 7798 | used if it's present, otherwise it will be overridden to `OWNER`. + |
Youssef Elghareeb | fd02dae | 2020-09-03 21:56:30 +0200 | [diff] [blame] | 7799 | If not set, the default is false. |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 7800 | |============================= |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 7801 | |
| 7802 | [[revert-submission-info]] |
| 7803 | === RevertSubmissionInfo |
Gal Paikin | 64777c7 | 2019-12-18 14:11:13 +0100 | [diff] [blame] | 7804 | The `RevertSubmissionInfo` entity describes the revert changes. |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 7805 | |
| 7806 | [options="header",cols="1,6"] |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 7807 | |============================== |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 7808 | |Field Name | Description |
| 7809 | |`revert_changes` | |
Edwin Kempin | 6e7fb4e | 2019-10-24 17:20:51 +0200 | [diff] [blame] | 7810 | A list of link:#change-info[ChangeInfo] that describes the revert changes. Each |
| 7811 | entity in that list is a revert change that was created in that revert |
| 7812 | submission. |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 7813 | |============================== |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 7814 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7815 | [[review-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7816 | === ReviewInfo |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7817 | The `ReviewInfo` entity contains information about a review. |
| 7818 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7819 | [options="header",cols="1,6"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7820 | |=========================== |
| 7821 | |Field Name |Description |
| 7822 | |`labels` | |
| 7823 | The labels of the review as a map that maps the label names to the |
| 7824 | voting values. |
| 7825 | |=========================== |
| 7826 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 7827 | [[review-update-info]] |
| 7828 | === ReviewerUpdateInfo |
| 7829 | The `ReviewerUpdateInfo` entity contains information about updates to |
| 7830 | change's reviewers set. |
| 7831 | |
| 7832 | [options="header",cols="1,6"] |
| 7833 | |=========================== |
| 7834 | |Field Name |Description |
| 7835 | |`updated`| |
| 7836 | Timestamp of the update. |
| 7837 | |`updated_by`| |
| 7838 | The account which modified state of the reviewer in question as |
| 7839 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 7840 | |`reviewer`| |
| 7841 | The reviewer account added or removed from the change as an |
| 7842 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 7843 | |`state`| |
| 7844 | The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`. |
| 7845 | |=========================== |
| 7846 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7847 | [[review-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7848 | === ReviewInput |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7849 | The `ReviewInput` entity contains information for adding a review to a |
| 7850 | revision. |
| 7851 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7852 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7853 | |============================ |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7854 | |Field Name ||Description |
| 7855 | |`message` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7856 | The message to be added as review comment. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7857 | |`tag` |optional| |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7858 | Apply this tag to the review comment message, votes, and inline |
Ben Rohlfs | d9be63f | 2021-02-04 09:01:46 +0100 | [diff] [blame] | 7859 | comments. Tags with an 'autogenerated:' prefix may be used by CI or other |
| 7860 | automated systems to distinguish them from human reviews. If another |
| 7861 | message was posted on a newer patchset, but with the same tag, then the older |
| 7862 | message will be hidden in the UI. Suffixes starting with `~` are not considered, |
| 7863 | so `autogenerated:my-ci-system~trigger` and `autogenerated:my-ci-system~result` |
| 7864 | will be considered being the same tag with regards to the hiding rule. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7865 | |`labels` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7866 | The votes that should be added to the revision as a map that maps the |
| 7867 | label names to the voting values. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7868 | |`comments` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7869 | The comments that should be added as a map that maps a file path to a |
| 7870 | list of link:#comment-input[CommentInput] entities. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7871 | |`robot_comments` |optional| |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 7872 | The robot comments that should be added as a map that maps a file path |
| 7873 | to a list of link:#robot-comment-input[RobotCommentInput] entities. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7874 | |`drafts` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7875 | Draft handling that defines how draft comments are handled that are |
| 7876 | already in the database but that were not also described in this |
| 7877 | input. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 7878 | Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values |
| 7879 | except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. + |
Dave Borowitz | c064054 | 2016-10-05 16:19:21 -0400 | [diff] [blame] | 7880 | Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 7881 | If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value |
| 7882 | besides `KEEP` is allowed. |
Youssef Elghareeb | 3e4bf51 | 2021-05-12 18:40:27 +0200 | [diff] [blame] | 7883 | |`draft_ids_to_publish` |optional| |
| 7884 | List of draft IDs to be published. The draft IDs should belong to the current |
| 7885 | user and be valid. If `drafts` is set to `PUBLISH`, then draft IDs should |
| 7886 | contain drafts for the same revision that is requested for review. If `drafts` |
| 7887 | is set to `KEEP`, then `draft_ids_to_publish` will be ignored and no draft |
| 7888 | comments will be published. + |
| 7889 | If not set, the default is to publish all drafts according to the `drafts` field. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7890 | |`notify` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7891 | Notify handling that defines to whom email notifications should be sent |
| 7892 | after the review is stored. + |
| 7893 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7894 | If not set, the default is `ALL`. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7895 | |`notify_details` |optional| |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7896 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7897 | of link:user-notify.html#recipient-types[recipient type] to |
| 7898 | link:#notify-info[NotifyInfo] entity. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7899 | |`omit_duplicate_comments` |optional| |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 7900 | If `true`, comments with the same content at the same place will be omitted. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7901 | |`on_behalf_of` |optional| |
Shawn Pearce | 9d78312 | 2013-06-11 18:18:03 -0700 | [diff] [blame] | 7902 | link:rest-api-accounts.html#account-id[\{account-id\}] the review |
| 7903 | should be posted on behalf of. To use this option the caller must |
| 7904 | have been granted `labelAs-NAME` permission for all keys of labels. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7905 | |`reviewers` |optional| |
Patrick Hiesel | cf6d935 | 2017-04-13 10:15:42 +0200 | [diff] [blame] | 7906 | A list of link:rest-api-changes.html#reviewer-input[ReviewerInput] |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 7907 | representing reviewers that should be added/removed to/from the change. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7908 | |`ready` |optional| |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 7909 | If true, and if the change is work in progress, then start review. |
| 7910 | It is an error for both `ready` and `work_in_progress` to be true. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7911 | |`work_in_progress` |optional| |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 7912 | If true, mark the change as work in progress. It is an error for both |
| 7913 | `ready` and `work_in_progress` to be true. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7914 | |`add_to_attention_set` |optional| |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7915 | list of link:#attention-set-input[AttentionSetInput] entities to add |
Gal Paikin | e631de2 | 2020-10-29 12:19:11 +0100 | [diff] [blame] | 7916 | to the link:#attention-set[attention set]. Users that are not reviewers, |
| 7917 | ccs, owner, or uploader are silently ignored. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7918 | |`remove_from_attention_set` |optional| |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7919 | list of link:#attention-set-input[AttentionSetInput] entities to remove |
| 7920 | from the link:#attention-set[attention set]. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 7921 | |`ignore_automatic_attention_set_rules`|optional| |
| 7922 | If set to true, ignore all automatic attention set rules described in the |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7923 | link:#attention-set[attention set]. Updates in add_to_attention_set |
| 7924 | and remove_from_attention_set are not ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7925 | |============================ |
| 7926 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 7927 | [[review-result]] |
| 7928 | === ReviewResult |
| 7929 | The `ReviewResult` entity contains information regarding the updates |
| 7930 | that were made to a review. |
| 7931 | |
| 7932 | [options="header",cols="1,^1,5"] |
| 7933 | |============================ |
| 7934 | |Field Name ||Description |
| 7935 | |`labels` |optional| |
| 7936 | Map of labels to values after the review was posted. Null if any reviewer |
| 7937 | additions were rejected. |
| 7938 | |`reviewers` |optional| |
| 7939 | Map of account or group identifier to |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 7940 | link:rest-api-changes.html#reviewer-result[ReviewerResult] |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 7941 | representing the outcome of adding/removing a reviewer. |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 7942 | Absent if no reviewer additions were requested. |
Logan Hanks | e81ad8e | 2017-07-18 09:45:46 -0700 | [diff] [blame] | 7943 | |`ready` |optional| |
| 7944 | If true, the change was moved from WIP to ready for review as a result of this |
| 7945 | action. Not set if false. |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 7946 | |============================ |
| 7947 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7948 | [[reviewer-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7949 | === ReviewerInfo |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7950 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 7951 | votes on a change. |
| 7952 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 7953 | `ReviewerInfo` has the same fields as |
| 7954 | link:rest-api-accounts.html#account-info[AccountInfo] and includes |
| 7955 | link:#detailed-accounts[detailed account information]. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7956 | In addition `ReviewerInfo` has the following fields: |
| 7957 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7958 | [options="header",cols="1,6"] |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7959 | |========================== |
| 7960 | |Field Name |Description |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7961 | |`approvals` | |
| 7962 | 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] | 7963 | approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`"). |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 7964 | |`_account_id` | |
| 7965 | This field is inherited from `AccountInfo` but is optional here if an |
| 7966 | unregistered reviewer was added by email. See |
| 7967 | link:rest-api-changes.html#add-reviewer[add-reviewer] for details. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 7968 | |========================== |
| 7969 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7970 | [[reviewer-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7971 | === ReviewerInput |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 7972 | The `ReviewerInput` entity contains information for adding or removing |
| 7973 | reviewers to/from the change. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7974 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7975 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7976 | |============================= |
| 7977 | |Field Name ||Description |
| 7978 | |`reviewer` || |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7979 | The link:rest-api-accounts.html#account-id[ID] of one account that |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 7980 | should be added/removed as reviewer or the link:rest-api-groups.html#group-id[ |
Han-Wen Nienhuys | e622905 | 2020-01-29 12:51:36 +0100 | [diff] [blame] | 7981 | ID] of one internal group for which all members should be added as reviewers. + |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7982 | If an ID identifies both an account and a group, only the account is |
| 7983 | added as reviewer to the change. |
Han-Wen Nienhuys | e622905 | 2020-01-29 12:51:36 +0100 | [diff] [blame] | 7984 | External groups, such as LDAP groups, will be silently omitted from a |
| 7985 | link:#set-review[set-review] or |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 7986 | link:rest-api-changes.html#add-reviewer[add-reviewer] call. A group can only be |
| 7987 | specified for adding reviewers, not for removing them. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7988 | |`state` |optional| |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 7989 | Add reviewer in this state. Possible reviewer states are `REVIEWER`, |
| 7990 | `CC` and `REMOVED`. If not given, defaults to `REVIEWER`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7991 | |`confirmed` |optional| |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 7992 | Whether adding the reviewer is confirmed. + |
| 7993 | The Gerrit server may be configured to |
| 7994 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 7995 | confirmation] when adding a group as reviewer that has many members. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7996 | |`notify` |optional| |
Sven Selberg | 4d64f97 | 2016-09-26 16:15:02 +0200 | [diff] [blame] | 7997 | Notify handling that defines to whom email notifications should be sent |
| 7998 | after the reviewer is added. + |
| 7999 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 8000 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8001 | |`notify_details`|optional| |
| 8002 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8003 | of link:user-notify.html#recipient-types[recipient type] to |
| 8004 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8005 | |============================= |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8006 | |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8007 | [[reviewer-result]] |
| 8008 | === ReviewerResult |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8009 | The `ReviewerResult` entity describes the result of modifying reviewers of |
| 8010 | a change. |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8011 | |
| 8012 | [options="header",cols="1,^1,5"] |
| 8013 | |=========================== |
| 8014 | |Field Name ||Description |
| 8015 | |`input` || |
| 8016 | Value of the `reviewer` field from link:#reviewer-input[ReviewerInput] |
| 8017 | set while adding the reviewer. |
| 8018 | |`reviewers` |optional| |
| 8019 | The newly added reviewers as a list of link:#reviewer-info[ |
| 8020 | ReviewerInfo] entities. |
| 8021 | |`ccs` |optional| |
Gal Paikin | efb4ad5 | 2021-04-15 09:44:40 +0200 | [diff] [blame] | 8022 | The newly CCed accounts as a list of |
| 8023 | link:rest-api-accounts.html#account-info[AccountInfo] entities. This field will |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8024 | only appear if the requested `state` for the reviewer was `CC`. |
| 8025 | |`removed` |optional| |
| 8026 | The newly removed accounts as a list of |
| 8027 | link:rest-api-accounts.html#account-info[AccountInfo] entities. |
| 8028 | This field will only appear if the requested `state` for the reviewer was |
| 8029 | `REMOVED`. |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8030 | |`error` |optional| |
| 8031 | Error message explaining why the reviewer could not be added. + |
| 8032 | If a group was specified in the input and an error is returned, it |
| 8033 | means that none of the members were added as reviewer. |
| 8034 | |`confirm` |`false` if not set| |
| 8035 | Whether adding the reviewer requires confirmation. |
| 8036 | |=========================== |
| 8037 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8038 | [[revision-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8039 | === RevisionInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8040 | The `RevisionInfo` entity contains information about a patch set. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 8041 | Not all fields are returned by default. Additional fields can |
| 8042 | be obtained by adding `o` parameters as described in |
| 8043 | link:#list-changes[Query Changes]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8044 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8045 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8046 | |=========================== |
| 8047 | |Field Name ||Description |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 8048 | |`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`, |
| 8049 | `MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`. |
Kasper Nilsson | be3616d | 2018-01-23 14:10:36 -0800 | [diff] [blame] | 8050 | |`_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] | 8051 | |`created` || |
| 8052 | The link:rest-api.html#timestamp[timestamp] of when the patch set was |
| 8053 | created. |
| 8054 | |`uploader` || |
| 8055 | The uploader of the patch set as an |
| 8056 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 8057 | |`ref` ||The Git reference for the patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8058 | |`fetch` || |
| 8059 | Information about how to fetch this patch set. The fetch information is |
| 8060 | provided as a map that maps the protocol name ("`git`", "`http`", |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 8061 | "`ssh`") to link:#fetch-info[FetchInfo] entities. This information is |
| 8062 | only included if a plugin implementing the |
| 8063 | link:intro-project-owner.html#download-commands[download commands] |
| 8064 | interface is installed. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 8065 | |`commit` |optional|The commit of the patch set as |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8066 | link:#commit-info[CommitInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 8067 | |`files` |optional| |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8068 | 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] | 8069 | link:#file-info[FileInfo] entities. Only set if |
| 8070 | link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES] |
| 8071 | option is requested. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 8072 | |`actions` |optional| |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 8073 | Actions the caller might be able to perform on this revision. The |
| 8074 | information is a map of view name to link:#action-info[ActionInfo] |
| 8075 | entities. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 8076 | |`reviewed` |optional| |
| 8077 | Indicates whether the caller is authenticated and has commented on the |
| 8078 | current revision. Only set if link:#reviewed[REVIEWED] option is requested. |
Quinten Yearsley | 28cd212 | 2019-06-10 14:41:13 -0700 | [diff] [blame] | 8079 | |`commit_with_footers` |optional| |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 8080 | If the link:#commit-footers[COMMIT_FOOTERS] option is requested and |
| 8081 | this is the current patch set, contains the full commit message with |
| 8082 | Gerrit-specific commit footers, as if this revision were submitted |
| 8083 | using the link:project-configuration.html#cherry_pick[Cherry Pick] |
| 8084 | submit type. |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 8085 | |`push_certificate` |optional| |
| 8086 | If the link:#push-certificates[PUSH_CERTIFICATES] option is requested, |
| 8087 | contains the push certificate provided by the user when uploading this |
| 8088 | patch set as a link:#push-certificate-info[PushCertificateInfo] entity. |
| 8089 | This field is always set if the option is requested; if no push |
| 8090 | certificate was provided, it is set to an empty object. |
Aaron Gable | 621c9b6 | 2017-04-21 09:24:20 -0700 | [diff] [blame] | 8091 | |`description` |optional| |
| 8092 | The description of this patchset, as displayed in the patchset |
| 8093 | selector menu. May be null if no description is set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8094 | |=========================== |
| 8095 | |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8096 | [[robot-comment-info]] |
| 8097 | === RobotCommentInfo |
| 8098 | The `RobotCommentInfo` entity contains information about a robot inline |
| 8099 | comment. |
| 8100 | |
Alice Kober-Sotzek | 7d890be | 2020-10-01 17:41:56 +0200 | [diff] [blame] | 8101 | `RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>> |
| 8102 | except for the `unresolved` field which doesn't exist for robot comments. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8103 | In addition `RobotCommentInfo` has the following fields: |
| 8104 | |
| 8105 | [options="header",cols="1,^1,5"] |
| 8106 | |=========================== |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 8107 | |Field Name ||Description |
| 8108 | |`robot_id` ||The ID of the robot that generated this comment. |
| 8109 | |`robot_run_id` ||An ID of the run of the robot. |
| 8110 | |`url` |optional|URL to more information. |
| 8111 | |`properties` |optional|Robot specific properties as map that maps arbitrary |
| 8112 | keys to values. |
| 8113 | |`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of |
| 8114 | <<fix-suggestion-info,FixSuggestionInfo>> entities. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8115 | |=========================== |
| 8116 | |
| 8117 | [[robot-comment-input]] |
| 8118 | === RobotCommentInput |
| 8119 | The `RobotCommentInput` entity contains information for creating an inline |
| 8120 | robot comment. |
| 8121 | |
Alice Kober-Sotzek | 7d890be | 2020-10-01 17:41:56 +0200 | [diff] [blame] | 8122 | [options="header",cols="1,^1,5"] |
| 8123 | |=========================== |
| 8124 | |Field Name ||Description |
| 8125 | |`path` || |
| 8126 | link:#file-id[The file path] for which the inline comment should be added. |
| 8127 | |`side` |optional| |
| 8128 | The side on which the comment should be added. + |
| 8129 | Allowed values are `REVISION` and `PARENT`. + |
| 8130 | If not set, the default is `REVISION`. |
| 8131 | |`line` |optional| |
| 8132 | The number of the line for which the comment should be added. + |
| 8133 | `0` if it is a file comment. + |
| 8134 | If neither line nor range is set, a file comment is added. + |
| 8135 | If range is set, this value is ignored in favor of the `end_line` of the range. |
| 8136 | |`range` |optional| |
| 8137 | The range of the comment as a link:#comment-range[CommentRange] |
| 8138 | entity. |
| 8139 | |`in_reply_to` |optional| |
| 8140 | The URL encoded UUID of the comment to which this comment is a reply. |
| 8141 | |`message` |optional| |
| 8142 | The comment message. |
| 8143 | |`robot_id` ||The ID of the robot that generated this comment. |
| 8144 | |`robot_run_id` ||An ID of the run of the robot. |
| 8145 | |`url` |optional|URL to more information. |
| 8146 | |`properties` |optional|Robot specific properties as map that maps arbitrary |
| 8147 | keys to values. |
| 8148 | |`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of |
| 8149 | <<fix-suggestion-info,FixSuggestionInfo>> entities. |
| 8150 | |=========================== |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8151 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8152 | [[rule-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8153 | === RuleInput |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8154 | The `RuleInput` entity contains information to test a Prolog rule. |
| 8155 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8156 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8157 | |=========================== |
| 8158 | |Field Name ||Description |
| 8159 | |`rule`|| |
| 8160 | Prolog code to execute instead of the code in `refs/meta/config`. |
| 8161 | |`filters`|`RUN` if not set| |
| 8162 | When `RUN` filter rules in the parent projects are called to |
| 8163 | post-process the results of the project specific rule. This |
| 8164 | behavior matches how the rule will execute if installed. + |
| 8165 | If `SKIP` the parent filters are not called, allowing the test |
| 8166 | to return results from the input rule. |
| 8167 | |=========================== |
| 8168 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8169 | [[submit-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8170 | === SubmitInput |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8171 | The `SubmitInput` entity contains information for submitting a change. |
| 8172 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8173 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8174 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8175 | |Field Name ||Description |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8176 | |`on_behalf_of` |optional| |
Dave Borowitz | c6d143d | 2016-02-24 12:32:23 -0500 | [diff] [blame] | 8177 | If set, submit the change on behalf of the given user. The value may take any |
| 8178 | format link:rest-api-accounts.html#account-id[accepted by the accounts REST |
| 8179 | API]. Using this option requires |
| 8180 | link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)] |
| 8181 | permission on the branch. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8182 | |`notify` |optional| |
Stephen Li | a5a5ef0 | 2016-03-31 16:55:53 -0700 | [diff] [blame] | 8183 | Notify handling that defines to whom email notifications should be sent after |
| 8184 | the change is submitted. + |
| 8185 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 8186 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8187 | |`notify_details`|optional| |
| 8188 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8189 | of link:user-notify.html#recipient-types[recipient type] to |
| 8190 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8191 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8192 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8193 | [[submit-record]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8194 | === SubmitRecord |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8195 | The `SubmitRecord` entity describes results from a submit_rule. |
Dave Borowitz | 6453fce | 2016-09-22 16:11:56 +0200 | [diff] [blame] | 8196 | Fields in this entity roughly correspond to the fields set by `LABELS` |
| 8197 | in link:#label-info[LabelInfo]. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8198 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8199 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8200 | |=========================== |
| 8201 | |Field Name ||Description |
| 8202 | |`status`|| |
| 8203 | `OK`, the change can be submitted. + |
| 8204 | `NOT_READY`, additional labels are required before submit. + |
| 8205 | `CLOSED`, closed changes cannot be submitted. + |
| 8206 | `RULE_ERROR`, rule code failed with an error. |
| 8207 | |`ok`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 8208 | Map of labels that are approved; an |
| 8209 | link:rest-api-accounts.html#account-info[AccountInfo] identifies the |
| 8210 | voter chosen by the rule. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8211 | |`reject`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 8212 | Map of labels that are preventing submit; |
| 8213 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8214 | |`need`|optional| |
| 8215 | Map of labels that need to be given to submit. The value is |
| 8216 | currently an empty object. |
| 8217 | |`may`|optional| |
| 8218 | Map of labels that can be used, but do not affect submit. |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 8219 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter, |
| 8220 | if the label has been applied. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8221 | |`impossible`|optional| |
| 8222 | Map of labels that should have been in `need` but cannot be |
| 8223 | used by any user because of access restrictions. The value |
| 8224 | is currently an empty object. |
| 8225 | |`error_message`|optional| |
| 8226 | When status is RULE_ERROR this message provides some text describing |
| 8227 | the failure of the rule predicate. |
| 8228 | |=========================== |
| 8229 | |
Youssef Elghareeb | 02d33aa | 2021-10-04 13:24:52 +0200 | [diff] [blame] | 8230 | [[submit-record-info]] |
| 8231 | === SubmitRecordInfo |
| 8232 | The `SubmitRecordInfo` entity describes results from a submit_rule. |
| 8233 | |
| 8234 | [options="header",cols="1,^1,5"] |
| 8235 | |=========================== |
| 8236 | |Field Name ||Description |
| 8237 | |`rule_name`|| |
| 8238 | The name of the submit rule that created this submit record. The submit rule is |
| 8239 | specified in the form of "$plugin~$rule" where `$plugin` is the plugin name |
| 8240 | and `$rule` is the name of the class that implemented the submit rule. |
| 8241 | |`status`|| |
| 8242 | `OK`, the change can be submitted. + |
| 8243 | `NOT_READY`, additional labels are required before submit. + |
| 8244 | `CLOSED`, closed changes cannot be submitted. + |
| 8245 | `FORCED`, the change was submitted bypassing the submit rule. + |
| 8246 | `RULE_ERROR`, rule code failed with an error. |
| 8247 | |`labels`|optional| |
| 8248 | A list of labels, each containing the following fields. + |
| 8249 | * `label`: the label name. + |
| 8250 | * `status`: the label status: {`OK`, `REJECT`, `MAY`, `NEED`, `IMPOSSIBLE`}. + |
| 8251 | * `appliedBy`: the link:rest-api-accounts.html#account-info[AccountInfo] |
| 8252 | that applied the vote to the label. |
| 8253 | |`requirements`|optional| |
| 8254 | List of the link:rest-api-changes.html#requirement[requirements] to be met |
| 8255 | before this change can be submitted. |
| 8256 | |`error_message`|optional| |
| 8257 | When status is RULE_ERROR this message provides some text describing |
| 8258 | the failure of the rule predicate. |
| 8259 | |=========================== |
| 8260 | |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8261 | [[submit-requirement-expression-info]] |
| 8262 | === SubmitRequirementExpressionInfo |
| 8263 | The `SubmitRequirementExpressionInfo` describes the result of evaluating a |
| 8264 | single submit requirement expression, for example `label:code-review=+2`. |
| 8265 | |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8266 | [options="header",cols="1,^1,5"] |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8267 | |=========================== |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8268 | |Field Name ||Description |
| 8269 | |`expression`|optional| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8270 | The submit requirement expression as a string, for example |
| 8271 | `branch:refs/heads/foo and label:verified=+1`. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8272 | |`fulfilled`|| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8273 | True if the submit requirement is fulfilled for the change. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8274 | |`passing_atoms`|optional| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8275 | A list of passing atoms as strings. For the above expression, |
| 8276 | `passing_atoms` can contain ["branch:refs/heads/foo"] if the branch predicate is |
| 8277 | fulfilled for the change. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8278 | |`failing_atoms`|optional| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8279 | A list of failing atoms. This is similar to `passing_atoms` except that it |
| 8280 | contains the list of predicates that are not fulfilled for the change. |
| 8281 | |=========================== |
| 8282 | |
Youssef Elghareeb | d598693 | 2021-10-15 11:45:23 +0200 | [diff] [blame] | 8283 | [[submit-requirement-input]] |
| 8284 | === SubmitRequirementInput |
| 8285 | The `SubmitRequirementInput` entity describes a submit requirement. |
| 8286 | |
| 8287 | [options="header",cols="1,^1,5"] |
| 8288 | |=========================== |
| 8289 | |Field Name ||Description |
| 8290 | |`name`|| |
| 8291 | The submit requirement name. |
| 8292 | |`description`|optional| |
| 8293 | Description of the submit requirement. |
| 8294 | |`applicability_expression`|optional| |
| 8295 | Query expression that can be evaluated on any change. If evaluated to true on a |
| 8296 | change, the submit requirement is then applicable for this change. |
| 8297 | If not specified, the submit requirement is applicable for all changes. |
| 8298 | |`submittability_expression`|| |
| 8299 | Query expression that can be evaluated on any change. If evaluated to true on a |
| 8300 | change, the submit requirement is fulfilled and not blocking change submission. |
| 8301 | |`override_expression`|optional| |
| 8302 | Query expression that can be evaluated on any change. If evaluated to true on a |
| 8303 | change, the submit requirement is overridden and not blocking change submission. |
| 8304 | |`allow_override_in_child_projects`|optional| |
| 8305 | Whether this submit requirement can be overridden in child projects. Default is |
| 8306 | `true`. |
| 8307 | |=========================== |
| 8308 | |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8309 | [[submit-requirement-result-info]] |
| 8310 | === SubmitRequirementResultInfo |
| 8311 | The `SubmitRequirementResultInfo` describes the result of evaluating a |
| 8312 | submit requirement on a change. |
| 8313 | |
| 8314 | [options="header",cols="1,^1,5"] |
| 8315 | |=========================== |
| 8316 | |Field Name ||Description |
| 8317 | |`name`|| |
| 8318 | The submit requirement name. |
| 8319 | |`description`|optional| |
| 8320 | Description of the submit requirement. |
| 8321 | |`status`|| |
| 8322 | Status describing the result of evaluating the submit requirement. The status |
Youssef Elghareeb | 5f62c59 | 2021-10-15 11:22:08 +0200 | [diff] [blame] | 8323 | is one of (`SATISFIED`, `UNSATISFIED`, `OVERRIDDEN`, `NOT_APPLICABLE`, `ERROR`). |
Youssef Elghareeb | 024103e | 2021-09-06 14:41:04 +0200 | [diff] [blame] | 8324 | |`is_legacy`|| |
| 8325 | If true, this submit requirement result was created from a legacy |
| 8326 | link:#submit-record[SubmitRecord]. Otherwise, it was created by evaluating a |
| 8327 | submit requirement. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8328 | |`applicability_expression_result`|optional| |
| 8329 | A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo] |
| 8330 | containing the result of evaluating the applicability expression. Not set if the |
| 8331 | submit requirement did not define an applicability expression. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8332 | Note that fields `expression`, `passing_atoms` and `failing_atoms` are always |
| 8333 | omitted for the `applicability_expression_result`. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8334 | |`submittability_expression_result`|| |
| 8335 | A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo] |
| 8336 | containing the result of evaluating the submittability expression. |
| 8337 | |`override_expression_result`|optional| |
| 8338 | A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo] |
| 8339 | containing the result of evaluating the override expression. Not set if the |
| 8340 | submit requirement did not define an override expression. |
| 8341 | |=========================== |
| 8342 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 8343 | [[submitted-together-info]] |
| 8344 | === SubmittedTogetherInfo |
| 8345 | The `SubmittedTogetherInfo` entity contains information about a |
| 8346 | collection of changes that would be submitted together. |
| 8347 | |
| 8348 | [options="header",cols="1,6"] |
| 8349 | |=========================== |
| 8350 | |Field Name |Description |
| 8351 | |`changes` | |
| 8352 | A list of ChangeInfo entities representing the changes to be submitted together. |
| 8353 | |`non_visible_changes`| |
| 8354 | The number of changes to be submitted together that the current user |
| 8355 | cannot see. (This count includes changes that are visible to the |
| 8356 | current user when their reason for being submitted together involves |
| 8357 | changes the user cannot see.) |
| 8358 | |=========================== |
| 8359 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8360 | [[suggested-reviewer-info]] |
| 8361 | === SuggestedReviewerInfo |
| 8362 | The `SuggestedReviewerInfo` entity contains information about a reviewer |
| 8363 | that can be added to a change (an account or a group). |
| 8364 | |
| 8365 | `SuggestedReviewerInfo` has either the `account` field that contains |
| 8366 | the link:rest-api-accounts.html#account-info[AccountInfo] entity, or |
| 8367 | the `group` field that contains the |
| 8368 | link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity. |
| 8369 | |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 8370 | [options="header",cols="1,^1,5"] |
| 8371 | |=========================== |
| 8372 | |Field Name ||Description |
| 8373 | |`account` |optional| |
| 8374 | An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the |
| 8375 | suggestion is an account. |
| 8376 | |`group` |optional| |
| 8377 | A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the |
| 8378 | suggestion is a group. |
| 8379 | |`count` || |
| 8380 | The total number of accounts in the suggestion. This is `1` if `account` is |
| 8381 | present. If `group` is present, the total number of accounts that are |
| 8382 | members of the group is returned (this count includes members of nested |
| 8383 | groups). |
| 8384 | |`confirm` |optional| |
| 8385 | True if `group` is present and `count` is above the threshold where the |
| 8386 | `confirmed` flag must be passed to add the group as a reviewer. |
| 8387 | |=========================== |
| 8388 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 8389 | [[topic-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8390 | === TopicInput |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 8391 | The `TopicInput` entity contains information for setting a topic. |
| 8392 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8393 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 8394 | |=========================== |
| 8395 | |Field Name ||Description |
| 8396 | |`topic` |optional|The topic. + |
| 8397 | The topic will be deleted if not set. |
Gal Paikin | 44dbd7e | 2020-04-15 15:23:44 +0200 | [diff] [blame] | 8398 | Topic can't contain quotation marks. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 8399 | |=========================== |
| 8400 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 8401 | [[tracking-id-info]] |
| 8402 | === TrackingIdInfo |
| 8403 | The `TrackingIdInfo` entity describes a reference to an external tracking system. |
| 8404 | |
| 8405 | [options="header",cols="1,6"] |
| 8406 | |====================== |
| 8407 | |Field Name|Description |
| 8408 | |`system` |The name of the external tracking system. |
| 8409 | |`id` |The tracking id. |
| 8410 | |====================== |
| 8411 | |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 8412 | [[voting-range-info]] |
| 8413 | === VotingRangeInfo |
| 8414 | The `VotingRangeInfo` entity describes the continuous voting range from min |
| 8415 | to max values. |
| 8416 | |
| 8417 | [options="header",cols="1,6"] |
| 8418 | |====================== |
| 8419 | |Field Name|Description |
| 8420 | |`min` |The minimum voting value. |
| 8421 | |`max` |The maximum voting value. |
| 8422 | |====================== |
| 8423 | |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 8424 | [[web-link-info]] |
| 8425 | === WebLinkInfo |
| 8426 | The `WebLinkInfo` entity describes a link to an external site. |
| 8427 | |
Edwin Kempin | af35ce4 | 2021-01-29 13:50:04 +0100 | [diff] [blame] | 8428 | [options="header",cols="1,^1,5"] |
| 8429 | |======================== |
| 8430 | |Field Name ||Description |
| 8431 | |`name` ||The link name. |
| 8432 | |`url` ||The link URL. |
| 8433 | |`image_url`|optional|URL to the icon of the link. |
| 8434 | |`target` |optional|The target window in which the web link should be opened. |
| 8435 | |======================== |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 8436 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 8437 | [[work-in-progress-input]] |
| 8438 | === WorkInProgressInput |
| 8439 | The `WorkInProgressInput` entity contains additional information for a change |
| 8440 | set to WorkInProgress/ReadyForReview. |
| 8441 | |
| 8442 | [options="header",cols="1,^1,5"] |
| 8443 | |============================= |
| 8444 | |Field Name ||Description |
| 8445 | |`message` |optional| |
| 8446 | Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview. |
| 8447 | |============================= |
| 8448 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 8449 | GERRIT |
| 8450 | ------ |
| 8451 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 8452 | |
| 8453 | SEARCHBOX |
| 8454 | --------- |