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 |
Jacek Centkowski | 34a2d6b | 2022-03-04 11:07:15 +0100 | [diff] [blame] | 80 | limit on queries and return all results (does not apply to anonymous requests). |
| 81 | This might not be supported by 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", |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 106 | "attention_set": { |
| 107 | "1000096": { |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 108 | "account": { |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 109 | "_account_id": 1000096, |
| 110 | "name": "John Doe", |
| 111 | "email": "john.doe@example.com" |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 112 | }, |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 113 | "last_update": "2012-07-17 07:19:27.766000000", |
| 114 | "reason": "reviewer or cc replied" |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 115 | } |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 116 | }, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 117 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 118 | "subject": "One change", |
| 119 | "status": "NEW", |
| 120 | "created": "2012-07-17 07:18:30.854000000", |
| 121 | "updated": "2012-07-17 07:19:27.766000000", |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 122 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 123 | "insertions": 26, |
| 124 | "deletions": 10, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 125 | "_number": 1756, |
| 126 | "owner": { |
| 127 | "name": "John Doe" |
| 128 | }, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 129 | }, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 130 | { |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 131 | "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 132 | "project": "demo", |
| 133 | "branch": "master", |
| 134 | "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 135 | "subject": "Another change", |
| 136 | "status": "NEW", |
| 137 | "created": "2012-07-17 07:18:30.884000000", |
| 138 | "updated": "2012-07-17 07:18:30.885000000", |
| 139 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 140 | "insertions": 12, |
| 141 | "deletions": 18, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 142 | "_number": 1757, |
| 143 | "owner": { |
| 144 | "name": "John Doe" |
| 145 | }, |
| 146 | "_more_changes": true |
| 147 | } |
| 148 | ] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 149 | ---- |
| 150 | |
Sebastian Schuberth | 02bafe0 | 2016-01-20 21:38:11 +0100 | [diff] [blame] | 151 | If the number of changes matching the query exceeds either the internal |
| 152 | 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] | 153 | `_more_changes: true` JSON field set. |
| 154 | |
| 155 | The `S` or `start` query parameter can be supplied to skip a number |
| 156 | of changes from the list. |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 157 | |
Matthias Sohn | 0b2bf61 | 2020-12-24 00:15:32 +0100 | [diff] [blame] | 158 | Administrators can use the `skip-visibility` query parameter to skip visibility filtering. |
| 159 | This can be used to ensure that no changes are missed e.g. when querying for changes which |
| 160 | need to be reindexed. Without this parameter query results the user has no permission to read |
| 161 | are filtered out. REST requests with the skip-visibility option are rejected when the current |
| 162 | user doesn't have the ADMINISTRATE_SERVER capability. |
| 163 | |
Youssef Elghareeb | f5fa77b | 2023-10-02 12:43:34 +0200 | [diff] [blame] | 164 | The `allow-incomplete-results` query parameter can be used. This is a boolean |
| 165 | parameter that can optionally be set to true. If set, the server can tolerate |
| 166 | handling faulty records when parsed from the change index, for example if a |
| 167 | field contained a value of a wrong format. For faulty records, the server |
| 168 | will return a canonical empty record where only the fields {project, branch, |
| 169 | change_id, _number, owner} are set and the subject will be set to |
| 170 | "\*\**ERROR***". All other fields will be empty. |
| 171 | Note that the handling of this parameter is up to the index implementation. |
| 172 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 173 | Clients are allowed to specify more than one query by setting the `q` |
| 174 | parameter multiple times. In this case the result is an array of |
| 175 | arrays, one per query in the same order the queries were given in. |
| 176 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 177 | .Query for the 25 most recent open changes of the projects that you watch |
| 178 | **** |
| 179 | get::/changes/?q=status:open+is:watched&n=25 |
| 180 | **** |
| 181 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 182 | Query that retrieves changes for a user's dashboard: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 183 | |
| 184 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 185 | ---- |
| 186 | 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] | 187 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 188 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 189 | .Response |
| 190 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 191 | HTTP/1.1 200 OK |
| 192 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 193 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 194 | |
| 195 | )]}' |
| 196 | [ |
| 197 | [ |
| 198 | { |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 199 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 200 | "project": "demo", |
| 201 | "branch": "master", |
| 202 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 203 | "subject": "One change", |
| 204 | "status": "NEW", |
| 205 | "created": "2012-07-17 07:18:30.854000000", |
| 206 | "updated": "2012-07-17 07:19:27.766000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 207 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 208 | "insertions": 4, |
| 209 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 210 | "_number": 1756, |
| 211 | "owner": { |
| 212 | "name": "John Doe" |
| 213 | }, |
| 214 | "labels": { |
| 215 | "Verified": {}, |
| 216 | "Code-Review": {} |
| 217 | } |
| 218 | } |
| 219 | ], |
| 220 | [], |
| 221 | [] |
| 222 | ] |
| 223 | ---- |
| 224 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 225 | .Query the changes for your user dashboard |
| 226 | **** |
| 227 | get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS |
| 228 | **** |
| 229 | |
David Pursehouse | 2cf2843 | 2016-08-21 23:20:08 +0900 | [diff] [blame] | 230 | [[query-options]] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 231 | Additional fields can be obtained by adding `o` parameters, each |
| 232 | option requires more database lookups and slows down the query |
| 233 | response time to the client so they are generally disabled by |
| 234 | default. Optional fields are: |
| 235 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 236 | [[labels]] |
| 237 | -- |
Youssef Elghareeb | 9b3e021 | 2022-01-21 14:40:18 +0100 | [diff] [blame] | 238 | * `LABELS`: Includes the `labels` field which contains all information about |
| 239 | labels and approvers that have granted (or rejected) that label. Does not |
| 240 | include the `permitted_voting_range` attribute with the list of |
| 241 | link:#approval-info[ApprovalInfo] of the `all` attribute. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 242 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 243 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 244 | [[detailed-labels]] |
| 245 | -- |
Youssef Elghareeb | 9b3e021 | 2022-01-21 14:40:18 +0100 | [diff] [blame] | 246 | * `DETAILED_LABELS`: Includes the `labels` field which contains all information |
| 247 | about labels and approvers that have granted (or rejected) that label, including |
| 248 | the `permitted_voting_range` attribute with the list of |
| 249 | link:#approval-info[ApprovalInfo] of the `all` attribute. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 250 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 251 | |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 252 | [[submit-requirements]] |
| 253 | -- |
| 254 | * `SUBMIT_REQUIREMENTS`: detailed result of the evaluated submit requirements |
| 255 | for this change. |
| 256 | -- |
| 257 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 258 | [[current-revision]] |
| 259 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 260 | * `CURRENT_REVISION`: describe the current revision (patch set) |
| 261 | 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] | 262 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 263 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 264 | [[all-revisions]] |
| 265 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 266 | * `ALL_REVISIONS`: describe all revisions, not just current. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 267 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 268 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 269 | [[download-commands]] |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 270 | -- |
| 271 | * `DOWNLOAD_COMMANDS`: include the `commands` field in the |
| 272 | link:#fetch-info[FetchInfo] for revisions. Only valid when the |
| 273 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
| 274 | -- |
| 275 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 276 | [[current-commit]] |
| 277 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 278 | * `CURRENT_COMMIT`: parse and output all header fields from the |
David Pursehouse | 98006e8 | 2013-10-02 10:15:52 +0900 | [diff] [blame] | 279 | commit object, including message. Only valid when the |
| 280 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 281 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 282 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 283 | [[all-commits]] |
| 284 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 285 | * `ALL_COMMITS`: parse and output all header fields from the |
| 286 | output revisions. If only `CURRENT_REVISION` was requested |
| 287 | then only the current revision's commit data will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 288 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 289 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 290 | [[current-files]] |
| 291 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 292 | * `CURRENT_FILES`: list files modified by the commit and magic files, |
| 293 | including basic line counts inserted/deleted per file. Only valid |
| 294 | when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 295 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 296 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 297 | [[all-files]] |
| 298 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 299 | * `ALL_FILES`: list files modified by the commit and magic files, |
| 300 | including basic line counts inserted/deleted per file. If only the |
| 301 | `CURRENT_REVISION` was requested then only that commit's modified |
| 302 | files will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 303 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 304 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 305 | [[detailed-accounts]] |
| 306 | -- |
Edwin Kempin | 4a00e22 | 2013-10-16 14:34:24 +0200 | [diff] [blame] | 307 | * `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username` |
| 308 | fields when referencing accounts. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 309 | -- |
Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 310 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 311 | [[reviewer-updates]] |
| 312 | -- |
| 313 | * `REVIEWER_UPDATES`: include updates to reviewers set as |
| 314 | link:#review-update-info[ReviewerUpdateInfo] entities. |
| 315 | -- |
| 316 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 317 | [[messages]] |
| 318 | -- |
| 319 | * `MESSAGES`: include messages associated with the change. |
| 320 | -- |
| 321 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 322 | [[actions]] |
| 323 | -- |
| 324 | * `CURRENT_ACTIONS`: include information on available actions |
Stefan Beller | 09cd95d | 2015-02-12 13:40:23 -0800 | [diff] [blame] | 325 | for the change and its current revision. Ignored if the caller |
| 326 | is not authenticated. |
| 327 | -- |
| 328 | |
| 329 | [[change-actions]] |
| 330 | -- |
| 331 | * `CHANGE_ACTIONS`: include information on available |
| 332 | change actions for the change. Ignored if the caller |
| 333 | is not authenticated. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 334 | -- |
| 335 | |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 336 | [[reviewed]] |
| 337 | -- |
Dave Borowitz | 86669b3 | 2015-05-27 14:56:10 -0700 | [diff] [blame] | 338 | * `REVIEWED`: include the `reviewed` field if all of the following are |
| 339 | true: |
Ardo Septama | 505f9ad | 2016-12-06 16:28:00 +0100 | [diff] [blame] | 340 | - the change is open |
| 341 | - the caller is authenticated |
| 342 | - 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] | 343 | from the change owner, i.e. this change would show up in the results of |
| 344 | link:user-search.html#reviewedby[reviewedby:self]. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 345 | -- |
Gal Paikin | 3a2aa01 | 2019-06-21 18:30:01 +0200 | [diff] [blame] | 346 | [[skip_diffstat]] |
| 347 | -- |
| 348 | * `SKIP_DIFFSTAT`: skip the 'insertions' and 'deletions' field in link:#change-info[ChangeInfo]. |
| 349 | For large trees, their computation may be expensive. |
| 350 | -- |
Han-Wen Nienhuys | 19de6cd | 2018-01-16 13:15:38 +0100 | [diff] [blame] | 351 | |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 352 | [[submittable]] |
| 353 | -- |
Jonathan Nieder | ad5240f | 2016-10-04 11:03:23 -0700 | [diff] [blame] | 354 | * `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo], |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 355 | which can be used to tell if the change is reviewed and ready for submit. |
| 356 | -- |
| 357 | |
Khai Do | 2a23ec8 | 2014-09-19 16:33:02 -0700 | [diff] [blame] | 358 | [[web-links]] |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 359 | -- |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 360 | * `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo], |
| 361 | therefore only valid in combination with `CURRENT_COMMIT` or |
| 362 | `ALL_COMMITS`. |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 363 | -- |
| 364 | |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 365 | [[check]] |
| 366 | -- |
| 367 | * `CHECK`: include potential problems with the change. |
| 368 | -- |
| 369 | |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 370 | [[commit-footers]] |
| 371 | -- |
| 372 | * `COMMIT_FOOTERS`: include the full commit message with |
| 373 | Gerrit-specific commit footers in the |
| 374 | link:#revision-info[RevisionInfo]. |
Yuxuan 'fishy' Wang | 16baf21 | 2015-05-05 16:49:55 -0700 | [diff] [blame] | 375 | -- |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 376 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 377 | [[push-certificates]] |
| 378 | -- |
| 379 | * `PUSH_CERTIFICATES`: include push certificate information in the |
| 380 | link:#revision-info[RevisionInfo]. Ignored if signed push is not |
| 381 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the |
| 382 | server. |
| 383 | -- |
| 384 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 385 | [[tracking-ids]] |
| 386 | -- |
| 387 | * `TRACKING_IDS`: include references to external tracking systems |
| 388 | as link:#tracking-id-info[TrackingIdInfo]. |
| 389 | -- |
| 390 | |
Chris Poucet | c2962dc | 2023-03-07 17:19:25 +0100 | [diff] [blame] | 391 | [[custom-keyed-values]] |
| 392 | -- |
| 393 | * `CUSTOM_KEYED_VALUES`: include the custom key-value map |
Kamil Musin | 5338200 | 2023-05-04 10:18:14 +0200 | [diff] [blame] | 394 | -- |
Chris Poucet | c2962dc | 2023-03-07 17:19:25 +0100 | [diff] [blame] | 395 | |
Youssef Elghareeb | f4f4948 | 2023-04-26 18:02:33 +0200 | [diff] [blame] | 396 | [[star]] |
| 397 | -- |
| 398 | * `STAR`: include the `starred` field in |
| 399 | link:#change-info[ChangeInfo], which indicates if the change is starred |
| 400 | by the current user or not. |
| 401 | -- |
| 402 | |
Youssef Elghareeb | a112144 | 2023-06-14 14:53:59 +0200 | [diff] [blame] | 403 | [[parents-data]] |
| 404 | -- |
| 405 | * `PARENTS`: include the `parents_data` field in |
| 406 | link:#revision-info[RevisionInfo], which provides information of whether the |
| 407 | parent commit of this revision, e.g. if it's merged in the target branch |
| 408 | and whether it points to a patch-set of another change. |
| 409 | -- |
| 410 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 411 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 412 | ---- |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 413 | 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] | 414 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 415 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 416 | .Response |
| 417 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 418 | HTTP/1.1 200 OK |
| 419 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 420 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 421 | |
| 422 | )]}' |
| 423 | [ |
| 424 | { |
David Pursehouse | c3be6ad | 2014-07-18 12:03:06 +0900 | [diff] [blame] | 425 | "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 426 | "project": "gerrit", |
| 427 | "branch": "master", |
| 428 | "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 429 | "subject": "Use an EventBus to manage star icons", |
| 430 | "status": "NEW", |
| 431 | "created": "2012-04-25 00:52:25.580000000", |
| 432 | "updated": "2012-04-25 00:52:25.586000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 433 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 434 | "insertions": 16, |
| 435 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 436 | "_number": 97, |
| 437 | "owner": { |
| 438 | "name": "Shawn Pearce" |
| 439 | }, |
| 440 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", |
| 441 | "revisions": { |
| 442 | "184ebe53805e102605d11f6b143486d15c23a09c": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 443 | "kind": "REWORK", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 444 | "_number": 1, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 445 | "ref": "refs/changes/97/97/1", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 446 | "fetch": { |
| 447 | "git": { |
| 448 | "url": "git://localhost/gerrit", |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 449 | "ref": "refs/changes/97/97/1", |
| 450 | "commands": { |
| 451 | "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 452 | "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 453 | "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 454 | "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1" |
| 455 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 456 | }, |
| 457 | "http": { |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 458 | "url": "http://myuser@127.0.0.1:8080/gerrit", |
| 459 | "ref": "refs/changes/97/97/1", |
| 460 | "commands": { |
| 461 | "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 462 | "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 463 | "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", |
| 464 | "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1" |
| 465 | } |
| 466 | }, |
| 467 | "ssh": { |
| 468 | "url": "ssh://myuser@*:29418/gerrit", |
| 469 | "ref": "refs/changes/97/97/1", |
| 470 | "commands": { |
| 471 | "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 472 | "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 473 | "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 474 | "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1" |
| 475 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 476 | } |
| 477 | }, |
| 478 | "commit": { |
| 479 | "parents": [ |
| 480 | { |
| 481 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 482 | "subject": "Migrate contributor agreements to All-Projects." |
| 483 | } |
| 484 | ], |
| 485 | "author": { |
| 486 | "name": "Shawn O. Pearce", |
| 487 | "email": "sop@google.com", |
| 488 | "date": "2012-04-24 18:08:08.000000000", |
| 489 | "tz": -420 |
| 490 | }, |
| 491 | "committer": { |
| 492 | "name": "Shawn O. Pearce", |
| 493 | "email": "sop@google.com", |
| 494 | "date": "2012-04-24 18:08:08.000000000", |
| 495 | "tz": -420 |
| 496 | }, |
| 497 | "subject": "Use an EventBus to manage star icons", |
| 498 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 499 | }, |
| 500 | "files": { |
| 501 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 502 | "lines_deleted": 8, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 503 | "size_delta": -412, |
| 504 | "size": 7782 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 505 | }, |
| 506 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 507 | "lines_inserted": 1, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 508 | "size_delta": 23, |
| 509 | "size": 6762 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 510 | }, |
| 511 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { |
| 512 | "lines_inserted": 11, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 513 | "lines_deleted": 19, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 514 | "size_delta": -298, |
| 515 | "size": 47023 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 516 | }, |
| 517 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { |
| 518 | "lines_inserted": 23, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 519 | "lines_deleted": 20, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 520 | "size_delta": 132, |
| 521 | "size": 17727 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 522 | }, |
| 523 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { |
| 524 | "status": "D", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 525 | "lines_deleted": 139, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 526 | "size_delta": -5512, |
| 527 | "size": 13098 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 528 | }, |
| 529 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { |
| 530 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 531 | "lines_inserted": 204, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 532 | "size_delta": 8345, |
| 533 | "size": 8345 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 534 | }, |
| 535 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 536 | "lines_deleted": 9, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 537 | "size_delta": -343, |
| 538 | "size": 5385 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 539 | } |
| 540 | } |
| 541 | } |
| 542 | } |
| 543 | } |
| 544 | ] |
| 545 | ---- |
| 546 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 547 | [[get-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 548 | === Get Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 549 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 550 | 'GET /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 551 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 552 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 553 | Retrieves a change. |
| 554 | |
Dave Borowitz | 0314f73 | 2013-10-03 09:34:30 -0700 | [diff] [blame] | 555 | Additional fields can be obtained by adding `o` parameters, each |
| 556 | option requires more database lookups and slows down the query |
| 557 | response time to the client so they are generally disabled by |
| 558 | default. Fields are described in link:#list-changes[Query Changes]. |
| 559 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 560 | .Request |
| 561 | ---- |
| 562 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 563 | ---- |
| 564 | |
| 565 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 566 | describes the change. |
| 567 | |
| 568 | .Response |
| 569 | ---- |
| 570 | HTTP/1.1 200 OK |
| 571 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 572 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 573 | |
| 574 | )]}' |
| 575 | { |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 576 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 577 | "project": "myProject", |
| 578 | "branch": "master", |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 579 | "attention_set": { |
| 580 | "1000096": { |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 581 | "account": { |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 582 | "_account_id": 1000096, |
| 583 | "name": "John Doe", |
| 584 | "email": "john.doe@example.com" |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 585 | }, |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 586 | "last_update": "2013-02-21 11:16:36.775000000", |
| 587 | "reason": "reviewer or cc replied" |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 588 | } |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 589 | }, |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 590 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 591 | "subject": "Implementing Feature X", |
| 592 | "status": "NEW", |
| 593 | "created": "2013-02-01 09:59:32.126000000", |
| 594 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 595 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 596 | "insertions": 34, |
| 597 | "deletions": 101, |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 598 | "_number": 3965, |
| 599 | "owner": { |
| 600 | "name": "John Doe" |
| 601 | } |
| 602 | } |
| 603 | ---- |
| 604 | |
Han-Wen Nienhuys | 63b81f2 | 2021-02-17 10:31:01 +0100 | [diff] [blame] | 605 | Historical state of the change can be retrieved by specifying the |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 606 | `meta=SHA-1` parameter. This will use a historical NoteDb snapshot to |
| 607 | 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] | 608 | status code 412 is returned. |
| 609 | |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 610 | [[get-meta-diff]] |
| 611 | === Get Meta Diff |
| 612 | -- |
Han-Wen Nienhuys | 524317a | 2021-04-08 12:12:35 +0200 | [diff] [blame] | 613 | '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] | 614 | -- |
| 615 | |
| 616 | Retrieves the difference between two historical states of a change |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 617 | by specifying the `old=SHA-1` and the `meta=SHA-1` parameters. |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 618 | |
| 619 | 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] | 620 | 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] | 621 | state of the change is used. If neither are provided, the |
| 622 | difference between the current state of the change and its previous |
| 623 | state is returned. |
| 624 | |
| 625 | Additional fields can be obtained by adding `o` parameters, analogous |
| 626 | to link:#get-change[Get Change], and the same concerns for Get Change hold for |
| 627 | this endpoint too. Fields are described in link:#list-changes[Query Changes]. |
| 628 | |
| 629 | .Request |
| 630 | ---- |
| 631 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/meta_diff?old=b083abc34eb6dbdb9e154ba092fc198000e997b4&meta=63b81f2bde703ae07787a940e8fdf9a1828605b1 HTTP/1.0 |
| 632 | ---- |
| 633 | |
| 634 | As a response, two link:#change-info[ChangeInfo] entities are returned |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 635 | that describe information added and removed from the `old` change state, and |
| 636 | the two link:#change-info[ChangeInfo] entities that generated the diff are |
| 637 | 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] | 638 | |
| 639 | .Response |
| 640 | ---- |
| 641 | HTTP/1.1 200 OK |
| 642 | Content-Disposition: attachment |
| 643 | Content-Type: application/json; charset=UTF-8 |
| 644 | |
| 645 | )]}' |
| 646 | { |
| 647 | "added": { |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 648 | "attention_set": { |
| 649 | "1000096": { |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 650 | "account": { |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 651 | "_account_id": 1000096, |
| 652 | "name": "John Doe", |
| 653 | "email": "john.doe@example.com" |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 654 | }, |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 655 | "last_update": "2013-02-21 11:16:36.775000000", |
| 656 | "reason": "reviewer or cc replied" |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 657 | } |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 658 | }, |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 659 | "updated": "2013-02-21 11:16:36.775000000", |
| 660 | "topic": "new-topic" |
| 661 | }, |
| 662 | "removed": { |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 663 | "updated": "2013-02-01 09:59:32.126000000", |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 664 | "topic": "old-topic" |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 665 | }, |
| 666 | "old_change_info": { |
| 667 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 668 | "project": "myProject", |
| 669 | "branch": "master", |
| 670 | "attention_set": [], |
| 671 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 672 | "subject": "Implementing Feature X", |
| 673 | "status": "NEW", |
| 674 | "topic": "old-topic", |
| 675 | "created": "2013-02-01 09:59:32.126000000", |
| 676 | "updated": "2013-02-01 09:59:32.126000000", |
| 677 | "mergeable": true, |
| 678 | "insertions": 34, |
| 679 | "deletions": 101, |
| 680 | "_number": 3965, |
| 681 | "owner": { |
| 682 | "name": "John Doe" |
| 683 | } |
| 684 | }, |
| 685 | "new_change_info": { |
| 686 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 687 | "project": "myProject", |
| 688 | "branch": "master", |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 689 | "attention_set": { |
| 690 | "1000096": { |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 691 | "account": { |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 692 | "_account_id": 1000096, |
| 693 | "name": "John Doe", |
| 694 | "email": "john.doe@example.com" |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 695 | }, |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 696 | "last_update": "2013-02-21 11:16:36.775000000", |
| 697 | "reason": "reviewer or cc replied" |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 698 | } |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 699 | }, |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 700 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 701 | "subject": "Implementing Feature X", |
| 702 | "status": "NEW", |
| 703 | "topic": "new-topic", |
| 704 | "created": "2013-02-01 09:59:32.126000000", |
| 705 | "updated": "2013-02-21 11:16:36.775000000", |
| 706 | "mergeable": true, |
| 707 | "insertions": 34, |
| 708 | "deletions": 101, |
| 709 | "_number": 3965, |
| 710 | "owner": { |
| 711 | "name": "John Doe" |
| 712 | } |
| 713 | }, |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 714 | } |
| 715 | ---- |
| 716 | |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 717 | If the provided SHA-1 for `meta` is not reachable as a NoteDb |
| 718 | 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] | 719 | is not reachable, the difference between the change at state |
| 720 | `meta` and an empty change is returned. |
Han-Wen Nienhuys | 63b81f2 | 2021-02-17 10:31:01 +0100 | [diff] [blame] | 721 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 722 | [[get-change-detail]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 723 | === Get Change Detail |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 724 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 725 | 'GET /changes/link:#change-id[\{change-id\}]/detail' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 726 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 727 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 728 | Retrieves a change with link:#labels[labels], link:#detailed-labels[ |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 729 | detailed labels], link:#detailed-accounts[detailed accounts], |
| 730 | link:#reviewer-updates[reviewer updates], and link:#messages[messages]. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 731 | |
Shawn Pearce | 7f3dccf | 2013-07-06 19:24:29 -0700 | [diff] [blame] | 732 | Additional fields can be obtained by adding `o` parameters, each |
| 733 | option requires more database lookups and slows down the query |
| 734 | response time to the client so they are generally disabled by |
| 735 | default. Fields are described in link:#list-changes[Query Changes]. |
| 736 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 737 | .Request |
| 738 | ---- |
| 739 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0 |
| 740 | ---- |
| 741 | |
| 742 | As response a link:#change-info[ChangeInfo] entity is returned that |
Khai Do | ad63201 | 2014-06-22 08:29:57 -0700 | [diff] [blame] | 743 | describes the change. This response will contain all votes for each |
| 744 | label and include one combined vote. The combined label vote is |
| 745 | calculated in the following order (from highest to lowest): |
| 746 | REJECTED > APPROVED > DISLIKED > RECOMMENDED. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 747 | |
| 748 | .Response |
| 749 | ---- |
| 750 | HTTP/1.1 200 OK |
| 751 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 752 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 753 | |
| 754 | )]}' |
| 755 | { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 756 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 757 | "project": "myProject", |
| 758 | "branch": "master", |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 759 | "attention_set": { |
| 760 | "1000096": { |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 761 | "account": { |
| 762 | "_account_id": 1000096, |
| 763 | "name": "John Doe", |
| 764 | "email": "john.doe@example.com", |
| 765 | "username": "jdoe" |
| 766 | }, |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 767 | "last_update": "2013-02-21 11:16:36.775000000", |
| 768 | "reason": "reviewer or cc replied" |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 769 | } |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 770 | }, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 771 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 772 | "subject": "Implementing Feature X", |
| 773 | "status": "NEW", |
| 774 | "created": "2013-02-01 09:59:32.126000000", |
| 775 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 776 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 777 | "insertions": 126, |
| 778 | "deletions": 11, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 779 | "_number": 3965, |
| 780 | "owner": { |
| 781 | "_account_id": 1000096, |
| 782 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 783 | "email": "john.doe@example.com", |
| 784 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 785 | }, |
| 786 | "labels": { |
| 787 | "Verified": { |
| 788 | "all": [ |
| 789 | { |
| 790 | "value": 0, |
| 791 | "_account_id": 1000096, |
| 792 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 793 | "email": "john.doe@example.com", |
| 794 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 795 | }, |
| 796 | { |
| 797 | "value": 0, |
| 798 | "_account_id": 1000097, |
| 799 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 800 | "email": "jane.roe@example.com", |
| 801 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 802 | } |
| 803 | ], |
| 804 | "values": { |
| 805 | "-1": "Fails", |
| 806 | " 0": "No score", |
| 807 | "+1": "Verified" |
| 808 | } |
| 809 | }, |
| 810 | "Code-Review": { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 811 | "disliked": { |
| 812 | "_account_id": 1000096, |
| 813 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 814 | "email": "john.doe@example.com", |
| 815 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 816 | }, |
| 817 | "all": [ |
| 818 | { |
| 819 | "value": -1, |
| 820 | "_account_id": 1000096, |
| 821 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 822 | "email": "john.doe@example.com", |
| 823 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 824 | }, |
| 825 | { |
| 826 | "value": 1, |
| 827 | "_account_id": 1000097, |
| 828 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 829 | "email": "jane.roe@example.com", |
| 830 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 831 | } |
| 832 | ] |
| 833 | "values": { |
Oswald Buddenhagen | f887770 | 2022-02-15 14:01:34 +0100 | [diff] [blame] | 834 | "-2": "This shall not be submitted", |
| 835 | "-1": "I would prefer this is not submitted as is", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 836 | " 0": "No score", |
| 837 | "+1": "Looks good to me, but someone else must approve", |
| 838 | "+2": "Looks good to me, approved" |
| 839 | } |
| 840 | } |
| 841 | }, |
| 842 | "permitted_labels": { |
| 843 | "Verified": [ |
| 844 | "-1", |
| 845 | " 0", |
| 846 | "+1" |
| 847 | ], |
| 848 | "Code-Review": [ |
| 849 | "-2", |
| 850 | "-1", |
| 851 | " 0", |
| 852 | "+1", |
| 853 | "+2" |
| 854 | ] |
| 855 | }, |
Nitzan Gur-Furman | d122357 | 2023-01-16 12:07:46 +0000 | [diff] [blame] | 856 | "removable_labels": { |
| 857 | "Code-Review": { |
| 858 | "-1": [ |
| 859 | { |
| 860 | "_account_id": 1000096, |
| 861 | "name": "John Doe", |
| 862 | "email": "john.doe@example.com", |
| 863 | "username": "jdoe" |
| 864 | } |
| 865 | ], |
| 866 | "+1": [ |
| 867 | { |
| 868 | "_account_id": 1000097, |
| 869 | "name": "Jane Roe", |
| 870 | "email": "jane.roe@example.com", |
| 871 | "username": "jroe" |
| 872 | } |
| 873 | ] |
| 874 | } |
| 875 | }, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 876 | "removable_reviewers": [ |
| 877 | { |
| 878 | "_account_id": 1000096, |
| 879 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 880 | "email": "john.doe@example.com", |
| 881 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 882 | }, |
| 883 | { |
| 884 | "_account_id": 1000097, |
| 885 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 886 | "email": "jane.roe@example.com", |
| 887 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 888 | } |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 889 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 890 | "reviewers": { |
| 891 | "REVIEWER": [ |
| 892 | { |
| 893 | "_account_id": 1000096, |
| 894 | "name": "John Doe", |
| 895 | "email": "john.doe@example.com", |
| 896 | "username": "jdoe" |
| 897 | }, |
| 898 | { |
| 899 | "_account_id": 1000097, |
| 900 | "name": "Jane Roe", |
| 901 | "email": "jane.roe@example.com", |
| 902 | "username": "jroe" |
| 903 | } |
| 904 | ] |
| 905 | }, |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 906 | "reviewer_updates": [ |
| 907 | { |
| 908 | "state": "REVIEWER", |
| 909 | "reviewer": { |
| 910 | "_account_id": 1000096, |
| 911 | "name": "John Doe", |
| 912 | "email": "john.doe@example.com", |
| 913 | "username": "jdoe" |
| 914 | }, |
| 915 | "updated_by": { |
| 916 | "_account_id": 1000096, |
| 917 | "name": "John Doe", |
| 918 | "email": "john.doe@example.com", |
| 919 | "username": "jdoe" |
| 920 | }, |
| 921 | "updated": "2016-07-21 20:12:39.000000000" |
| 922 | }, |
| 923 | { |
| 924 | "state": "REMOVED", |
| 925 | "reviewer": { |
| 926 | "_account_id": 1000096, |
| 927 | "name": "John Doe", |
| 928 | "email": "john.doe@example.com", |
| 929 | "username": "jdoe" |
| 930 | }, |
| 931 | "updated_by": { |
| 932 | "_account_id": 1000096, |
| 933 | "name": "John Doe", |
| 934 | "email": "john.doe@example.com", |
| 935 | "username": "jdoe" |
| 936 | }, |
| 937 | "updated": "2016-07-21 20:12:33.000000000" |
| 938 | }, |
| 939 | { |
| 940 | "state": "CC", |
| 941 | "reviewer": { |
| 942 | "_account_id": 1000096, |
| 943 | "name": "John Doe", |
| 944 | "email": "john.doe@example.com", |
| 945 | "username": "jdoe" |
| 946 | }, |
| 947 | "updated_by": { |
| 948 | "_account_id": 1000096, |
| 949 | "name": "John Doe", |
| 950 | "email": "john.doe@example.com", |
| 951 | "username": "jdoe" |
| 952 | }, |
| 953 | "updated": "2016-03-23 21:34:02.419000000", |
| 954 | }, |
| 955 | ], |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 956 | "messages": [ |
| 957 | { |
| 958 | "id": "YH-egE", |
| 959 | "author": { |
| 960 | "_account_id": 1000096, |
| 961 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 962 | "email": "john.doe@example.com", |
| 963 | "username": "jdoe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 964 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 965 | "date": "2013-03-23 21:34:02.419000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 966 | "message": "Patch Set 1:\n\nThis is the first message.", |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 967 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 968 | }, |
| 969 | { |
| 970 | "id": "WEEdhU", |
| 971 | "author": { |
| 972 | "_account_id": 1000097, |
| 973 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 974 | "email": "jane.roe@example.com", |
| 975 | "username": "jroe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 976 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 977 | "date": "2013-03-23 21:36:52.332000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 978 | "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] | 979 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 980 | } |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 981 | ] |
| 982 | } |
| 983 | ---- |
| 984 | |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 985 | [[create-merge-patch-set-for-change]] |
| 986 | === Create Merge Patch Set For Change |
| 987 | -- |
| 988 | 'POST /changes/link:#change-id[\{change-id\}]/merge' |
| 989 | -- |
| 990 | |
| 991 | Update an existing change by using a |
| 992 | link:#merge-patch-set-input[MergePatchSetInput] entity. |
| 993 | |
| 994 | Gerrit will create a merge commit based on the information of |
| 995 | MergePatchSetInput and add a new patch set to the change corresponding |
| 996 | to the new merge commit. |
| 997 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 998 | If one of the secondary emails associated with the user performing the operation was used as the |
| 999 | committer email in the current patch set, the same email will be used as the committer email in the |
| 1000 | new patch set; otherwise, the user's preferred email will be used. |
| 1001 | |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 1002 | .Request |
| 1003 | ---- |
| 1004 | POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0 |
| 1005 | Content-Type: application/json; charset=UTF-8 |
| 1006 | |
| 1007 | { |
| 1008 | "subject": "Merge dev_branch into master", |
| 1009 | "merge": { |
David Pursehouse | f4fb104 | 2018-03-18 23:03:46 +0900 | [diff] [blame] | 1010 | "source": "refs/changes/34/1234/1" |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 1011 | } |
| 1012 | } |
| 1013 | ---- |
| 1014 | |
| 1015 | As response a link:#change-info[ChangeInfo] entity with current revision is |
| 1016 | returned that describes the resulting change. |
| 1017 | |
| 1018 | .Response |
| 1019 | ---- |
| 1020 | HTTP/1.1 200 OK |
| 1021 | Content-Disposition: attachment |
| 1022 | Content-Type: application/json; charset=UTF-8 |
| 1023 | |
| 1024 | )]}' |
| 1025 | { |
| 1026 | "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 1027 | "project": "test", |
| 1028 | "branch": "master", |
| 1029 | "hashtags": [], |
| 1030 | "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 1031 | "subject": "Merge dev_branch into master", |
| 1032 | "status": "NEW", |
| 1033 | "created": "2016-09-23 18:08:53.238000000", |
| 1034 | "updated": "2016-09-23 18:09:25.934000000", |
| 1035 | "submit_type": "MERGE_IF_NECESSARY", |
| 1036 | "mergeable": true, |
| 1037 | "insertions": 5, |
| 1038 | "deletions": 0, |
| 1039 | "_number": 72, |
| 1040 | "owner": { |
| 1041 | "_account_id": 1000000 |
| 1042 | }, |
| 1043 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822" |
| 1044 | } |
| 1045 | ---- |
| 1046 | |
Edwin Kempin | 7d761ff | 2024-02-16 14:37:54 +0000 | [diff] [blame] | 1047 | [[get-message]] |
| 1048 | === Get Commit Message |
| 1049 | -- |
| 1050 | 'GET /changes/link:#change-id[\{change-id\}]/message' |
| 1051 | -- |
| 1052 | |
| 1053 | Returns the commit message of the change (from the current patch set). |
| 1054 | |
| 1055 | .Request |
| 1056 | ---- |
| 1057 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0 |
| 1058 | ---- |
| 1059 | |
| 1060 | The commit message is returned as a link:#commit-message-info[ |
| 1061 | CommitMessageInfo] entity. |
| 1062 | |
| 1063 | Response |
| 1064 | ---- |
| 1065 | HTTP/1.1 200 OK |
| 1066 | Content-Disposition: attachment |
| 1067 | Content-Type: application/json; charset=UTF-8 |
| 1068 | |
| 1069 | )]}' |
| 1070 | { |
| 1071 | "subject": "Add feature X", |
| 1072 | "full_message": "Add Feature X\n\nFeature X helps with foo.\n\nBug: 123\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n", |
| 1073 | "footers": { |
| 1074 | "Bug": "123", |
| 1075 | "Change-Id": "I10394472cbd17dd12454f229e4f6de00b143a444" |
| 1076 | } |
| 1077 | } |
| 1078 | ---- |
| 1079 | |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 1080 | [[set-message]] |
| 1081 | === Set Commit Message |
| 1082 | -- |
| 1083 | 'PUT /changes/link:#change-id[\{change-id\}]/message' |
| 1084 | -- |
| 1085 | |
| 1086 | Creates a new patch set with a new commit message. |
| 1087 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 1088 | If one of the secondary emails associated with the user performing the operation was used as the |
| 1089 | committer email in the current patch set, the same email will be used as the committer email in the |
| 1090 | new patch set; otherwise, the user's preferred email will be used. |
| 1091 | |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 1092 | 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] | 1093 | link:#commit-message-input[CommitMessageInput] entity. If a Change-Id |
| 1094 | footer is specified, it must match the current Change-Id footer. If |
| 1095 | the Change-Id footer is absent, the current Change-Id is added to the |
| 1096 | message. |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 1097 | |
| 1098 | .Request |
| 1099 | ---- |
| 1100 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0 |
| 1101 | Content-Type: application/json; charset=UTF-8 |
| 1102 | |
| 1103 | { |
| 1104 | "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n" |
| 1105 | } |
| 1106 | ---- |
| 1107 | |
| 1108 | .Notifications |
| 1109 | |
| 1110 | An email will be sent using the "newpatchset" template. |
| 1111 | |
| 1112 | [options="header",cols="1,1"] |
| 1113 | |============================= |
| 1114 | |WIP State |Default |
| 1115 | |Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers |
| 1116 | |Work in progress|owner |
| 1117 | |============================= |
| 1118 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1119 | [[get-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1120 | === Get Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1121 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1122 | 'GET /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1123 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1124 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1125 | Retrieves the topic of a change. |
| 1126 | |
| 1127 | .Request |
| 1128 | ---- |
| 1129 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 1130 | ---- |
| 1131 | |
| 1132 | .Response |
| 1133 | ---- |
| 1134 | HTTP/1.1 200 OK |
| 1135 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1136 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1137 | |
| 1138 | )]}' |
| 1139 | "Documentation" |
| 1140 | ---- |
| 1141 | |
| 1142 | If the change does not have a topic an empty string is returned. |
| 1143 | |
| 1144 | [[set-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1145 | === Set Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1146 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1147 | 'PUT /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1148 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1149 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1150 | Sets the topic of a change. |
| 1151 | |
| 1152 | The new topic must be provided in the request body inside a |
Patrick Hiesel | 4aa1456 | 2018-06-19 15:07:50 +0200 | [diff] [blame] | 1153 | link:#topic-input[TopicInput] entity. Any leading or trailing whitespace |
| 1154 | in the topic name will be removed. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1155 | |
| 1156 | .Request |
| 1157 | ---- |
| 1158 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1159 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1160 | |
| 1161 | { |
| 1162 | "topic": "Documentation" |
| 1163 | } |
| 1164 | ---- |
| 1165 | |
| 1166 | As response the new topic is returned. |
| 1167 | |
| 1168 | .Response |
| 1169 | ---- |
| 1170 | HTTP/1.1 200 OK |
| 1171 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1172 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1173 | |
| 1174 | )]}' |
| 1175 | "Documentation" |
| 1176 | ---- |
| 1177 | |
| 1178 | If the topic was deleted the response is "`204 No Content`". |
| 1179 | |
| 1180 | [[delete-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1181 | === Delete Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1182 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1183 | 'DELETE /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1184 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1185 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1186 | Deletes the topic of a change. |
| 1187 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1188 | .Request |
| 1189 | ---- |
| 1190 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 1191 | ---- |
| 1192 | |
| 1193 | .Response |
| 1194 | ---- |
| 1195 | HTTP/1.1 204 No Content |
| 1196 | ---- |
| 1197 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 1198 | [[get-pure-revert]] |
| 1199 | === Get Pure Revert |
| 1200 | -- |
| 1201 | 'GET /changes/link:#change-id[\{change-id\}]/pure_revert' |
| 1202 | -- |
| 1203 | |
| 1204 | 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] | 1205 | 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] | 1206 | 40 digit hex representation) to check against. It takes precedence over `revertOf`. |
| 1207 | If the change has no reference in `revertOf`, the parameter is mandatory. |
| 1208 | |
| 1209 | As response a link:#pure-revert-info[PureRevertInfo] entity is returned. |
| 1210 | |
| 1211 | .Request |
| 1212 | ---- |
| 1213 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0 |
| 1214 | ---- |
| 1215 | |
| 1216 | .Response |
| 1217 | ---- |
| 1218 | HTTP/1.1 200 OK |
| 1219 | Content-Disposition: attachment |
| 1220 | Content-Type: application/json; charset=UTF-8 |
| 1221 | |
| 1222 | )]}' |
| 1223 | { |
| 1224 | "is_pure_revert" : false |
| 1225 | } |
| 1226 | ---- |
| 1227 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1228 | [[abandon-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1229 | === Abandon Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1230 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1231 | 'POST /changes/link:#change-id[\{change-id\}]/abandon' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1232 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1233 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1234 | Abandons a change. |
| 1235 | |
| 1236 | The request body does not need to include a link:#abandon-input[ |
| 1237 | AbandonInput] entity if no review comment is added. |
| 1238 | |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 1239 | Abandoning a change also removes all users from the link:user-attention-set.html[attention set]. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 1240 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1241 | .Request |
| 1242 | ---- |
| 1243 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0 |
| 1244 | ---- |
| 1245 | |
| 1246 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1247 | describes the abandoned change. |
| 1248 | |
| 1249 | .Response |
| 1250 | ---- |
| 1251 | HTTP/1.1 200 OK |
| 1252 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1253 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1254 | |
| 1255 | )]}' |
| 1256 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1257 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1258 | "project": "myProject", |
| 1259 | "branch": "master", |
| 1260 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1261 | "subject": "Implementing Feature X", |
| 1262 | "status": "ABANDONED", |
| 1263 | "created": "2013-02-01 09:59:32.126000000", |
| 1264 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1265 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1266 | "insertions": 3, |
| 1267 | "deletions": 310, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1268 | "_number": 3965, |
| 1269 | "owner": { |
| 1270 | "name": "John Doe" |
| 1271 | } |
| 1272 | } |
| 1273 | ---- |
| 1274 | |
| 1275 | If the change cannot be abandoned because the change state doesn't |
| 1276 | allow abandoning of the change, the response is "`409 Conflict`" and |
| 1277 | the error message is contained in the response body. |
| 1278 | |
| 1279 | .Response |
| 1280 | ---- |
| 1281 | HTTP/1.1 409 Conflict |
| 1282 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1283 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1284 | |
| 1285 | change is merged |
| 1286 | ---- |
| 1287 | |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1288 | .Notifications |
| 1289 | |
| 1290 | An email will be sent using the "abandon" template. The notify handling is ALL. |
| 1291 | Notifications are suppressed on WIP changes that have never started review. |
| 1292 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1293 | [options="header",cols="1,2"] |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1294 | |============================= |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1295 | |WIP State |notify=ALL |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1296 | |Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1297 | |Work in progress|not sent |
| 1298 | |Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1299 | |============================= |
| 1300 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1301 | [[restore-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1302 | === Restore Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1303 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1304 | 'POST /changes/link:#change-id[\{change-id\}]/restore' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1305 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1306 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1307 | Restores a change. |
| 1308 | |
| 1309 | The request body does not need to include a link:#restore-input[ |
| 1310 | RestoreInput] entity if no review comment is added. |
| 1311 | |
| 1312 | .Request |
| 1313 | ---- |
| 1314 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0 |
| 1315 | ---- |
| 1316 | |
| 1317 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1318 | describes the restored change. |
| 1319 | |
| 1320 | .Response |
| 1321 | ---- |
| 1322 | HTTP/1.1 200 OK |
| 1323 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1324 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1325 | |
| 1326 | )]}' |
| 1327 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1328 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1329 | "project": "myProject", |
| 1330 | "branch": "master", |
| 1331 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1332 | "subject": "Implementing Feature X", |
| 1333 | "status": "NEW", |
| 1334 | "created": "2013-02-01 09:59:32.126000000", |
| 1335 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1336 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1337 | "insertions": 2, |
| 1338 | "deletions": 13, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1339 | "_number": 3965, |
| 1340 | "owner": { |
| 1341 | "name": "John Doe" |
| 1342 | } |
| 1343 | } |
| 1344 | ---- |
| 1345 | |
| 1346 | If the change cannot be restored because the change state doesn't |
| 1347 | allow restoring the change, the response is "`409 Conflict`" and |
| 1348 | the error message is contained in the response body. |
| 1349 | |
| 1350 | .Response |
| 1351 | ---- |
| 1352 | HTTP/1.1 409 Conflict |
| 1353 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1354 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1355 | |
| 1356 | change is new |
| 1357 | ---- |
| 1358 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1359 | [[rebase-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1360 | === Rebase Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1361 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1362 | 'POST /changes/link:#change-id[\{change-id\}]/rebase' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1363 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1364 | |
| 1365 | Rebases a change. |
| 1366 | |
Edwin Kempin | b81fefe | 2023-11-06 11:58:00 +0000 | [diff] [blame] | 1367 | For merge commits always the first parent is rebased. This means the new base becomes the first |
| 1368 | parent of the rebased merge commit while the second parent stays intact. |
| 1369 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 1370 | If one of the secondary emails associated with the user performing the operation was used as the |
| 1371 | committer email in the current patch set, the same email will be used as the committer email in the |
| 1372 | new patch set; otherwise, the user's preferred email will be used. |
| 1373 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1374 | Optionally, the parent revision can be changed to another patch set through the |
| 1375 | link:#rebase-input[RebaseInput] entity. |
| 1376 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1377 | .Request |
| 1378 | ---- |
| 1379 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1380 | Content-Type: application/json;charset=UTF-8 |
| 1381 | |
| 1382 | { |
| 1383 | "base" : "1234", |
| 1384 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1385 | ---- |
| 1386 | |
| 1387 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1388 | describes the rebased change. Information about the current patch set |
| 1389 | is included. |
| 1390 | |
| 1391 | .Response |
| 1392 | ---- |
| 1393 | HTTP/1.1 200 OK |
| 1394 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1395 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1396 | |
| 1397 | )]}' |
| 1398 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1399 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1400 | "project": "myProject", |
| 1401 | "branch": "master", |
| 1402 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1403 | "subject": "Implement Feature X", |
| 1404 | "status": "NEW", |
| 1405 | "created": "2013-02-01 09:59:32.126000000", |
| 1406 | "updated": "2013-02-21 11:16:36.775000000", |
| 1407 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1408 | "insertions": 33, |
| 1409 | "deletions": 9, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1410 | "_number": 4799, |
| 1411 | "owner": { |
| 1412 | "name": "John Doe" |
| 1413 | }, |
| 1414 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 1415 | "revisions": { |
| 1416 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1417 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1418 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 1419 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1420 | "fetch": { |
| 1421 | "http": { |
| 1422 | "url": "http://gerrit:8080/myProject", |
| 1423 | "ref": "refs/changes/99/4799/2" |
| 1424 | } |
| 1425 | }, |
| 1426 | "commit": { |
| 1427 | "parents": [ |
| 1428 | { |
| 1429 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 1430 | "subject": "Implement Feature A" |
| 1431 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 1432 | ], |
| 1433 | "author": { |
| 1434 | "name": "John Doe", |
| 1435 | "email": "john.doe@example.com", |
| 1436 | "date": "2013-05-07 15:21:27.000000000", |
| 1437 | "tz": 120 |
| 1438 | }, |
| 1439 | "committer": { |
| 1440 | "name": "Gerrit Code Review", |
| 1441 | "email": "gerrit-server@example.com", |
| 1442 | "date": "2013-05-07 15:35:43.000000000", |
| 1443 | "tz": 120 |
| 1444 | }, |
| 1445 | "subject": "Implement Feature X", |
| 1446 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1447 | } |
| 1448 | } |
| 1449 | } |
| 1450 | ---- |
| 1451 | |
| 1452 | If the change cannot be rebased, e.g. due to conflicts, the response is |
| 1453 | "`409 Conflict`" and the error message is contained in the response |
| 1454 | body. |
| 1455 | |
| 1456 | .Response |
| 1457 | ---- |
| 1458 | HTTP/1.1 409 Conflict |
| 1459 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1460 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1461 | |
| 1462 | The change could not be rebased due to a path conflict during merge. |
| 1463 | ---- |
| 1464 | |
Edwin Kempin | 8b2ff7f | 2023-03-24 12:14:44 +0100 | [diff] [blame] | 1465 | Rebasing a change is allowed for the change owner, users with the |
| 1466 | link:access-control.html#category_rebase[Rebase] permission and users |
| 1467 | with the link:access-control.html#category_submit[Submit] permission. |
| 1468 | |
| 1469 | In addition, the rebaser or the original uploader, if rebasing is done |
| 1470 | on behalf of the uploader (see `rebase_on_behalf_of_uploader` option in |
| 1471 | link:#rebase-input[RebaseInput]), needs to have all permissions that |
| 1472 | are required to create the new patch set: |
| 1473 | |
| 1474 | * the link:access-control.html#category_push[Push] permission |
| 1475 | * the link:access-control.html#category_add_patch_set[Add Patch Set] |
| 1476 | permission (only if the user is not the change owner) |
| 1477 | * the link:access-control.html#category_forge_author[Forge Author] |
| 1478 | permission (only if the commit author is forged) |
| 1479 | * the link:access-control.html#category_forge_server[Forge Server] |
| 1480 | permission (only if the commit author is the server identity) |
| 1481 | |
| 1482 | The same permissions were required for the upload of the original patch |
| 1483 | set. This means if the rebase is done on behalf of the uploader these |
| 1484 | permission checks should just pass, unless the uploader lost |
| 1485 | permissions after the upload of the original patch set. In this case |
| 1486 | rebasing on behalf of the uploader is not possible and a normal rebase |
| 1487 | (on behalf of the rebaser) must be done, which means that the rebaser |
| 1488 | becomes the uploader and takes over the change. If self approvals are |
| 1489 | disallowed, this means that the rebaser can no longer approve the |
| 1490 | change (as approvals of the uploader are ignored). |
| 1491 | |
Nitzan Gur-Furman | 4655d8b | 2022-12-16 08:46:18 +0100 | [diff] [blame] | 1492 | [[rebase-chain]] |
| 1493 | === Rebase Chain |
| 1494 | -- |
| 1495 | 'POST /changes/link:#change-id[\{change-id\}]/rebase:chain' |
| 1496 | -- |
| 1497 | |
| 1498 | Rebases an ancestry chain of changes. |
| 1499 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 1500 | If one of the secondary emails associated with the user performing the operation was used as the |
| 1501 | committer email in the current patch set, the same email will be used as the committer email in the |
| 1502 | new patch set; otherwise, the user's preferred email will be used. |
| 1503 | |
Nitzan Gur-Furman | 4655d8b | 2022-12-16 08:46:18 +0100 | [diff] [blame] | 1504 | The operated change is treated as the chain tip. All unsubmitted ancestors are rebased. |
| 1505 | |
| 1506 | Requires a linear ancestry relation (single parenting throughout the chain). |
| 1507 | |
| 1508 | Optionally, the parent revision (of the oldest ancestor to be rebased) can be changed to another |
| 1509 | change, revision or branch through the link:#rebase-input[RebaseInput] entity. |
| 1510 | |
Kaushik Lingarkar | 95f3b27 | 2023-06-06 14:14:40 -0700 | [diff] [blame] | 1511 | Providing a `committer_email` through the link:#rebase-input[RebaseInput] entity is not supported |
| 1512 | when rebasing a chain. |
| 1513 | |
Nitzan Gur-Furman | 4655d8b | 2022-12-16 08:46:18 +0100 | [diff] [blame] | 1514 | If the chain is outdated, i.e., there's a change that depends on an old revision of its parent, the |
| 1515 | result is the same as individually rebasing all outdated changes on top of their parent's latest |
| 1516 | revision before running the rebase chain action. |
| 1517 | |
| 1518 | .Request |
| 1519 | ---- |
| 1520 | POST /changes/myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f/rebase:chain HTTP/1.0 |
| 1521 | Content-Type: application/json;charset=UTF-8 |
| 1522 | |
| 1523 | { |
| 1524 | "base" : "1234", |
| 1525 | } |
| 1526 | ---- |
| 1527 | |
| 1528 | As response a link:#rebase-chain-info[RebaseChainInfo] entity is returned that |
| 1529 | describes the rebased changes. Information about the current patch sets |
| 1530 | are included. |
| 1531 | |
| 1532 | .Response |
| 1533 | ---- |
| 1534 | HTTP/1.1 200 OK |
| 1535 | Content-Disposition: attachment |
| 1536 | Content-Type: application/json; charset=UTF-8 |
| 1537 | |
| 1538 | )]}' |
| 1539 | { |
| 1540 | "rebased_changes": [ |
| 1541 | { |
| 1542 | "id": "myProject~master~I0e534de9d7f0d6f35b71f7d726acf835b2110c66", |
| 1543 | "project": "myProject", |
| 1544 | "branch": "master", |
| 1545 | "hashtags": [ |
| 1546 | |
| 1547 | ], |
| 1548 | "change_id": "I0e534de9d7f0d6f35b71f7d726acf835b2110c66", |
| 1549 | "subject": "456", |
| 1550 | "status": "NEW", |
| 1551 | "created": "2022-11-21 20: 51: 31.000000000", |
| 1552 | "updated": "2022-11-21 20: 56: 49.000000000", |
| 1553 | "submit_type": "MERGE_IF_NECESSARY", |
| 1554 | "insertions": 0, |
| 1555 | "deletions": 0, |
| 1556 | "total_comment_count": 0, |
| 1557 | "unresolved_comment_count": 0, |
| 1558 | "has_review_started": true, |
| 1559 | "meta_rev_id": "a2a6692213f546e1045ecf4647439fac8d6d8faa", |
| 1560 | "_number": 21, |
| 1561 | "owner": { |
| 1562 | "_account_id": 1000000 |
| 1563 | }, |
| 1564 | "current_revision": "c3b2ba222d42a56e05c90f88d4509a124620517d", |
| 1565 | "revisions": { |
| 1566 | "c3b2ba222d42a56e05c90f88d4509a124620517d": { |
| 1567 | "kind": "NO_CHANGE", |
| 1568 | "_number": 2, |
| 1569 | "created": "2022-11-21 20: 56: 49.000000000", |
| 1570 | "uploader": { |
| 1571 | "_account_id": 1000000 |
| 1572 | }, |
| 1573 | "ref": "refs/changes/21/21/2", |
| 1574 | "fetch": { |
| 1575 | |
| 1576 | }, |
| 1577 | "commit": { |
| 1578 | "parents": [ |
| 1579 | { |
| 1580 | "commit": "7803f427dd7c4a2441466e4d740a1850dcee1af4", |
| 1581 | "subject": "123" |
| 1582 | } |
| 1583 | ], |
| 1584 | "author": { |
| 1585 | "name": "Nitzan Gur-Furman", |
| 1586 | "email": "nitzan@google.com", |
| 1587 | "date": "2022-11-21 20: 49: 39.000000000", |
| 1588 | "tz": 60 |
| 1589 | }, |
| 1590 | "committer": { |
| 1591 | "name": "Administrator", |
| 1592 | "email": "admin@example.com", |
| 1593 | "date": "2022-11-21 20: 56: 49.000000000", |
| 1594 | "tz": 60 |
| 1595 | }, |
| 1596 | "subject": "456", |
| 1597 | "message": "456\n" |
| 1598 | }, |
| 1599 | "description": "Rebase" |
| 1600 | } |
| 1601 | }, |
| 1602 | "requirements": [ |
| 1603 | |
| 1604 | ], |
| 1605 | "submit_records": [ |
| 1606 | { |
| 1607 | "rule_name": "gerrit~DefaultSubmitRule", |
| 1608 | "status": "NOT_READY", |
| 1609 | "labels": [ |
| 1610 | { |
| 1611 | "label": "Code-Review", |
| 1612 | "status": "NEED" |
| 1613 | } |
| 1614 | ] |
| 1615 | } |
| 1616 | ] |
| 1617 | }, |
| 1618 | { |
| 1619 | "id": "myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f", |
| 1620 | "project": "myProject", |
| 1621 | "branch": "master", |
| 1622 | "hashtags": [ |
| 1623 | |
| 1624 | ], |
| 1625 | "change_id": "I08a021fb07b83fe845140a2c11508b3bdd93b48f", |
| 1626 | "subject": "789", |
| 1627 | "status": "NEW", |
| 1628 | "created": "2022-11-21 20: 51: 31.000000000", |
| 1629 | "updated": "2022-11-21 20: 56: 49.000000000", |
| 1630 | "submit_type": "MERGE_IF_NECESSARY", |
| 1631 | "insertions": 0, |
| 1632 | "deletions": 0, |
| 1633 | "total_comment_count": 0, |
| 1634 | "unresolved_comment_count": 0, |
| 1635 | "has_review_started": true, |
| 1636 | "meta_rev_id": "3bfb843fea471f96e16b9199c3a30fff0285bc45", |
| 1637 | "_number": 22, |
| 1638 | "owner": { |
| 1639 | "_account_id": 1000000 |
| 1640 | }, |
| 1641 | "current_revision": "77eb17a9501a5c21963bc6af56085e60f281acbb", |
| 1642 | "revisions": { |
| 1643 | "77eb17a9501a5c21963bc6af56085e60f281acbb": { |
| 1644 | "kind": "NO_CHANGE", |
| 1645 | "_number": 2, |
| 1646 | "created": "2022-11-21 20: 56: 49.000000000", |
| 1647 | "uploader": { |
| 1648 | "_account_id": 1000000 |
| 1649 | }, |
| 1650 | "ref": "refs/changes/22/22/2", |
| 1651 | "fetch": { |
| 1652 | |
| 1653 | }, |
| 1654 | "commit": { |
| 1655 | "parents": [ |
| 1656 | { |
| 1657 | "commit": "c3b2ba222d42a56e05c90f88d4509a124620517d", |
| 1658 | "subject": "456" |
| 1659 | } |
| 1660 | ], |
| 1661 | "author": { |
| 1662 | "name": "Nitzan Gur-Furman", |
| 1663 | "email": "nitzan@google.com", |
| 1664 | "date": "2022-11-21 20: 51: 07.000000000", |
| 1665 | "tz": 60 |
| 1666 | }, |
| 1667 | "committer": { |
| 1668 | "name": "Administrator", |
| 1669 | "email": "admin@example.com", |
| 1670 | "date": "2022-11-21 20: 56: 49.000000000", |
| 1671 | "tz": 60 |
| 1672 | }, |
| 1673 | "subject": "789", |
| 1674 | "message": "789\n" |
| 1675 | }, |
| 1676 | "description": "Rebase" |
| 1677 | } |
| 1678 | }, |
| 1679 | "requirements": [ |
| 1680 | |
| 1681 | ], |
| 1682 | "submit_records": [ |
| 1683 | { |
| 1684 | "rule_name": "gerrit~DefaultSubmitRule", |
| 1685 | "status": "NOT_READY", |
| 1686 | "labels": [ |
| 1687 | { |
| 1688 | "label": "Code-Review", |
| 1689 | "status": "NEED" |
| 1690 | } |
| 1691 | ] |
| 1692 | } |
| 1693 | ] |
| 1694 | } |
| 1695 | ], |
| 1696 | } |
| 1697 | ---- |
| 1698 | |
| 1699 | If the change cannot be rebased, e.g. due to conflicts, the response is |
| 1700 | "`409 Conflict`" and the error message is contained in the response |
| 1701 | body. |
| 1702 | |
| 1703 | .Response |
| 1704 | ---- |
| 1705 | HTTP/1.1 409 Conflict |
| 1706 | Content-Disposition: attachment |
| 1707 | Content-Type: text/plain; charset=UTF-8 |
| 1708 | |
| 1709 | Change I0e534de9d7f0d6f35b71f7d726acf835b2110c66 could not be rebased due to a conflict during |
| 1710 | merge. |
| 1711 | |
| 1712 | merge conflict(s): |
| 1713 | a.txt |
| 1714 | ---- |
| 1715 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1716 | [[move-change]] |
| 1717 | === Move Change |
| 1718 | -- |
| 1719 | 'POST /changes/link:#change-id[\{change-id\}]/move' |
| 1720 | -- |
| 1721 | |
| 1722 | Move a change. |
| 1723 | |
| 1724 | The destination branch must be provided in the request body inside a |
| 1725 | link:#move-input[MoveInput] entity. |
Marija Savtchouk | cee6a8f | 2020-12-03 12:58:04 +0000 | [diff] [blame] | 1726 | Only veto votes that are blocking the change from submission are moved to |
| 1727 | the destination branch by default. |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1728 | |
| 1729 | .Request |
| 1730 | ---- |
| 1731 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0 |
| 1732 | Content-Type: application/json; charset=UTF-8 |
| 1733 | |
| 1734 | { |
| 1735 | "destination_branch" : "release-branch" |
| 1736 | } |
| 1737 | |
| 1738 | ---- |
| 1739 | |
| 1740 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1741 | describes the moved change. |
| 1742 | |
| 1743 | .Response |
| 1744 | ---- |
| 1745 | HTTP/1.1 200 OK |
| 1746 | Content-Disposition: attachment |
| 1747 | Content-Type: application/json; charset=UTF-8 |
| 1748 | |
| 1749 | )]}' |
| 1750 | { |
| 1751 | "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1752 | "project": "myProject", |
| 1753 | "branch": "release-branch", |
| 1754 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1755 | "subject": "Implementing Feature X", |
| 1756 | "status": "NEW", |
| 1757 | "created": "2013-02-01 09:59:32.126000000", |
| 1758 | "updated": "2013-02-21 11:16:36.775000000", |
| 1759 | "mergeable": true, |
| 1760 | "insertions": 2, |
| 1761 | "deletions": 13, |
| 1762 | "_number": 3965, |
| 1763 | "owner": { |
| 1764 | "name": "John Doe" |
| 1765 | } |
| 1766 | } |
| 1767 | ---- |
| 1768 | |
Changcheng Xiao | 6dc9042 | 2017-08-09 10:21:58 +0200 | [diff] [blame] | 1769 | Note that this endpoint will not update the change's parents, which is |
| 1770 | different from the link:#cherry-pick[cherry-pick] endpoint. |
| 1771 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1772 | If the change cannot be moved because the change state doesn't |
| 1773 | allow moving the change, the response is "`409 Conflict`" and |
| 1774 | the error message is contained in the response body. |
| 1775 | |
| 1776 | .Response |
| 1777 | ---- |
| 1778 | HTTP/1.1 409 Conflict |
| 1779 | Content-Disposition: attachment |
| 1780 | Content-Type: text/plain; charset=UTF-8 |
| 1781 | |
| 1782 | change is merged |
| 1783 | ---- |
| 1784 | |
| 1785 | If the change cannot be moved because the user doesn't have |
| 1786 | abandon permission on the change or upload permission on the destination, |
| 1787 | the response is "`409 Conflict`" and the error message is contained in the |
| 1788 | response body. |
| 1789 | |
| 1790 | .Response |
| 1791 | ---- |
| 1792 | HTTP/1.1 409 Conflict |
| 1793 | Content-Disposition: attachment |
| 1794 | Content-Type: text/plain; charset=UTF-8 |
| 1795 | |
| 1796 | move not permitted |
| 1797 | ---- |
| 1798 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1799 | [[revert-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1800 | === Revert Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1801 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1802 | 'POST /changes/link:#change-id[\{change-id\}]/revert' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1803 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1804 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1805 | Reverts a change. |
| 1806 | |
Gal Paikin | 006d52b | 2019-12-19 11:22:09 +0100 | [diff] [blame] | 1807 | The subject of the newly created change will be |
| 1808 | 'Revert "<subject-of-reverted-change>"'. If the subject of the change reverted is |
| 1809 | above 63 characters, it will be cut down to 59 characters with "..." in the end. |
| 1810 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1811 | The request body does not need to include a link:#revert-input[ |
| 1812 | RevertInput] entity if no review comment is added. |
| 1813 | |
| 1814 | .Request |
| 1815 | ---- |
Michael Zhou | 1027049 | 2016-03-24 22:35:40 -0400 | [diff] [blame] | 1816 | POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1817 | ---- |
| 1818 | |
| 1819 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1820 | describes the reverting change. |
| 1821 | |
| 1822 | .Response |
| 1823 | ---- |
| 1824 | HTTP/1.1 200 OK |
| 1825 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1826 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1827 | |
| 1828 | )]}' |
| 1829 | { |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1830 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1831 | "project": "myProject", |
| 1832 | "branch": "master", |
| 1833 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1834 | "subject": "Revert \"Implementing Feature X\"", |
| 1835 | "status": "NEW", |
| 1836 | "created": "2013-02-01 09:59:32.126000000", |
| 1837 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1838 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1839 | "insertions": 6, |
| 1840 | "deletions": 4, |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1841 | "_number": 3965, |
| 1842 | "owner": { |
| 1843 | "name": "John Doe" |
| 1844 | } |
| 1845 | } |
| 1846 | ---- |
| 1847 | |
Gal Paikin | 6c9ed95 | 2020-01-22 10:36:35 +0100 | [diff] [blame] | 1848 | If the user doesn't have revert permission on the change or upload permission on |
| 1849 | the destination branch, the response is "`403 Forbidden`", and the error message is |
| 1850 | contained in the response body. |
| 1851 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1852 | If the change cannot be reverted because the change state doesn't |
Gal Paikin | 6c9ed95 | 2020-01-22 10:36:35 +0100 | [diff] [blame] | 1853 | allow reverting the change the response is "`409 Conflict`", and the error |
| 1854 | message is contained in the response body. |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1855 | |
| 1856 | .Response |
| 1857 | ---- |
| 1858 | HTTP/1.1 409 Conflict |
| 1859 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1860 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1861 | |
| 1862 | change is new |
| 1863 | ---- |
| 1864 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1865 | [[revert-submission]] |
| 1866 | === Revert Submission |
| 1867 | -- |
| 1868 | 'POST /changes/link:#change-id[\{change-id\}]/revert_submission' |
| 1869 | -- |
| 1870 | |
| 1871 | Creates open revert changes for all of the changes of a certain submission. |
| 1872 | |
Gal Paikin | 006d52b | 2019-12-19 11:22:09 +0100 | [diff] [blame] | 1873 | 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] | 1874 | If the subject is above 60 characters, the subject will be cut to 56 characters |
| 1875 | with "..." in the end. However, whenever reverting the submission of a revert |
| 1876 | submission, the subject will be shortened from |
| 1877 | 'Revert "Revert "<subject-of-reverted-change""' to |
| 1878 | 'Revert^2 "<subject-of-reverted-change"'. Also, for every future revert submission, |
| 1879 | the only difference in the subject will be the number of the revert (instead of |
| 1880 | Revert^2 the subject will change to Revert^3 and so on). |
| 1881 | 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] | 1882 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1883 | Details for the revert can be specified in the request body inside a link:#revert-input[ |
| 1884 | RevertInput] The topic of all created revert changes will be |
| 1885 | `revert-{submission_id}-{random_string_of_size_10}`. |
| 1886 | |
| 1887 | The changes will not be rebased on onto the destination branch so the users may still |
| 1888 | have to manually rebase them to resolve conflicts and make them submittable. |
| 1889 | |
Gal Paikin | 653a852 | 2019-11-25 11:40:10 +0100 | [diff] [blame] | 1890 | However, the changes that have the same project and branch will be rebased on top |
| 1891 | of each other. E.g, the first revert change will have the original change as a |
| 1892 | parent, and the second revert change will have the first revert change as a |
| 1893 | parent. |
| 1894 | |
| 1895 | There is one special case that involves merge commits; if a user has multiple |
| 1896 | changes in the same project and branch, but not in the same change series, those |
| 1897 | changes can still get submitted together if they have the same topic and |
| 1898 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] in |
| 1899 | gerrit.config is set to true. In the case, Gerrit may create merge commits on |
| 1900 | submit (depending on the link:config-project-config.html#submit-type[submit types] |
| 1901 | of the project). |
| 1902 | The first parent for the reverts will be the most recent merge commit that was |
| 1903 | created by Gerrit to merge the different change series into the target branch. |
| 1904 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1905 | .Request |
| 1906 | ---- |
| 1907 | POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0 |
| 1908 | ---- |
| 1909 | |
| 1910 | As response link:#revert-submission-info[RevertSubmissionInfo] entity |
| 1911 | is returned. That entity describes the revert changes. |
| 1912 | |
| 1913 | .Response |
| 1914 | ---- |
| 1915 | HTTP/1.1 200 OK |
| 1916 | Content-Disposition: attachment |
| 1917 | Content-Type: application/json; charset=UTF-8 |
| 1918 | |
| 1919 | )]}' |
| 1920 | "revert_changes": |
| 1921 | [ |
| 1922 | { |
| 1923 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1924 | "project": "myProject", |
| 1925 | "branch": "master", |
| 1926 | "topic": "revert--1571043962462-3640749-ABCEEZGHIJ", |
| 1927 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1928 | "subject": "Revert \"Implementing Feature X\"", |
| 1929 | "status": "NEW", |
| 1930 | "created": "2013-02-01 09:59:32.126000000", |
| 1931 | "updated": "2013-02-21 11:16:36.775000000", |
| 1932 | "mergeable": true, |
| 1933 | "insertions": 6, |
| 1934 | "deletions": 4, |
| 1935 | "_number": 3965, |
| 1936 | "owner": { |
| 1937 | "name": "John Doe" |
| 1938 | } |
| 1939 | }, |
| 1940 | { |
| 1941 | "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 1942 | "project": "anyProject", |
| 1943 | "branch": "master", |
| 1944 | "topic": "revert--1571043962462-3640749-ABCEEZGHIJ", |
| 1945 | "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 1946 | "subject": "Revert \"Implementing Feature Y\"", |
| 1947 | "status": "NEW", |
| 1948 | "created": "2013-02-04 09:59:33.126000000", |
| 1949 | "updated": "2013-02-21 11:16:37.775000000", |
| 1950 | "mergeable": true, |
| 1951 | "insertions": 62, |
| 1952 | "deletions": 11, |
| 1953 | "_number": 3966, |
| 1954 | "owner": { |
| 1955 | "name": "Jane Doe" |
| 1956 | } |
| 1957 | } |
| 1958 | ] |
| 1959 | ---- |
| 1960 | |
Gal Paikin | 6c9ed95 | 2020-01-22 10:36:35 +0100 | [diff] [blame] | 1961 | If the user doesn't have revert permission on the change or upload permission on |
| 1962 | the destination, the response is "`403 Forbidden`", and the error message is |
| 1963 | contained in the response body. |
| 1964 | |
| 1965 | If the change cannot be reverted because the change state doesn't |
| 1966 | allow reverting the change the response is "`409 Conflict`", and the error |
| 1967 | message is contained in the response body. |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1968 | |
| 1969 | .Response |
| 1970 | ---- |
| 1971 | HTTP/1.1 409 Conflict |
| 1972 | Content-Disposition: attachment |
| 1973 | Content-Type: text/plain; charset=UTF-8 |
| 1974 | |
| 1975 | change is new |
| 1976 | ---- |
| 1977 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1978 | [[submit-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1979 | === Submit Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1980 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1981 | 'POST /changes/link:#change-id[\{change-id\}]/submit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1982 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1983 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1984 | Submits a change. |
| 1985 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 1986 | If the submission results in a new patch set (due to a rebase or cherry-pick merge method), the |
| 1987 | committer email will remain the same as the one used in the previous commit, provided that one of |
| 1988 | the secondary emails associated with the user performing the operation was used as the committer |
| 1989 | email in the previous commit. Otherwise, the user's preferred email will be used. |
| 1990 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1991 | The request body only needs to include a link:#submit-input[ |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 1992 | SubmitInput] entity if submitting on behalf of another user. |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1993 | |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 1994 | Submitting a change also removes all users from the link:user-attention-set.html[attention set]. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 1995 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1996 | .Request |
| 1997 | ---- |
| 1998 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1999 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 2000 | |
| 2001 | { |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 2002 | "on_behalf_of": 1001439 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 2003 | } |
| 2004 | ---- |
| 2005 | |
| 2006 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 2007 | describes the submitted/merged change. |
| 2008 | |
Gal Paikin | e2849a8 | 2021-04-19 13:41:10 +0200 | [diff] [blame] | 2009 | Submission may submit multiple changes, but we still only return one ChangeInfo |
| 2010 | object. To query for all submitted changes, please use the submission_id that is |
| 2011 | part of the response. |
| 2012 | |
| 2013 | Changes that will also be submitted: |
| 2014 | 1. All changes of the same topic if |
| 2015 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 2016 | configuration is set to true. |
| 2017 | 2. All dependent changes. |
| 2018 | 3. The closure of the above (e.g if a dependent change has a topic, all changes |
| 2019 | of *that* topic will also be submitted). |
| 2020 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 2021 | .Response |
| 2022 | ---- |
| 2023 | HTTP/1.1 200 OK |
| 2024 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2025 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 2026 | |
| 2027 | )]}' |
| 2028 | { |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 2029 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2030 | "project": "myProject", |
| 2031 | "branch": "master", |
| 2032 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2033 | "subject": "Implementing Feature X", |
| 2034 | "status": "MERGED", |
| 2035 | "created": "2013-02-01 09:59:32.126000000", |
| 2036 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 2037 | "submitted": "2013-02-21 11:16:36.615000000", |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 2038 | "_number": 3965, |
| 2039 | "owner": { |
| 2040 | "name": "John Doe" |
| 2041 | } |
| 2042 | } |
| 2043 | ---- |
| 2044 | |
| 2045 | If the change cannot be submitted because the submit rule doesn't allow |
| 2046 | submitting the change, the response is "`409 Conflict`" and the error |
| 2047 | message is contained in the response body. |
| 2048 | |
| 2049 | .Response |
| 2050 | ---- |
| 2051 | HTTP/1.1 409 Conflict |
| 2052 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2053 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 2054 | |
| 2055 | blocked by Verified |
| 2056 | ---- |
| 2057 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 2058 | [[submitted-together]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2059 | === Changes Submitted Together |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2060 | -- |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2061 | '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] | 2062 | -- |
| 2063 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2064 | Computes list of all changes which are submitted when |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2065 | link:#submit-change[Submit] is called for this change, |
Stefan Beller | 460f354 | 2015-07-20 14:10:41 -0700 | [diff] [blame] | 2066 | including the current change itself. |
| 2067 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2068 | The list consists of: |
| 2069 | |
| 2070 | * The given change. |
| 2071 | * If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
Gal Paikin | e7a208d | 2021-11-30 12:08:27 +0100 | [diff] [blame] | 2072 | is enabled OR if the `o=TOPIC_CLOSURE` query parameter is passed, include all |
| 2073 | open changes with the same topic. |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2074 | * For each change whose submit type is not CHERRY_PICK, include unmerged |
| 2075 | ancestors targeting the same branch. |
| 2076 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2077 | As a special case, the list is empty if this change would be |
| 2078 | submitted by itself (without other changes). |
| 2079 | |
| 2080 | .Request |
| 2081 | ---- |
| 2082 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0 |
| 2083 | Content-Type: application/json; charset=UTF-8 |
| 2084 | ---- |
| 2085 | |
| 2086 | As a response a link:#submitted-together-info[SubmittedTogetherInfo] |
| 2087 | entity is returned that describes what would happen if the change were |
| 2088 | submitted. This response contains a list of changes and a count of |
| 2089 | changes that are not visible to the caller that are part of the set of |
| 2090 | changes to be merged. |
| 2091 | |
| 2092 | The listed changes use the same format as in |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2093 | link:#list-changes[Query Changes] with the |
| 2094 | link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`], |
Patrick Hiesel | 6fbbdaa | 2018-04-05 15:10:13 +0200 | [diff] [blame] | 2095 | link:#current-revision[`CURRENT_REVISION`],and |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 2096 | link:#submittable[`SUBMITTABLE`] options set. |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2097 | |
Shawn Pearce | 8080c3d | 2016-09-19 19:15:04 -0700 | [diff] [blame] | 2098 | Standard link:#query-options[formatting options] can be specified |
| 2099 | with the `o` parameter, as well as the `submitted_together` specific |
Gal Paikin | e7a208d | 2021-11-30 12:08:27 +0100 | [diff] [blame] | 2100 | options `NON_VISIBLE_CHANGES` and `TOPIC_CLOSURE`. |
Shawn Pearce | 8080c3d | 2016-09-19 19:15:04 -0700 | [diff] [blame] | 2101 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2102 | .Response |
| 2103 | ---- |
| 2104 | HTTP/1.1 200 OK |
| 2105 | Content-Disposition: attachment |
| 2106 | Content-Type: application/json; charset=UTF-8 |
| 2107 | |
| 2108 | )]}' |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2109 | { |
| 2110 | "changes": [ |
| 2111 | { |
| 2112 | "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 2113 | "project": "gerrit", |
| 2114 | "branch": "master", |
| 2115 | "hashtags": [], |
| 2116 | "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 2117 | "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes", |
| 2118 | "status": "NEW", |
| 2119 | "created": "2015-05-01 15:39:57.979000000", |
| 2120 | "updated": "2015-05-20 19:25:21.592000000", |
| 2121 | "mergeable": true, |
| 2122 | "insertions": 303, |
| 2123 | "deletions": 210, |
| 2124 | "_number": 1779, |
| 2125 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2126 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2127 | }, |
| 2128 | "labels": { |
| 2129 | "Code-Review": { |
| 2130 | "approved": { |
| 2131 | "_account_id": 1000000 |
| 2132 | }, |
| 2133 | "all": [ |
| 2134 | { |
| 2135 | "value": 2, |
| 2136 | "date": "2015-05-20 19:25:21.592000000", |
| 2137 | "_account_id": 1000000 |
| 2138 | } |
| 2139 | ], |
| 2140 | "values": { |
Oswald Buddenhagen | f887770 | 2022-02-15 14:01:34 +0100 | [diff] [blame] | 2141 | "-2": "This shall not be submitted", |
| 2142 | "-1": "I would prefer this is not submitted as is", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2143 | " 0": "No score", |
| 2144 | "+1": "Looks good to me, but someone else must approve", |
| 2145 | "+2": "Looks good to me, approved" |
| 2146 | }, |
| 2147 | "default_value": 0 |
| 2148 | }, |
| 2149 | "Verified": { |
| 2150 | "approved": { |
| 2151 | "_account_id": 1000000 |
| 2152 | }, |
| 2153 | "all": [ |
| 2154 | { |
| 2155 | "value": 1, |
| 2156 | "date": "2015-05-20 19:25:21.592000000", |
| 2157 | "_account_id": 1000000 |
| 2158 | } |
| 2159 | ], |
| 2160 | "values": { |
| 2161 | "-1": "Fails", |
| 2162 | " 0": "No score", |
| 2163 | "+1": "Verified" |
| 2164 | }, |
| 2165 | "default_value": 0 |
| 2166 | } |
| 2167 | }, |
| 2168 | "permitted_labels": { |
| 2169 | "Code-Review": [ |
| 2170 | "-2", |
| 2171 | "-1", |
| 2172 | " 0", |
| 2173 | "+1", |
| 2174 | "+2" |
| 2175 | ], |
| 2176 | "Verified": [ |
| 2177 | "-1", |
| 2178 | " 0", |
| 2179 | "+1" |
| 2180 | ] |
| 2181 | }, |
| 2182 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 2183 | { |
| 2184 | "_account_id": 1000000 |
| 2185 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2186 | ], |
| 2187 | "reviewers": { |
| 2188 | "REVIEWER": [ |
| 2189 | { |
| 2190 | "_account_id": 1000000 |
| 2191 | } |
| 2192 | ] |
| 2193 | }, |
| 2194 | "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379", |
| 2195 | "revisions": { |
| 2196 | "9adb9f4c7b40eeee0646e235de818d09164d7379": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 2197 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2198 | "_number": 1, |
| 2199 | "created": "2015-05-01 15:39:57.979000000", |
| 2200 | "uploader": { |
| 2201 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2202 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2203 | "ref": "refs/changes/79/1779/1", |
| 2204 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2205 | } |
| 2206 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2207 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2208 | { |
| 2209 | "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 2210 | "project": "gerrit", |
| 2211 | "branch": "master", |
| 2212 | "hashtags": [], |
| 2213 | "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 2214 | "subject": "AbstractSubmoduleSubscription: Split up createSubscription", |
| 2215 | "status": "NEW", |
| 2216 | "created": "2015-05-01 15:39:57.979000000", |
| 2217 | "updated": "2015-05-20 19:25:21.546000000", |
| 2218 | "mergeable": true, |
| 2219 | "insertions": 15, |
| 2220 | "deletions": 6, |
| 2221 | "_number": 1780, |
| 2222 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2223 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2224 | }, |
| 2225 | "labels": { |
| 2226 | "Code-Review": { |
| 2227 | "approved": { |
| 2228 | "_account_id": 1000000 |
| 2229 | }, |
| 2230 | "all": [ |
| 2231 | { |
| 2232 | "value": 2, |
| 2233 | "date": "2015-05-20 19:25:21.546000000", |
| 2234 | "_account_id": 1000000 |
| 2235 | } |
| 2236 | ], |
| 2237 | "values": { |
Oswald Buddenhagen | f887770 | 2022-02-15 14:01:34 +0100 | [diff] [blame] | 2238 | "-2": "This shall not be submitted", |
| 2239 | "-1": "I would prefer this is not submitted as is", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2240 | " 0": "No score", |
| 2241 | "+1": "Looks good to me, but someone else must approve", |
| 2242 | "+2": "Looks good to me, approved" |
| 2243 | }, |
| 2244 | "default_value": 0 |
| 2245 | }, |
| 2246 | "Verified": { |
| 2247 | "approved": { |
| 2248 | "_account_id": 1000000 |
| 2249 | }, |
| 2250 | "all": [ |
| 2251 | { |
| 2252 | "value": 1, |
| 2253 | "date": "2015-05-20 19:25:21.546000000", |
| 2254 | "_account_id": 1000000 |
| 2255 | } |
| 2256 | ], |
| 2257 | "values": { |
| 2258 | "-1": "Fails", |
| 2259 | " 0": "No score", |
| 2260 | "+1": "Verified" |
| 2261 | }, |
| 2262 | "default_value": 0 |
| 2263 | } |
| 2264 | }, |
| 2265 | "permitted_labels": { |
| 2266 | "Code-Review": [ |
| 2267 | "-2", |
| 2268 | "-1", |
| 2269 | " 0", |
| 2270 | "+1", |
| 2271 | "+2" |
| 2272 | ], |
| 2273 | "Verified": [ |
| 2274 | "-1", |
| 2275 | " 0", |
| 2276 | "+1" |
| 2277 | ] |
| 2278 | }, |
| 2279 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 2280 | { |
| 2281 | "_account_id": 1000000 |
| 2282 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2283 | ], |
| 2284 | "reviewers": { |
| 2285 | "REVIEWER": [ |
| 2286 | { |
| 2287 | "_account_id": 1000000 |
| 2288 | } |
| 2289 | ] |
| 2290 | }, |
| 2291 | "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4", |
| 2292 | "revisions": { |
| 2293 | "1bd7c12a38854a2c6de426feec28800623f492c4": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 2294 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2295 | "_number": 1, |
| 2296 | "created": "2015-05-01 15:39:57.979000000", |
| 2297 | "uploader": { |
| 2298 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2299 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2300 | "ref": "refs/changes/80/1780/1", |
| 2301 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2302 | } |
| 2303 | } |
| 2304 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2305 | ], |
| 2306 | "non_visible_changes": 0 |
| 2307 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2308 | ---- |
| 2309 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2310 | If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then |
| 2311 | instead of a link:#submitted-together-info[SubmittedTogetherInfo] |
| 2312 | entity, the response is a list of changes, or a 403 response with a |
| 2313 | message if the set of changes to be submitted with this change |
| 2314 | includes changes the caller cannot read. |
| 2315 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2316 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 2317 | [[delete-change]] |
| 2318 | === Delete Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2319 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2320 | 'DELETE /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2321 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2322 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 2323 | Deletes a change. |
| 2324 | |
Paladox none | 580ae0e | 2017-02-12 18:15:48 +0000 | [diff] [blame] | 2325 | New or abandoned changes can be deleted by their owner if the user is granted |
| 2326 | the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission, |
| 2327 | otherwise only by administrators. |
| 2328 | |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2329 | .Request |
| 2330 | ---- |
| 2331 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2332 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2333 | ---- |
| 2334 | |
| 2335 | .Response |
| 2336 | ---- |
| 2337 | HTTP/1.1 204 No Content |
| 2338 | ---- |
| 2339 | |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 2340 | [[apply-patch]] |
| 2341 | === Create patch-set from patch |
| 2342 | -- |
| 2343 | 'POST /changes/link:#change-id[\{change-id\}]/patch:apply' |
| 2344 | -- |
| 2345 | |
| 2346 | Creates a new patch set on a destination change from the provided patch. |
| 2347 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 2348 | If one of the secondary emails associated with the user performing the operation was used as the |
| 2349 | committer email in the current patch set, the same email will be used as the committer email in the |
| 2350 | new patch set; otherwise, the user's preferred email will be used. |
| 2351 | |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 2352 | The patch must be provided in the request body, inside a |
| 2353 | link:#applypatchpatchset-input[ApplyPatchPatchSetInput] entity. |
| 2354 | |
| 2355 | If a base commit is given, the patch is applied on top of it. Otherwise, the |
Nitzan Gur-Furman | 0f0b2d8 | 2023-02-22 15:31:23 +0100 | [diff] [blame] | 2356 | patch is applied on top of the target change's original parent. |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 2357 | |
| 2358 | Applying the patch will fail if the destination change is closed, or in case of any conflicts. |
| 2359 | |
| 2360 | .Request |
| 2361 | ---- |
| 2362 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/patch:apply HTTP/1.0 |
| 2363 | Content-Type: application/json; charset=UTF-8 |
| 2364 | |
| 2365 | { |
| 2366 | "patch": { |
| 2367 | "patch": "new file mode 100644\n--- /dev/null\n+++ b/a_new_file.txt\n@@ -0,0 +1,2 @@ \ |
| 2368 | +Patch compatible `git diff` output \ |
| 2369 | +For example: `link:#get-patch[<gerrit patch>] | base64 -d | sed -z 's/\n/\\n/g'`" |
| 2370 | } |
| 2371 | } |
| 2372 | ---- |
| 2373 | |
| 2374 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 2375 | describes the destination change after applying the patch. |
| 2376 | |
| 2377 | .Response |
| 2378 | ---- |
| 2379 | HTTP/1.1 200 OK |
| 2380 | Content-Disposition: attachment |
| 2381 | Content-Type: application/json; charset=UTF-8 |
| 2382 | |
| 2383 | )]}' |
| 2384 | { |
| 2385 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2386 | "project": "myProject", |
| 2387 | "branch": "release-branch", |
| 2388 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2389 | "subject": "Original change subject", |
| 2390 | "status": "NEW", |
| 2391 | "created": "2013-02-01 09:59:32.126000000", |
| 2392 | "updated": "2013-02-21 11:16:36.775000000", |
| 2393 | "mergeable": true, |
| 2394 | "insertions": 12, |
| 2395 | "deletions": 11, |
| 2396 | "_number": 3965, |
| 2397 | "owner": { |
| 2398 | "name": "John Doe" |
| 2399 | }, |
| 2400 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c" |
| 2401 | } |
| 2402 | ---- |
| 2403 | |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2404 | [[get-included-in]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2405 | === Get Included In |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2406 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2407 | 'GET /changes/link:#change-id[\{change-id\}]/in' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2408 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2409 | |
| 2410 | Retrieves the branches and tags in which a change is included. As result |
| 2411 | an link:#included-in-info[IncludedInInfo] entity is returned. |
| 2412 | |
| 2413 | .Request |
| 2414 | ---- |
| 2415 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0 |
| 2416 | ---- |
| 2417 | |
| 2418 | .Response |
| 2419 | ---- |
| 2420 | HTTP/1.1 200 OK |
| 2421 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2422 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2423 | |
| 2424 | )]}' |
| 2425 | { |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2426 | "branches": [ |
| 2427 | "master" |
| 2428 | ], |
| 2429 | "tags": [] |
| 2430 | } |
| 2431 | ---- |
| 2432 | |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 2433 | [[index-change]] |
| 2434 | === Index Change |
| 2435 | -- |
| 2436 | 'POST /changes/link:#change-id[\{change-id\}]/index' |
| 2437 | -- |
| 2438 | |
| 2439 | Adds or updates the change in the secondary index. |
| 2440 | |
| 2441 | .Request |
| 2442 | ---- |
| 2443 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0 |
| 2444 | ---- |
| 2445 | |
| 2446 | .Response |
| 2447 | ---- |
| 2448 | HTTP/1.1 204 No Content |
| 2449 | ---- |
| 2450 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2451 | [[list-change-comments]] |
| 2452 | === List Change Comments |
| 2453 | -- |
| 2454 | 'GET /changes/link:#change-id[\{change-id\}]/comments' |
| 2455 | -- |
| 2456 | |
| 2457 | Lists the published comments of all revisions of the change. |
| 2458 | |
| 2459 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 2460 | entries. The entries in the map are sorted by file path, and the |
| 2461 | comments for each path are sorted by patch set number. Each comment has |
| 2462 | the `patch_set` and `author` fields set. |
| 2463 | |
Youssef Elghareeb | 68e87b6 | 2021-01-11 13:20:03 +0100 | [diff] [blame] | 2464 | 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] | 2465 | will contain a list of link:#context-line[ContextLine] containing the lines of |
| 2466 | the source file where the comment was written. |
| 2467 | |
Youssef Elghareeb | 87b7450 | 2021-02-05 18:53:05 +0100 | [diff] [blame] | 2468 | The `context-padding` request parameter can be used to specify an extra number |
| 2469 | of context lines to be added before and after the comment range. This parameter |
| 2470 | only works if `enable-context` is set to true. |
| 2471 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2472 | .Request |
| 2473 | ---- |
| 2474 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0 |
| 2475 | ---- |
| 2476 | |
| 2477 | .Response |
| 2478 | ---- |
| 2479 | HTTP/1.1 200 OK |
| 2480 | Content-Disposition: attachment |
| 2481 | Content-Type: application/json; charset=UTF-8 |
| 2482 | |
| 2483 | )]}' |
| 2484 | { |
| 2485 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2486 | { |
| 2487 | "patch_set": 1, |
| 2488 | "id": "TvcXrmjM", |
| 2489 | "line": 23, |
| 2490 | "message": "[nit] trailing whitespace", |
| 2491 | "updated": "2013-02-26 15:40:43.986000000" |
| 2492 | "author": { |
| 2493 | "_account_id": 1000096, |
| 2494 | "name": "John Doe", |
| 2495 | "email": "john.doe@example.com" |
| 2496 | } |
| 2497 | }, |
| 2498 | { |
| 2499 | "patch_set": 2, |
| 2500 | "id": "TveXwFiA", |
| 2501 | "line": 49, |
| 2502 | "in_reply_to": "TfYX-Iuo", |
| 2503 | "message": "Done", |
| 2504 | "updated": "2013-02-26 15:40:45.328000000" |
| 2505 | "author": { |
| 2506 | "_account_id": 1000097, |
| 2507 | "name": "Jane Roe", |
| 2508 | "email": "jane.roe@example.com" |
| 2509 | } |
| 2510 | } |
| 2511 | ] |
| 2512 | } |
| 2513 | ---- |
| 2514 | |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2515 | [[list-change-robot-comments]] |
Patrick Hiesel | ad9efd4 | 2024-01-18 15:16:20 +0100 | [diff] [blame] | 2516 | === List Change Robot Comments (deprecated) |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2517 | -- |
| 2518 | 'GET /changes/link:#change-id[\{change-id\}]/robotcomments' |
| 2519 | -- |
| 2520 | |
| 2521 | Lists the robot comments of all revisions of the change. |
| 2522 | |
| 2523 | Return a map that maps the file path to a list of |
| 2524 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 2525 | map are sorted by file path. |
| 2526 | |
| 2527 | .Request |
| 2528 | ---- |
| 2529 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0 |
| 2530 | ---- |
| 2531 | |
| 2532 | .Response |
| 2533 | ---- |
| 2534 | HTTP/1.1 200 OK |
| 2535 | Content-Disposition: attachment |
| 2536 | Content-Type: application/json; charset=UTF-8 |
| 2537 | |
| 2538 | )]}' |
| 2539 | { |
| 2540 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2541 | { |
| 2542 | "id": "TvcXrmjM", |
| 2543 | "line": 23, |
| 2544 | "message": "unused import", |
| 2545 | "updated": "2016-02-26 15:40:43.986000000", |
| 2546 | "author": { |
| 2547 | "_account_id": 1000110, |
| 2548 | "name": "Code Analyzer", |
| 2549 | "email": "code.analyzer@example.com" |
| 2550 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 2551 | "robot_id": "importChecker", |
| 2552 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2553 | }, |
| 2554 | { |
| 2555 | "id": "TveXwFiA", |
| 2556 | "line": 49, |
| 2557 | "message": "wrong indention", |
| 2558 | "updated": "2016-02-26 15:40:45.328000000", |
| 2559 | "author": { |
| 2560 | "_account_id": 1000110, |
| 2561 | "name": "Code Analyzer", |
| 2562 | "email": "code.analyzer@example.com" |
| 2563 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 2564 | "robot_id": "styleChecker", |
| 2565 | "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2566 | } |
| 2567 | ] |
| 2568 | } |
| 2569 | ---- |
| 2570 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2571 | [[list-change-drafts]] |
| 2572 | === List Change Drafts |
| 2573 | -- |
| 2574 | 'GET /changes/link:#change-id[\{change-id\}]/drafts' |
| 2575 | -- |
| 2576 | |
| 2577 | Lists the draft comments of all revisions of the change that belong to |
| 2578 | the calling user. |
| 2579 | |
| 2580 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 2581 | entries. The entries in the map are sorted by file path, and the |
| 2582 | comments for each path are sorted by patch set number. Each comment has |
| 2583 | the `patch_set` field set, and no `author`. |
| 2584 | |
Youssef Elghareeb | 59580cb | 2021-03-17 15:02:49 +0100 | [diff] [blame] | 2585 | The `enable-context` and `context-padding` request parameters can be used to |
| 2586 | request comment context. See link:#list-change-comments[List Change Comments] |
| 2587 | for more details. |
| 2588 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2589 | .Request |
| 2590 | ---- |
| 2591 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0 |
| 2592 | ---- |
| 2593 | |
| 2594 | .Response |
| 2595 | ---- |
| 2596 | HTTP/1.1 200 OK |
| 2597 | Content-Disposition: attachment |
| 2598 | Content-Type: application/json; charset=UTF-8 |
| 2599 | |
| 2600 | )]}' |
| 2601 | { |
| 2602 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2603 | { |
| 2604 | "patch_set": 1, |
| 2605 | "id": "TvcXrmjM", |
| 2606 | "line": 23, |
| 2607 | "message": "[nit] trailing whitespace", |
| 2608 | "updated": "2013-02-26 15:40:43.986000000" |
| 2609 | }, |
| 2610 | { |
| 2611 | "patch_set": 2, |
| 2612 | "id": "TveXwFiA", |
| 2613 | "line": 49, |
| 2614 | "in_reply_to": "TfYX-Iuo", |
| 2615 | "message": "Done", |
| 2616 | "updated": "2013-02-26 15:40:45.328000000" |
| 2617 | } |
| 2618 | ] |
| 2619 | } |
| 2620 | ---- |
| 2621 | |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2622 | [[check-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2623 | === Check Change |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2624 | -- |
| 2625 | 'GET /changes/link:#change-id[\{change-id\}]/check' |
| 2626 | -- |
| 2627 | |
| 2628 | Performs consistency checks on the change, and returns a |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2629 | link:#change-info[ChangeInfo] entity with the `problems` field set to a |
| 2630 | list of link:#problem-info[ProblemInfo] entities. |
| 2631 | |
| 2632 | Depending on the type of problem, some fields not marked optional may be |
| 2633 | missing from the result. At least `id`, `project`, `branch`, and |
| 2634 | `_number` will be present. |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2635 | |
| 2636 | .Request |
| 2637 | ---- |
| 2638 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2639 | ---- |
| 2640 | |
| 2641 | .Response |
| 2642 | ---- |
| 2643 | HTTP/1.1 200 OK |
| 2644 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2645 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2646 | |
| 2647 | )]}' |
| 2648 | { |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2649 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2650 | "project": "myProject", |
| 2651 | "branch": "master", |
| 2652 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2653 | "subject": "Implementing Feature X", |
| 2654 | "status": "NEW", |
| 2655 | "created": "2013-02-01 09:59:32.126000000", |
| 2656 | "updated": "2013-02-21 11:16:36.775000000", |
| 2657 | "mergeable": true, |
| 2658 | "insertions": 34, |
| 2659 | "deletions": 101, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2660 | "_number": 3965, |
| 2661 | "owner": { |
| 2662 | "name": "John Doe" |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2663 | }, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2664 | "problems": [ |
| 2665 | { |
| 2666 | "message": "Current patch set 1 not found" |
| 2667 | } |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2668 | ] |
| 2669 | } |
| 2670 | ---- |
| 2671 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2672 | [[fix-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2673 | === Fix Change |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2674 | -- |
| 2675 | 'POST /changes/link:#change-id[\{change-id\}]/check' |
| 2676 | -- |
| 2677 | |
| 2678 | Performs consistency checks on the change as with link:#check-change[GET |
| 2679 | /check], and additionally fixes any problems that can be fixed |
| 2680 | automatically. The returned field values reflect any fixes. |
| 2681 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 2682 | Some fixes have options controlling their behavior, which can be set in the |
| 2683 | link:#fix-input[FixInput] entity body. |
| 2684 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2685 | Only the change owner, a project owner, or an administrator may fix changes. |
| 2686 | |
| 2687 | .Request |
| 2688 | ---- |
| 2689 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2690 | ---- |
| 2691 | |
| 2692 | .Response |
| 2693 | ---- |
| 2694 | HTTP/1.1 200 OK |
| 2695 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2696 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2697 | |
| 2698 | )]}' |
| 2699 | { |
| 2700 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2701 | "project": "myProject", |
| 2702 | "branch": "master", |
| 2703 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2704 | "subject": "Implementing Feature X", |
| 2705 | "status": "MERGED", |
| 2706 | "created": "2013-02-01 09:59:32.126000000", |
| 2707 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 2708 | "submitted": "2013-02-21 11:16:36.615000000", |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2709 | "mergeable": true, |
| 2710 | "insertions": 34, |
| 2711 | "deletions": 101, |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2712 | "_number": 3965, |
| 2713 | "owner": { |
| 2714 | "name": "John Doe" |
| 2715 | }, |
| 2716 | "problems": [ |
| 2717 | { |
| 2718 | "message": "Current patch set 2 not found" |
| 2719 | }, |
| 2720 | { |
| 2721 | "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW", |
| 2722 | "status": FIXED, |
| 2723 | "outcome": "Marked change as merged" |
| 2724 | } |
| 2725 | ] |
| 2726 | } |
| 2727 | ---- |
| 2728 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2729 | [[set-work-in-pogress]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2730 | === Set Work-In-Progress |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2731 | -- |
| 2732 | 'POST /changes/link:#change-id[\{change-id\}]/wip' |
| 2733 | -- |
| 2734 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2735 | Marks the change as not ready for review yet. Changes may only be marked not |
| 2736 | ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2737 | |
| 2738 | The request body does not need to include a |
| 2739 | link:#work-in-progress-input[WorkInProgressInput] entity if no review comment |
| 2740 | is added. Actions that create a new patch set in a WIP change default to |
| 2741 | notifying *OWNER* instead of *ALL*. |
| 2742 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 2743 | Marking a change work in progress also removes all users from the |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 2744 | link:user-attention-set.html[attention set]. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 2745 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2746 | .Request |
| 2747 | ---- |
| 2748 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0 |
| 2749 | Content-Type: application/json; charset=UTF-8 |
| 2750 | |
| 2751 | { |
| 2752 | "message": "Refactoring needs to be done before we can proceed here." |
| 2753 | } |
| 2754 | ---- |
| 2755 | |
| 2756 | .Response |
| 2757 | ---- |
| 2758 | HTTP/1.1 200 OK |
| 2759 | ---- |
| 2760 | |
| 2761 | [[set-ready-for-review]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2762 | === Set Ready-For-Review |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2763 | -- |
| 2764 | 'POST /changes/link:#change-id[\{change-id\}]/ready' |
| 2765 | -- |
| 2766 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2767 | Marks the change as ready for review (set WIP property to false). Changes may |
| 2768 | only be marked ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2769 | |
| 2770 | Activates notifications of reviewer. The request body does not need |
| 2771 | to include a link:#work-in-progress-input[WorkInProgressInput] entity |
| 2772 | if no review comment is added. |
| 2773 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 2774 | Marking a change ready for review also adds all of the reviewers of the change |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 2775 | to the link:user-attention-set.html[attention set]. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 2776 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2777 | .Request |
| 2778 | ---- |
| 2779 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0 |
| 2780 | Content-Type: application/json;charset=UTF-8 |
| 2781 | |
| 2782 | { |
| 2783 | "message": "Refactoring is done." |
| 2784 | } |
| 2785 | |
| 2786 | ---- |
| 2787 | |
| 2788 | .Response |
| 2789 | ---- |
| 2790 | HTTP/1.1 200 OK |
| 2791 | ---- |
| 2792 | |
David Pursehouse | 7c5c3a5 | 2017-04-10 11:37:23 +0900 | [diff] [blame] | 2793 | [[mark-private]] |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2794 | === Mark Private |
| 2795 | -- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2796 | 'POST /changes/link:#change-id[\{change-id\}]/private' |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2797 | -- |
| 2798 | |
Patrick Hiesel | 707e61a | 2019-02-13 18:28:48 +0100 | [diff] [blame] | 2799 | Marks the change to be private. Only open changes can be marked private. |
| 2800 | Changes may only be marked private by the owner or site administrators. |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2801 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2802 | A message can be specified in the request body inside a |
| 2803 | link:#private-input[PrivateInput] entity. |
| 2804 | |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2805 | .Request |
| 2806 | ---- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2807 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2808 | Content-Type: application/json; charset=UTF-8 |
| 2809 | |
| 2810 | { |
| 2811 | "message": "After this security fix has been released we can make it public now." |
| 2812 | } |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2813 | ---- |
| 2814 | |
| 2815 | .Response |
| 2816 | ---- |
| 2817 | HTTP/1.1 201 Created |
| 2818 | ---- |
| 2819 | |
| 2820 | If the change was already private the response is "`200 OK`". |
| 2821 | |
| 2822 | [[unmark-private]] |
| 2823 | === Unmark Private |
| 2824 | -- |
| 2825 | 'DELETE /changes/link:#change-id[\{change-id\}]/private' |
| 2826 | -- |
| 2827 | |
| 2828 | Marks the change to be non-private. Note users can only unmark own private |
| 2829 | changes. |
| 2830 | |
| 2831 | .Request |
| 2832 | ---- |
| 2833 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2834 | ---- |
| 2835 | |
| 2836 | .Response |
| 2837 | ---- |
| 2838 | HTTP/1.1 204 No Content |
| 2839 | ---- |
| 2840 | |
| 2841 | If the change was already not private, the response is "`409 Conflict`". |
| 2842 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 2843 | A message can be specified in the request body inside a |
| 2844 | link:#private-input[PrivateInput] entity. Historically, this method allowed |
| 2845 | a body in the DELETE, but that behavior is |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 2846 | 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] | 2847 | In this case, use a POST request instead: |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2848 | |
| 2849 | .Request |
| 2850 | ---- |
| 2851 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0 |
| 2852 | Content-Type: application/json; charset=UTF-8 |
| 2853 | |
| 2854 | { |
| 2855 | "message": "This is a security fix that must not be public." |
| 2856 | } |
| 2857 | ---- |
| 2858 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2859 | [[get-hashtags]] |
| 2860 | === Get Hashtags |
| 2861 | -- |
| 2862 | 'GET /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2863 | -- |
| 2864 | |
| 2865 | Gets the hashtags associated with a change. |
| 2866 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2867 | .Request |
| 2868 | ---- |
| 2869 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2870 | ---- |
| 2871 | |
| 2872 | As response the change's hashtags are returned as a list of strings. |
| 2873 | |
| 2874 | .Response |
| 2875 | ---- |
| 2876 | HTTP/1.1 200 OK |
| 2877 | Content-Disposition: attachment |
| 2878 | Content-Type: application/json; charset=UTF-8 |
| 2879 | |
| 2880 | )]}' |
| 2881 | [ |
| 2882 | "hashtag1", |
| 2883 | "hashtag2" |
| 2884 | ] |
| 2885 | ---- |
| 2886 | |
| 2887 | [[set-hashtags]] |
| 2888 | === Set Hashtags |
| 2889 | -- |
| 2890 | 'POST /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2891 | -- |
| 2892 | |
| 2893 | Adds and/or removes hashtags from a change. |
| 2894 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2895 | The hashtags to add or remove must be provided in the request body inside a |
| 2896 | link:#hashtags-input[HashtagsInput] entity. |
| 2897 | |
| 2898 | .Request |
| 2899 | ---- |
| 2900 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2901 | Content-Type: application/json; charset=UTF-8 |
| 2902 | |
| 2903 | { |
| 2904 | "add" : [ |
| 2905 | "hashtag3" |
| 2906 | ], |
| 2907 | "remove" : [ |
| 2908 | "hashtag2" |
| 2909 | ] |
| 2910 | } |
| 2911 | ---- |
| 2912 | |
| 2913 | As response the change's hashtags are returned as a list of strings. |
| 2914 | |
| 2915 | .Response |
| 2916 | ---- |
| 2917 | HTTP/1.1 200 OK |
| 2918 | Content-Disposition: attachment |
| 2919 | Content-Type: application/json; charset=UTF-8 |
| 2920 | |
| 2921 | )]}' |
| 2922 | [ |
| 2923 | "hashtag1", |
| 2924 | "hashtag3" |
| 2925 | ] |
| 2926 | ---- |
| 2927 | |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 2928 | [[get-custom-keyed-values]] |
| 2929 | === Get Custom Keyed Values |
| 2930 | -- |
Brian Egizi | c130e66 | 2023-08-14 21:58:17 +0000 | [diff] [blame] | 2931 | 'GET /changes/link:#change-id[\{change-id\}]/custom_keyed_values' |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 2932 | -- |
| 2933 | |
| 2934 | Gets the custom keyed values associated with a change. |
| 2935 | |
| 2936 | .Request |
| 2937 | ---- |
Brian Egizi | c130e66 | 2023-08-14 21:58:17 +0000 | [diff] [blame] | 2938 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/custom_keyed_values HTTP/1.0 |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 2939 | ---- |
| 2940 | |
| 2941 | As response the change's custom keyed values are returned as a map of strings. |
| 2942 | |
| 2943 | .Response |
| 2944 | ---- |
| 2945 | HTTP/1.1 200 OK |
| 2946 | Content-Disposition: attachment |
| 2947 | Content-Type: application/json; charset=UTF-8 |
| 2948 | |
| 2949 | )]}' |
| 2950 | { |
| 2951 | "key1": "value1", |
| 2952 | "key2": "value2" |
| 2953 | } |
| 2954 | ---- |
| 2955 | |
| 2956 | [[set-custom-keyed-values]] |
| 2957 | === Set Custom Keyed Values |
| 2958 | -- |
Brian Egizi | c130e66 | 2023-08-14 21:58:17 +0000 | [diff] [blame] | 2959 | 'POST /changes/link:#change-id[\{change-id\}]/custom_keyed_values' |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 2960 | -- |
| 2961 | |
| 2962 | Adds and/or removes custom keyed values from a change. |
| 2963 | |
| 2964 | The custom keyed values to add or remove must be provided in the request body |
| 2965 | inside a link:#custom-keyed-values-input[CustomKeyedValuesInput] entity. |
| 2966 | |
Chris Poucet | 5cfec34 | 2023-08-22 08:56:39 +0200 | [diff] [blame] | 2967 | Note that custom keyed values are expected to be small in both key and value. |
| 2968 | A typical use-case would be storing the ID to some external system, in which |
| 2969 | case the key would be something unique to that system and the value would be |
| 2970 | the ID. |
| 2971 | |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 2972 | .Request |
| 2973 | ---- |
Brian Egizi | c130e66 | 2023-08-14 21:58:17 +0000 | [diff] [blame] | 2974 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/custom_keyed_values HTTP/1.0 |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 2975 | Content-Type: application/json; charset=UTF-8 |
| 2976 | |
| 2977 | { |
| 2978 | "add" : { |
| 2979 | "key1": "value1" |
| 2980 | }, |
| 2981 | "remove" : [ |
| 2982 | "key2" |
| 2983 | ] |
| 2984 | } |
| 2985 | ---- |
| 2986 | |
| 2987 | As response the change's custom keyed values are returned as a map of strings to strings. |
| 2988 | |
| 2989 | .Response |
| 2990 | ---- |
| 2991 | HTTP/1.1 200 OK |
| 2992 | Content-Disposition: attachment |
| 2993 | Content-Type: application/json; charset=UTF-8 |
| 2994 | |
| 2995 | )]}' |
| 2996 | { |
| 2997 | "key1": "value1", |
| 2998 | "key3": "value3" |
| 2999 | } |
| 3000 | ---- |
| 3001 | |
| 3002 | |
Changcheng Xiao | 7fb7329 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 3003 | [[list-change-messages]] |
| 3004 | === List Change Messages |
| 3005 | -- |
| 3006 | 'GET /changes/link:#change-id[\{change-id\}]/messages' |
| 3007 | -- |
| 3008 | |
| 3009 | Lists all the messages of a change including link:#detailed-accounts[detailed account information]. |
| 3010 | |
| 3011 | .Request |
| 3012 | ---- |
| 3013 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages |
| 3014 | ---- |
| 3015 | |
| 3016 | As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned. |
| 3017 | |
| 3018 | .Response |
| 3019 | ---- |
| 3020 | HTTP/1.1 200 OK |
| 3021 | Content-Disposition: attachment |
| 3022 | Content-Type: application/json; charset=UTF-8 |
| 3023 | |
| 3024 | )]}' |
| 3025 | [ |
| 3026 | { |
| 3027 | "id": "YH-egE", |
| 3028 | "author": { |
| 3029 | "_account_id": 1000096, |
| 3030 | "name": "John Doe", |
| 3031 | "email": "john.doe@example.com", |
| 3032 | "username": "jdoe" |
| 3033 | }, |
| 3034 | "date": "2013-03-23 21:34:02.419000000", |
| 3035 | "message": "Patch Set 1:\n\nThis is the first message.", |
| 3036 | "_revision_number": 1 |
| 3037 | }, |
| 3038 | { |
| 3039 | "id": "WEEdhU", |
| 3040 | "author": { |
| 3041 | "_account_id": 1000097, |
| 3042 | "name": "Jane Roe", |
| 3043 | "email": "jane.roe@example.com", |
| 3044 | "username": "jroe" |
| 3045 | }, |
| 3046 | "date": "2013-03-23 21:36:52.332000000", |
| 3047 | "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.", |
| 3048 | "_revision_number": 1 |
| 3049 | } |
| 3050 | ] |
| 3051 | ---- |
David Pursehouse | c32050d | 2017-08-25 16:27:47 +0900 | [diff] [blame] | 3052 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 3053 | [[get-change-message]] |
| 3054 | === Get Change Message |
| 3055 | |
| 3056 | Retrieves a change message including link:#detailed-accounts[detailed account information]. |
| 3057 | |
| 3058 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 3059 | '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] | 3060 | -- |
| 3061 | |
| 3062 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned. |
| 3063 | |
| 3064 | .Response |
| 3065 | ---- |
| 3066 | HTTP/1.1 200 OK |
| 3067 | Content-Disposition: attachment |
| 3068 | Content-Type: application/json; charset=UTF-8 |
| 3069 | |
| 3070 | )]}' |
| 3071 | { |
| 3072 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 3073 | "author": { |
| 3074 | "_account_id": 1000096, |
| 3075 | "name": "John Doe", |
| 3076 | "email": "john.doe@example.com", |
| 3077 | "username": "jdoe" |
| 3078 | }, |
| 3079 | "date": "2013-03-23 21:34:02.419000000", |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 3080 | "message": "a change message", |
| 3081 | "_revision_number": 1 |
| 3082 | } |
| 3083 | ---- |
| 3084 | |
| 3085 | [[delete-change-message]] |
| 3086 | === Delete Change Message |
| 3087 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 3088 | 'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' + |
| 3089 | '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] | 3090 | -- |
| 3091 | |
| 3092 | Deletes a change message by replacing the change message with a new message, |
| 3093 | which contains the name of the user who deleted the change message and the |
| 3094 | reason why it was deleted. The reason can be provided in the request body as a |
| 3095 | link:#delete-change-message-input[DeleteChangeMessageInput] entity. |
| 3096 | |
| 3097 | Note that only users with the |
| 3098 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 3099 | global capability are permitted to delete a change message. |
| 3100 | |
| 3101 | To delete a change message, send a DELETE request: |
| 3102 | |
| 3103 | .Request |
| 3104 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 3105 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 3106 | ---- |
| 3107 | |
| 3108 | To provide a reason for the deletion, use a POST request: |
| 3109 | |
| 3110 | .Request |
| 3111 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 3112 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 3113 | Content-Type: application/json; charset=UTF-8 |
| 3114 | |
| 3115 | { |
| 3116 | "reason": "spam" |
| 3117 | } |
| 3118 | ---- |
| 3119 | |
| 3120 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned that |
| 3121 | describes the updated change message. |
| 3122 | |
| 3123 | .Response |
| 3124 | ---- |
| 3125 | HTTP/1.1 200 OK |
| 3126 | Content-Disposition: attachment |
| 3127 | Content-Type: application/json; charset=UTF-8 |
| 3128 | |
| 3129 | )]}' |
| 3130 | { |
| 3131 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 3132 | "author": { |
| 3133 | "_account_id": 1000096, |
| 3134 | "name": "John Doe", |
| 3135 | "email": "john.doe@example.com", |
| 3136 | "username": "jdoe" |
| 3137 | }, |
| 3138 | "date": "2013-03-23 21:34:02.419000000", |
| 3139 | "message": "Change message removed by: Administrator\nReason: spam", |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 3140 | "_revision_number": 1 |
| 3141 | } |
| 3142 | ---- |
Gustaf Lundh | e8647c6 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 3143 | |
Youssef Elghareeb | d598693 | 2021-10-15 11:45:23 +0200 | [diff] [blame] | 3144 | [[check-submit-requirement]] |
| 3145 | === Check Submit Requirement |
| 3146 | -- |
| 3147 | 'POST /changes/link:#change-id[\{change-id\}]/check.submit_requirement' |
| 3148 | -- |
| 3149 | |
| 3150 | Tests a submit requirement and returns the result as a |
Youssef Elghareeb | 1a24df6 | 2022-06-24 17:52:28 +0200 | [diff] [blame] | 3151 | link:#submit-requirement-result-info[SubmitRequirementResultInfo]. |
| 3152 | |
| 3153 | The submit requirement can be specified in one of the following ways: |
| 3154 | |
| 3155 | * In the request body as a link:#submit-requirement-input[SubmitRequirementInput]. |
| 3156 | * By passing the two request parameters `sr-name` and |
| 3157 | `refs-config-change-id`. The submit requirement will then be loaded from |
| 3158 | the project config pointed to by the latest patchset of this change ID. |
| 3159 | The `sr-name` should point to an existing submit-requirement and the |
| 3160 | `refs-config-change-id` must be a valid change identifier for a change in the |
| 3161 | refs/meta/config branch, otherwise the request would fail with |
| 3162 | `400 Bad Request`. |
Youssef Elghareeb | d598693 | 2021-10-15 11:45:23 +0200 | [diff] [blame] | 3163 | |
| 3164 | Note that this endpoint does not modify the change resource. |
| 3165 | |
| 3166 | .Request |
| 3167 | ---- |
| 3168 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check.submit_requirement HTTP/1.0 |
| 3169 | Content-Type: application/json; charset=UTF-8 |
| 3170 | |
| 3171 | { |
| 3172 | "name": "Code-Review", |
| 3173 | "submittability_expression": "label:Code-Review=+2" |
| 3174 | } |
| 3175 | ---- |
| 3176 | |
| 3177 | As response a link:#submit-requirement-result-info[SubmitRequirementResultInfo] |
| 3178 | entity is returned that describes the submit requirement result. |
| 3179 | |
| 3180 | .Response |
| 3181 | ---- |
| 3182 | HTTP/1.1 200 OK |
| 3183 | Content-Disposition: attachment |
| 3184 | Content-Type: application/json; charset=UTF-8 |
| 3185 | |
| 3186 | )]}' |
| 3187 | { |
| 3188 | "name": "Code-Review", |
| 3189 | "status": "SATISFIED", |
| 3190 | "submittability_expression_result": { |
| 3191 | "expression": "label:Code-Review=+2", |
| 3192 | "fulfilled": true, |
| 3193 | "passingAtoms": [ |
| 3194 | "label:Code-Review=+2" |
| 3195 | ] |
| 3196 | }, |
| 3197 | "is_legacy": false |
| 3198 | } |
| 3199 | ---- |
| 3200 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3201 | [[edit-endpoints]] |
| 3202 | == Change Edit Endpoints |
| 3203 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3204 | [[get-edit-detail]] |
| 3205 | === Get Change Edit Details |
| 3206 | -- |
| 3207 | 'GET /changes/link:#change-id[\{change-id\}]/edit |
| 3208 | -- |
| 3209 | |
Nitzan Gur-Furman | cbf9a8f | 2023-03-08 13:21:18 +0100 | [diff] [blame] | 3210 | Retrieves the details of the change edit done by the caller to the given change. |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3211 | |
| 3212 | .Request |
| 3213 | ---- |
| 3214 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 3215 | ---- |
| 3216 | |
| 3217 | As response an link:#edit-info[EditInfo] entity is returned that |
| 3218 | describes the change edit, or "`204 No Content`" when change edit doesn't |
| 3219 | exist for this change. Change edits are stored on special branches and there |
| 3220 | 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] | 3221 | When request parameter `list` is provided the response also includes the file |
| 3222 | list. When `base` request parameter is provided the file list is computed |
David Ostrovsky | 5562fe5 | 2014-08-12 22:36:27 +0200 | [diff] [blame] | 3223 | against this base revision. When request parameter `download-commands` is |
| 3224 | provided fetch info map is also included. |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3225 | |
| 3226 | .Response |
| 3227 | ---- |
| 3228 | HTTP/1.1 200 OK |
| 3229 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3230 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3231 | |
| 3232 | )]}' |
| 3233 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3234 | "commit": { |
| 3235 | "parents": [ |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3236 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3237 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3238 | } |
| 3239 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3240 | "author": { |
| 3241 | "name": "Shawn O. Pearce", |
| 3242 | "email": "sop@google.com", |
| 3243 | "date": "2012-04-24 18:08:08.000000000", |
| 3244 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3245 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3246 | "committer": { |
| 3247 | "name": "Shawn O. Pearce", |
| 3248 | "email": "sop@google.com", |
| 3249 | "date": "2012-04-24 18:08:08.000000000", |
| 3250 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3251 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3252 | "subject": "Use an EventBus to manage star icons", |
| 3253 | "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] | 3254 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3255 | "base_patch_set_number": 1, |
| 3256 | "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3", |
| 3257 | "ref": "refs/users/01/1000001/edit-76482/1" |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3258 | } |
| 3259 | ---- |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 3260 | |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 3261 | [[put-edit-file]] |
| 3262 | === Change file content in Change Edit |
| 3263 | -- |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 3264 | 'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile' |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 3265 | -- |
| 3266 | |
| 3267 | Put content of a file to a change edit. |
| 3268 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 3269 | If one of the secondary emails associated with the user performing the operation was used as the |
| 3270 | committer email in the latest patch set, the same email will be used as the committer email in the |
| 3271 | new change edit commit; otherwise, the user's preferred email will be used. |
| 3272 | |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 3273 | .Request |
| 3274 | ---- |
| 3275 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3276 | ---- |
| 3277 | |
Paladox none | 28920b4 | 2020-02-22 19:28:21 +0000 | [diff] [blame] | 3278 | To upload a file as binary data in the request body: |
| 3279 | |
| 3280 | .Request |
| 3281 | ---- |
| 3282 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3283 | Content-Type: application/json; charset=UTF-8 |
| 3284 | |
| 3285 | { |
jtrinh | 4ca1041 | 2022-10-04 10:05:34 -0700 | [diff] [blame] | 3286 | "binary_content": "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==", |
| 3287 | "file_mode": 100755 |
Paladox none | 28920b4 | 2020-02-22 19:28:21 +0000 | [diff] [blame] | 3288 | } |
| 3289 | ---- |
| 3290 | |
| 3291 | Note that it must be base-64 encoded data uri. |
| 3292 | |
jtrinh | 4ca1041 | 2022-10-04 10:05:34 -0700 | [diff] [blame] | 3293 | The "file_mode" field is optional, and if provided must be in octal format. The field |
| 3294 | indicates whether the file is executable or not and has a value of either 100755 |
| 3295 | (executable) or 100644 (not executable). If it's unset, this indicates no change |
| 3296 | has been made. New files default to not being executable if this parameter is not |
| 3297 | provided |
| 3298 | |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 3299 | When change edit doesn't exist for this change yet it is created. When file |
| 3300 | content isn't provided, it is wiped out for that file. As response |
| 3301 | "`204 No Content`" is returned. |
| 3302 | |
| 3303 | .Response |
| 3304 | ---- |
| 3305 | HTTP/1.1 204 No Content |
| 3306 | ---- |
| 3307 | |
Gal Paikin | 68d217b | 2019-10-07 21:01:22 +0200 | [diff] [blame] | 3308 | When the change edit is a no-op, for example when providing the same file |
| 3309 | content that the file already has, '409 no changes were made' is returned. |
| 3310 | |
| 3311 | .Response |
| 3312 | ---- |
| 3313 | HTTP/1.1 409 no changes were made |
| 3314 | ---- |
| 3315 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3316 | [[post-edit]] |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 3317 | === Restore file content or rename files in Change Edit |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3318 | -- |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 3319 | 'POST /changes/link:#change-id[\{change-id\}]/edit' |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3320 | -- |
| 3321 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 3322 | Creates empty change edit, restores file content or renames files in change |
| 3323 | edit. The request body needs to include a |
| 3324 | link:#change-edit-input[ChangeEditInput] entity when a file within change |
| 3325 | 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] | 3326 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 3327 | If one of the secondary emails associated with the user performing the operation was used as the |
| 3328 | committer email in the latest patch set, the same email will be used as the committer email in the |
| 3329 | new change edit commit; otherwise, the user's preferred email will be used. |
| 3330 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3331 | .Request |
| 3332 | ---- |
| 3333 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3334 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3335 | |
| 3336 | { |
David Ostrovsky | bd12e17 | 2014-08-21 23:08:15 +0200 | [diff] [blame] | 3337 | "restore_path": "foo" |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3338 | } |
| 3339 | ---- |
| 3340 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 3341 | or for rename: |
| 3342 | |
| 3343 | .Request |
| 3344 | ---- |
| 3345 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 3346 | Content-Type: application/json; charset=UTF-8 |
| 3347 | |
| 3348 | { |
| 3349 | "old_path": "foo", |
| 3350 | "new_path": "bar" |
| 3351 | } |
| 3352 | ---- |
| 3353 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3354 | 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] | 3355 | and restore flag are provided in request body, this file is restored. When |
| 3356 | old and new file names are provided, the file is renamed. As response |
| 3357 | "`204 No Content`" is returned. |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3358 | |
| 3359 | .Response |
| 3360 | ---- |
| 3361 | HTTP/1.1 204 No Content |
| 3362 | ---- |
| 3363 | |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 3364 | [[put-change-edit-message]] |
| 3365 | === Change commit message in Change Edit |
| 3366 | -- |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 3367 | 'PUT /changes/link:#change-id[\{change-id\}]/edit:message' |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 3368 | -- |
| 3369 | |
| 3370 | Modify commit message. The request body needs to include a |
| 3371 | link:#change-edit-message-input[ChangeEditMessageInput] |
| 3372 | entity. |
| 3373 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 3374 | If one of the secondary emails associated with the user performing the operation was used as the |
| 3375 | committer email in the latest patch set, the same email will be used as the committer email in the |
| 3376 | new change edit commit; otherwise, the user's preferred email will be used. |
| 3377 | |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 3378 | .Request |
| 3379 | ---- |
| 3380 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3381 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 3382 | |
| 3383 | { |
| 3384 | "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444" |
| 3385 | } |
| 3386 | ---- |
| 3387 | |
| 3388 | If a change edit doesn't exist for this change yet, it is created. As |
| 3389 | response "`204 No Content`" is returned. |
| 3390 | |
| 3391 | .Response |
| 3392 | ---- |
| 3393 | HTTP/1.1 204 No Content |
| 3394 | ---- |
| 3395 | |
David Ostrovsky | 2830c29 | 2014-08-01 02:24:31 +0200 | [diff] [blame] | 3396 | [[delete-edit-file]] |
| 3397 | === Delete file in Change Edit |
| 3398 | -- |
| 3399 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile' |
| 3400 | -- |
| 3401 | |
| 3402 | Deletes a file from a change edit. This deletes the file from the repository |
| 3403 | completely. This is not the same as reverting or restoring a file to its |
| 3404 | previous contents. |
| 3405 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 3406 | If one of the secondary emails associated with the user performing the operation was used as the |
| 3407 | committer email in the latest patch set, the same email will be used as the committer email in the |
| 3408 | new change edit commit; otherwise, the user's preferred email will be used. |
| 3409 | |
David Ostrovsky | 2830c29 | 2014-08-01 02:24:31 +0200 | [diff] [blame] | 3410 | .Request |
| 3411 | ---- |
| 3412 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3413 | ---- |
| 3414 | |
| 3415 | When change edit doesn't exist for this change yet it is created. |
| 3416 | |
| 3417 | .Response |
| 3418 | ---- |
| 3419 | HTTP/1.1 204 No Content |
| 3420 | ---- |
| 3421 | |
Kaushik Lingarkar | af3905d | 2023-10-31 12:16:35 -0700 | [diff] [blame] | 3422 | [[put-change-edit-committer-author-identity]] |
| 3423 | === Change author or committer identity in Change Edit |
| 3424 | -- |
| 3425 | 'PUT /changes/link:#change-id[\{change-id\}]/edit:identity' |
| 3426 | -- |
| 3427 | |
| 3428 | Modify author or committer identity. The request body needs to include a |
| 3429 | link:#change-edit-identity-input[ChangeEditIdentityInput] |
| 3430 | entity. Either `name` or `email` must be provided. `type` must be either `AUTHOR` or `COMMITTER`. |
| 3431 | |
| 3432 | .Request |
| 3433 | ---- |
| 3434 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:identity HTTP/1.0 |
| 3435 | Content-Type: application/json; charset=UTF-8 |
| 3436 | |
| 3437 | { |
| 3438 | "name": "John Doe", |
| 3439 | "email": "john.doe@example.com", |
| 3440 | "type": "COMMITTER" |
| 3441 | } |
| 3442 | ---- |
| 3443 | |
| 3444 | If a change edit doesn't exist for this change yet, it is created. As |
| 3445 | response "`204 No Content`" is returned. |
| 3446 | |
| 3447 | .Response |
| 3448 | ---- |
| 3449 | HTTP/1.1 204 No Content |
| 3450 | ---- |
| 3451 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3452 | [[get-edit-file]] |
| 3453 | === Retrieve file content from Change Edit |
| 3454 | -- |
| 3455 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile |
| 3456 | -- |
| 3457 | |
| 3458 | Retrieves content of a file from a change edit. |
| 3459 | |
| 3460 | .Request |
| 3461 | ---- |
| 3462 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3463 | ---- |
| 3464 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 3465 | The content of the file is returned as text encoded inside base64. |
| 3466 | The Content-Type header will always be `text/plain` reflecting the |
| 3467 | outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header |
| 3468 | can be examined to find the server detected content type of the file. |
| 3469 | |
| 3470 | When the specified file was deleted in the change edit |
| 3471 | "`204 No Content`" is returned. |
| 3472 | |
| 3473 | If only the content type is required, callers should use HEAD to |
| 3474 | avoid downloading the encoded file contents. |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3475 | |
Michael Zhou | 551ad0c | 2016-04-26 01:21:42 -0400 | [diff] [blame] | 3476 | If the `base` parameter is set to true, the returned content is from the |
| 3477 | revision that the edit is based on. |
| 3478 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3479 | .Response |
| 3480 | ---- |
| 3481 | HTTP/1.1 200 OK |
| 3482 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3483 | Content-Type: text/plain; charset=ISO-8859-1 |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3484 | X-FYI-Content-Encoding: base64 |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 3485 | X-FYI-Content-Type: text/xml |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3486 | |
| 3487 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
| 3488 | ---- |
| 3489 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 3490 | Alternatively, if the only value of the Accept request header is |
| 3491 | `application/json` the content is returned as JSON string and |
| 3492 | `X-FYI-Content-Encoding` is set to `json`. |
| 3493 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 3494 | [[get-edit-meta-data]] |
| 3495 | === Retrieve meta data of a file from Change Edit |
| 3496 | -- |
| 3497 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta |
| 3498 | -- |
| 3499 | |
| 3500 | Retrieves meta data of a file from a change edit. Currently only |
| 3501 | web links are returned. |
| 3502 | |
| 3503 | .Request |
| 3504 | ---- |
| 3505 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0 |
| 3506 | ---- |
| 3507 | |
| 3508 | This REST endpoint retrieves additional information for a file in a |
| 3509 | change edit. As result an link:#edit-file-info[EditFileInfo] entity is |
| 3510 | returned. |
| 3511 | |
| 3512 | .Response |
| 3513 | ---- |
| 3514 | HTTP/1.1 200 OK |
| 3515 | Content-Disposition: attachment |
| 3516 | Content-Type: application/json; charset=UTF-8 |
| 3517 | |
| 3518 | )]}' |
| 3519 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3520 | "web_links": [ |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 3521 | { |
| 3522 | "show_on_side_by_side_diff_view": true, |
| 3523 | "name": "side-by-side preview diff", |
| 3524 | "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png", |
| 3525 | "url": "#/x/xdocs/c/42/1..0/README.md", |
| 3526 | "target": "_self" |
| 3527 | }, |
| 3528 | { |
| 3529 | "show_on_unified_diff_view": true, |
| 3530 | "name": "unified preview diff", |
| 3531 | "image_url": "plugins/xdocs/static/unifiedDiffPreview.png", |
| 3532 | "url": "#/x/xdocs/c/42/1..0/README.md,unified", |
| 3533 | "target": "_self" |
| 3534 | } |
| 3535 | ]} |
| 3536 | ---- |
| 3537 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 3538 | [[get-edit-message]] |
| 3539 | === Retrieve commit message from Change Edit or current patch set of the change |
| 3540 | -- |
| 3541 | 'GET /changes/link:#change-id[\{change-id\}]/edit:message |
| 3542 | -- |
| 3543 | |
David Ostrovsky | 25ad15e | 2014-12-15 21:18:59 +0100 | [diff] [blame] | 3544 | Retrieves commit message from change edit. |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 3545 | |
David Ostrovsky | 0ee0bb2 | 2016-05-31 22:47:47 +0200 | [diff] [blame] | 3546 | If the `base` parameter is set to true, the returned message is from the |
| 3547 | revision that the edit is based on. |
| 3548 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 3549 | .Request |
| 3550 | ---- |
| 3551 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
| 3552 | ---- |
| 3553 | |
| 3554 | The commit message is returned as base64 encoded string. |
| 3555 | |
| 3556 | .Response |
| 3557 | ---- |
| 3558 | HTTP/1.1 200 OK |
| 3559 | |
| 3560 | VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz |
| 3561 | M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg== |
| 3562 | ---- |
| 3563 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 3564 | Alternatively, if the only value of the Accept request header is |
| 3565 | `application/json` the commit message is returned as JSON string: |
| 3566 | |
| 3567 | .Response |
| 3568 | ---- |
| 3569 | HTTP/1.1 200 OK |
| 3570 | |
| 3571 | )]}' |
| 3572 | "Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n" |
| 3573 | ---- |
| 3574 | |
| 3575 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3576 | [[publish-edit]] |
| 3577 | === Publish Change Edit |
| 3578 | -- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3579 | 'POST /changes/link:#change-id[\{change-id\}]/edit:publish |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3580 | -- |
| 3581 | |
| 3582 | Promotes change edit to a regular patch set. |
| 3583 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 3584 | Options can be provided in the request body as a |
| 3585 | link:#publish-change-edit-input[PublishChangeEditInput] entity. |
| 3586 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3587 | .Request |
| 3588 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3589 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0 |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 3590 | Content-Type: application/json; charset=UTF-8 |
| 3591 | |
| 3592 | { |
| 3593 | "notify": "NONE" |
| 3594 | } |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3595 | ---- |
| 3596 | |
| 3597 | As response "`204 No Content`" is returned. |
| 3598 | |
| 3599 | .Response |
| 3600 | ---- |
| 3601 | HTTP/1.1 204 No Content |
| 3602 | ---- |
| 3603 | |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3604 | [[rebase-edit]] |
| 3605 | === Rebase Change Edit |
| 3606 | -- |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 3607 | 'POST /changes/link:#change-id[\{change-id\}]/edit:rebase' |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3608 | -- |
| 3609 | |
| 3610 | Rebases change edit on top of latest patch set. |
| 3611 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 3612 | If one of the secondary emails associated with the user performing the operation was used as the |
| 3613 | committer email in the latest patch set, the same email will be used as the committer email in the |
| 3614 | new change edit commit; otherwise, the user's preferred email will be used. |
| 3615 | |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3616 | .Request |
| 3617 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3618 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0 |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3619 | ---- |
| 3620 | |
| 3621 | When change was rebased on top of latest patch set, response |
David Pursehouse | 56fbc08 | 2015-05-19 16:33:03 +0900 | [diff] [blame] | 3622 | "`204 No Content`" is returned. When change edit is already |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3623 | based on top of the latest patch set, the response |
| 3624 | "`409 Conflict`" is returned. |
| 3625 | |
| 3626 | .Response |
| 3627 | ---- |
| 3628 | HTTP/1.1 204 No Content |
| 3629 | ---- |
| 3630 | |
David Ostrovsky | 8e75f50 | 2014-08-10 00:36:31 +0200 | [diff] [blame] | 3631 | [[delete-edit]] |
| 3632 | === Delete Change Edit |
| 3633 | -- |
| 3634 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit' |
| 3635 | -- |
| 3636 | |
| 3637 | Deletes change edit. |
| 3638 | |
| 3639 | .Request |
| 3640 | ---- |
| 3641 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 3642 | ---- |
| 3643 | |
| 3644 | As response "`204 No Content`" is returned. |
| 3645 | |
| 3646 | .Response |
| 3647 | ---- |
| 3648 | HTTP/1.1 204 No Content |
| 3649 | ---- |
| 3650 | |
Edwin Kempin | 9a9f1c0 | 2017-01-02 15:10:49 +0100 | [diff] [blame] | 3651 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3652 | [[reviewer-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3653 | == Reviewer Endpoints |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3654 | |
| 3655 | [[list-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3656 | === List Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3657 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3658 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3659 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3660 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3661 | Lists the reviewers of a change. |
| 3662 | |
| 3663 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 3664 | |
| 3665 | .Request |
| 3666 | ---- |
| 3667 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0 |
| 3668 | ---- |
| 3669 | |
| 3670 | .Response |
| 3671 | ---- |
| 3672 | HTTP/1.1 200 OK |
| 3673 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3674 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3675 | |
| 3676 | )]}' |
| 3677 | [ |
| 3678 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3679 | "approvals": { |
| 3680 | "Verified": "+1", |
| 3681 | "Code-Review": "+2" |
| 3682 | }, |
| 3683 | "_account_id": 1000096, |
| 3684 | "name": "John Doe", |
| 3685 | "email": "john.doe@example.com" |
| 3686 | }, |
| 3687 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3688 | "approvals": { |
| 3689 | "Verified": " 0", |
| 3690 | "Code-Review": "-1" |
| 3691 | }, |
| 3692 | "_account_id": 1000097, |
| 3693 | "name": "Jane Roe", |
| 3694 | "email": "jane.roe@example.com" |
| 3695 | } |
| 3696 | ] |
| 3697 | ---- |
| 3698 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3699 | [[suggest-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3700 | === Suggest Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3701 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3702 | '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] | 3703 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3704 | |
| 3705 | Suggest the reviewers for a given query `q` and result limit `n`. If result |
| 3706 | limit is not passed, then the default 10 is used. |
| 3707 | |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3708 | This REST endpoint only suggests accounts that |
| 3709 | |
| 3710 | * are active |
Edwin Kempin | 076ce8e | 2023-12-28 07:51:17 +0000 | [diff] [blame] | 3711 | |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3712 | * can see the change |
Edwin Kempin | 076ce8e | 2023-12-28 07:51:17 +0000 | [diff] [blame] | 3713 | |
| 3714 | * are visible to the calling user: |
| 3715 | + |
| 3716 | Whether an account is visible to the calling user depends on the |
| 3717 | link:config-gerrit.html#accounts.visibility[accounts.visibility] setting of the |
| 3718 | server. Which account visibility is configured can be checked by opening |
| 3719 | `https://<HOST>/config/server/info?pp=1` in a browser (see field `accounts` > |
| 3720 | link:rest-api-config.html#accounts-config-info[visibility] in the returned |
| 3721 | JSON). |
| 3722 | |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3723 | * are not already reviewer on the change |
Edwin Kempin | 076ce8e | 2023-12-28 07:51:17 +0000 | [diff] [blame] | 3724 | |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3725 | * don't own the change |
Edwin Kempin | 076ce8e | 2023-12-28 07:51:17 +0000 | [diff] [blame] | 3726 | |
Edwin Kempin | ad55dde | 2021-09-28 11:30:55 +0200 | [diff] [blame] | 3727 | * are not service users (unless |
| 3728 | link:config.html#suggest.skipServiceUsers[skipServiceUsers] is set to `false`) |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3729 | |
Edwin Kempin | ec02a55 | 2019-08-27 09:30:15 +0200 | [diff] [blame] | 3730 | Groups can be excluded from the results by specifying the 'exclude-groups' |
| 3731 | request parameter: |
| 3732 | |
| 3733 | -- |
| 3734 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups' |
| 3735 | -- |
Patrick Hiesel | c79ae0e | 2017-06-28 14:50:53 +0200 | [diff] [blame] | 3736 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3737 | As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned. |
| 3738 | |
| 3739 | .Request |
| 3740 | ---- |
| 3741 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0 |
| 3742 | ---- |
| 3743 | |
| 3744 | .Response |
| 3745 | ---- |
| 3746 | HTTP/1.1 200 OK |
| 3747 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3748 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3749 | |
| 3750 | )]}' |
| 3751 | [ |
| 3752 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3753 | "account": { |
| 3754 | "_account_id": 1000097, |
| 3755 | "name": "Jane Roe", |
| 3756 | "email": "jane.roe@example.com" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3757 | }, |
| 3758 | "count": 1 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3759 | }, |
| 3760 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3761 | "group": { |
| 3762 | "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279", |
| 3763 | "name": "Joiner" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3764 | }, |
| 3765 | "count": 5 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3766 | } |
| 3767 | ] |
| 3768 | ---- |
| 3769 | |
Edwin Kempin | 0ca3f72 | 2019-08-27 09:43:31 +0200 | [diff] [blame] | 3770 | To suggest CCs `reviewer-state=CC` can be specified as additional URL |
| 3771 | parameter. This includes existing reviewers in the result, but excludes |
| 3772 | existing CCs. |
| 3773 | |
| 3774 | -- |
| 3775 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC' |
| 3776 | -- |
| 3777 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3778 | [[get-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3779 | === Get Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3780 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3781 | '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] | 3782 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3783 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3784 | Retrieves a reviewer of a change. |
| 3785 | |
| 3786 | As response a link:#reviewer-info[ReviewerInfo] entity is returned that |
| 3787 | describes the reviewer. |
| 3788 | |
| 3789 | .Request |
| 3790 | ---- |
| 3791 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0 |
| 3792 | ---- |
| 3793 | |
| 3794 | .Response |
| 3795 | ---- |
| 3796 | HTTP/1.1 200 OK |
| 3797 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3798 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3799 | |
| 3800 | )]}' |
| 3801 | { |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3802 | "approvals": { |
| 3803 | "Verified": "+1", |
| 3804 | "Code-Review": "+2" |
| 3805 | }, |
| 3806 | "_account_id": 1000096, |
| 3807 | "name": "John Doe", |
| 3808 | "email": "john.doe@example.com" |
| 3809 | } |
| 3810 | ---- |
| 3811 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3812 | [[add-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3813 | === Add Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3814 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3815 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3816 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3817 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3818 | Adds one user or all members of one group as reviewer to the change. |
| 3819 | |
| 3820 | The reviewer to be added to the change must be provided in the request |
| 3821 | body as a link:#reviewer-input[ReviewerInput] entity. |
| 3822 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3823 | Users can be moved from reviewer to CC and vice versa. This means if a |
| 3824 | user is added as CC that is already a reviewer on the change, the |
| 3825 | reviewer state of that user is updated to CC. If a user that is already |
| 3826 | a CC on the change is added as reviewer, the reviewer state of that |
| 3827 | user is updated to reviewer. |
| 3828 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 3829 | Adding a new reviewer also adds that reviewer to the attention set, unless |
| 3830 | the change is work in progress. |
| 3831 | Also, moving a reviewer to CC removes that user from the attention set. |
| 3832 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3833 | .Request |
| 3834 | ---- |
| 3835 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3836 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3837 | |
| 3838 | { |
| 3839 | "reviewer": "john.doe@example.com" |
| 3840 | } |
| 3841 | ---- |
| 3842 | |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 3843 | As response an link:#reviewer-result[ReviewerResult] entity is |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3844 | returned that describes the newly added reviewers. |
| 3845 | |
| 3846 | .Response |
| 3847 | ---- |
| 3848 | HTTP/1.1 200 OK |
| 3849 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3850 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3851 | |
| 3852 | )]}' |
| 3853 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3854 | "input": "john.doe@example.com", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3855 | "reviewers": [ |
| 3856 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3857 | "_account_id": 1000096, |
| 3858 | "name": "John Doe", |
| 3859 | "email": "john.doe@example.com" |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3860 | "approvals": { |
| 3861 | "Verified": " 0", |
| 3862 | "Code-Review": " 0" |
| 3863 | }, |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3864 | } |
| 3865 | ] |
| 3866 | } |
| 3867 | ---- |
| 3868 | |
| 3869 | If a group is specified, adding the group members as reviewers is an |
| 3870 | atomic operation. This means if an error is returned, none of the |
| 3871 | members are added as reviewer. |
| 3872 | |
| 3873 | If a group with many members is added as reviewer a confirmation may be |
| 3874 | required. |
| 3875 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3876 | If a group is added as CC and members of this group are already |
| 3877 | reviewers on the change, these members stay reviewers on the change |
| 3878 | (they are not downgraded to CC). However if a group is added as |
| 3879 | reviewer, all group members become reviewer of the change, even if they |
| 3880 | have been added as CC before. |
| 3881 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3882 | .Request |
| 3883 | ---- |
| 3884 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3885 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3886 | |
| 3887 | { |
| 3888 | "reviewer": "MyProjectVerifiers" |
| 3889 | } |
| 3890 | ---- |
| 3891 | |
| 3892 | .Response |
| 3893 | ---- |
| 3894 | HTTP/1.1 200 OK |
| 3895 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3896 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3897 | |
| 3898 | )]}' |
| 3899 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3900 | "input": "MyProjectVerifiers", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3901 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 3902 | "confirm": true |
| 3903 | } |
| 3904 | ---- |
| 3905 | |
| 3906 | To confirm the addition of the reviewers, resend the request with the |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3907 | `confirmed` flag being set. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3908 | |
| 3909 | .Request |
| 3910 | ---- |
| 3911 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3912 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3913 | |
| 3914 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3915 | "input": "MyProjectVerifiers", |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3916 | "confirmed": true |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3917 | } |
| 3918 | ---- |
| 3919 | |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 3920 | If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set |
| 3921 | for the project, reviewers and CCs are not required to have a Gerrit account. If you POST |
| 3922 | an email address of a reviewer or CC then, they will be added to the change even if they |
| 3923 | don't have a Gerrit account. |
| 3924 | |
| 3925 | If this option is disabled, the request would fail with `400 Bad Request` if the email |
| 3926 | address can't be resolved to an active Gerrit account. |
| 3927 | |
| 3928 | Note that the name is optional so both "un.registered@reviewer.com" and |
| 3929 | "John Doe <un.registered@reviewer.com>" are valid inputs. |
| 3930 | |
| 3931 | Reviewers without Gerrit accounts can only be added on changes visible to anonymous users. |
| 3932 | |
| 3933 | .Request |
| 3934 | ---- |
| 3935 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 3936 | Content-Type: application/json; charset=UTF-8 |
| 3937 | |
| 3938 | { |
| 3939 | "reviewer": "John Doe <un.registered@reviewer.com>" |
| 3940 | } |
| 3941 | ---- |
| 3942 | |
| 3943 | .Response |
| 3944 | ---- |
| 3945 | HTTP/1.1 200 OK |
| 3946 | Content-Disposition: attachment |
| 3947 | Content-Type: application/json; charset=UTF-8 |
| 3948 | |
| 3949 | )]}' |
| 3950 | { |
| 3951 | "input": "John Doe <un.registered@reviewer.com>" |
| 3952 | } |
| 3953 | ---- |
| 3954 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3955 | .Notifications |
| 3956 | |
| 3957 | An email will be sent using the "newchange" template. |
| 3958 | |
| 3959 | [options="header",cols="1,1,1"] |
| 3960 | |============================= |
| 3961 | |WIP State |Default|notify=ALL |
| 3962 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 3963 | |Work in progress|not sent|owner, reviewers, CCs |
| 3964 | |============================= |
| 3965 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3966 | [[delete-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3967 | === Delete Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3968 | -- |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3969 | 'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' + |
| 3970 | '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] | 3971 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3972 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3973 | Deletes a reviewer from a change. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 3974 | Deleting a reviewer also removes that user from the attention set. |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3975 | |
| 3976 | .Request |
| 3977 | ---- |
| 3978 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0 |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3979 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3980 | ---- |
| 3981 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3982 | Options can be provided in the request body as a |
| 3983 | link:#delete-reviewer-input[DeleteReviewerInput] entity. |
| 3984 | 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] | 3985 | 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] | 3986 | In this case, use a POST request instead: |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3987 | |
| 3988 | .Request |
| 3989 | ---- |
| 3990 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3991 | Content-Type: application/json; charset=UTF-8 |
| 3992 | |
| 3993 | { |
| 3994 | "notify": "NONE" |
| 3995 | } |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3996 | ---- |
| 3997 | |
| 3998 | .Response |
| 3999 | ---- |
| 4000 | HTTP/1.1 204 No Content |
| 4001 | ---- |
| 4002 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 4003 | .Notifications |
| 4004 | |
| 4005 | An email will be sent using the "deleteReviewer" template. If deleting the |
| 4006 | reviewer resulted in one or more approvals being removed, then the deleted |
| 4007 | reviewer will also receive a notification (unless notify=NONE). |
| 4008 | |
| 4009 | [options="header",cols="1,5"] |
| 4010 | |============================= |
| 4011 | |WIP State |Default Recipients |
| 4012 | |Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers |
| 4013 | |Work in progress|notify=NONE: deleted reviewer (if voted) |
| 4014 | |============================= |
| 4015 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 4016 | [[list-votes]] |
| 4017 | === List Votes |
| 4018 | -- |
| 4019 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 4020 | -- |
| 4021 | |
| 4022 | Lists the votes for a specific reviewer of the change. |
| 4023 | |
| 4024 | .Request |
| 4025 | ---- |
Edwin Kempin | 314f10a | 2016-07-11 11:39:05 +0200 | [diff] [blame] | 4026 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0 |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 4027 | ---- |
| 4028 | |
| 4029 | As result a map is returned that maps the label name to the label value. |
| 4030 | The entries in the map are sorted by label name. |
| 4031 | |
| 4032 | .Response |
| 4033 | ---- |
| 4034 | HTTP/1.1 200 OK |
| 4035 | Content-Disposition: attachment |
| 4036 | Content-Type: application/json;charset=UTF-8 |
| 4037 | |
| 4038 | )]}' |
| 4039 | { |
| 4040 | "Code-Review": -1, |
| 4041 | "Verified": 1 |
| 4042 | "Work-In-Progress": 1, |
| 4043 | } |
| 4044 | ---- |
| 4045 | |
| 4046 | [[delete-vote]] |
| 4047 | === Delete Vote |
| 4048 | -- |
Edwin Kempin | 5488dc1 | 2016-08-29 11:13:31 +0200 | [diff] [blame] | 4049 | '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] | 4050 | '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] | 4051 | -- |
| 4052 | |
| 4053 | Deletes a single vote from a change. Note, that even when the last vote of |
| 4054 | a reviewer is removed the reviewer itself is still listed on the change. |
| 4055 | |
Gal Paikin | 6ce56dc | 2021-03-29 12:28:43 +0200 | [diff] [blame] | 4056 | If another user removed a user's vote, the user with the deleted vote will be |
| 4057 | added to the attention set. |
| 4058 | |
Dmitrii Filippov | 3e0bbb7 | 2023-02-22 12:57:00 +0100 | [diff] [blame] | 4059 | The request returns: |
| 4060 | * '204 No Content' if the vote is deleted successfully; |
| 4061 | * '404 Not Found' when the vote to be deleted is zero or not present. |
| 4062 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 4063 | .Request |
| 4064 | ---- |
| 4065 | 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] | 4066 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 4067 | ---- |
| 4068 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 4069 | Options can be provided in the request body as a |
| 4070 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 4071 | 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] | 4072 | 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] | 4073 | In this case, use a POST request instead: |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 4074 | |
| 4075 | .Request |
| 4076 | ---- |
| 4077 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 4078 | Content-Type: application/json; charset=UTF-8 |
| 4079 | |
| 4080 | { |
| 4081 | "notify": "NONE" |
| 4082 | } |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 4083 | ---- |
| 4084 | |
| 4085 | .Response |
| 4086 | ---- |
| 4087 | HTTP/1.1 204 No Content |
| 4088 | ---- |
| 4089 | |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 4090 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4091 | [[revision-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4092 | == Revision Endpoints |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4093 | |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 4094 | [[get-commit]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4095 | === Get Commit |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4096 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 4097 | '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] | 4098 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 4099 | |
| 4100 | Retrieves a parsed commit of a revision. |
| 4101 | |
| 4102 | .Request |
| 4103 | ---- |
| 4104 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0 |
| 4105 | ---- |
| 4106 | |
| 4107 | As response a link:#commit-info[CommitInfo] entity is returned that |
| 4108 | describes the revision. |
| 4109 | |
| 4110 | .Response |
| 4111 | ---- |
| 4112 | HTTP/1.1 200 OK |
| 4113 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4114 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 4115 | |
| 4116 | )]}' |
| 4117 | { |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 4118 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 4119 | "parents": [ |
| 4120 | { |
| 4121 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 4122 | "subject": "Migrate contributor agreements to All-Projects." |
| 4123 | } |
| 4124 | ], |
| 4125 | "author": { |
| 4126 | "name": "Shawn O. Pearce", |
| 4127 | "email": "sop@google.com", |
| 4128 | "date": "2012-04-24 18:08:08.000000000", |
| 4129 | "tz": -420 |
| 4130 | }, |
| 4131 | "committer": { |
| 4132 | "name": "Shawn O. Pearce", |
| 4133 | "email": "sop@google.com", |
| 4134 | "date": "2012-04-24 18:08:08.000000000", |
| 4135 | "tz": -420 |
| 4136 | }, |
| 4137 | "subject": "Use an EventBus to manage star icons", |
| 4138 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 4139 | } |
| 4140 | ---- |
| 4141 | |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 4142 | Adding query parameter `links` (for example `/changes/.../commit?links`) |
| 4143 | returns a link:#commit-info[CommitInfo] with the additional field `web_links`. |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 4144 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 4145 | [[get-description]] |
| 4146 | === Get Description |
| 4147 | -- |
| 4148 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 4149 | -- |
| 4150 | |
| 4151 | Retrieves the description of a patch set. |
| 4152 | |
| 4153 | .Request |
| 4154 | ---- |
| 4155 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 4156 | ---- |
| 4157 | |
| 4158 | .Response |
| 4159 | ---- |
| 4160 | HTTP/1.1 200 OK |
| 4161 | Content-Disposition: attachment |
| 4162 | Content-Type: application/json; charset=UTF-8 |
| 4163 | |
| 4164 | )]}' |
| 4165 | "Added Documentation" |
| 4166 | ---- |
| 4167 | |
| 4168 | If the patch set does not have a description an empty string is returned. |
| 4169 | |
| 4170 | [[set-description]] |
| 4171 | === Set Description |
| 4172 | -- |
| 4173 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 4174 | -- |
| 4175 | |
| 4176 | Sets the description of a patch set. |
| 4177 | |
| 4178 | The new description must be provided in the request body inside a |
| 4179 | link:#description-input[DescriptionInput] entity. |
| 4180 | |
| 4181 | .Request |
| 4182 | ---- |
| 4183 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 4184 | Content-Type: application/json; charset=UTF-8 |
| 4185 | |
| 4186 | { |
| 4187 | "description": "Added Documentation" |
| 4188 | } |
| 4189 | ---- |
| 4190 | |
| 4191 | As response the new description is returned. |
| 4192 | |
| 4193 | .Response |
| 4194 | ---- |
| 4195 | HTTP/1.1 200 OK |
| 4196 | Content-Disposition: attachment |
| 4197 | Content-Type: application/json; charset=UTF-8 |
| 4198 | |
| 4199 | )]}' |
| 4200 | "Added Documentation" |
| 4201 | ---- |
| 4202 | |
Edwin Kempin | 0f22944 | 2016-09-09 13:06:12 +0200 | [diff] [blame] | 4203 | [[get-merge-list]] |
| 4204 | === Get Merge List |
| 4205 | -- |
| 4206 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist' |
| 4207 | -- |
| 4208 | |
| 4209 | Returns the list of commits that are being integrated into a target |
| 4210 | branch by a merge commit. By default the first parent is assumed to be |
| 4211 | uninteresting. By using the `parent` option another parent can be set |
| 4212 | as uninteresting (parents are 1-based). |
| 4213 | |
| 4214 | The list of commits is returned as a list of |
| 4215 | link:#commit-info[CommitInfo] entities. Web links are only included if |
| 4216 | the `links` option was set. |
| 4217 | |
| 4218 | .Request |
| 4219 | ---- |
| 4220 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0 |
| 4221 | ---- |
| 4222 | |
| 4223 | .Response |
| 4224 | ---- |
| 4225 | HTTP/1.1 200 OK |
| 4226 | Content-Disposition: attachment |
| 4227 | Content-Type: application/json; charset=UTF-8 |
| 4228 | |
| 4229 | )]}' |
| 4230 | [ |
| 4231 | { |
| 4232 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 4233 | "parents": [ |
| 4234 | { |
| 4235 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 4236 | "subject": "Migrate contributor agreements to All-Projects." |
| 4237 | } |
| 4238 | ], |
| 4239 | "author": { |
| 4240 | "name": "Shawn O. Pearce", |
| 4241 | "email": "sop@google.com", |
| 4242 | "date": "2012-04-24 18:08:08.000000000", |
| 4243 | "tz": -420 |
| 4244 | }, |
| 4245 | "committer": { |
| 4246 | "name": "Shawn O. Pearce", |
| 4247 | "email": "sop@google.com", |
| 4248 | "date": "2012-04-24 18:08:08.000000000", |
| 4249 | "tz": -420 |
| 4250 | }, |
| 4251 | "subject": "Use an EventBus to manage star icons", |
| 4252 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 4253 | } |
| 4254 | ] |
| 4255 | ---- |
| 4256 | |
Stefan Beller | c725966 | 2015-02-12 17:23:05 -0800 | [diff] [blame] | 4257 | [[get-revision-actions]] |
| 4258 | === Get Revision Actions |
| 4259 | -- |
| 4260 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions' |
| 4261 | -- |
| 4262 | |
| 4263 | Retrieves revision link:#action-info[actions] of the revision of a change. |
| 4264 | |
| 4265 | .Request |
| 4266 | ---- |
| 4267 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0 |
| 4268 | ---- |
| 4269 | |
| 4270 | .Response |
| 4271 | ---- |
| 4272 | HTTP/1.1 200 OK |
| 4273 | Content-Disposition: attachment |
| 4274 | Content-Type: application/json; charset=UTF-8 |
| 4275 | |
| 4276 | )]}' |
| 4277 | |
| 4278 | { |
| 4279 | "submit": { |
| 4280 | "method": "POST", |
| 4281 | "label": "Submit", |
| 4282 | "title": "Submit patch set 1 into master", |
| 4283 | "enabled": true |
| 4284 | }, |
| 4285 | "cherrypick": { |
| 4286 | "method": "POST", |
| 4287 | "label": "Cherry Pick", |
| 4288 | "title": "Cherry pick change to a different branch", |
| 4289 | "enabled": true |
| 4290 | } |
| 4291 | } |
| 4292 | ---- |
| 4293 | |
Han-Wen Nienhuys | 86db767 | 2021-08-10 12:45:58 +0200 | [diff] [blame] | 4294 | The response is a flat map of possible revision REST endpoint names |
| 4295 | mapped to their link:#action-info[ActionInfo]. |
Stefan Beller | c725966 | 2015-02-12 17:23:05 -0800 | [diff] [blame] | 4296 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4297 | [[get-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4298 | === Get Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4299 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4300 | '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] | 4301 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4302 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4303 | Retrieves a review of a revision. |
| 4304 | |
| 4305 | .Request |
| 4306 | ---- |
| 4307 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 4308 | ---- |
| 4309 | |
| 4310 | As response a link:#change-info[ChangeInfo] entity with |
| 4311 | link:#detailed-labels[detailed labels] and link:#detailed-accounts[ |
| 4312 | detailed accounts] is returned that describes the review of the |
| 4313 | revision. The revision for which the review is retrieved is contained |
| 4314 | in the `revisions` field. In addition the `current_revision` field is |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 4315 | 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] | 4316 | revision of the change. Please note that the returned labels are always |
| 4317 | for the current patch set. |
| 4318 | |
| 4319 | .Response |
| 4320 | ---- |
| 4321 | HTTP/1.1 200 OK |
| 4322 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4323 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4324 | |
| 4325 | )]}' |
| 4326 | { |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4327 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4328 | "project": "myProject", |
| 4329 | "branch": "master", |
| 4330 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4331 | "subject": "Implementing Feature X", |
| 4332 | "status": "NEW", |
| 4333 | "created": "2013-02-01 09:59:32.126000000", |
| 4334 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4335 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 4336 | "insertions": 34, |
| 4337 | "deletions": 45, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4338 | "_number": 3965, |
| 4339 | "owner": { |
| 4340 | "_account_id": 1000096, |
| 4341 | "name": "John Doe", |
| 4342 | "email": "john.doe@example.com" |
| 4343 | }, |
| 4344 | "labels": { |
| 4345 | "Verified": { |
| 4346 | "all": [ |
| 4347 | { |
| 4348 | "value": 0, |
| 4349 | "_account_id": 1000096, |
| 4350 | "name": "John Doe", |
| 4351 | "email": "john.doe@example.com" |
| 4352 | }, |
| 4353 | { |
| 4354 | "value": 0, |
| 4355 | "_account_id": 1000097, |
| 4356 | "name": "Jane Roe", |
| 4357 | "email": "jane.roe@example.com" |
| 4358 | } |
| 4359 | ], |
| 4360 | "values": { |
| 4361 | "-1": "Fails", |
| 4362 | " 0": "No score", |
| 4363 | "+1": "Verified" |
| 4364 | } |
| 4365 | }, |
| 4366 | "Code-Review": { |
| 4367 | "all": [ |
| 4368 | { |
| 4369 | "value": -1, |
| 4370 | "_account_id": 1000096, |
| 4371 | "name": "John Doe", |
| 4372 | "email": "john.doe@example.com" |
| 4373 | }, |
| 4374 | { |
| 4375 | "value": 1, |
| 4376 | "_account_id": 1000097, |
| 4377 | "name": "Jane Roe", |
| 4378 | "email": "jane.roe@example.com" |
| 4379 | } |
| 4380 | ] |
| 4381 | "values": { |
Oswald Buddenhagen | f887770 | 2022-02-15 14:01:34 +0100 | [diff] [blame] | 4382 | "-2": "This shall not be submitted", |
| 4383 | "-1": "I would prefer this is not submitted as is", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4384 | " 0": "No score", |
| 4385 | "+1": "Looks good to me, but someone else must approve", |
| 4386 | "+2": "Looks good to me, approved" |
| 4387 | } |
| 4388 | } |
| 4389 | }, |
| 4390 | "permitted_labels": { |
| 4391 | "Verified": [ |
| 4392 | "-1", |
| 4393 | " 0", |
| 4394 | "+1" |
| 4395 | ], |
| 4396 | "Code-Review": [ |
| 4397 | "-2", |
| 4398 | "-1", |
| 4399 | " 0", |
| 4400 | "+1", |
| 4401 | "+2" |
| 4402 | ] |
| 4403 | }, |
| 4404 | "removable_reviewers": [ |
| 4405 | { |
| 4406 | "_account_id": 1000096, |
| 4407 | "name": "John Doe", |
| 4408 | "email": "john.doe@example.com" |
| 4409 | }, |
| 4410 | { |
| 4411 | "_account_id": 1000097, |
| 4412 | "name": "Jane Roe", |
| 4413 | "email": "jane.roe@example.com" |
| 4414 | } |
| 4415 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 4416 | "reviewers": { |
| 4417 | "REVIEWER": [ |
| 4418 | { |
| 4419 | "_account_id": 1000096, |
| 4420 | "name": "John Doe", |
| 4421 | "email": "john.doe@example.com" |
| 4422 | }, |
| 4423 | { |
| 4424 | "_account_id": 1000097, |
| 4425 | "name": "Jane Roe", |
| 4426 | "email": "jane.roe@example.com" |
| 4427 | } |
| 4428 | ] |
| 4429 | }, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4430 | "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 4431 | "revisions": { |
| 4432 | "674ac754f91e64a0efb8087e59a176484bd534d1": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 4433 | "kind": "REWORK", |
| 4434 | "_number": 2, |
| 4435 | "ref": "refs/changes/65/3965/2", |
| 4436 | "fetch": { |
| 4437 | "http": { |
| 4438 | "url": "http://gerrit/myProject", |
| 4439 | "ref": "refs/changes/65/3965/2" |
| 4440 | } |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4441 | } |
| 4442 | } |
| 4443 | } |
| 4444 | } |
| 4445 | ---- |
| 4446 | |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4447 | [[get-related-changes]] |
| 4448 | === Get Related Changes |
| 4449 | -- |
| 4450 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related' |
| 4451 | -- |
| 4452 | |
| 4453 | Retrieves related changes of a revision. Related changes are changes that either |
| 4454 | depend on, or are dependencies of the revision. |
| 4455 | |
Joerg Zieren | 75e9538 | 2022-07-08 11:30:35 +0200 | [diff] [blame] | 4456 | Additional fields can be obtained by adding `o` parameters. Since these may slow |
| 4457 | down processing they are disabled by default. Currently a single parameter is |
| 4458 | supported: |
| 4459 | |
| 4460 | [[get-related-changes-submittable]] |
| 4461 | -- |
| 4462 | * `SUBMITTABLE`: Compute the `submittable` field in the returned |
| 4463 | link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities. |
| 4464 | -- |
| 4465 | |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4466 | .Request |
| 4467 | ---- |
| 4468 | GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0 |
| 4469 | ---- |
| 4470 | |
| 4471 | As result a link:#related-changes-info[RelatedChangesInfo] entity is returned |
| 4472 | describing the related changes. |
| 4473 | |
| 4474 | .Response |
| 4475 | ---- |
| 4476 | HTTP/1.1 200 OK |
| 4477 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4478 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4479 | |
| 4480 | )]}' |
| 4481 | { |
| 4482 | "changes": [ |
| 4483 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 4484 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4485 | "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5", |
| 4486 | "commit": { |
| 4487 | "commit": "78847477532e386f5a2185a4e8c90b2509e354e3", |
| 4488 | "parents": [ |
| 4489 | { |
| 4490 | "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e" |
| 4491 | } |
| 4492 | ], |
| 4493 | "author": { |
| 4494 | "name": "David Ostrovsky", |
| 4495 | "email": "david@ostrovsky.org", |
| 4496 | "date": "2014-07-12 15:04:24.000000000", |
| 4497 | "tz": 120 |
| 4498 | }, |
| 4499 | "subject": "Remove Solr" |
| 4500 | }, |
| 4501 | "_change_number": 58478, |
| 4502 | "_revision_number": 2, |
| 4503 | "_current_revision_number": 2 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 4504 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4505 | }, |
| 4506 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 4507 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4508 | "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774", |
| 4509 | "commit": { |
| 4510 | "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe", |
| 4511 | "parents": [ |
| 4512 | { |
| 4513 | "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad" |
| 4514 | } |
| 4515 | ], |
| 4516 | "author": { |
| 4517 | "name": "David Pursehouse", |
| 4518 | "email": "david.pursehouse@sonymobile.com", |
| 4519 | "date": "2014-06-24 02:01:28.000000000", |
| 4520 | "tz": 540 |
| 4521 | }, |
| 4522 | "subject": "Add support for secondary index with Elasticsearch" |
| 4523 | }, |
| 4524 | "_change_number": 58081, |
| 4525 | "_revision_number": 10, |
| 4526 | "_current_revision_number": 10 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 4527 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4528 | } |
| 4529 | ] |
| 4530 | } |
| 4531 | ---- |
| 4532 | |
| 4533 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4534 | [[set-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4535 | === Set Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4536 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4537 | '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] | 4538 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4539 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 4540 | Sets a review on a revision, optionally also publishing draft comments, setting |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 4541 | labels, adding reviewers or CCs, and modifying the work in progress property. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4542 | |
| 4543 | The review must be provided in the request body as a |
| 4544 | link:#review-input[ReviewInput] entity. |
| 4545 | |
Youssef Elghareeb | 12add16 | 2019-12-18 18:43:23 +0100 | [diff] [blame] | 4546 | If the labels are set, the user sending the request will automatically be |
| 4547 | added as a reviewer, otherwise (if they only commented) they are added to |
| 4548 | the CC list. |
| 4549 | |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 4550 | Posting a review usually updates the link:user-attention-set.html[attention |
| 4551 | set]. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 4552 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4553 | A review cannot be set on a change edit. Trying to post a review for a |
| 4554 | change edit fails with `409 Conflict`. |
| 4555 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 4556 | Here is an example of using this method to set labels: |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4557 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4558 | .Request |
| 4559 | ---- |
| 4560 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4561 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4562 | |
| 4563 | { |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 4564 | "tag": "jenkins", |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4565 | "message": "Some nits need to be fixed.", |
| 4566 | "labels": { |
| 4567 | "Code-Review": -1 |
| 4568 | }, |
| 4569 | "comments": { |
| 4570 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4571 | { |
| 4572 | "line": 23, |
| 4573 | "message": "[nit] trailing whitespace" |
| 4574 | }, |
| 4575 | { |
| 4576 | "line": 49, |
| 4577 | "message": "[nit] s/conrtol/control" |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 4578 | }, |
| 4579 | { |
| 4580 | "range": { |
| 4581 | "start_line": 50, |
| 4582 | "start_character": 0, |
| 4583 | "end_line": 55, |
| 4584 | "end_character": 20 |
| 4585 | }, |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 4586 | "message": "Incorrect indentation" |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4587 | } |
| 4588 | ] |
| 4589 | } |
| 4590 | } |
| 4591 | ---- |
| 4592 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 4593 | As response a link:#review-result[ReviewResult] entity is returned that |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4594 | describes the applied labels and any added reviewers (e.g. yourself, |
| 4595 | 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] | 4596 | |
| 4597 | .Response |
| 4598 | ---- |
| 4599 | HTTP/1.1 200 OK |
| 4600 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4601 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4602 | |
| 4603 | )]}' |
| 4604 | { |
| 4605 | "labels": { |
| 4606 | "Code-Review": -1 |
| 4607 | } |
| 4608 | } |
| 4609 | ---- |
| 4610 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4611 | It is also possible to add one or more reviewers or CCs |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 4612 | to a change simultaneously with a review: |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4613 | |
| 4614 | .Request |
| 4615 | ---- |
| 4616 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 4617 | Content-Type: application/json; charset=UTF-8 |
| 4618 | |
| 4619 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4620 | "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] | 4621 | "reviewers": [ |
| 4622 | { |
| 4623 | "reviewer": "jane.roe@example.com" |
| 4624 | }, |
| 4625 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4626 | "reviewer": "john.doe@example.com", |
| 4627 | "state": "CC" |
| 4628 | } |
| 4629 | { |
| 4630 | "reviewer": "MyProjectVerifiers", |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4631 | } |
| 4632 | ] |
| 4633 | } |
| 4634 | ---- |
| 4635 | |
| 4636 | Each element of the `reviewers` list is an instance of |
| 4637 | link:#reviewer-input[ReviewerInput]. The corresponding result of |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4638 | adding each reviewer will be returned in a map of inputs to |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 4639 | link:#reviewer-result[ReviewerResult]s. |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4640 | |
| 4641 | .Response |
| 4642 | ---- |
| 4643 | HTTP/1.1 200 OK |
| 4644 | Content-Disposition: attachment |
| 4645 | Content-Type: application/json; charset=UTF-8 |
| 4646 | |
| 4647 | )]}' |
| 4648 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4649 | "reviewers": { |
| 4650 | "jane.roe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4651 | "input": "jane.roe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4652 | "reviewers": [ |
| 4653 | { |
| 4654 | "_account_id": 1000097, |
| 4655 | "name": "Jane Roe", |
| 4656 | "email": "jane.roe@example.com" |
| 4657 | "approvals": { |
| 4658 | "Verified": " 0", |
| 4659 | "Code-Review": " 0" |
| 4660 | }, |
| 4661 | }, |
| 4662 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4663 | }, |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4664 | "john.doe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4665 | "input": "john.doe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4666 | "ccs": [ |
| 4667 | { |
| 4668 | "_account_id": 1000096, |
| 4669 | "name": "John Doe", |
| 4670 | "email": "john.doe@example.com" |
| 4671 | "approvals": { |
| 4672 | "Verified": " 0", |
| 4673 | "Code-Review": " 0" |
| 4674 | }, |
| 4675 | } |
| 4676 | ] |
| 4677 | }, |
| 4678 | "MyProjectVerifiers": { |
| 4679 | "input": "MyProjectVerifiers", |
| 4680 | "reviewers": [ |
| 4681 | { |
| 4682 | "_account_id": 1000098, |
| 4683 | "name": "Alice Ansel", |
| 4684 | "email": "alice.ansel@example.com" |
| 4685 | "approvals": { |
| 4686 | "Verified": " 0", |
| 4687 | "Code-Review": " 0" |
| 4688 | }, |
| 4689 | }, |
| 4690 | { |
| 4691 | "_account_id": 1000099, |
| 4692 | "name": "Bob Bollard", |
| 4693 | "email": "bob.bollard@example.com" |
| 4694 | "approvals": { |
| 4695 | "Verified": " 0", |
| 4696 | "Code-Review": " 0" |
| 4697 | }, |
| 4698 | }, |
| 4699 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4700 | } |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4701 | } |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4702 | } |
| 4703 | ---- |
| 4704 | |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4705 | 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] | 4706 | be rejected with `400 Bad Request`. None of the entries will have the |
| 4707 | `reviewers` or `ccs` field set, and those which specifically failed will have |
| 4708 | the `errors` field set containing details of why they failed. |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4709 | |
| 4710 | .Error Response |
| 4711 | ---- |
| 4712 | HTTP/1.1 400 Bad Request |
| 4713 | Content-Disposition: attachment |
| 4714 | Content-Type: application/json; charset=UTF-8 |
| 4715 | |
| 4716 | )]}' |
| 4717 | { |
| 4718 | "reviewers": { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4719 | "jane.roe@example.com": { |
| 4720 | "input": "jane.roe@example.com", |
| 4721 | "error": "Account of jane.roe@example.com is inactive." |
| 4722 | }, |
| 4723 | "john.doe@example.com": { |
| 4724 | "input": "john.doe@example.com" |
| 4725 | }, |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4726 | "MyProjectVerifiers": { |
| 4727 | "input": "MyProjectVerifiers", |
| 4728 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 4729 | "confirm": true |
| 4730 | } |
| 4731 | } |
| 4732 | } |
| 4733 | ---- |
| 4734 | |
Dave Borowitz | d2e4145 | 2017-10-26 08:06:23 -0400 | [diff] [blame] | 4735 | [[set-review-notifications]] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4736 | .Notifications |
| 4737 | |
| 4738 | An email will be sent using the "comment" template. |
| 4739 | |
| 4740 | If the top-level notify property is null or not set, then notification behavior |
| 4741 | depends on whether the change is WIP, whether it has started review, and whether |
| 4742 | the tag property is null. |
| 4743 | |
| 4744 | NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*. |
| 4745 | Use the notify property of the top-level link:#review-input[ReviewInput] instead. |
| 4746 | |
| 4747 | For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS |
| 4748 | watchers*. |
| 4749 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4750 | [options="header",cols="2,1,1,2,2"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4751 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4752 | |WIP State |Review Started|Tag Given|Default |notify=ALL |
| 4753 | |Ready for review|N/A |N/A |everyone|everyone |
| 4754 | |Work in progress|no |no |not sent|everyone |
| 4755 | |Work in progress|no |yes |owner |everyone |
| 4756 | |Work in progress|yes |no |everyone|everyone |
| 4757 | |Work in progress|yes |yes |owner |everyone |
| 4758 | |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4759 | |============================= |
| 4760 | |
| 4761 | If reviewers are added, then a second email will be sent using the "newchange" |
| 4762 | template. The notification logic for this email is the same as for |
| 4763 | link:#add-reviewer[Add Reviewer]. |
| 4764 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4765 | [options="header",cols="1,1,1"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4766 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4767 | |WIP State |Default |notify=ALL |
| 4768 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 4769 | |Work in progress|not sent |owner, reviewers, CCs |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4770 | |============================= |
| 4771 | |
| 4772 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4773 | [[rebase-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4774 | === Rebase Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4775 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4776 | '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] | 4777 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4778 | |
| 4779 | Rebases a revision. |
| 4780 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4781 | Optionally, the parent revision can be changed to another patch set through the |
| 4782 | link:#rebase-input[RebaseInput] entity. |
| 4783 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4784 | .Request |
| 4785 | ---- |
| 4786 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4787 | Content-Type: application/json;charset=UTF-8 |
| 4788 | |
| 4789 | { |
| 4790 | "base" : "1234", |
| 4791 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4792 | ---- |
| 4793 | |
| 4794 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 4795 | describes the rebased change. Information about the current patch set |
| 4796 | is included. |
| 4797 | |
| 4798 | .Response |
| 4799 | ---- |
| 4800 | HTTP/1.1 200 OK |
| 4801 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4802 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4803 | |
| 4804 | )]}' |
| 4805 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4806 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4807 | "project": "myProject", |
| 4808 | "branch": "master", |
| 4809 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4810 | "subject": "Implement Feature X", |
| 4811 | "status": "NEW", |
| 4812 | "created": "2013-02-01 09:59:32.126000000", |
| 4813 | "updated": "2013-02-21 11:16:36.775000000", |
| 4814 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 4815 | "insertions": 21, |
| 4816 | "deletions": 21, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4817 | "_number": 4799, |
| 4818 | "owner": { |
| 4819 | "name": "John Doe" |
| 4820 | }, |
| 4821 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 4822 | "revisions": { |
| 4823 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 4824 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4825 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 4826 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4827 | "fetch": { |
| 4828 | "http": { |
| 4829 | "url": "http://gerrit:8080/myProject", |
| 4830 | "ref": "refs/changes/99/4799/2" |
| 4831 | } |
| 4832 | }, |
| 4833 | "commit": { |
| 4834 | "parents": [ |
| 4835 | { |
| 4836 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 4837 | "subject": "Implement Feature A" |
| 4838 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 4839 | ], |
| 4840 | "author": { |
| 4841 | "name": "John Doe", |
| 4842 | "email": "john.doe@example.com", |
| 4843 | "date": "2013-05-07 15:21:27.000000000", |
| 4844 | "tz": 120 |
| 4845 | }, |
| 4846 | "committer": { |
| 4847 | "name": "Gerrit Code Review", |
| 4848 | "email": "gerrit-server@example.com", |
| 4849 | "date": "2013-05-07 15:35:43.000000000", |
| 4850 | "tz": 120 |
| 4851 | }, |
| 4852 | "subject": "Implement Feature X", |
| 4853 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4854 | } |
| 4855 | } |
| 4856 | } |
| 4857 | ---- |
| 4858 | |
| 4859 | If the revision cannot be rebased, e.g. due to conflicts, the response is |
| 4860 | "`409 Conflict`" and the error message is contained in the response |
| 4861 | body. |
| 4862 | |
| 4863 | .Response |
| 4864 | ---- |
| 4865 | HTTP/1.1 409 Conflict |
| 4866 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4867 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4868 | |
| 4869 | The change could not be rebased due to a path conflict during merge. |
| 4870 | ---- |
| 4871 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4872 | [[submit-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4873 | === Submit Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4874 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4875 | '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] | 4876 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4877 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4878 | Submits a revision. |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 4879 | Submitting a change also removes all users from the link:user-attention-set.html[attention set]. |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4880 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4881 | .Request |
| 4882 | ---- |
| 4883 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4884 | ---- |
| 4885 | |
Gal Paikin | 3d6cdec | 2021-04-19 13:32:13 +0200 | [diff] [blame] | 4886 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 4887 | describes the submitted/merged change. |
| 4888 | |
Gal Paikin | e2849a8 | 2021-04-19 13:41:10 +0200 | [diff] [blame] | 4889 | Submission may submit multiple changes, but we still only return one ChangeInfo |
| 4890 | object. To query for all submitted changes, please use the submission_id that is |
| 4891 | part of the response. |
| 4892 | |
| 4893 | Changes that will also be submitted: |
| 4894 | 1. All changes of the same topic if |
| 4895 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 4896 | configuration is set to true. |
| 4897 | 2. All dependent changes. |
| 4898 | 3. The closure of the above (e.g if a dependent change has a topic, all changes |
| 4899 | of *that* topic will also be submitted). |
| 4900 | |
Gal Paikin | 3d6cdec | 2021-04-19 13:32:13 +0200 | [diff] [blame] | 4901 | .Response |
| 4902 | ---- |
| 4903 | HTTP/1.1 200 OK |
| 4904 | Content-Disposition: attachment |
| 4905 | Content-Type: application/json; charset=UTF-8 |
| 4906 | |
| 4907 | )]}' |
| 4908 | { |
| 4909 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4910 | "project": "myProject", |
| 4911 | "branch": "master", |
| 4912 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4913 | "subject": "Implementing Feature X", |
| 4914 | "status": "MERGED", |
| 4915 | "created": "2013-02-01 09:59:32.126000000", |
| 4916 | "updated": "2013-02-21 11:16:36.775000000", |
| 4917 | "submitted": "2013-02-21 11:16:36.615000000", |
| 4918 | "_number": 3965, |
| 4919 | "owner": { |
| 4920 | "name": "John Doe" |
| 4921 | } |
| 4922 | } |
| 4923 | ---- |
| 4924 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4925 | If the revision cannot be submitted, e.g. because the submit rule |
| 4926 | doesn't allow submitting the revision or the revision is not the |
| 4927 | current revision, the response is "`409 Conflict`" and the error |
| 4928 | message is contained in the response body. |
| 4929 | |
| 4930 | .Response |
| 4931 | ---- |
| 4932 | HTTP/1.1 409 Conflict |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4933 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4934 | |
| 4935 | "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision" |
| 4936 | ---- |
| 4937 | |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4938 | [[get-patch]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4939 | === Get Patch |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4940 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4941 | '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] | 4942 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4943 | |
| 4944 | Gets the formatted patch for one revision. |
| 4945 | |
| 4946 | .Request |
| 4947 | ---- |
| 4948 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0 |
| 4949 | ---- |
| 4950 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4951 | The formatted patch is returned as text encoded inside base64: |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4952 | |
| 4953 | .Response |
| 4954 | ---- |
| 4955 | HTTP/1.1 200 OK |
| 4956 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4957 | Content-Type: text/plain; charset=ISO-8859-1 |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4958 | X-FYI-Content-Encoding: base64 |
| 4959 | X-FYI-Content-Type: application/mbox |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4960 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4961 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4962 | ---- |
| 4963 | |
David Ostrovsky | 973f38b | 2013-08-22 00:24:51 -0700 | [diff] [blame] | 4964 | Adding query parameter `zip` (for example `/changes/.../patch?zip`) |
| 4965 | returns the patch as a single file inside of a ZIP archive. Clients |
| 4966 | can expand the ZIP to obtain the plain text patch, avoiding the |
| 4967 | need for a base64 decoding step. This option implies `download`. |
| 4968 | |
| 4969 | Query parameter `download` (e.g. `/changes/.../patch?download`) |
| 4970 | will suggest the browser save the patch as `commitsha1.diff.base64`, |
| 4971 | for later processing by command line tools. |
| 4972 | |
Kasper Nilsson | 8144807 | 2016-10-17 15:04:33 -0700 | [diff] [blame] | 4973 | If the `path` parameter is set, the returned content is a diff of the single |
| 4974 | file that the path refers to. |
| 4975 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4976 | [[get-mergeable]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4977 | === Get Mergeable |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4978 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4979 | '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] | 4980 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4981 | |
| 4982 | Gets the method the server will use to submit (merge) the change and |
| 4983 | an indicator if the change is currently mergeable. |
| 4984 | |
| 4985 | .Request |
| 4986 | ---- |
| 4987 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0 |
| 4988 | ---- |
| 4989 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 4990 | As response a link:#mergeable-info[MergeableInfo] entity is returned. |
| 4991 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4992 | .Response |
| 4993 | ---- |
| 4994 | HTTP/1.1 200 OK |
| 4995 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4996 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4997 | |
| 4998 | )]}' |
| 4999 | { |
| 5000 | submit_type: "MERGE_IF_NECESSARY", |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 5001 | strategy: "recursive", |
| 5002 | mergeable: true |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 5003 | } |
| 5004 | ---- |
| 5005 | |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 5006 | If the `other-branches` parameter is specified, the mergeability will also be |
Zhen Chen | 6729b63 | 2016-11-11 17:32:32 -0800 | [diff] [blame] | 5007 | checked for all other branches which are listed in the |
| 5008 | link:config-project-config.html#branchOrder-section[branchOrder] section in the |
| 5009 | project.config file. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 5010 | |
| 5011 | .Request |
| 5012 | ---- |
| 5013 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0 |
| 5014 | ---- |
| 5015 | |
| 5016 | The response will then contain a list of all other branches where this changes |
| 5017 | could merge cleanly. |
| 5018 | |
| 5019 | .Response |
| 5020 | ---- |
| 5021 | HTTP/1.1 200 OK |
| 5022 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5023 | Content-Type: application/json; charset=UTF-8 |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 5024 | |
| 5025 | )]}' |
| 5026 | { |
| 5027 | submit_type: "MERGE_IF_NECESSARY", |
| 5028 | mergeable: true, |
| 5029 | mergeable_into: [ |
| 5030 | "refs/heads/stable-2.7", |
| 5031 | "refs/heads/stable-2.8", |
| 5032 | ] |
| 5033 | } |
| 5034 | ---- |
| 5035 | |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5036 | [[get-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5037 | === Get Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5038 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5039 | '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] | 5040 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5041 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5042 | Gets the method the server will use to submit (merge) the change. |
| 5043 | |
| 5044 | .Request |
| 5045 | ---- |
| 5046 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0 |
| 5047 | ---- |
| 5048 | |
| 5049 | .Response |
| 5050 | ---- |
| 5051 | HTTP/1.1 200 OK |
| 5052 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5053 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5054 | |
| 5055 | )]}' |
| 5056 | "MERGE_IF_NECESSARY" |
| 5057 | ---- |
| 5058 | |
| 5059 | [[test-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5060 | === Test Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5061 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5062 | '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] | 5063 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5064 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5065 | Tests the submit_type Prolog rule in the project, or the one given. |
| 5066 | |
| 5067 | Request body may be either the Prolog code as `text/plain` or a |
| 5068 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 5069 | may be set to `SKIP` to bypass parent project filters while testing |
| 5070 | a project-specific rule. |
| 5071 | |
| 5072 | .Request |
| 5073 | ---- |
| 5074 | 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] | 5075 | Content-Type: text/plain; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5076 | |
| 5077 | submit_type(cherry_pick). |
| 5078 | ---- |
| 5079 | |
| 5080 | .Response |
| 5081 | ---- |
| 5082 | HTTP/1.1 200 OK |
| 5083 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5084 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5085 | |
| 5086 | )]}' |
Shawn Pearce | 7076f4e | 2013-08-20 22:11:51 -0700 | [diff] [blame] | 5087 | "CHERRY_PICK" |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5088 | ---- |
| 5089 | |
| 5090 | [[test-submit-rule]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5091 | === Test Submit Rule |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5092 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5093 | '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] | 5094 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5095 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5096 | Tests the submit_rule Prolog rule in the project, or the one given. |
| 5097 | |
| 5098 | Request body may be either the Prolog code as `text/plain` or a |
| 5099 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 5100 | may be set to `SKIP` to bypass parent project filters while testing |
| 5101 | a project-specific rule. |
| 5102 | |
| 5103 | .Request |
| 5104 | ---- |
Shawn Pearce | a3cce71 | 2014-03-21 08:16:11 -0700 | [diff] [blame] | 5105 | 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] | 5106 | Content-Type: text/plain; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5107 | |
| 5108 | submit_rule(submit(R)) :- |
| 5109 | R = label('Any-Label-Name', reject(_)). |
| 5110 | ---- |
| 5111 | |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 5112 | The response is a link:#submit-record[SubmitRecord] describing the |
| 5113 | permutations that satisfy the tested submit rule. |
| 5114 | |
David Pursehouse | 87a3fb0 | 2019-10-29 16:01:27 +0900 | [diff] [blame] | 5115 | 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] | 5116 | |
| 5117 | .Response |
| 5118 | ---- |
| 5119 | HTTP/1.1 200 OK |
| 5120 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5121 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5122 | |
| 5123 | )]}' |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 5124 | { |
| 5125 | "status": "NOT_READY", |
| 5126 | "reject": { |
| 5127 | "Any-Label-Name": {} |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5128 | } |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 5129 | } |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5130 | ---- |
| 5131 | |
Shawn Pearce | b42e303 | 2015-04-02 10:28:10 -0700 | [diff] [blame] | 5132 | When testing with the `curl` command line client the |
| 5133 | `--data-binary @rules.pl` flag should be used to ensure |
| 5134 | all LFs are included in the Prolog code: |
| 5135 | |
| 5136 | ---- |
| 5137 | curl -X POST \ |
| 5138 | -H 'Content-Type: text/plain; charset=UTF-8' \ |
| 5139 | --data-binary @rules.pl \ |
| 5140 | http://.../test.submit_rule |
| 5141 | ---- |
| 5142 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5143 | [[list-drafts]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 5144 | === List Revision Drafts |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5145 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5146 | '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] | 5147 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5148 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5149 | Lists the draft comments of a revision that belong to the calling |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5150 | user. |
| 5151 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 5152 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 5153 | entries. The entries in the map are sorted by file path. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5154 | |
| 5155 | .Request |
| 5156 | ---- |
| 5157 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0 |
| 5158 | ---- |
| 5159 | |
| 5160 | .Response |
| 5161 | ---- |
| 5162 | HTTP/1.1 200 OK |
| 5163 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5164 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5165 | |
| 5166 | )]}' |
| 5167 | { |
| 5168 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5169 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5170 | "id": "TvcXrmjM", |
| 5171 | "line": 23, |
| 5172 | "message": "[nit] trailing whitespace", |
| 5173 | "updated": "2013-02-26 15:40:43.986000000" |
| 5174 | }, |
| 5175 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5176 | "id": "TveXwFiA", |
| 5177 | "line": 49, |
| 5178 | "in_reply_to": "TfYX-Iuo", |
| 5179 | "message": "Done", |
| 5180 | "updated": "2013-02-26 15:40:45.328000000" |
| 5181 | } |
| 5182 | ] |
| 5183 | } |
| 5184 | ---- |
| 5185 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5186 | [[create-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5187 | === Create Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5188 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5189 | '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] | 5190 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5191 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5192 | Creates a draft comment on a revision. |
| 5193 | |
| 5194 | The new draft comment must be provided in the request body inside a |
| 5195 | link:#comment-input[CommentInput] entity. |
| 5196 | |
| 5197 | .Request |
| 5198 | ---- |
| 5199 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5200 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5201 | |
| 5202 | { |
| 5203 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5204 | "line": 23, |
| 5205 | "message": "[nit] trailing whitespace" |
| 5206 | } |
| 5207 | ---- |
| 5208 | |
| 5209 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5210 | describes the draft comment. |
| 5211 | |
| 5212 | .Response |
| 5213 | ---- |
| 5214 | HTTP/1.1 200 OK |
| 5215 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5216 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5217 | |
| 5218 | )]}' |
| 5219 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5220 | "id": "TvcXrmjM", |
| 5221 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5222 | "line": 23, |
| 5223 | "message": "[nit] trailing whitespace", |
| 5224 | "updated": "2013-02-26 15:40:43.986000000" |
| 5225 | } |
| 5226 | ---- |
| 5227 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5228 | [[get-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5229 | === Get Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5230 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5231 | '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] | 5232 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5233 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5234 | Retrieves a draft comment of a revision that belongs to the calling |
| 5235 | user. |
| 5236 | |
| 5237 | .Request |
| 5238 | ---- |
| 5239 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 5240 | ---- |
| 5241 | |
| 5242 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5243 | describes the draft comment. |
| 5244 | |
| 5245 | .Response |
| 5246 | ---- |
| 5247 | HTTP/1.1 200 OK |
| 5248 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5249 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5250 | |
| 5251 | )]}' |
| 5252 | { |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5253 | "id": "TvcXrmjM", |
| 5254 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5255 | "line": 23, |
| 5256 | "message": "[nit] trailing whitespace", |
| 5257 | "updated": "2013-02-26 15:40:43.986000000" |
| 5258 | } |
| 5259 | ---- |
| 5260 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5261 | [[update-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5262 | === Update Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5263 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5264 | '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] | 5265 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5266 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5267 | Updates a draft comment on a revision. |
| 5268 | |
| 5269 | The new draft comment must be provided in the request body inside a |
| 5270 | link:#comment-input[CommentInput] entity. |
| 5271 | |
| 5272 | .Request |
| 5273 | ---- |
| 5274 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5275 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5276 | |
| 5277 | { |
| 5278 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5279 | "line": 23, |
| 5280 | "message": "[nit] trailing whitespace" |
| 5281 | } |
| 5282 | ---- |
| 5283 | |
| 5284 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5285 | describes the draft comment. |
| 5286 | |
| 5287 | .Response |
| 5288 | ---- |
| 5289 | HTTP/1.1 200 OK |
| 5290 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5291 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5292 | |
| 5293 | )]}' |
| 5294 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5295 | "id": "TvcXrmjM", |
| 5296 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5297 | "line": 23, |
| 5298 | "message": "[nit] trailing whitespace", |
| 5299 | "updated": "2013-02-26 15:40:43.986000000" |
| 5300 | } |
| 5301 | ---- |
| 5302 | |
| 5303 | [[delete-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5304 | === Delete Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5305 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5306 | '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] | 5307 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5308 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5309 | Deletes a draft comment from a revision. |
| 5310 | |
| 5311 | .Request |
| 5312 | ---- |
| 5313 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 5314 | ---- |
| 5315 | |
| 5316 | .Response |
| 5317 | ---- |
| 5318 | HTTP/1.1 204 No Content |
| 5319 | ---- |
| 5320 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5321 | [[list-comments]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 5322 | === List Revision Comments |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5323 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5324 | '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] | 5325 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5326 | |
| 5327 | Lists the published comments of a revision. |
| 5328 | |
| 5329 | As result a map is returned that maps the file path to a list of |
| 5330 | link:#comment-info[CommentInfo] entries. The entries in the map are |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 5331 | sorted by file path and only include file (or inline) comments. Use |
| 5332 | the link:#get-change-detail[Get Change Detail] endpoint to retrieve |
| 5333 | the general change message (or comment). |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5334 | |
| 5335 | .Request |
| 5336 | ---- |
| 5337 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0 |
| 5338 | ---- |
| 5339 | |
| 5340 | .Response |
| 5341 | ---- |
| 5342 | HTTP/1.1 200 OK |
| 5343 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5344 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5345 | |
| 5346 | )]}' |
| 5347 | { |
| 5348 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5349 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5350 | "id": "TvcXrmjM", |
| 5351 | "line": 23, |
| 5352 | "message": "[nit] trailing whitespace", |
| 5353 | "updated": "2013-02-26 15:40:43.986000000", |
| 5354 | "author": { |
| 5355 | "_account_id": 1000096, |
| 5356 | "name": "John Doe", |
| 5357 | "email": "john.doe@example.com" |
| 5358 | } |
| 5359 | }, |
| 5360 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5361 | "id": "TveXwFiA", |
| 5362 | "line": 49, |
| 5363 | "in_reply_to": "TfYX-Iuo", |
| 5364 | "message": "Done", |
| 5365 | "updated": "2013-02-26 15:40:45.328000000", |
| 5366 | "author": { |
| 5367 | "_account_id": 1000097, |
| 5368 | "name": "Jane Roe", |
| 5369 | "email": "jane.roe@example.com" |
| 5370 | } |
| 5371 | } |
| 5372 | ] |
| 5373 | } |
| 5374 | ---- |
| 5375 | |
| 5376 | [[get-comment]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5377 | === Get Comment |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5378 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5379 | '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] | 5380 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5381 | |
| 5382 | Retrieves a published comment of a revision. |
| 5383 | |
| 5384 | .Request |
| 5385 | ---- |
| 5386 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0 |
| 5387 | ---- |
| 5388 | |
| 5389 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5390 | describes the published comment. |
| 5391 | |
| 5392 | .Response |
| 5393 | ---- |
| 5394 | HTTP/1.1 200 OK |
| 5395 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5396 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5397 | |
| 5398 | )]}' |
| 5399 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5400 | "id": "TvcXrmjM", |
| 5401 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5402 | "line": 23, |
| 5403 | "message": "[nit] trailing whitespace", |
| 5404 | "updated": "2013-02-26 15:40:43.986000000", |
| 5405 | "author": { |
| 5406 | "_account_id": 1000096, |
| 5407 | "name": "John Doe", |
| 5408 | "email": "john.doe@example.com" |
| 5409 | } |
| 5410 | } |
| 5411 | ---- |
| 5412 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5413 | [[delete-comment]] |
| 5414 | === Delete Comment |
| 5415 | -- |
| 5416 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' + |
| 5417 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete' |
| 5418 | -- |
| 5419 | |
| 5420 | Deletes a published comment of a revision. Instead of deleting the |
| 5421 | whole comment, this endpoint just replaces the comment's message |
| 5422 | 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] | 5423 | the comment and the reason why it's deleted. |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5424 | |
Gal Paikin | 8d02723 | 2021-12-09 12:39:19 +0100 | [diff] [blame] | 5425 | This endpoint also marks the comment as resolved since deleted comments are not |
| 5426 | actionable. |
| 5427 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5428 | Note that only users with the |
| 5429 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 5430 | global capability are permitted to delete a comment. |
| 5431 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 5432 | Deletion reason can be provided in the request body as a |
| 5433 | link:#delete-comment-input[DeleteCommentInput] entity. |
| 5434 | 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] | 5435 | 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] | 5436 | In this case, use a POST request instead: |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5437 | |
| 5438 | .Request |
| 5439 | ---- |
| 5440 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0 |
| 5441 | Content-Type: application/json; charset=UTF-8 |
| 5442 | |
| 5443 | { |
| 5444 | "reason": "contains confidential information" |
| 5445 | } |
| 5446 | ---- |
| 5447 | |
| 5448 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5449 | describes the updated comment. |
| 5450 | |
| 5451 | .Response |
| 5452 | ---- |
| 5453 | HTTP/1.1 200 OK |
| 5454 | Content-Disposition: attachment |
| 5455 | Content-Type: application/json; charset=UTF-8 |
| 5456 | |
| 5457 | )]}' |
| 5458 | { |
| 5459 | "id": "TvcXrmjM", |
| 5460 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5461 | "line": 23, |
| 5462 | "message": "Comment removed by: Administrator; Reason: contains confidential information", |
| 5463 | "updated": "2013-02-26 15:40:43.986000000", |
| 5464 | "author": { |
| 5465 | "_account_id": 1000096, |
| 5466 | "name": "John Doe", |
| 5467 | "email": "john.doe@example.com" |
| 5468 | } |
| 5469 | } |
| 5470 | ---- |
| 5471 | |
Edwin Kempin | b050a48 | 2016-12-01 09:11:19 +0100 | [diff] [blame] | 5472 | [[list-robot-comments]] |
Patrick Hiesel | ad9efd4 | 2024-01-18 15:16:20 +0100 | [diff] [blame] | 5473 | === List Robot Comments (deprecated) |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5474 | -- |
| 5475 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/' |
| 5476 | -- |
| 5477 | |
| 5478 | Lists the link:config-robot-comments.html[robot comments] of a |
| 5479 | revision. |
| 5480 | |
| 5481 | As result a map is returned that maps the file path to a list of |
| 5482 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 5483 | map are sorted by file path. |
| 5484 | |
| 5485 | .Request |
| 5486 | ---- |
| 5487 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0 |
| 5488 | ---- |
| 5489 | |
| 5490 | .Response |
| 5491 | ---- |
| 5492 | HTTP/1.1 200 OK |
| 5493 | Content-Disposition: attachment |
| 5494 | Content-Type: application/json; charset=UTF-8 |
| 5495 | |
| 5496 | )]}' |
| 5497 | { |
| 5498 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5499 | { |
| 5500 | "id": "TvcXrmjM", |
| 5501 | "line": 23, |
| 5502 | "message": "unused import", |
| 5503 | "updated": "2016-02-26 15:40:43.986000000", |
| 5504 | "author": { |
| 5505 | "_account_id": 1000110, |
| 5506 | "name": "Code Analyzer", |
| 5507 | "email": "code.analyzer@example.com" |
| 5508 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 5509 | "robot_id": "importChecker", |
| 5510 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5511 | }, |
| 5512 | { |
| 5513 | "id": "TveXwFiA", |
| 5514 | "line": 49, |
| 5515 | "message": "wrong indention", |
| 5516 | "updated": "2016-02-26 15:40:45.328000000", |
| 5517 | "author": { |
| 5518 | "_account_id": 1000110, |
| 5519 | "name": "Code Analyzer", |
| 5520 | "email": "code.analyzer@example.com" |
| 5521 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 5522 | "robot_id": "styleChecker", |
| 5523 | "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5524 | } |
| 5525 | ] |
| 5526 | } |
| 5527 | ---- |
| 5528 | |
| 5529 | [[get-robot-comment]] |
Patrick Hiesel | ad9efd4 | 2024-01-18 15:16:20 +0100 | [diff] [blame] | 5530 | === Get Robot Comment (deprecated) |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5531 | -- |
| 5532 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]' |
| 5533 | -- |
| 5534 | |
| 5535 | Retrieves a link:config-robot-comments.html[robot comment] of a |
| 5536 | revision. |
| 5537 | |
| 5538 | .Request |
| 5539 | ---- |
| 5540 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0 |
| 5541 | ---- |
| 5542 | |
| 5543 | As response a link:#robot-comment-info[RobotCommentInfo] entity is |
| 5544 | returned that describes the robot comment. |
| 5545 | |
| 5546 | .Response |
| 5547 | ---- |
| 5548 | HTTP/1.1 200 OK |
| 5549 | Content-Disposition: attachment |
| 5550 | Content-Type: application/json; charset=UTF-8 |
| 5551 | |
| 5552 | )]}' |
| 5553 | { |
| 5554 | "id": "TvcXrmjM", |
| 5555 | "line": 23, |
| 5556 | "message": "unused import", |
| 5557 | "updated": "2016-02-26 15:40:43.986000000", |
| 5558 | "author": { |
| 5559 | "_account_id": 1000110, |
| 5560 | "name": "Code Analyzer", |
| 5561 | "email": "code.analyzer@example.com" |
| 5562 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 5563 | "robot_id": "importChecker", |
| 5564 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5565 | } |
| 5566 | ---- |
| 5567 | |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5568 | [[list-ported-comments]] |
| 5569 | === List Ported Comments |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5570 | -- |
| 5571 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_comments' |
| 5572 | -- |
| 5573 | |
| 5574 | Ports comments of other revisions to the requested revision. |
| 5575 | |
| 5576 | Only comments added on earlier patchsets are ported. That set of comments is filtered even further |
| 5577 | due to some additional rules. Callers of this endpoint shouldn't rely on the exact logic of which |
| 5578 | comments are ported as that logic might change in the future. Instead, callers must be able to |
| 5579 | handle any smaller/larger set of comments returned by this endpoint. |
| 5580 | |
| 5581 | Typically, a comment thread is returned fully or excluded fully. However, draft comments and |
| 5582 | robot comments are ignored and not returned via this endpoint. Hence, it's possible to get ported |
| 5583 | comments from this endpoint which are a reply to a non-ported robot comment. Callers must be |
| 5584 | able to deal with this situation. |
| 5585 | |
| 5586 | The returned comments are organized in a map of file path to link:#comment-info[CommentInfo] entries |
| 5587 | in the same fashion as for the link:#list-comments[List Revision Comments] endpoint. |
| 5588 | The map is filled with the original comment attributes except for these attributes: `path`, `line`, |
| 5589 | and `range` point to the computed position in the target revision. If the exactly correct position |
| 5590 | can't be determined, those fields will be filled with the next best position. That can also mean |
| 5591 | not filling the `line` or `range` attribute anymore and thus converting the comment to a file |
| 5592 | comment (or even moving the comment to a different file or the patchset level). Callers of this |
| 5593 | endpoint must be able to deal with this and not rely on the original comment position. |
| 5594 | |
| 5595 | It's possible that this endpoint returns different link:#comment-info[CommentInfo] entries with |
| 5596 | the same comment UUID. This is not a bug but a feature. If a comment appears on a file which Gerrit |
| 5597 | recognizes as copied between patchsets, the ported version of this comment consists of two ported |
| 5598 | instances having the same UUID but different `file`/`line`/`range` positions. Callers must be able |
| 5599 | to handle this situation. |
| 5600 | |
| 5601 | Repeated calls of this endpoint might produce different results. Internal errors during the |
| 5602 | position computation are mapped to fallback locations for affected comments. Those errors might |
| 5603 | have vanished on later calls, upon which this endpoint returns the actually mapped position. In |
| 5604 | addition, comments can be deleted and draft comments can be published, upon which the set of ported |
| 5605 | comments may change. |
| 5606 | |
| 5607 | .Request |
| 5608 | ---- |
| 5609 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/4/ported_comments/ HTTP/1.0 |
| 5610 | ---- |
| 5611 | |
| 5612 | .Response |
| 5613 | ---- |
| 5614 | HTTP/1.1 200 OK |
| 5615 | Content-Disposition: attachment |
| 5616 | Content-Type: application/json; charset=UTF-8 |
| 5617 | |
| 5618 | )]}' |
| 5619 | { |
| 5620 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5621 | { |
| 5622 | "id": "TvcXrmjM", |
| 5623 | "patch_set": 2, |
| 5624 | "line": 23, |
| 5625 | "message": "[nit] trailing whitespace", |
| 5626 | "updated": "2013-02-26 15:40:43.986000000", |
| 5627 | "author": { |
| 5628 | "_account_id": 1000096, |
| 5629 | "name": "John Doe", |
| 5630 | "email": "john.doe@example.com" |
| 5631 | }, |
| 5632 | "unresolved": true |
| 5633 | }, |
| 5634 | { |
| 5635 | "id": "TveXwFiA", |
| 5636 | "patch_set": 2, |
| 5637 | "line": 23, |
| 5638 | "in_reply_to": "TvcXrmjM", |
| 5639 | "message": "Done", |
| 5640 | "updated": "2013-02-26 15:40:45.328000000", |
| 5641 | "author": { |
| 5642 | "_account_id": 1000097, |
| 5643 | "name": "Jane Roe", |
| 5644 | "email": "jane.roe@example.com" |
| 5645 | }, |
| 5646 | "unresolved": true |
| 5647 | } |
| 5648 | ] |
| 5649 | } |
| 5650 | ---- |
| 5651 | |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5652 | [[list-ported-drafts]] |
| 5653 | === List Ported Drafts |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5654 | -- |
| 5655 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_drafts' |
| 5656 | -- |
| 5657 | |
| 5658 | Ports draft comments of other revisions to the requested revision. |
| 5659 | |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5660 | This endpoint behaves similarly to the link:#list-ported-comments[List Ported Comments] endpoint. |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5661 | With this endpoint, only draft comments of the calling user are ported, though. If a draft comment |
| 5662 | is a reply to a published comment, only the ported draft comment is returned. |
| 5663 | |
| 5664 | Depending on the filtering rules, it's possible that this endpoint returns a draft comment which is |
| 5665 | a reply to a comment thread which is not returned by the |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5666 | link:#list-ported-comments[List Ported Comments] endpoint. That's intended behavior. Callers must be |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5667 | able to handle this situation. The same holds for drafts which are a reply to a robot comment. |
| 5668 | |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5669 | Different than the link:#list-ported-comments[List Ported Comments] endpoint, the `author` of the |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5670 | returned comments is not filled for this endpoint as only comments of the calling user are returned. |
| 5671 | |
Patrick Hiesel | afd6c70 | 2020-11-06 10:21:47 +0100 | [diff] [blame] | 5672 | This endpoint requires authentication. |
| 5673 | |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5674 | .Request |
| 5675 | ---- |
| 5676 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/ported_drafts/ HTTP/1.0 |
| 5677 | ---- |
| 5678 | |
| 5679 | .Response |
| 5680 | ---- |
| 5681 | HTTP/1.1 200 OK |
| 5682 | Content-Disposition: attachment |
| 5683 | Content-Type: application/json; charset=UTF-8 |
| 5684 | |
| 5685 | )]}' |
| 5686 | { |
| 5687 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5688 | { |
| 5689 | "id": "TveXwFiA", |
| 5690 | "patch_set": 2, |
| 5691 | "line": 23, |
| 5692 | "in_reply_to": "TvcXrmjM", |
| 5693 | "message": "Done", |
| 5694 | "updated": "2013-02-26 15:40:45.328000000", |
| 5695 | "unresolved": true |
| 5696 | } |
| 5697 | ] |
| 5698 | } |
| 5699 | ---- |
| 5700 | |
Sharad Bagri | 3f6ed64 | 2022-06-06 12:41:57 -0700 | [diff] [blame] | 5701 | [[apply-stored-fix]] |
| 5702 | === Apply Stored Fix |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5703 | -- |
| 5704 | 'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply' |
| 5705 | -- |
| 5706 | |
| 5707 | Applies a suggested fix by creating a change edit which includes the |
| 5708 | modifications indicated by the fix suggestion. If a change edit already exists, |
| 5709 | it will be updated accordingly. A fix can only be applied if no change edit |
| 5710 | exists and the fix refers to the current patch set, or the fix refers to the |
| 5711 | patch set on which the change edit is based. |
| 5712 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 5713 | If one of the secondary emails associated with the user performing the operation was used as the |
| 5714 | committer email in the current patch set, the same email will be used as the committer email in the |
| 5715 | new change edit commit; otherwise, the user's preferred email will be used. |
| 5716 | |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5717 | .Request |
| 5718 | ---- |
| 5719 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0 |
| 5720 | ---- |
| 5721 | |
| 5722 | If the fix was successfully applied, an <<edit-info,EditInfo>> describing the |
| 5723 | resulting change edit is returned. |
| 5724 | |
| 5725 | .Response |
| 5726 | ---- |
| 5727 | HTTP/1.1 200 OK |
| 5728 | Content-Disposition: attachment |
| 5729 | Content-Type: application/json; charset=UTF-8 |
| 5730 | |
| 5731 | )]}' |
| 5732 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5733 | "commit": { |
| 5734 | "parents": [ |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5735 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5736 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5737 | } |
| 5738 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5739 | "author": { |
| 5740 | "name": "John Doe", |
| 5741 | "email": "john.doe@example.com", |
| 5742 | "date": "2013-05-07 15:21:27.000000000", |
| 5743 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5744 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5745 | "committer": { |
| 5746 | "name": "Jane Doe", |
| 5747 | "email": "jane.doe@example.com", |
| 5748 | "date": "2013-05-07 15:35:43.000000000", |
| 5749 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5750 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5751 | "subject": "Implement feature X", |
| 5752 | "message": "Implement feature X\n\nWith this feature ..." |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5753 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5754 | "base_patch_set_number": 1, |
| 5755 | "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1" |
| 5756 | "ref": "refs/users/01/1000001/edit-42622/1" |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5757 | } |
| 5758 | ---- |
| 5759 | |
| 5760 | If the application failed e.g. due to conflicts with an existing change edit, |
| 5761 | the response "`409 Conflict`" including an error message in the response body |
| 5762 | is returned. |
| 5763 | |
| 5764 | .Response |
| 5765 | ---- |
| 5766 | HTTP/1.1 409 Conflict |
| 5767 | Content-Disposition: attachment |
| 5768 | Content-Type: text/plain; charset=UTF-8 |
| 5769 | |
| 5770 | The existing change edit could not be merged with another tree. |
| 5771 | ---- |
| 5772 | |
Sharad Bagri | bdb582d | 2022-03-26 01:32:35 -0700 | [diff] [blame] | 5773 | [[apply-provided-fix]] |
| 5774 | ==== Apply Provided Fix |
| 5775 | -- |
| 5776 | 'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:apply' |
| 5777 | -- |
| 5778 | Applies a list of <<fix-replacement-info,FixReplacementInfo>> loaded from the |
| 5779 | <<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the request body. The |
| 5780 | application of the fixes creates a new change edit. `Apply Provided Fix` can only be applied on the current |
| 5781 | patchset. |
| 5782 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 5783 | If one of the secondary emails associated with the user performing the operation was used as the |
| 5784 | committer email in the current patch set, the same email will be used as the committer email in the |
| 5785 | new change edit commit; otherwise, the user's preferred email will be used. |
| 5786 | |
Sharad Bagri | bdb582d | 2022-03-26 01:32:35 -0700 | [diff] [blame] | 5787 | .Request |
| 5788 | ---- |
| 5789 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fix:apply HTTP/1.0 |
| 5790 | Content-Type: application/json; charset=UTF-8 |
| 5791 | |
| 5792 | { |
| 5793 | "fix_replacement_infos": [ |
| 5794 | { |
| 5795 | "path": "abcd.txt", |
| 5796 | "range": { |
| 5797 | "start_line": 2, |
| 5798 | "start_character": 2, |
| 5799 | "end_line": 2, |
| 5800 | "end_character": 5 |
| 5801 | }, |
| 5802 | "replacement": "abcdefg" |
| 5803 | } |
| 5804 | ] |
| 5805 | } |
| 5806 | ---- |
| 5807 | |
| 5808 | If the `ApplyProvidedFixInput` was successfully applied, an link:#edit-info[EditInfo] describing the |
| 5809 | resulting change edit is returned. |
| 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 | "commit": { |
| 5820 | "commit": "bd43e48c33d2b1a03485040eba38cefc505f7997", |
| 5821 | "parents": [ |
| 5822 | { |
| 5823 | "commit": "9825962f8ab6da89afebad3f5034db05fb4b7560" |
| 5824 | } |
| 5825 | ], |
| 5826 | "author": { |
| 5827 | "name": "John Doe", |
| 5828 | "email": "john.doe@example.com", |
| 5829 | "date": "2022-05-07 15:21:27.000000000", |
| 5830 | "tz": 120 |
| 5831 | }, |
| 5832 | "committer": { |
| 5833 | "name": "Jane Doe", |
| 5834 | "email": "jane.doe@example.com", |
| 5835 | "date": "2022-05-07 15:35:43.000000000", |
| 5836 | "tz": 120 |
| 5837 | }, |
| 5838 | "subject": "Implement feature X", |
| 5839 | "message": "Implement feature X\n\nWith this feature ..." |
| 5840 | }, |
| 5841 | "base_patch_set_number": 1, |
| 5842 | "base_revision": "86d87686ce0ef7f7c536bfc7e9a66f5a6fa5d658", |
| 5843 | "ref": "refs/users/01/1000001/edit-1/1" |
| 5844 | } |
| 5845 | ---- |
| 5846 | |
| 5847 | If the application failed due to presence of an existing change edit, |
| 5848 | the response "`400 Bad Request`" including an error message in the response body |
| 5849 | is returned. |
| 5850 | |
| 5851 | .Response |
| 5852 | ---- |
| 5853 | HTTP/1.1 400 Bad Request |
| 5854 | Content-Disposition: attachment |
| 5855 | Content-Type: text/plain; charset=UTF-8 |
| 5856 | |
| 5857 | Change edit already exists. A new change edit can't be created |
| 5858 | ---- |
| 5859 | |
| 5860 | If the application failed due to application on a previous patch set, the response |
| 5861 | "`409 Conflict`" including an error message in the response body is returned. |
| 5862 | |
| 5863 | .Response |
| 5864 | ---- |
| 5865 | HTTP/1.1 409 Conflict |
| 5866 | Content-Disposition: attachment |
| 5867 | Content-Type: text/plain; charset=UTF-8 |
| 5868 | |
| 5869 | A change edit may only be created for the current patch set 1,2 (and not for 1,1) |
| 5870 | ---- |
| 5871 | |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5872 | [[list-files]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5873 | === List Files |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5874 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5875 | '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] | 5876 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5877 | |
| 5878 | Lists the files that were modified, added or deleted in a revision. |
| 5879 | |
| 5880 | .Request |
| 5881 | ---- |
| 5882 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0 |
| 5883 | ---- |
| 5884 | |
Makson Lee | faf05c2 | 2018-07-26 22:42:59 +0000 | [diff] [blame] | 5885 | As result a map is returned that maps the link:#file-id[file path] to a |
| 5886 | link:#file-info[FileInfo] entry. The entries in the map are |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5887 | sorted by file path. |
| 5888 | |
| 5889 | .Response |
| 5890 | ---- |
| 5891 | HTTP/1.1 200 OK |
| 5892 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5893 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5894 | |
| 5895 | )]}' |
| 5896 | { |
| 5897 | "/COMMIT_MSG": { |
| 5898 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 5899 | "lines_inserted": 7, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 5900 | "size_delta": 551, |
| 5901 | "size": 551 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5902 | }, |
| 5903 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": { |
| 5904 | "lines_inserted": 5, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 5905 | "lines_deleted": 3, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 5906 | "size_delta": 98, |
| 5907 | "size": 23348 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5908 | } |
| 5909 | } |
| 5910 | ---- |
| 5911 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5912 | The request parameter `reviewed` changes the response to return a list |
| 5913 | of the paths the caller has marked as reviewed. Clients that also |
| 5914 | need the FileInfo should make two requests. |
| 5915 | |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 5916 | The request parameter `q` changes the response to return a list |
| 5917 | of all files (modified or unmodified) that contain that substring |
| 5918 | in the path name. This is useful to implement suggestion services |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 5919 | finding a file by partial name. Clients that also need the FileInfo |
| 5920 | should make two requests. |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 5921 | |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 5922 | For merge commits only, the integer-valued request parameter `parent` |
| 5923 | changes the response to return a map of the files which are different |
| 5924 | 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] | 5925 | 1-based index of the parent's position in the commit object, |
| 5926 | with the first parent always belonging to the target branch. If not |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 5927 | specified, the response contains a map of the files different in the |
| 5928 | auto merge result. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 5929 | |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 5930 | The request parameter `base` changes the response to return a map of the |
| 5931 | files which are different in this commit compared to the given revision. The |
| 5932 | revision must correspond to a patch set in the change. |
| 5933 | |
| 5934 | The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive. |
| 5935 | That is, only one of them may be used at a time. |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5936 | |
| 5937 | .Request |
| 5938 | ---- |
| 5939 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0 |
| 5940 | ---- |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5941 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5942 | .Response |
| 5943 | ---- |
| 5944 | HTTP/1.1 200 OK |
| 5945 | Content-Disposition: attachment |
| 5946 | Content-Type: application/json; charset=UTF-8 |
| 5947 | |
| 5948 | )]}' |
| 5949 | [ |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5950 | "/COMMIT_MSG", |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5951 | "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] | 5952 | ] |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5953 | ---- |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5954 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5955 | [[get-content]] |
| 5956 | === Get Content |
| 5957 | -- |
| 5958 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content' |
| 5959 | -- |
| 5960 | |
| 5961 | Gets the content of a file from a certain revision. |
| 5962 | |
Patrick Hiesel | 38667d4 | 2017-05-02 13:12:48 +0200 | [diff] [blame] | 5963 | The optional, integer-valued `parent` parameter can be specified to request |
| 5964 | the named file from a parent commit of the specified revision. The value is |
| 5965 | the 1-based index of the parent's position in the commit object. If the |
| 5966 | parameter is omitted or the value is non-positive, the patch set is referenced. |
| 5967 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5968 | .Request |
| 5969 | ---- |
| 5970 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0 |
| 5971 | ---- |
| 5972 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5973 | The content is returned as base64 encoded string. The HTTP response |
| 5974 | Content-Type is always `text/plain`, reflecting the base64 wrapping. |
| 5975 | A Gerrit-specific `X-FYI-Content-Type` header is returned describing |
| 5976 | the server detected content type of the file. |
| 5977 | |
| 5978 | If only the content type is required, callers should use HEAD to |
| 5979 | avoid downloading the encoded file contents. |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5980 | |
| 5981 | .Response |
| 5982 | ---- |
| 5983 | HTTP/1.1 200 OK |
| 5984 | Content-Disposition: attachment |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5985 | Content-Type: text/plain; charset=ISO-8859-1 |
| 5986 | X-FYI-Content-Encoding: base64 |
| 5987 | X-FYI-Content-Type: text/xml |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5988 | |
| 5989 | Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY... |
| 5990 | ---- |
| 5991 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 5992 | Alternatively, if the only value of the Accept request header is |
| 5993 | `application/json` the content is returned as JSON string and |
| 5994 | `X-FYI-Content-Encoding` is set to `json`. |
| 5995 | |
David Pletcher | d1efb45 | 2015-09-01 17:45:55 -0700 | [diff] [blame] | 5996 | [[get-safe-content]] |
| 5997 | === Download Content |
| 5998 | -- |
| 5999 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download' |
| 6000 | -- |
| 6001 | |
| 6002 | Downloads the content of a file from a certain revision, in a safe format |
| 6003 | that poses no risk for inadvertent execution of untrusted code. |
| 6004 | |
| 6005 | If the content type is defined as safe, the binary file content is returned |
| 6006 | verbatim. If the content type is not safe, the file is stored inside a ZIP |
| 6007 | file, containing a single entry with a random, unpredictable name having the |
| 6008 | same base and suffix as the true filename. The ZIP file is returned in |
| 6009 | verbatim binary form. |
| 6010 | |
| 6011 | See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation] |
| 6012 | for information about safe file type configuration. |
| 6013 | |
| 6014 | The HTTP resource Content-Type is dependent on the file type: the |
| 6015 | applicable type for safe files, or "application/zip" for unsafe files. |
| 6016 | |
David Pletcher | ec622bf | 2015-09-18 14:30:05 -0700 | [diff] [blame] | 6017 | The optional, integer-valued `parent` parameter can be specified to request |
| 6018 | the named file from a parent commit of the specified revision. The value is |
| 6019 | the 1-based index of the parent's position in the commit object. If the |
| 6020 | parameter is omitted or the value non-positive, the patch set is referenced. |
| 6021 | |
| 6022 | Filenames are decorated with a suffix of `_new` for the current patch, |
| 6023 | `_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] | 6024 | |
| 6025 | .Request |
| 6026 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 6027 | 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] | 6028 | ---- |
| 6029 | |
| 6030 | .Response |
| 6031 | ---- |
| 6032 | HTTP/1.1 200 OK |
| 6033 | Content-Disposition: attachment; filename="logo.png" |
| 6034 | Content-Type: image/png |
| 6035 | |
| 6036 | `[binary data for logo.png]` |
| 6037 | ---- |
| 6038 | |
| 6039 | .Request |
| 6040 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 6041 | 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] | 6042 | ---- |
| 6043 | |
| 6044 | .Response |
| 6045 | ---- |
| 6046 | HTTP/1.1 200 OK |
| 6047 | Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip" |
| 6048 | Content-Type:application/zip |
| 6049 | |
| 6050 | `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]` |
| 6051 | ---- |
| 6052 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6053 | [[get-diff]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6054 | === Get Diff |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 6055 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6056 | '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] | 6057 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6058 | |
| 6059 | Gets the diff of a file from a certain revision. |
| 6060 | |
| 6061 | .Request |
| 6062 | ---- |
| 6063 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0 |
| 6064 | ---- |
| 6065 | |
| 6066 | As response a link:#diff-info[DiffInfo] entity is returned that describes the diff. |
| 6067 | |
| 6068 | .Response |
| 6069 | ---- |
| 6070 | HTTP/1.1 200 OK |
| 6071 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 6072 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6073 | |
| 6074 | )] |
| 6075 | { |
| 6076 | "meta_a": { |
| 6077 | "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] | 6078 | "content_type": "text/x-java-source", |
| 6079 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6080 | }, |
| 6081 | "meta_b": { |
| 6082 | "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] | 6083 | "content_type": "text/x-java-source", |
| 6084 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6085 | }, |
| 6086 | "change_type": "MODIFIED", |
| 6087 | "diff_header": [ |
| 6088 | "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", |
| 6089 | "index 59b7670..9faf81c 100644", |
| 6090 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 6091 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 6092 | ], |
| 6093 | "content": [ |
| 6094 | { |
| 6095 | "ab": [ |
| 6096 | "// Copyright (C) 2010 The Android Open Source Project", |
| 6097 | "//", |
| 6098 | "// Licensed under the Apache License, Version 2.0 (the \"License\");", |
| 6099 | "// you may not use this file except in compliance with the License.", |
| 6100 | "// You may obtain a copy of the License at", |
| 6101 | "//", |
| 6102 | "// http://www.apache.org/licenses/LICENSE-2.0", |
| 6103 | "//", |
| 6104 | "// Unless required by applicable law or agreed to in writing, software", |
| 6105 | "// distributed under the License is distributed on an \"AS IS\" BASIS,", |
| 6106 | "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", |
| 6107 | "// See the License for the specific language governing permissions and", |
| 6108 | "// limitations under the License." |
| 6109 | ] |
| 6110 | }, |
| 6111 | { |
| 6112 | "b": [ |
| 6113 | "//", |
| 6114 | "// Add some more lines in the header." |
| 6115 | ] |
| 6116 | }, |
| 6117 | { |
| 6118 | "ab": [ |
| 6119 | "", |
| 6120 | "package com.google.gerrit.server.project;", |
| 6121 | "", |
| 6122 | "import com.google.common.collect.Maps;", |
| 6123 | ... |
| 6124 | ] |
| 6125 | } |
| 6126 | ... |
| 6127 | ] |
| 6128 | } |
| 6129 | ---- |
| 6130 | |
| 6131 | If the `intraline` parameter is specified, intraline differences are included in the diff. |
| 6132 | |
| 6133 | .Request |
| 6134 | ---- |
| 6135 | 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 |
| 6136 | ---- |
| 6137 | |
| 6138 | .Response |
| 6139 | ---- |
| 6140 | HTTP/1.1 200 OK |
| 6141 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 6142 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6143 | |
| 6144 | )] |
| 6145 | { |
| 6146 | "meta_a": { |
| 6147 | "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] | 6148 | "content_type": "text/x-java-source", |
| 6149 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6150 | }, |
| 6151 | "meta_b": { |
| 6152 | "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] | 6153 | "content_type": "text/x-java-source", |
| 6154 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6155 | }, |
| 6156 | "change_type": "MODIFIED", |
| 6157 | "diff_header": [ |
| 6158 | "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", |
| 6159 | "index 59b7670..9faf81c 100644", |
| 6160 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 6161 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 6162 | ], |
| 6163 | "content": [ |
| 6164 | ... |
| 6165 | { |
| 6166 | "a": [ |
| 6167 | "/** Manages access control for Git references (aka branches, tags). */" |
| 6168 | ], |
| 6169 | "b": [ |
| 6170 | "/** Manages access control for the Git references (aka branches, tags). */" |
| 6171 | ], |
| 6172 | "edit_a": [], |
| 6173 | "edit_b": [ |
| 6174 | [ |
| 6175 | 31, |
| 6176 | 4 |
| 6177 | ] |
| 6178 | ] |
| 6179 | } |
| 6180 | ] |
| 6181 | } |
| 6182 | ---- |
| 6183 | |
| 6184 | The `base` parameter can be specified to control the base patch set from which the diff should |
| 6185 | be generated. |
| 6186 | |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 6187 | The integer-valued request parameter `parent` can be specified to control the |
| 6188 | parent commit number against which the diff should be generated. This is useful |
| 6189 | for supporting review of merge commits. The value is the 1-based index of the |
| 6190 | parent's position in the commit object. |
| 6191 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6192 | .Request |
| 6193 | ---- |
| 6194 | 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 |
| 6195 | ---- |
| 6196 | |
| 6197 | .Response |
| 6198 | ---- |
| 6199 | HTTP/1.1 200 OK |
| 6200 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 6201 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6202 | |
| 6203 | )] |
| 6204 | { |
| 6205 | "meta_a": { |
| 6206 | "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] | 6207 | "content_type": "text/x-java-source", |
| 6208 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6209 | }, |
| 6210 | "meta_b": { |
| 6211 | "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] | 6212 | "content_type": "text/x-java-source", |
| 6213 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6214 | }, |
| 6215 | "change_type": "MODIFIED", |
| 6216 | "content": [ |
| 6217 | { |
| 6218 | "skip": 578 |
| 6219 | } |
| 6220 | ] |
| 6221 | } |
| 6222 | ---- |
| 6223 | |
Edwin Kempin | 0b7c40f | 2016-02-09 17:13:23 +0100 | [diff] [blame] | 6224 | The `whitespace` parameter can be specified to control how whitespace |
| 6225 | differences are reported in the result. Valid values are `IGNORE_NONE`, |
| 6226 | `IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6227 | |
Sharad Bagri | 3f6ed64 | 2022-06-06 12:41:57 -0700 | [diff] [blame] | 6228 | [[preview-stored-fix]] |
| 6229 | === Preview Stored Fix |
Dmitrii Filippov | bf3f08b | 2019-12-06 03:13:06 +0100 | [diff] [blame] | 6230 | -- |
| 6231 | 'GET /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/preview' |
| 6232 | -- |
| 6233 | |
| 6234 | Gets the diffs of all files for a certain <<fix-id,\{fix-id\}>>. |
| 6235 | As response, a map of link:#diff-info[DiffInfo] entities is returned that describes the diffs. |
| 6236 | |
| 6237 | 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. |
| 6238 | |
Sharad Bagri | d1b05fd | 2022-05-18 13:14:17 -0700 | [diff] [blame] | 6239 | [[preview-provided-fix]] |
| 6240 | === Preview Provided fix |
| 6241 | -- |
| 6242 | 'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:preview' |
| 6243 | -- |
| 6244 | |
| 6245 | Gets the diffs of all files for a list of <<fix-replacement-info,FixReplacementInfo>> loaded from |
| 6246 | the <<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the |
| 6247 | request body. |
| 6248 | As response, a map of link:#diff-info[DiffInfo] is returned that describes the diffs. |
| 6249 | |
| 6250 | Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id |
| 6251 | and a virtual patch set with the applied fix. No content on the server will be modified as part of this request. |
| 6252 | |
| 6253 | .Request |
| 6254 | ---- |
| 6255 | POST /changes/myProject~master~Id6f0b9d946791f8aba90ace53074eda565983452/revisions/1/fix:preview HTTP/1.0 |
| 6256 | Content-Type: application/json; charset=UTF-8 |
| 6257 | |
| 6258 | { |
| 6259 | "fix_replacement_infos": [ |
| 6260 | { |
| 6261 | "path": "abcd.txt", |
| 6262 | "range": { |
| 6263 | "start_line": 2, |
| 6264 | "start_character": 2, |
| 6265 | "end_line": 2, |
| 6266 | "end_character": 5 |
| 6267 | }, |
| 6268 | "replacement": "abcdefg" |
| 6269 | } |
| 6270 | ] |
| 6271 | } |
| 6272 | ---- |
| 6273 | |
| 6274 | If the `Preview Provided Fix` operation was successful, a link:#diff-info[DiffInfo] previewing the |
| 6275 | change is returned. |
| 6276 | |
| 6277 | .Response |
| 6278 | ---- |
| 6279 | HTTP/1.1 200 OK |
| 6280 | Content-Disposition: attachment |
| 6281 | Content-Type: application/json; charset=UTF-8 |
| 6282 | |
| 6283 | )]}' |
| 6284 | { |
| 6285 | "abcd.txt": { |
| 6286 | "meta_a": { |
| 6287 | "name": "abcd.txt", |
| 6288 | "content_type": "text/plain", |
| 6289 | "lines": 3 |
| 6290 | }, |
| 6291 | "meta_b": { |
| 6292 | "name": "abcd.txt", |
| 6293 | "content_type": "text/plain", |
| 6294 | "lines": 3 |
| 6295 | }, |
| 6296 | "intraline_status": "OK", |
| 6297 | "change_type": "MODIFIED", |
| 6298 | "content": [ |
| 6299 | { |
| 6300 | "ab": [ |
| 6301 | "ABCDEFGHI" |
| 6302 | ] |
| 6303 | }, |
| 6304 | { |
| 6305 | "a": [ |
| 6306 | "JKLMNOPQR" |
| 6307 | ], |
| 6308 | "b": [ |
| 6309 | "JKabcdefgOPQR" |
| 6310 | ], |
| 6311 | "edit_a": [ |
| 6312 | [ |
| 6313 | 2, |
| 6314 | 3 |
| 6315 | ] |
| 6316 | ], |
| 6317 | "edit_b": [ |
| 6318 | [ |
| 6319 | 2, |
| 6320 | 7 |
| 6321 | ] |
| 6322 | ] |
| 6323 | }, |
| 6324 | { |
| 6325 | "ab": [ |
| 6326 | "" |
| 6327 | ] |
| 6328 | } |
| 6329 | ] |
| 6330 | } |
| 6331 | } |
| 6332 | ---- |
| 6333 | |
| 6334 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 6335 | [[get-blame]] |
| 6336 | === Get Blame |
| 6337 | -- |
| 6338 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame' |
| 6339 | -- |
| 6340 | |
| 6341 | Gets the blame of a file from a certain revision. |
| 6342 | |
| 6343 | .Request |
| 6344 | ---- |
| 6345 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0 |
| 6346 | ---- |
| 6347 | |
| 6348 | As response a link:#blame-info[BlameInfo] entity is returned that describes the |
| 6349 | blame. |
| 6350 | |
| 6351 | .Response |
| 6352 | ---- |
| 6353 | HTTP/1.1 200 OK |
| 6354 | Content-Disposition: attachment |
| 6355 | Content-Type: application/json; charset=UTF-8 |
| 6356 | |
| 6357 | )] |
| 6358 | { |
| 6359 | [ |
| 6360 | { |
| 6361 | "author": "Joe Daw", |
| 6362 | "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7", |
| 6363 | "time": 1421441349, |
| 6364 | "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n", |
| 6365 | "ranges": [ |
| 6366 | { |
| 6367 | "start": 1, |
| 6368 | "end": 10 |
| 6369 | }, |
| 6370 | { |
| 6371 | "start": 16, |
| 6372 | "end": 296 |
| 6373 | } |
| 6374 | ] |
| 6375 | }, |
| 6376 | { |
| 6377 | "author": "Jane Daw", |
| 6378 | "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7", |
| 6379 | "time": 1421825421, |
| 6380 | "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n", |
| 6381 | "ranges": [ |
| 6382 | { |
| 6383 | "start": 13, |
| 6384 | "end": 13 |
| 6385 | } |
| 6386 | ] |
| 6387 | } |
| 6388 | ] |
| 6389 | } |
| 6390 | ---- |
| 6391 | |
| 6392 | The `base` parameter can be specified to control the base patch set from which |
| 6393 | the blame should be generated. |
| 6394 | |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 6395 | [[set-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6396 | === Set Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 6397 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6398 | '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] | 6399 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 6400 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6401 | Marks a file of a revision as reviewed by the calling user. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 6402 | |
| 6403 | .Request |
| 6404 | ---- |
| 6405 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 6406 | ---- |
| 6407 | |
| 6408 | .Response |
| 6409 | ---- |
| 6410 | HTTP/1.1 201 Created |
| 6411 | ---- |
| 6412 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6413 | 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] | 6414 | response is "`200 OK`". |
| 6415 | |
| 6416 | [[delete-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6417 | === Delete Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 6418 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6419 | '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] | 6420 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 6421 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6422 | 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] | 6423 | |
| 6424 | .Request |
| 6425 | ---- |
| 6426 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 6427 | ---- |
| 6428 | |
| 6429 | .Response |
| 6430 | ---- |
| 6431 | HTTP/1.1 204 No Content |
| 6432 | ---- |
| 6433 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6434 | [[cherry-pick]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6435 | === Cherry Pick Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 6436 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6437 | '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] | 6438 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6439 | |
| 6440 | Cherry picks a revision to a destination branch. |
| 6441 | |
Yash Chaturvedi | 28bb35e | 2023-07-09 16:45:18 +0530 | [diff] [blame] | 6442 | If one of the secondary emails associated with the user performing the operation was used as the |
| 6443 | committer email in the original revision, the same email will be used as the committer email |
| 6444 | in the new patch set; otherwise, the user's preferred email will be used. |
| 6445 | |
Changcheng Xiao | 54b6c0c | 2017-10-23 14:57:42 +0200 | [diff] [blame] | 6446 | To cherry pick a commit with no change-id associated with it, see |
| 6447 | link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit]. |
| 6448 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6449 | 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] | 6450 | link:#cherrypick-input[CherryPickInput] entity. If the commit message |
| 6451 | 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] | 6452 | |
Gal Paikin | 8dadd42 | 2021-05-07 10:21:54 +0200 | [diff] [blame] | 6453 | When cherry-picking a change into a branch that already contains the Change-Id |
| 6454 | that we want to cherry-pick, the cherry-pick will create a new patch-set on the |
| 6455 | destination's branch's appropriate Change-Id. If the change is closed on the |
| 6456 | destination branch, the cherry-pick will fail. |
| 6457 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6458 | .Request |
| 6459 | ---- |
| 6460 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 6461 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6462 | |
| 6463 | { |
Gustaf Lundh | 98df5b5 | 2013-05-07 19:22:13 +0100 | [diff] [blame] | 6464 | "message" : "Implementing Feature X", |
| 6465 | "destination" : "release-branch" |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6466 | } |
| 6467 | ---- |
| 6468 | |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 6469 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 6470 | describes the resulting cherry-pick change. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6471 | |
| 6472 | .Response |
| 6473 | ---- |
| 6474 | HTTP/1.1 200 OK |
| 6475 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 6476 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6477 | |
| 6478 | )]}' |
| 6479 | { |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6480 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 6481 | "project": "myProject", |
| 6482 | "branch": "release-branch", |
| 6483 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 6484 | "subject": "Implementing Feature X", |
| 6485 | "status": "NEW", |
| 6486 | "created": "2013-02-01 09:59:32.126000000", |
| 6487 | "updated": "2013-02-21 11:16:36.775000000", |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6488 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 6489 | "insertions": 12, |
| 6490 | "deletions": 11, |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6491 | "_number": 3965, |
| 6492 | "owner": { |
| 6493 | "name": "John Doe" |
| 6494 | } |
| 6495 | } |
| 6496 | ---- |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6497 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 6498 | [[revision-reviewer-endpoints]] |
| 6499 | == Revision Reviewer Endpoints |
| 6500 | |
| 6501 | [[list-revision-reviewers]] |
| 6502 | === List Revision Reviewers |
| 6503 | -- |
| 6504 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/' |
| 6505 | -- |
| 6506 | |
| 6507 | Lists the reviewers of a revision. |
| 6508 | |
| 6509 | Please note that only the current revision is supported. |
| 6510 | |
| 6511 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 6512 | |
| 6513 | .Request |
| 6514 | ---- |
| 6515 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0 |
| 6516 | ---- |
| 6517 | |
| 6518 | .Response |
| 6519 | ---- |
| 6520 | HTTP/1.1 200 OK |
| 6521 | Content-Disposition: attachment |
| 6522 | Content-Type: application/json; charset=UTF-8 |
| 6523 | |
| 6524 | )]}' |
| 6525 | [ |
| 6526 | { |
| 6527 | "approvals": { |
| 6528 | "Verified": "+1", |
| 6529 | "Code-Review": "+2" |
| 6530 | }, |
| 6531 | "_account_id": 1000096, |
| 6532 | "name": "John Doe", |
| 6533 | "email": "john.doe@example.com" |
| 6534 | }, |
| 6535 | { |
| 6536 | "approvals": { |
| 6537 | "Verified": " 0", |
| 6538 | "Code-Review": "-1" |
| 6539 | }, |
| 6540 | "_account_id": 1000097, |
| 6541 | "name": "Jane Roe", |
| 6542 | "email": "jane.roe@example.com" |
| 6543 | } |
| 6544 | ] |
| 6545 | ---- |
| 6546 | |
| 6547 | [[list-revision-votes]] |
| 6548 | === List Revision Votes |
| 6549 | -- |
| 6550 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 6551 | -- |
| 6552 | |
| 6553 | Lists the votes for a specific reviewer of the revision. |
| 6554 | |
| 6555 | Please note that only the current revision is supported. |
| 6556 | |
| 6557 | .Request |
| 6558 | ---- |
| 6559 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0 |
| 6560 | ---- |
| 6561 | |
| 6562 | As result a map is returned that maps the label name to the label value. |
| 6563 | The entries in the map are sorted by label name. |
| 6564 | |
| 6565 | .Response |
| 6566 | ---- |
| 6567 | HTTP/1.1 200 OK |
| 6568 | Content-Disposition: attachment |
| 6569 | Content-Type: application/json;charset=UTF-8 |
| 6570 | |
| 6571 | )]}' |
| 6572 | { |
| 6573 | "Code-Review": -1, |
| 6574 | "Verified": 1, |
| 6575 | "Work-In-Progress": 1 |
| 6576 | } |
| 6577 | ---- |
| 6578 | |
| 6579 | [[delete-revision-vote]] |
| 6580 | === Delete Revision Vote |
| 6581 | -- |
| 6582 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 6583 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' + |
| 6584 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 6585 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete' |
| 6586 | -- |
| 6587 | |
| 6588 | Deletes a single vote from a revision. The deletion will be possible only |
| 6589 | if the revision is the current revision. By using this endpoint you can prevent |
| 6590 | deleting the vote (with same label) from a newer patch set by mistake. |
| 6591 | |
| 6592 | Note, that even when the last vote of a reviewer is removed the reviewer itself |
| 6593 | is still listed on the change. |
| 6594 | |
Gal Paikin | 6ce56dc | 2021-03-29 12:28:43 +0200 | [diff] [blame] | 6595 | If another user removed a user's vote, the user with the deleted vote will be |
| 6596 | added to the attention set. |
| 6597 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 6598 | .Request |
| 6599 | ---- |
| 6600 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0 |
| 6601 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 6602 | ---- |
| 6603 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 6604 | Options can be provided in the request body as a |
| 6605 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 6606 | 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] | 6607 | 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] | 6608 | In this case, use a POST request instead: |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 6609 | |
| 6610 | .Request |
| 6611 | ---- |
| 6612 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 6613 | Content-Type: application/json; charset=UTF-8 |
| 6614 | |
| 6615 | { |
| 6616 | "notify": "NONE" |
| 6617 | } |
| 6618 | ---- |
| 6619 | |
| 6620 | .Response |
| 6621 | ---- |
| 6622 | HTTP/1.1 204 No Content |
| 6623 | ---- |
| 6624 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6625 | [[attention-set-endpoints]] |
| 6626 | == Attention Set Endpoints |
| 6627 | |
| 6628 | [[get-attention-set]] |
| 6629 | === Get Attention Set |
| 6630 | -- |
| 6631 | 'GET /changes/link:#change-id[\{change-id\}]/attention' |
| 6632 | -- |
| 6633 | |
| 6634 | Returns all users that are currently in the attention set. |
| 6635 | As response a list of link:#attention-set-info[AttentionSetInfo] |
| 6636 | entity is returned. |
| 6637 | |
| 6638 | .Request |
| 6639 | ---- |
| 6640 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0 |
| 6641 | ---- |
| 6642 | |
| 6643 | .Response |
| 6644 | ---- |
| 6645 | HTTP/1.1 200 OK |
| 6646 | Content-Disposition: attachment |
| 6647 | Content-Type: application/json; charset=UTF-8 |
| 6648 | |
| 6649 | )]}' |
| 6650 | [ |
| 6651 | { |
| 6652 | "account": { |
| 6653 | "_account_id": 1000096, |
| 6654 | "name": "John Doe", |
| 6655 | "email": "john.doe@example.com", |
| 6656 | "username": "jdoe" |
| 6657 | }, |
| 6658 | "last_update": "2013-02-01 09:59:32.126000000", |
| 6659 | "reason": "reviewer or cc replied" |
| 6660 | }, |
| 6661 | { |
| 6662 | "account": { |
| 6663 | "_account_id": 1000097, |
| 6664 | "name": "Jane Doe", |
| 6665 | "email": "jane.doe@example.com", |
| 6666 | "username": "janedoe" |
| 6667 | }, |
| 6668 | "last_update": "2013-02-01 09:59:32.126000000", |
| 6669 | "reason": "Reviewer was added" |
| 6670 | } |
| 6671 | ] |
| 6672 | ---- |
| 6673 | |
| 6674 | [[add-to-attention-set]] |
| 6675 | === Add To Attention Set |
| 6676 | -- |
| 6677 | 'POST /changes/link:#change-id[\{change-id\}]/attention' |
| 6678 | -- |
| 6679 | |
| 6680 | Adds a single user to the attention set of a change. |
| 6681 | |
| 6682 | A user can only be added if they are not in the attention set. |
| 6683 | If a user is added while already in the attention set, the |
| 6684 | request is silently ignored. |
| 6685 | |
Gal Paikin | e631de2 | 2020-10-29 12:19:11 +0100 | [diff] [blame] | 6686 | The user must be a reviewer, cc, uploader, or owner on the change. |
| 6687 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6688 | .Request |
| 6689 | ---- |
| 6690 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0 |
| 6691 | ---- |
| 6692 | |
| 6693 | Details should be provided in the request body as an |
| 6694 | link:#attention-set-input[AttentionSetInput] entity. |
| 6695 | |
| 6696 | .Request |
| 6697 | ---- |
| 6698 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0 |
| 6699 | Content-Type: application/json; charset=UTF-8 |
| 6700 | |
| 6701 | { |
| 6702 | "user": "John Doe", |
| 6703 | "reason": "reason" |
| 6704 | } |
| 6705 | ---- |
| 6706 | |
| 6707 | .Response |
| 6708 | ---- |
| 6709 | HTTP/1.1 200 OK |
| 6710 | Content-Disposition: attachment |
| 6711 | Content-Type: application/json; charset=UTF-8 |
| 6712 | |
| 6713 | )]}' |
| 6714 | { |
| 6715 | "_account_id": 1000096, |
| 6716 | "name": "John Doe", |
| 6717 | "email": "john.doe@example.com", |
| 6718 | "username": "jdoe" |
| 6719 | } |
| 6720 | ---- |
| 6721 | |
| 6722 | [[remove-from-attention-set]] |
| 6723 | === Remove from Attention Set |
| 6724 | -- |
| 6725 | 'DELETE /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]' + |
| 6726 | 'POST /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]/delete' |
| 6727 | -- |
| 6728 | |
| 6729 | Deletes a single user from the attention set of a change. |
| 6730 | |
| 6731 | A user can only be removed from the attention set if they |
| 6732 | are currently in the attention set. Otherwise, the request |
| 6733 | is silently ignored. |
| 6734 | |
| 6735 | .Request |
| 6736 | ---- |
| 6737 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe HTTP/1.0 |
| 6738 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0 |
| 6739 | ---- |
| 6740 | |
| 6741 | Reason can be provided in the request body as an |
| 6742 | link:#attention-set-input[AttentionSetInput] entity. |
| 6743 | |
| 6744 | User must be left empty, or the user must be exactly |
| 6745 | the same user as in the request header. |
| 6746 | |
| 6747 | .Request |
| 6748 | ---- |
| 6749 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0 |
| 6750 | Content-Type: application/json; charset=UTF-8 |
| 6751 | |
| 6752 | { |
| 6753 | "reason": "reason" |
| 6754 | } |
| 6755 | ---- |
| 6756 | |
| 6757 | .Response |
| 6758 | ---- |
| 6759 | HTTP/1.1 204 No Content |
| 6760 | ---- |
| 6761 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6762 | [[ids]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6763 | == IDs |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6764 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 6765 | [[account-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6766 | === link:rest-api-accounts.html#account-id[\{account-id\}] |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 6767 | -- |
| 6768 | -- |
| 6769 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6770 | [[change-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6771 | === \{change-id\} |
Patrick Hiesel | 18da045 | 2017-12-21 14:02:05 +0100 | [diff] [blame] | 6772 | Identifier that uniquely identifies one change. It contains the URL-encoded |
Edwin Kempin | 00ecc02 | 2023-07-26 06:49:09 +0000 | [diff] [blame] | 6773 | project name as well as the change number: "<project>~<changeNumber>" |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6774 | |
Sven Selberg | 78ce9f4 | 2023-01-05 14:41:04 +0100 | [diff] [blame] | 6775 | ==== Alternative identifiers |
| 6776 | Gerrit also supports an array of other change identifiers. |
| 6777 | |
| 6778 | [NOTE] |
Sven Selberg | aaf8ed8 | 2023-01-11 11:44:08 +0000 | [diff] [blame] | 6779 | Even though these identifiers will work in the majority of cases it is highly |
Edwin Kempin | 00ecc02 | 2023-07-26 06:49:09 +0000 | [diff] [blame] | 6780 | recommended to use "<project>~<changeNumber>" whenever possible. |
Sven Selberg | aaf8ed8 | 2023-01-11 11:44:08 +0000 | [diff] [blame] | 6781 | Since these identifiers require additional lookups from index and caches, to |
Edwin Kempin | 00ecc02 | 2023-07-26 06:49:09 +0000 | [diff] [blame] | 6782 | be translated to the "<project>~<changeNumber>" identifier, they |
Sven Selberg | aaf8ed8 | 2023-01-11 11:44:08 +0000 | [diff] [blame] | 6783 | may result in both false-positives and false-negatives. |
| 6784 | Furthermore the additional lookup mean that they come with a performance penalty. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6785 | |
Edwin Kempin | 19e1492 | 2023-10-19 06:54:41 +0000 | [diff] [blame] | 6786 | * an ID of the change in the format "<project>\~<branch>~<Change-Id>", |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6787 | where for the branch the `refs/heads/` prefix can be omitted |
Edwin Kempin | 19e1492 | 2023-10-19 06:54:41 +0000 | [diff] [blame] | 6788 | ("myProject\~master~I8473b95934b5732ac55d26311a706c9c2bde9940") |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6789 | * a Change-Id if it uniquely identifies one change |
| 6790 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 6791 | * a change number if it uniquely identifies one change ("4247") |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6792 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 6793 | [[change-message-id]] |
| 6794 | === \{change-message-id\} |
| 6795 | ID of a change message returned in a link:#change-message-info[ChangeMessageInfo]. |
| 6796 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6797 | [[comment-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6798 | === \{comment-id\} |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6799 | UUID of a published comment. |
| 6800 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 6801 | [[draft-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6802 | === \{draft-id\} |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 6803 | UUID of a draft comment. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6804 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 6805 | [[label-id]] |
| 6806 | === \{label-id\} |
| 6807 | The name of the label. |
| 6808 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6809 | [[file-id]] |
David Pursehouse | b10c266 | 2016-12-06 08:41:33 +0900 | [diff] [blame] | 6810 | === \{file-id\} |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6811 | The path of the file. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 6812 | |
David Pursehouse | 11badbb | 2017-03-27 10:58:05 +0900 | [diff] [blame] | 6813 | The following magic paths are supported: |
| 6814 | |
| 6815 | * `/COMMIT_MSG`: |
| 6816 | + |
| 6817 | The commit message and headers with the parent commit(s), the author |
| 6818 | information and the committer information. |
| 6819 | |
| 6820 | * `/MERGE_LIST` (for merge commits only): |
| 6821 | + |
| 6822 | The list of commits that are being integrated into the destination |
| 6823 | branch by submitting the merge commit. |
| 6824 | |
Gal Paikin | 3edc142 | 2020-03-19 12:04:52 +0100 | [diff] [blame] | 6825 | * `/PATCHSET_LEVEL`: |
| 6826 | + |
| 6827 | This file path is used exclusively for posting and indicating |
| 6828 | patchset-level comments, thus not relevant for other use-cases. |
| 6829 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6830 | [[fix-id]] |
| 6831 | === \{fix-id\} |
| 6832 | UUID of a suggested fix. |
| 6833 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6834 | [[revision-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6835 | === \{revision-id\} |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6836 | Identifier that uniquely identifies one revision of a change. |
| 6837 | |
| 6838 | This can be: |
| 6839 | |
Shawn Pearce | 9c0722a | 2013-03-02 15:30:31 -0800 | [diff] [blame] | 6840 | * the literal `current` to name the current patch set/revision |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6841 | * a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1") |
| 6842 | * an abbreviated commit ID that uniquely identifies one revision of the |
| 6843 | change ("674ac754"), at least 4 digits are required |
Edwin Kempin | 2582c98 | 2022-12-27 15:47:59 +0100 | [diff] [blame] | 6844 | * a numeric patch number ("1" for first patch set of the change) |
Edwin Kempin | 8cc0bab | 2016-09-15 15:53:37 +0200 | [diff] [blame] | 6845 | * "0" or the literal `edit` for a change edit |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6846 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6847 | [[json-entities]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6848 | == JSON Entities |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6849 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6850 | [[abandon-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6851 | === AbandonInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6852 | The `AbandonInput` entity contains information for abandoning a change. |
| 6853 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6854 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6855 | |============================= |
| 6856 | |Field Name ||Description |
| 6857 | |`message` |optional| |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6858 | Message to be added as review comment to the change when abandoning the |
| 6859 | change. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6860 | |`notify` |optional| |
Stephen Li | e5fcdf7 | 2016-08-02 11:05:11 -0700 | [diff] [blame] | 6861 | Notify handling that defines to whom email notifications should be sent after |
| 6862 | the change is abandoned. + |
| 6863 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6864 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6865 | |`notify_details`|optional| |
| 6866 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 6867 | of link:user-notify.html#recipient-types[recipient type] to |
| 6868 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6869 | |============================= |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6870 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6871 | [[action-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6872 | === ActionInfo |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6873 | The `ActionInfo` entity describes a REST API call the client can |
| 6874 | make to manipulate a resource. These are frequently implemented by |
| 6875 | plugins and may be discovered at runtime. |
| 6876 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6877 | [options="header",cols="1,^1,5"] |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6878 | |==================================== |
| 6879 | |Field Name ||Description |
| 6880 | |`method` |optional| |
| 6881 | HTTP method to use with the action. Most actions use `POST`, `PUT` |
| 6882 | or `DELETE` to cause state changes. |
| 6883 | |`label` |optional| |
| 6884 | Short title to display to a user describing the action. In the |
| 6885 | Gerrit web interface the label is used as the text on the button |
| 6886 | presented in the UI. |
| 6887 | |`title` |optional| |
| 6888 | Longer text to display describing the action. In a web UI this |
| 6889 | should be the title attribute of the element, displaying when |
| 6890 | the user hovers the mouse. |
| 6891 | |`enabled` |optional| |
| 6892 | If true the action is permitted at this time and the caller is |
| 6893 | likely allowed to execute it. This may change if state is updated |
| 6894 | at the server or permissions are modified. Not present if false. |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6895 | |`enabled_options` |optional| |
| 6896 | Optional list of enabled options. + |
Edwin Kempin | b7c80b5 | 2023-03-02 12:30:20 +0100 | [diff] [blame] | 6897 | See the list of suppported options link:#action-options[below]. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6898 | |==================================== |
| 6899 | |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6900 | [[action-options]] |
| 6901 | ==== Action Options |
| 6902 | |
| 6903 | Options that are returned via the `enabled_options` field of |
| 6904 | link:#action-info[ActionInfo]. |
| 6905 | |
| 6906 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6907 | |=================================== |
| 6908 | |REST view |Option |Description |
| 6909 | |`rebase` |`rebase`| |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6910 | Present if the user can rebase the change. + |
| 6911 | This is the case for the change owner and users with the |
| 6912 | link:access-control.html#category_submit[Submit] or |
| 6913 | link:access-control.html#category_rebase[Rebase] permission if they |
| 6914 | have the link:access-control.html#category_push[Push] permission. |
Edwin Kempin | c8e0a06 | 2023-03-16 11:04:13 +0100 | [diff] [blame] | 6915 | |`rebase` |`rebase_on_behalf_of_uploader`| |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6916 | Present if the user can rebase the change on behalf of the uploader. + |
| 6917 | This is the case for the change owner and users with the |
| 6918 | link:access-control.html#category_submit[Submit] or |
| 6919 | link:access-control.html#category_rebase[Rebase] permission. |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6920 | |`rebase:chain`|`rebase`| |
| 6921 | Present if the user can rebase the chain. + |
| 6922 | This is the case if the calling user can rebase each change in the |
Edwin Kempin | f40b1f8 | 2023-03-31 09:40:08 +0000 | [diff] [blame] | 6923 | chain. |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6924 | Rebasing a change is allowed for the change owner and users with the |
| 6925 | link:access-control.html#category_submit[Submit] or |
| 6926 | link:access-control.html#category_rebase[Rebase] permission if they |
| 6927 | have the link:access-control.html#category_push[Push] permission. |
Edwin Kempin | c8e0a06 | 2023-03-16 11:04:13 +0100 | [diff] [blame] | 6928 | |`rebase:chain`|`rebase_on_behalf_of_uploader`| |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6929 | Present if the user can rebase the chain on behalf of the uploader. + |
| 6930 | This is the case if the calling user can rebase each change in the |
Edwin Kempin | f40b1f8 | 2023-03-31 09:40:08 +0000 | [diff] [blame] | 6931 | chain on behalf of the uploader. |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6932 | Rebasing a change on behalf of the uploader is allowed for the change |
| 6933 | owner and users with the link:access-control.html#category_submit[Submit] |
| 6934 | or link:access-control.html#category_rebase[Rebase] permission. |
| 6935 | |=================================== |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6936 | |
| 6937 | For all other REST views no options are returned. |
| 6938 | |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 6939 | [[applypatch-input]] |
| 6940 | === ApplyPatchInput |
| 6941 | The `ApplyPatchInput` entity contains information about a patch to apply. |
| 6942 | |
| 6943 | A new commit will be created from the patch, and saved as a new patch set. |
| 6944 | |
| 6945 | [options="header",cols="1,^1,5"] |
| 6946 | |================================= |
| 6947 | |Field Name ||Description |
| 6948 | |`patch` |required| |
| 6949 | The patch to be applied. Must be compatible with `git diff` output. |
| 6950 | For example, link:#get-patch[Get Patch] output. |
Nitzan Gur-Furman | cf722f6 | 2023-02-15 20:40:33 +0100 | [diff] [blame] | 6951 | The patch must be provided as UTF-8 text, either directly or base64-encoded. |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 6952 | |================================= |
| 6953 | |
| 6954 | [[applypatchpatchset-input]] |
| 6955 | === ApplyPatchPatchSetInput |
| 6956 | The `ApplyPatchPatchSetInput` entity contains information for creating a new patch set from a |
| 6957 | given patch. |
| 6958 | |
| 6959 | [options="header",cols="1,^1,5"] |
| 6960 | |================================= |
| 6961 | |Field Name ||Description |
| 6962 | |`patch` |required| |
| 6963 | The details of the patch to be applied as a link:#applypatch-input[ApplyPatchInput] entity. |
| 6964 | |`commit_message` |optional| |
Nitzan Gur-Furman | 9039848 | 2023-02-23 09:48:24 +0100 | [diff] [blame] | 6965 | The commit message for the new patch set. If not specified, the latest patch-set message will be |
| 6966 | used. |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 6967 | |`base` |optional| |
| 6968 | 40-hex digit SHA-1 of the commit which will be the parent commit of the newly created patch set. |
| 6969 | If set, it must be a merged commit or a change revision on the destination branch. |
| 6970 | Otherwise, the target change's branch tip will be used. |
| 6971 | |`author` |optional| |
| 6972 | The author of the commit to create. Must be an |
| 6973 | link:rest-api-accounts.html#account-input[AccountInput] entity with at least |
| 6974 | the `name` and `email` fields set. |
| 6975 | The caller needs "Forge Author" permission when using this field, unless specifies their own details. |
| 6976 | This field does not affect the owner of the change, which will continue to use the identity of the |
| 6977 | caller. |
Patrick Hiesel | e6759d5 | 2023-02-21 15:24:15 +0100 | [diff] [blame] | 6978 | |`response_format_options` |optional| |
| 6979 | List of link:#query-options[query options] to format the response. |
Patrick Hiesel | 257539f | 2023-06-23 13:36:05 +0200 | [diff] [blame] | 6980 | |`amend` |optional| |
| 6981 | If true, the revision from the URL will be amended by the patch. This will use the tree of the |
| 6982 | revision, apply the patch and create a new commit whose tree is the resulting tree of the operation |
| 6983 | and whose parent(s) are the parent(s) of the revision. Cannot be used together with `base`. |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 6984 | |================================= |
| 6985 | |
| 6986 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6987 | [[approval-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6988 | === ApprovalInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6989 | The `ApprovalInfo` entity contains information about an approval from a |
| 6990 | user for a label on a change. |
| 6991 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 6992 | `ApprovalInfo` has the same fields as |
| 6993 | link:rest-api-accounts.html#account-info[AccountInfo]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6994 | In addition `ApprovalInfo` has the following fields: |
| 6995 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6996 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6997 | |=========================== |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 6998 | |Field Name ||Description |
| 6999 | |`value` |optional| |
Dave Borowitz | a30db91 | 2013-03-22 14:20:33 -0700 | [diff] [blame] | 7000 | The vote that the user has given for the label. If present and zero, the |
| 7001 | user is permitted to vote on the label. If absent, the user is not |
| 7002 | permitted to vote on that label. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 7003 | |`permitted_voting_range` |optional| |
| 7004 | The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote |
| 7005 | on that label. If present, the user is permitted to vote on the label |
| 7006 | regarding the range values. If absent, the user is not permitted to vote |
| 7007 | on that label. |
| 7008 | |`date` |optional| |
Gustaf Lundh | 2e07d502 | 2013-05-08 17:07:42 +0100 | [diff] [blame] | 7009 | The time and date describing when the approval was made. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 7010 | |`tag` |optional| |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7011 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 7012 | while posting the review. Votes/comments that contain `tag` with |
| 7013 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 7014 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7015 | invocations of the REST call are required. |
Dave Borowitz | e47fe47 | 2016-09-09 13:57:14 -0400 | [diff] [blame] | 7016 | |`post_submit` |not set if `false`| |
| 7017 | If true, this vote was made after the change was submitted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7018 | |=========================== |
| 7019 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7020 | [[attention-set-info]] |
| 7021 | === AttentionSetInfo |
| 7022 | The `AttentionSetInfo` entity contains details of users that are in |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 7023 | the link:user-attention-set.html[attention set]. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7024 | |
| 7025 | [options="header",cols="1,^1,5"] |
| 7026 | |=========================== |
| 7027 | |Field Name ||Description |
| 7028 | |`account` || link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 7029 | |`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] | 7030 | |`reason` || |
| 7031 | The reason for adding or removing the user. |
| 7032 | If the update was caused by another user, that account is represented by |
| 7033 | account ID in reason as `<GERRIT_ACCOUNT_18419>` and the corresponding |
| 7034 | link:rest-api-accounts.html#account-info[AccountInfo] can be found in `reason_account` field. |
| 7035 | |`reason_account` || |
| 7036 | 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] | 7037 | |
| 7038 | |=========================== |
| 7039 | [[attention-set-input]] |
| 7040 | === AttentionSetInput |
| 7041 | The `AttentionSetInput` entity contains details for adding users to the |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 7042 | link:user-attention-set.html[attention set] and removing them from it. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7043 | |
| 7044 | [options="header",cols="1,^1,5"] |
| 7045 | |=========================== |
Gal Paikin | f2b1b33 | 2020-07-06 16:34:36 +0300 | [diff] [blame] | 7046 | |Field Name ||Description |
| 7047 | |`user` |optional| link:rest-api-accounts.html#account-id[ID] |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7048 | of the account that should be added to the attention set. For removals, |
| 7049 | 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] | 7050 | |`reason` || The reason of for adding or removing the user. |
| 7051 | |`notify` |optional| |
| 7052 | Notify handling that defines to whom email notifications should be sent |
| 7053 | after the change is created. + |
| 7054 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7055 | If not set, the default is `OWNER`. |
| 7056 | |`notify_details` |optional| |
| 7057 | Additional information about whom to notify about the change creation |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7058 | as a map of link:user-notify.html#recipient-types[recipient type] to |
| 7059 | link:#notify-info[NotifyInfo] entity. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7060 | |=========================== |
| 7061 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 7062 | [[blame-info]] |
| 7063 | === BlameInfo |
| 7064 | The `BlameInfo` entity stores the commit metadata with the row coordinates where |
| 7065 | it applies. |
| 7066 | |
| 7067 | [options="header",cols="1,6"] |
| 7068 | |=========================== |
| 7069 | |Field Name | Description |
| 7070 | |`author` | The author of the commit. |
| 7071 | |`id` | The id of the commit. |
| 7072 | |`time` | Commit time. |
| 7073 | |`commit_msg` | The commit message. |
| 7074 | |`ranges` | |
| 7075 | The blame row coordinates as link:#range-info[RangeInfo] entities. |
| 7076 | |=========================== |
| 7077 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7078 | [[change-edit-input]] |
| 7079 | === ChangeEditInput |
| 7080 | The `ChangeEditInput` entity contains information for restoring a |
| 7081 | path within change edit. |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 7082 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7083 | [options="header",cols="1,^1,5"] |
| 7084 | |=========================== |
| 7085 | |Field Name ||Description |
| 7086 | |`restore_path`|optional|Path to file to restore. |
| 7087 | |`old_path` |optional|Old path to file to rename. |
| 7088 | |`new_path` |optional|New path to file to rename. |
| 7089 | |=========================== |
| 7090 | |
| 7091 | [[change-edit-message-input]] |
| 7092 | === ChangeEditMessageInput |
| 7093 | The `ChangeEditMessageInput` entity contains information for changing |
| 7094 | the commit message within a change edit. |
| 7095 | |
| 7096 | [options="header",cols="1,^1,5"] |
| 7097 | |=========================== |
| 7098 | |Field Name ||Description |
| 7099 | |`message` ||New commit message. |
| 7100 | |=========================== |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 7101 | |
Kaushik Lingarkar | af3905d | 2023-10-31 12:16:35 -0700 | [diff] [blame] | 7102 | [[change-edit-identity-input]] |
| 7103 | === ChangeEditIdentityInput |
| 7104 | The `ChangeEditIdentityInput` entity contains information for changing |
| 7105 | the author or committer identity within a change edit. |
| 7106 | |
| 7107 | [options="header",cols="1,^1,5"] |
| 7108 | |=========================== |
| 7109 | |Field Name ||Description |
| 7110 | |`name` |optional|The name of the author/committer. If not specified, the existing name will be used. |
| 7111 | |`email` |optional|The email of the author/committer. If not specified, the existing email will be used. |
| 7112 | |`type` ||Type of the identity being edited. Must be either `AUTHOR` or `COMMITTER`. |
| 7113 | |=========================== |
| 7114 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7115 | [[change-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7116 | === ChangeInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7117 | The `ChangeInfo` entity contains information about a change. |
| 7118 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7119 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7120 | |================================== |
| 7121 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7122 | |`id` || |
Marija Savtchouk | f8aa921 | 2023-09-28 09:58:01 +0200 | [diff] [blame] | 7123 | The ID of the change. The format is "'<project>\~<_number>'". |
Marija Savtchouk | 5073525 | 2023-04-27 12:22:44 +0200 | [diff] [blame] | 7124 | 'project' and '_number' are URL encoded. The callers must not rely on the format. |
| 7125 | |`triplet_id` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7126 | The ID of the change in the format "'<project>\~<branch>~<Change-Id>'", |
Alon Bar-Lev | 921085b | 2023-05-18 21:16:48 +0300 | [diff] [blame] | 7127 | where 'project' and 'branch' are URL encoded. For 'branch' the |
Marija Savtchouk | 5073525 | 2023-04-27 12:22:44 +0200 | [diff] [blame] | 7128 | `refs/heads/` prefix is omitted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7129 | |`project` ||The name of the project. |
| 7130 | |`branch` || |
| 7131 | The name of the target branch. + |
| 7132 | The `refs/heads/` prefix is omitted. |
Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 7133 | |`topic` |optional|The topic to which this change belongs. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7134 | |`attention_set` |optional| |
| 7135 | The map that maps link:rest-api-accounts.html#account-id[account IDs] |
Gal Paikin | 69f2046 | 2021-11-08 17:26:42 +0100 | [diff] [blame] | 7136 | to link:#attention-set-info[AttentionSetInfo] of that account. Those are all |
| 7137 | accounts that are currently in the attention set. |
| 7138 | |`removed_from_attention_set` |optional| |
| 7139 | The map that maps link:rest-api-accounts.html#account-id[account IDs] |
| 7140 | to link:#attention-set-info[AttentionSetInfo] of that account. Those are all |
| 7141 | accounts that were in the attention set but were removed. The |
| 7142 | link:#attention-set-info[AttentionSetInfo] is the latest and most recent removal |
| 7143 | of the account from the attention set. |
Edwin Kempin | 93b74fb | 2017-08-25 10:42:56 +0200 | [diff] [blame] | 7144 | |`hashtags` |optional| |
Gal Paikin | 07a580c | 2021-04-15 09:47:36 +0200 | [diff] [blame] | 7145 | List of hashtags that are set on the change. |
Chris Poucet | c2962dc | 2023-03-07 17:19:25 +0100 | [diff] [blame] | 7146 | |`custom_keyed_values` |optional| |
| 7147 | A map that maps custom keys to custom values that are tied to a specific change, |
| 7148 | both in the form of strings. Only set if link:#custom-keyed-values[custom keyed |
| 7149 | values] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7150 | |`change_id` ||The Change-Id of the change. |
| 7151 | |`subject` || |
| 7152 | The subject of the change (header line of the commit message). |
| 7153 | |`status` || |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 7154 | The status of the change (`NEW`, `MERGED`, `ABANDONED`). |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7155 | |`created` || |
| 7156 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 7157 | created. |
| 7158 | |`updated` || |
| 7159 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 7160 | updated. |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 7161 | |`submitted` |only set for merged changes| |
| 7162 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 7163 | submitted. |
Dave Borowitz | 8ec31f9 | 2017-08-23 10:28:34 -0400 | [diff] [blame] | 7164 | |`submitter` |only set for merged changes| |
| 7165 | The user who submitted the change, as an |
| 7166 | link:rest-api-accounts.html#account-info[ AccountInfo] entity. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7167 | |`starred` |not set if `false`| |
Nitzan Gur-Furman | 70933e5 | 2023-06-30 13:36:41 +0200 | [diff] [blame] | 7168 | Whether the calling user has starred this change. |
Youssef Elghareeb | f4f4948 | 2023-04-26 18:02:33 +0200 | [diff] [blame] | 7169 | Only set if link:#star[requested]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7170 | |`reviewed` |not set if `false`| |
| 7171 | Whether the change was reviewed by the calling user. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 7172 | Only set if link:#reviewed[reviewed] is requested. |
Dave Borowitz | ace3210 | 2015-12-17 13:08:25 -0500 | [diff] [blame] | 7173 | |`submit_type` |optional| |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 7174 | 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] | 7175 | Not set for merged changes. |
Edwin Kempin | baf70e1 | 2013-02-27 10:36:13 +0100 | [diff] [blame] | 7176 | |`mergeable` |optional| |
| 7177 | Whether the change is mergeable. + |
Patrick Hiesel | a4824db | 2019-12-20 10:55:26 +0100 | [diff] [blame] | 7178 | Only set for open changes if |
| 7179 | link:config-gerrit.html#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior] |
| 7180 | is `API_REF_UPDATED_AND_CHANGE_REINDEX`. |
Shawn Pearce | 4cd05b2 | 2016-09-17 22:45:33 -0700 | [diff] [blame] | 7181 | |`submittable` |optional| |
| 7182 | Whether the change has been approved by the project submit rules. + |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 7183 | Only set if link:#submittable[requested]. |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 7184 | |`insertions` || |
| 7185 | Number of inserted lines. |
| 7186 | |`deletions` || |
| 7187 | Number of deleted lines. |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 7188 | |`total_comment_count` |optional| |
| 7189 | Total number of inline comments across all patch sets. Not set if the current |
| 7190 | change index doesn't have the data. |
Changcheng Xiao | 81c4809 | 2017-02-08 13:04:07 +0100 | [diff] [blame] | 7191 | |`unresolved_comment_count` |optional| |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 7192 | Number of unresolved inline comment threads across all patch sets. Not set if |
| 7193 | the current change index doesn't have the data. |
Ben Rohlfs | b56e355 | 2021-09-10 09:04:19 +0200 | [diff] [blame] | 7194 | |`_number` || |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 7195 | The change number. (The underscore is just a relict of a prior |
| 7196 | attempt to deprecate the change number.) |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7197 | |`owner` || |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 7198 | The owner of the change as an link:rest-api-accounts.html#account-info[ |
| 7199 | AccountInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 7200 | |`actions` |optional| |
| 7201 | Actions the caller might be able to perform on this revision. The |
| 7202 | information is a map of view name to link:#action-info[ActionInfo] |
| 7203 | entities. |
Youssef Elghareeb | 02d33aa | 2021-10-04 13:24:52 +0200 | [diff] [blame] | 7204 | |`submit_records` || |
| 7205 | List of the link:rest-api-changes.html#submit-record-info[SubmitRecordInfo] |
| 7206 | containing the submit records for the change at the latest patchset. |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 7207 | |`requirements` |optional| |
| 7208 | 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] | 7209 | can be submitted. This field is deprecated in favour of `submit_requirements`. |
| 7210 | |`submit_requirements` |optional| |
| 7211 | List of the link:#submit-requirement-result-info[SubmitRequirementResultInfo] |
| 7212 | containing the evaluated submit requirements for the change. |
| 7213 | Only set if link:#submit-requirements[`SUBMIT_REQUIREMENTS`] is requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7214 | |`labels` |optional| |
| 7215 | The labels of the change as a map that maps the label names to |
| 7216 | link:#label-info[LabelInfo] entries. + |
| 7217 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 7218 | labels] are requested. |
| 7219 | |`permitted_labels` |optional| |
| 7220 | A map of the permitted labels that maps a label name to the list of |
| 7221 | values that are allowed for that label. + |
| 7222 | Only set if link:#detailed-labels[detailed labels] are requested. |
Nitzan Gur-Furman | d122357 | 2023-01-16 12:07:46 +0000 | [diff] [blame] | 7223 | |`removable_labels` |optional| |
| 7224 | A map of the removable labels that maps a label name to the map of |
| 7225 | values and reviewers ( |
| 7226 | link:rest-api-accounts.html#account-info[AccountInfo] entities) |
| 7227 | that are allowed to be removed from the change. + |
| 7228 | Only set if link:#labels[labels] or |
| 7229 | link:#detailed-labels[detailed labels] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7230 | |`removable_reviewers`|optional| |
| 7231 | 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] | 7232 | link:rest-api-accounts.html#account-info[AccountInfo] entities. + |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 7233 | Only set if link:#labels[labels] or |
| 7234 | link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 7235 | |`reviewers` |optional| |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 7236 | The reviewers as a map that maps a reviewer state to a list of |
| 7237 | link:rest-api-accounts.html#account-info[AccountInfo] entities. |
Dmitrii Filippov | d0024cc | 2023-12-04 09:34:31 +0000 | [diff] [blame] | 7238 | Possible reviewer states are `REVIEWER`, `CC`. + |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 7239 | `REVIEWER`: Users with at least one non-zero vote on the change. + |
| 7240 | `CC`: Users that were added to the change, but have not voted. + |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 7241 | Only set if link:#labels[labels] or |
| 7242 | link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 7243 | |`pending_reviewers` |optional| |
| 7244 | Updates to `reviewers` that have been made while the change was in the |
| 7245 | WIP state. Only present on WIP changes and only if there are pending |
| 7246 | reviewer updates to report. These are reviewers who have not yet been |
| 7247 | notified about being added to or removed from the change. + |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 7248 | Only set if link:#labels[labels] or |
| 7249 | link:#detailed-labels[detailed labels] are requested. |
Dmitrii Filippov | d0024cc | 2023-12-04 09:34:31 +0000 | [diff] [blame] | 7250 | Possible states are `REVIEWER`, `CC` and `REMOVED`. + |
| 7251 | `REVIEWER`: Users with at least one non-zero vote on the change. + |
| 7252 | `CC`: Users that were added to the change, but have not voted. + |
| 7253 | `REMOVED`: Users that were previously reviewers on the change, but have |
| 7254 | been removed. |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 7255 | |`reviewer_updates`|optional| |
| 7256 | Updates to reviewers set for the change as |
| 7257 | link:#review-update-info[ReviewerUpdateInfo] entities. |
Han-Wen Nienhuys | 3c670be | 2020-06-30 19:17:07 +0200 | [diff] [blame] | 7258 | Only set if link:#reviewer-updates[reviewer updates] are requested. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7259 | |`messages`|optional| |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 7260 | Messages associated with the change as a list of |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7261 | link:#change-message-info[ChangeMessageInfo] entities. + |
| 7262 | Only set if link:#messages[messages] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7263 | |`current_revision` |optional| |
| 7264 | The commit ID of the current patch set of this change. + |
| 7265 | Only set if link:#current-revision[the current revision] is requested |
| 7266 | or if link:#all-revisions[all revisions] are requested. |
| 7267 | |`revisions` |optional| |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 7268 | 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] | 7269 | patch set to a link:#revision-info[RevisionInfo] entity. + |
Dave Borowitz | 0adf270 | 2014-01-22 10:41:52 -0800 | [diff] [blame] | 7270 | Only set if link:#current-revision[the current revision] is requested |
| 7271 | (in which case it will only contain a key for the current revision) or |
| 7272 | if link:#all-revisions[all revisions] are requested. |
Han-Wen Nienhuys | 4ec526a | 2021-02-16 19:20:26 +0100 | [diff] [blame] | 7273 | |`meta_rev_id` |optional| |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 7274 | The SHA-1 of the NoteDb meta ref. |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 7275 | |`tracking_ids` |optional| |
| 7276 | A list of link:#tracking-id-info[TrackingIdInfo] entities describing |
| 7277 | references to external tracking systems. Only set if |
| 7278 | link:#tracking-ids[tracking ids] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7279 | |`_more_changes` |optional, not set if `false`| |
| 7280 | Whether the query would deliver more results if not limited. + |
Dave Borowitz | 4241459 | 2014-12-19 11:27:14 -0800 | [diff] [blame] | 7281 | Only set on the last change that is returned. |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 7282 | |`problems` |optional| |
| 7283 | A list of link:#problem-info[ProblemInfo] entities describing potential |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 7284 | problems with this change. Only set if link:#check[CHECK] is set. |
David Ostrovsky | cb19cec | 2017-04-28 11:55:45 +0200 | [diff] [blame] | 7285 | |`is_private` |optional, not set if `false`| |
| 7286 | When present, change is marked as private. |
David Ostrovsky | 258849b | 2017-03-09 23:21:03 +0100 | [diff] [blame] | 7287 | |`work_in_progress` |optional, not set if `false`| |
| 7288 | When present, change is marked as Work In Progress. |
Logan Hanks | 724b24c | 2017-07-14 10:01:05 -0700 | [diff] [blame] | 7289 | |`has_review_started` |optional, not set if `false`| |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 7290 | When present, change has been marked Ready at some point in time. |
Patrick Hiesel | 828f322 | 2017-07-13 14:18:38 +0200 | [diff] [blame] | 7291 | |`revert_of` |optional| |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 7292 | The change number of the change that this change reverts. |
Gal Paikin | f57225a | 2019-11-13 12:39:12 -0800 | [diff] [blame] | 7293 | |`submission_id` |optional| |
| 7294 | ID of the submission of this change. Only set if the status is `MERGED`. |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 7295 | This ID is equal to the change number of the change that triggered the |
| 7296 | submission. If the change that triggered the submission also has a topic, |
| 7297 | it will be "<id>-<topic>" of the change that triggered the submission. |
Gal Paikin | dd31db9 | 2019-12-06 14:43:35 +0100 | [diff] [blame] | 7298 | The callers must not rely on the format of the submission ID. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7299 | |`cherry_pick_of_change` |optional| |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 7300 | The change number of the change that this change was cherry-picked from. |
Edwin Kempin | 4529d64 | 2021-02-01 13:03:08 +0100 | [diff] [blame] | 7301 | Only set if the cherry-pick has been done through the Gerrit REST API (and |
| 7302 | not if a cherry-picked commit was pushed). |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7303 | |`cherry_pick_of_patch_set`|optional| |
Kaushik Lingarkar | 73bcb41 | 2020-01-29 13:00:46 -0800 | [diff] [blame] | 7304 | 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] | 7305 | Only set if the cherry-pick has been done through the Gerrit REST API (and |
| 7306 | not if a cherry-picked commit was pushed). |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7307 | |`contains_git_conflicts` |optional, not set if `false`| |
| 7308 | Whether the change contains conflicts. + |
| 7309 | If `true`, some of the file contents of the change contain git conflict |
| 7310 | markers to indicate the conflicts. + |
| 7311 | Only set if this change info is returned in response to a request that |
| 7312 | creates a new change or patch set and conflicts are allowed. In |
| 7313 | particular this field is only populated if the change info is returned |
| 7314 | by one of the following REST endpoints: link:#create-change[Create |
| 7315 | Change], link:#create-merge-patch-set-for-change[Create Merge Patch Set |
| 7316 | For Change], link:#cherry-pick[Cherry Pick Revision], |
Edwin Kempin | 269a950 | 2022-05-11 12:28:22 +0200 | [diff] [blame] | 7317 | link:rest-api-project.html#cherry-pick-commit[Cherry Pick Commit], |
| 7318 | link:#rebase-change[Rebase Change] |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 7319 | |================================== |
| 7320 | |
| 7321 | [[change-input]] |
| 7322 | === ChangeInput |
| 7323 | The `ChangeInput` entity contains information about creating a new change. |
| 7324 | |
| 7325 | [options="header",cols="1,^1,5"] |
| 7326 | |================================== |
| 7327 | |Field Name ||Description |
| 7328 | |`project` ||The name of the project. |
| 7329 | |`branch` || |
| 7330 | The name of the target branch. + |
| 7331 | The `refs/heads/` prefix is omitted. |
| 7332 | |`subject` || |
Edwin Kempin | ba8388c | 2020-03-06 08:46:59 +0100 | [diff] [blame] | 7333 | The commit message of the change. Comment lines (beginning with `#`) |
| 7334 | will be removed. If the commit message contains a Change-Id (as a |
| 7335 | "Change-Id: I..." footer) that Change-Id will be used for the newly |
| 7336 | created changed. If a change with this Change-Id already exists for |
| 7337 | same repository and branch, the request is rejected since Change-Ids |
| 7338 | must be unique per repository and branch. If the commit message doesn't |
| 7339 | contain a Change-Id, a newly generated Change-Id is automatically |
| 7340 | inserted into the commit message. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 7341 | |`topic` |optional|The topic to which this change belongs. |
Gal Paikin | 44dbd7e | 2020-04-15 15:23:44 +0200 | [diff] [blame] | 7342 | Topic can't contain quotation marks. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 7343 | |`status` |optional, default to `NEW`| |
David Ostrovsky | 4b44bdc | 2017-07-27 08:05:43 +0200 | [diff] [blame] | 7344 | The status of the change (only `NEW` accepted here). |
Edwin Kempin | 14d50ed | 2017-05-03 13:26:30 +0200 | [diff] [blame] | 7345 | |`is_private` |optional, default to `false`| |
| 7346 | Whether the new change should be marked as private. |
| 7347 | |`work_in_progress` |optional, default to `false`| |
| 7348 | Whether the new change should be set to work in progress. |
David Ostrovsky | 9d8ec42 | 2014-12-24 00:52:09 +0100 | [diff] [blame] | 7349 | |`base_change` |optional| |
| 7350 | A link:#change-id[\{change-id\}] that identifies the base change for a create |
Nitzan Gur-Furman | 6799a83 | 2023-01-13 12:20:25 +0100 | [diff] [blame] | 7351 | change operation. + |
| 7352 | Mutually exclusive with `base_commit`. + |
| 7353 | If neither `base_commit` nor `base_change` are set, the target branch tip will |
| 7354 | be used as the parent commit. |
Aaron Gable | e8e7328 | 2018-04-26 11:09:30 -0700 | [diff] [blame] | 7355 | |`base_commit` |optional| |
| 7356 | A 40-digit hex SHA-1 of the commit which will be the parent commit of the newly |
Nitzan Gur-Furman | 6799a83 | 2023-01-13 12:20:25 +0100 | [diff] [blame] | 7357 | created change. If set, it must be a merged commit on the destination branch. + |
| 7358 | Mutually exclusive with `base_change`. + |
| 7359 | If neither `base_commit` nor `base_change` are set, the target branch tip will |
| 7360 | be used as the parent commit. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 7361 | |`new_branch` |optional, default to `false`| |
Edwin Kempin | e94bb87 | 2019-10-08 13:47:41 +0200 | [diff] [blame] | 7362 | Allow creating a new branch when set to `true`. Using this option is |
| 7363 | 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] | 7364 | |`validation_options` |optional| |
| 7365 | Map with key-value pairs that are forwarded as options to the commit validation |
| 7366 | listeners (e.g. can be used to skip certain validations). Which validation |
| 7367 | options are supported depends on the installed commit validation listeners. |
| 7368 | Gerrit core doesn't support any validation options, but commit validation |
| 7369 | listeners that are implemented in plugins may. Please refer to the |
| 7370 | documentation of the installed plugins to learn whether they support validation |
| 7371 | options. Unknown validation options are silently ignored. |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 7372 | |`custom_keyed_values`|optional|Custom keyed values as a |
| 7373 | map from custom keys to values. |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 7374 | |`merge` |optional| |
| 7375 | 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] | 7376 | If set, the target branch (see `branch` field) must exist (it is not |
| 7377 | possible to create it automatically by setting the `new_branch` field |
| 7378 | to `true`. |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 7379 | |`patch` |optional| |
| 7380 | The detail of a patch to be applied as an link:#applypatch-input[ApplyPatchInput] entity. |
Han-Wen Nienhuys | 2a1029e | 2020-01-30 18:52:45 +0100 | [diff] [blame] | 7381 | |`author` |optional| |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 7382 | The author of the commit to create. Must be an |
| 7383 | link:rest-api-accounts.html#account-input[AccountInput] entity with at least |
| 7384 | the `name` and `email` fields set. |
Han-Wen Nienhuys | 2a1029e | 2020-01-30 18:52:45 +0100 | [diff] [blame] | 7385 | The caller needs "Forge Author" permission when using this field. |
| 7386 | This field does not affect the owner of the change, which will |
| 7387 | continue to use the identity of the caller. |
Edwin Kempin | 5f8c383 | 2017-01-13 11:45:06 +0100 | [diff] [blame] | 7388 | |`notify` |optional| |
| 7389 | Notify handling that defines to whom email notifications should be sent |
| 7390 | after the change is created. + |
| 7391 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7392 | If not set, the default is `ALL`. |
| 7393 | |`notify_details` |optional| |
| 7394 | Additional information about whom to notify about the change creation |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7395 | as a map of link:user-notify.html#recipient-types[recipient type] to |
| 7396 | link:#notify-info[NotifyInfo] entity. |
Patrick Hiesel | e6759d5 | 2023-02-21 15:24:15 +0100 | [diff] [blame] | 7397 | |`response_format_options` |optional| |
| 7398 | List of link:#query-options[query options] to format the response. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7399 | |================================== |
| 7400 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7401 | [[change-message-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7402 | === ChangeMessageInfo |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7403 | The `ChangeMessageInfo` entity contains information about a message |
| 7404 | attached to a change. |
| 7405 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7406 | [options="header",cols="1,^1,5"] |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7407 | |================================== |
| 7408 | |Field Name ||Description |
| 7409 | |`id` ||The ID of the message. |
| 7410 | |`author` |optional| |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 7411 | Author of the message as an |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7412 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 7413 | Unset if written by the Gerrit system. |
Patrick Hiesel | 9221ef1 | 2017-03-23 16:44:36 +0100 | [diff] [blame] | 7414 | |`real_author` |optional| |
| 7415 | Real author of the message as an |
| 7416 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
Edwin Kempin | e03de5f | 2023-01-31 14:54:51 +0100 | [diff] [blame] | 7417 | Only set if the message was posted on behalf of another user. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7418 | |`date` || |
| 7419 | The link:rest-api.html#timestamp[timestamp] this message was posted. |
Marija Savtchouk | e40dc1a | 2021-04-07 09:56:12 +0100 | [diff] [blame] | 7420 | |`message` || |
| 7421 | The text left by the user or Gerrit system. Accounts are served as account IDs |
| 7422 | inlined in the text as `<GERRIT_ACCOUNT_18419>`. |
Kamil Musin | 47d9d71 | 2023-08-23 17:11:47 +0200 | [diff] [blame] | 7423 | All accounts, used in message, can be found in `accounts_in_message` |
Marija Savtchouk | e40dc1a | 2021-04-07 09:56:12 +0100 | [diff] [blame] | 7424 | field. |
Kamil Musin | 47d9d71 | 2023-08-23 17:11:47 +0200 | [diff] [blame] | 7425 | |`accounts_in_message` || |
| 7426 | link:rest-api-accounts.html#account-info[AccountInfo] list, used in `message`. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7427 | |`tag` |optional| |
| 7428 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 7429 | while posting the review. Votes/comments that contain `tag` with |
| 7430 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 7431 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7432 | invocations of the REST call are required. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7433 | |`_revision_number` |optional| |
| 7434 | Which patchset (if any) generated this message. |
| 7435 | |================================== |
| 7436 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 7437 | [[cherrypick-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7438 | === CherryPickInput |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 7439 | The `CherryPickInput` entity contains information for cherry-picking a change to a new branch. |
| 7440 | |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 7441 | [options="header",cols="1,^1,5"] |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 7442 | |=========================== |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7443 | |Field Name ||Description |
| 7444 | |`message` |optional| |
Edwin Kempin | 159804b | 2019-09-23 11:09:39 +0200 | [diff] [blame] | 7445 | Commit message for the cherry-pick change. If not set, the commit message of |
| 7446 | the cherry-picked commit is used. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7447 | |`destination` ||Destination branch |
| 7448 | |`base` |optional| |
Changcheng Xiao | e333258 | 2017-05-26 15:29:41 +0200 | [diff] [blame] | 7449 | 40-hex digit SHA-1 of the commit which will be the parent commit of the newly created change. |
| 7450 | If set, it must be a merged commit or a change revision on the destination branch. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7451 | |`parent` |optional, defaults to 1| |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 7452 | Number of the parent relative to which the cherry-pick should be considered. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7453 | |`notify` |optional| |
Changcheng Xiao | e04e846 | 2017-05-23 09:39:03 +0200 | [diff] [blame] | 7454 | Notify handling that defines to whom email notifications should be sent |
| 7455 | after the cherry-pick. + |
| 7456 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Saša Živkov | 357e2bd | 2020-06-12 12:06:07 +0200 | [diff] [blame] | 7457 | If not set, the default is `ALL`. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7458 | |`notify_details` |optional| |
Changcheng Xiao | e04e846 | 2017-05-23 09:39:03 +0200 | [diff] [blame] | 7459 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7460 | of link:user-notify.html#recipient-types[recipient type] to |
| 7461 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7462 | |`keep_reviewers` |optional, defaults to false| |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 7463 | If `true`, carries reviewers and ccs over from original change to newly created one. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7464 | |`allow_conflicts` |optional, defaults to false| |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 7465 | If `true`, the cherry-pick uses content merge and succeeds also if |
| 7466 | there are conflicts. If there are conflicts the file contents of the |
| 7467 | created change contain git conflict markers to indicate the conflicts. |
| 7468 | Callers can find out if there were conflicts by checking the |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7469 | `contains_git_conflicts` field in the link:#change-info[ChangeInfo]. If |
| 7470 | there are conflicts the cherry-pick change is marked as |
Edwin Kempin | 3c4113a | 2018-10-12 10:49:33 +0200 | [diff] [blame] | 7471 | work-in-progress. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7472 | |`topic` |optional| |
Gal Paikin | f3abd3c | 2020-03-24 16:39:20 +0100 | [diff] [blame] | 7473 | The topic of the created cherry-picked change. If not set, the default depends |
| 7474 | on the source. If the source is a change with a topic, the resulting topic |
| 7475 | of the cherry-picked change will be {source_change_topic}-{destination_branch}. |
| 7476 | Otherwise, if the source change has no topic, or the source is a commit, |
| 7477 | the created change will have no topic. |
Gal Paikin | 1f83c20 | 2020-03-31 16:23:41 +0200 | [diff] [blame] | 7478 | If the change already exists, the topic will not change if not set. If set, the |
| 7479 | topic will be overridden. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7480 | |`allow_empty` |optional, defaults to false| |
Gal Paikin | 626abe0 | 2020-04-07 12:21:26 +0200 | [diff] [blame] | 7481 | If `true`, the cherry-pick succeeds also if the created commit will be empty. |
| 7482 | If `false`, a cherry-pick that would create an empty commit fails without creating |
| 7483 | the commit. |
Yash Chaturvedi | 05d63b5 | 2023-06-14 21:48:45 +0530 | [diff] [blame] | 7484 | |`committer_email`|optional| |
| 7485 | Cherry-pick is committed using this email address. Only the registered emails |
| 7486 | of the calling user are considered valid. Defaults to source commit's committer |
| 7487 | email if it is a registered email of the calling user, else defaults to calling |
| 7488 | user's preferred email. |
| 7489 | |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7490 | |`validation_options`|optional| |
| 7491 | Map with key-value pairs that are forwarded as options to the commit validation |
| 7492 | listeners (e.g. can be used to skip certain validations). Which validation |
| 7493 | options are supported depends on the installed commit validation listeners. |
| 7494 | Gerrit core doesn't support any validation options, but commit validation |
| 7495 | listeners that are implemented in plugins may. Please refer to the |
| 7496 | documentation of the installed plugins to learn whether they support validation |
| 7497 | options. Unknown validation options are silently ignored. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 7498 | |=========================== |
| 7499 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7500 | [[comment-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7501 | === CommentInfo |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 7502 | The `CommentInfo` entity contains information about an inline comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7503 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7504 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7505 | |=========================== |
| 7506 | |Field Name ||Description |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 7507 | |`patch_set` |optional| |
| 7508 | The patch set number for the comment; only set in contexts where + |
| 7509 | comments may be returned for multiple patch sets. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 7510 | |`id` ||The URL encoded UUID of the comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7511 | |`path` |optional| |
Gal Paikin | 3edc142 | 2020-03-19 12:04:52 +0100 | [diff] [blame] | 7512 | 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] | 7513 | Not set if returned in a map where the key is the file path. |
| 7514 | |`side` |optional| |
| 7515 | The side on which the comment was added. + |
| 7516 | Allowed values are `REVISION` and `PARENT`. + |
| 7517 | If not set, the default is `REVISION`. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 7518 | |`parent` |optional| |
| 7519 | The 1-based parent number. Used only for merge commits when `side == PARENT`. |
| 7520 | When not set the comment is for the auto-merge tree. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7521 | |`line` |optional| |
| 7522 | The number of the line for which the comment was done. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7523 | If range is set, this equals the end line of the range. + |
| 7524 | If neither line nor range is set, it's a file comment. |
| 7525 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 7526 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7527 | entity. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7528 | |`in_reply_to` |optional| |
| 7529 | The URL encoded UUID of the comment to which this comment is a reply. |
| 7530 | |`message` |optional|The comment message. |
| 7531 | |`updated` || |
| 7532 | The link:rest-api.html#timestamp[timestamp] of when this comment was |
| 7533 | written. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 7534 | |`author` |optional| |
David Pursehouse | c633a57 | 2013-08-26 14:01:59 +0900 | [diff] [blame] | 7535 | The author of the message as an |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 7536 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 7537 | Unset for draft comments, assumed to be the calling user. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7538 | |`tag` |optional| |
| 7539 | Value of the `tag` field from link:#review-input[ReviewInput] set |
| 7540 | while posting the review. |
Sven Selberg | 1a6728d | 2018-09-28 12:30:12 +0200 | [diff] [blame] | 7541 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7542 | invocations of the REST call are required. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 7543 | |`unresolved` |optional| |
| 7544 | Whether or not the comment must be addressed by the user. The state of |
| 7545 | resolution of a comment thread is stored in the last comment in that thread |
| 7546 | chronologically. |
Youssef Elghareeb | 7fdfa44 | 2020-02-03 12:00:52 +0100 | [diff] [blame] | 7547 | |`change_message_id` |optional| |
Youssef Elghareeb | 5bd4e4e | 2020-08-13 17:09:42 +0200 | [diff] [blame] | 7548 | Available with the link:#list-change-comments[list change comments] endpoint. |
| 7549 | Contains the link:rest-api-changes.html#change-message-info[id] of the change |
| 7550 | message that this comment is linked to. |
Youssef Elghareeb | b5e4208 | 2020-07-09 15:24:01 +0200 | [diff] [blame] | 7551 | |`commit_id` |optional| |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 7552 | 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] | 7553 | this comment applies. |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 7554 | |`context_lines` |optional| |
| 7555 | 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] | 7556 | file where the comment was written. Available only if the "enable-context" |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 7557 | parameter (see link:#list-change-comments[List Change Comments]) is set. |
Youssef Elghareeb | 27d6201 | 2021-02-23 18:21:46 +0100 | [diff] [blame] | 7558 | |`source_content_type` |optional| |
| 7559 | Mime type of the file where the comment is written. Available only if the |
| 7560 | "enable-context" parameter (see link:#list-change-comments[List Change Comments]) |
| 7561 | is set. |
Patrick Hiesel | ad9efd4 | 2024-01-18 15:16:20 +0100 | [diff] [blame] | 7562 | |`fix_suggestions`|optional|Suggested fixes for this comment as a list of |
| 7563 | <<fix-suggestion-info,FixSuggestionInfo>> entities. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7564 | |=========================== |
| 7565 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7566 | [[comment-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7567 | === CommentInput |
Orgad Shaneh | c99da3a | 2014-06-13 14:57:54 +0300 | [diff] [blame] | 7568 | The `CommentInput` entity contains information for creating an inline |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7569 | comment. |
| 7570 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7571 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7572 | |=========================== |
| 7573 | |Field Name ||Description |
| 7574 | |`id` |optional| |
Edwin Kempin | c09826d7 | 2013-02-26 16:10:39 +0100 | [diff] [blame] | 7575 | The URL encoded UUID of the comment if an existing draft comment should |
| 7576 | be updated. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 7577 | |`path` |optional| |
Gal Paikin | 3edc142 | 2020-03-19 12:04:52 +0100 | [diff] [blame] | 7578 | 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] | 7579 | Doesn't need to be set if contained in a map where the key is the file |
| 7580 | path. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7581 | |`side` |optional| |
| 7582 | The side on which the comment should be added. + |
| 7583 | Allowed values are `REVISION` and `PARENT`. + |
| 7584 | If not set, the default is `REVISION`. |
| 7585 | |`line` |optional| |
| 7586 | The number of the line for which the comment should be added. + |
| 7587 | `0` if it is a file comment. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7588 | If neither line nor range is set, a file comment is added. + |
David Pursehouse | 4a159a1 | 2014-08-26 15:45:14 +0900 | [diff] [blame] | 7589 | 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] | 7590 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 7591 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7592 | entity. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7593 | |`in_reply_to` |optional| |
| 7594 | 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] | 7595 | |`updated` |optional| |
| 7596 | The link:rest-api.html#timestamp[timestamp] of this comment. + |
| 7597 | Accepted but ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7598 | |`message` |optional| |
| 7599 | The comment message. + |
| 7600 | If not set and an existing draft comment is updated, the existing draft |
| 7601 | comment is deleted. |
Dave Borowitz | 3dd203b | 2016-04-19 13:52:41 -0400 | [diff] [blame] | 7602 | |`tag` |optional, drafts only| |
| 7603 | Value of the `tag` field. Only allowed on link:#create-draft[draft comment] + |
| 7604 | inputs; for published comments, use the `tag` field in + |
Gal Paikin | b2b81f2 | 2020-02-26 13:14:08 +0100 | [diff] [blame] | 7605 | link:#review-input[ReviewInput]. Votes/comments that contain `tag` with |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 7606 | 'autogenerated:' prefix can be filtered out in the web UI. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 7607 | |`unresolved` |optional| |
| 7608 | Whether or not the comment must be addressed by the user. This value will |
| 7609 | default to false if the comment is an orphan, or the value of the `in_reply_to` |
| 7610 | comment if it is supplied. |
Patrick Hiesel | ad9efd4 | 2024-01-18 15:16:20 +0100 | [diff] [blame] | 7611 | |`fix_suggestions`|optional|Suggested fixes for this comment as a list of |
| 7612 | <<fix-suggestion-info,FixSuggestionInfo>> entities. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7613 | |=========================== |
| 7614 | |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7615 | [[comment-range]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7616 | === CommentRange |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7617 | The `CommentRange` entity describes the range of an inline comment. |
| 7618 | |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 7619 | The comment range is a range from the start position, specified by `start_line` |
| 7620 | and `start_character`, to the end position, specified by `end_line` and |
| 7621 | `end_character`. The start position is *inclusive* and the end position is |
| 7622 | *exclusive*. |
| 7623 | |
| 7624 | So, a range over part of a line will have `start_line` equal to |
| 7625 | `end_line`; however a range with `end_line` set to 5 and `end_character` equal |
| 7626 | to 0 will not include any characters on line 5, |
| 7627 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7628 | [options="header",cols="1,^1,5"] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7629 | |=========================== |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 7630 | |Field Name ||Description |
| 7631 | |`start_line` ||The start line number of the range. (1-based) |
| 7632 | |`start_character` ||The character position in the start line. (0-based) |
| 7633 | |`end_line` ||The end line number of the range. (1-based) |
| 7634 | |`end_character` ||The character position in the end line. (0-based) |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7635 | |=========================== |
| 7636 | |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 7637 | [[context-line]] |
| 7638 | === ContextLine |
| 7639 | The `ContextLine` entity contains the line number and line text of a single |
| 7640 | line of the source file content. |
| 7641 | |
| 7642 | [options="header",cols="1,6"] |
| 7643 | |=========================== |
| 7644 | |Field Name |Description |
| 7645 | |`line_number` |The line number of the source line. |
| 7646 | |`context_line` |String containing the line text. |
| 7647 | |=========================== |
| 7648 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7649 | [[commit-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7650 | === CommitInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7651 | The `CommitInfo` entity contains information about a commit. |
| 7652 | |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7653 | [options="header",cols="1,^1,5"] |
| 7654 | |=========================== |
| 7655 | |Field Name ||Description |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 7656 | |`commit` |Optional| |
| 7657 | The commit ID. Not set if included in a link:#revision-info[ |
| 7658 | RevisionInfo] entity that is contained in a map which has the commit ID |
| 7659 | as key. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7660 | |`parents` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7661 | The parent commits of this commit as a list of |
Edwin Kempin | cecf90a | 2014-04-09 14:58:35 +0200 | [diff] [blame] | 7662 | link:#commit-info[CommitInfo] entities. In each parent |
| 7663 | only the `commit` and `subject` fields are populated. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7664 | |`author` ||The author of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7665 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7666 | |`committer` ||The committer of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7667 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7668 | |`subject` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7669 | The subject of the commit (header line of the commit message). |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7670 | |`message` ||The commit message. |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 7671 | |`web_links` |optional| |
Frank Borden | df69edb | 2021-05-05 17:00:15 +0200 | [diff] [blame] | 7672 | Links to the patch set in external sites as a list of |
| 7673 | link:#web-link-info[WebLinkInfo] entities. |
| 7674 | |`resolve_conflicts_web_links` |optional| |
| 7675 | 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] | 7676 | link:#web-link-info[WebLinkInfo] entities. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7677 | |=========================== |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7678 | |
Edwin Kempin | 7d761ff | 2024-02-16 14:37:54 +0000 | [diff] [blame] | 7679 | [[commit-message-info]] |
| 7680 | === CommitMessageInfo |
| 7681 | The `CommitMessageInfo` entity contains information about the commit |
| 7682 | message of a change. |
| 7683 | |
| 7684 | [options="header",cols="1,6"] |
| 7685 | |============================ |
| 7686 | |Field Name |Description |
| 7687 | |`subject` |The subject of the change (first line of the commit |
| 7688 | message). |
| 7689 | |`full_message` |Full commit message of the change. |
| 7690 | |`footers` |The footers from the commit message as a map of |
| 7691 | key-value pairs. |
| 7692 | |============================ |
| 7693 | |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 7694 | [[commit-message-input]] |
| 7695 | === CommitMessageInput |
| 7696 | The `CommitMessageInput` entity contains information for changing |
| 7697 | the commit message of a change. |
| 7698 | |
| 7699 | [options="header",cols="1,^1,5"] |
| 7700 | |============================= |
| 7701 | |Field Name ||Description |
| 7702 | |`message` ||New commit message. |
Kaushik Lingarkar | 0826c03 | 2024-01-05 10:50:57 +0530 | [diff] [blame] | 7703 | |`committer_email`|optional| |
| 7704 | New message is committed using this email address. Only the |
| 7705 | registered emails of the calling user are considered valid. |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 7706 | |`notify` |optional| |
| 7707 | Notify handling that defines to whom email notifications should be sent |
| 7708 | after the commit message was updated. + |
| 7709 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 7710 | 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] | 7711 | |`notify_details`|optional| |
| 7712 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7713 | of link:user-notify.html#recipient-types[recipient type] to |
| 7714 | link:#notify-info[NotifyInfo] entity. |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 7715 | |============================= |
| 7716 | |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 7717 | [[delete-change-message-input]] |
| 7718 | === DeleteChangeMessageInput |
| 7719 | The `DeleteChangeMessageInput` entity contains the options for deleting a change message. |
| 7720 | |
| 7721 | [options="header",cols="1,^1,5"] |
| 7722 | |============================= |
| 7723 | |Field Name ||Description |
| 7724 | |`reason` |optional| |
| 7725 | The reason why the change message should be deleted. + |
| 7726 | If set, the change message will be replaced with |
| 7727 | "Change message removed by: `name`\nReason: `reason`", |
| 7728 | or just "Change message removed by: `name`." if not set. |
| 7729 | |============================= |
| 7730 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 7731 | [[delete-comment-input]] |
| 7732 | === DeleteCommentInput |
| 7733 | The `DeleteCommentInput` entity contains the option for deleting a comment. |
| 7734 | |
| 7735 | [options="header",cols="1,^1,5"] |
| 7736 | |============================= |
| 7737 | |Field Name ||Description |
| 7738 | |`reason` |optional| |
| 7739 | The reason why the comment should be deleted. + |
| 7740 | If set, the comment's message will be replaced with |
| 7741 | "Comment removed by: `name`; Reason: `reason`", |
| 7742 | or just "Comment removed by: `name`." if not set. |
| 7743 | |============================= |
| 7744 | |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 7745 | [[delete-reviewer-input]] |
| 7746 | === DeleteReviewerInput |
| 7747 | The `DeleteReviewerInput` entity contains options for the deletion of a |
| 7748 | reviewer. |
| 7749 | |
| 7750 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7751 | |============================= |
| 7752 | |Field Name ||Description |
| 7753 | |`notify` |optional| |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 7754 | Notify handling that defines to whom email notifications should be sent |
| 7755 | after the reviewer is deleted. + |
| 7756 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7757 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7758 | |`notify_details`|optional| |
| 7759 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7760 | of link:user-notify.html#recipient-types[recipient type] to |
| 7761 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7762 | |============================= |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 7763 | |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7764 | [[delete-vote-input]] |
| 7765 | === DeleteVoteInput |
| 7766 | The `DeleteVoteInput` entity contains options for the deletion of a |
| 7767 | vote. |
| 7768 | |
| 7769 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7770 | |============================= |
| 7771 | |Field Name ||Description |
| 7772 | |`label` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7773 | The label for which the vote should be deleted. + |
| 7774 | If set, must match the label in the URL. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7775 | |`notify` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7776 | Notify handling that defines to whom email notifications should be sent |
| 7777 | after the vote is deleted. + |
| 7778 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7779 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7780 | |`notify_details`|optional| |
| 7781 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7782 | of link:user-notify.html#recipient-types[recipient type] to |
| 7783 | link:#notify-info[NotifyInfo] entity. |
Gal Paikin | bd7575d | 2021-11-11 14:42:53 +0100 | [diff] [blame] | 7784 | |`ignore_automatic_attention_set_rules`|optional| |
| 7785 | If set to true, ignore all automatic attention set rules described in the |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 7786 | link:user-attention-set.html[attention set]. When not set, the default is false. |
Patrick Hiesel | 8c5568a | 2022-05-31 08:33:52 +0200 | [diff] [blame] | 7787 | |`reason` |optional| |
| 7788 | The reason why this vote is deleted. Will + |
| 7789 | go into the change message. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7790 | |============================= |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7791 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 7792 | [[description-input]] |
| 7793 | === DescriptionInput |
| 7794 | The `DescriptionInput` entity contains information for setting a description. |
| 7795 | |
| 7796 | [options="header",cols="1,6"] |
| 7797 | |=========================== |
| 7798 | |Field Name |Description |
| 7799 | |`description` |The description text. |
| 7800 | |=========================== |
| 7801 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7802 | [[diff-content]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7803 | === DiffContent |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7804 | The `DiffContent` entity contains information about the content differences |
| 7805 | in a file. |
| 7806 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7807 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7808 | |========================== |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7809 | |Field Name ||Description |
| 7810 | |`a` |optional|Content only in the file on side A (deleted in B). |
| 7811 | |`b` |optional|Content only in the file on side B (added in B). |
| 7812 | |`ab` |optional|Content in the file on both sides (unchanged). |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 7813 | |`edit_a` |only present when the `intraline` parameter is set and the |
| 7814 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7815 | Text sections deleted from side A as a |
| 7816 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 7817 | |`edit_b` |only present when the `intraline` parameter is set and the |
| 7818 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7819 | Text sections inserted in side B as a |
| 7820 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7821 | |`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a |
| 7822 | rebase. |
Renan Oliveira | c5077aa | 2020-09-25 18:11:54 +0200 | [diff] [blame] | 7823 | |`due_to_move`|not set if `false`|Indicates whether this entry was introduced by a |
| 7824 | move operation. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7825 | |`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] | 7826 | too large to include all common lines. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7827 | |`common` |optional|Set to `true` if the region is common according |
Shawn Pearce | 425a2be | 2014-01-02 16:00:58 -0800 | [diff] [blame] | 7828 | to the requested ignore-whitespace parameter, but a and b contain |
| 7829 | differing amounts of whitespace. When present and true a and b are |
| 7830 | used instead of ab. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7831 | |========================== |
| 7832 | |
| 7833 | [[diff-file-meta-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7834 | === DiffFileMetaInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7835 | The `DiffFileMetaInfo` entity contains meta information about a file diff. |
| 7836 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7837 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7838 | |========================== |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 7839 | |Field Name ||Description |
| 7840 | |`name` ||The name of the file. |
Youssef Elghareeb | 20a91dd | 2022-02-03 13:46:44 +0100 | [diff] [blame] | 7841 | |`content_type`||The content type of the file. For the commit message and merge |
| 7842 | list the value is `text/x-gerrit-commit-message` and `text/x-gerrit-merge-list` |
| 7843 | respectively. For git links the value is `x-git/gitlink`. For symlinks the value |
| 7844 | is `x-git/symlink`. For regular files the value is the file mime type (e.g. |
| 7845 | `text/x-java`, `text/x-c++src`, etc...). |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 7846 | |`lines` ||The total number of lines in the file. |
Edwin Kempin | 26c95a4 | 2014-11-25 16:29:47 +0100 | [diff] [blame] | 7847 | |`web_links` |optional| |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 7848 | Links to the file in external sites as a list of |
Shawn Pearce | b62414c | 2014-10-16 22:48:33 -0700 | [diff] [blame] | 7849 | link:rest-api-changes.html#web-link-info[WebLinkInfo] entries. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7850 | |========================== |
| 7851 | |
| 7852 | [[diff-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7853 | === DiffInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7854 | The `DiffInfo` entity contains information about the diff of a file |
| 7855 | in a revision. |
| 7856 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7857 | If the link:#weblinks-only[weblinks-only] parameter is specified, only |
| 7858 | the `web_links` field is set. |
| 7859 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7860 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7861 | |========================== |
| 7862 | |Field Name ||Description |
| 7863 | |`meta_a` |not present when the file is added| |
| 7864 | Meta information about the file on side A as a |
| 7865 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 7866 | |`meta_b` |not present when the file is deleted| |
| 7867 | Meta information about the file on side B as a |
| 7868 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 7869 | |`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED` |
| 7870 | `COPIED`, `REWRITE`). |
| 7871 | |`intraline_status`|only set when the `intraline` parameter was specified in the request| |
| 7872 | Intraline status (`OK`, `ERROR`, `TIMEOUT`). |
| 7873 | |`diff_header` ||A list of strings representing the patch set diff header. |
| 7874 | |`content` ||The content differences in the file as a list of |
| 7875 | link:#diff-content[DiffContent] entities. |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7876 | |`web_links` |optional| |
| 7877 | Links to the file diff in external sites as a list of |
| 7878 | link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries. |
Frank Borden | 1952492 | 2021-05-04 11:40:44 +0200 | [diff] [blame] | 7879 | |`edit_web_links` |optional| |
| 7880 | Links to edit the file in external sites as a list of |
| 7881 | link:rest-api-changes.html#web-link-info[WebLinkInfo] entries. |
David Ostrovsky | cdbef23 | 2015-02-13 01:16:37 +0100 | [diff] [blame] | 7882 | |`binary` |not set if `false`|Whether the file is binary. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7883 | |========================== |
| 7884 | |
| 7885 | [[diff-intraline-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7886 | === DiffIntralineInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7887 | The `DiffIntralineInfo` entity contains information about intraline edits in a |
| 7888 | file. |
| 7889 | |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 7890 | 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] | 7891 | 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] | 7892 | 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] | 7893 | 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] | 7894 | diff content lines. If the list is empty, the entire DiffContent should be considered |
| 7895 | as unedited. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7896 | |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 7897 | 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] | 7898 | 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] | 7899 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7900 | [[diff-web-link-info]] |
| 7901 | === DiffWebLinkInfo |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 7902 | The `DiffWebLinkInfo` entity extends link:#web-link-info[WebLinkInfo] and |
| 7903 | describes a link on a diff screen to an external site. |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7904 | |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 7905 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7906 | |======================= |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 7907 | |Field Name||Description |
| 7908 | |`name` ||See link:#web-link-info[WebLinkInfo] |
| 7909 | |`tooltip` |optional|See link:#web-link-info[WebLinkInfo] |
| 7910 | |`url` ||See link:#web-link-info[WebLinkInfo] |
| 7911 | |`image_url`|optional|See link:#web-link-info[WebLinkInfo] |
| 7912 | |show_on_side_by_side_diff_view|| |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7913 | Whether the web link should be shown on the side-by-side diff screen. |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 7914 | |show_on_unified_diff_view|| |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7915 | Whether the web link should be shown on the unified diff screen. |
| 7916 | |======================= |
| 7917 | |
Sharad Bagri | bdb582d | 2022-03-26 01:32:35 -0700 | [diff] [blame] | 7918 | [[apply-provided-fix-input]] |
| 7919 | === ApplyProvidedFixInput |
| 7920 | The `ApplyProvidedFixInput` entity contains the fixes to be applied on a review. |
| 7921 | |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 7922 | [[custom-keyed-values-input]] |
| 7923 | === CustomKeyedValuesInput |
| 7924 | |
| 7925 | The `CustomKeyedValuesInput` entity contains information about custom keyed values |
| 7926 | to add to, and/or remove from, a change. |
| 7927 | |
| 7928 | [options="header",cols="1,^1,5"] |
| 7929 | |======================= |
| 7930 | |Field Name||Description |
| 7931 | |`add` |optional|The map of custom keyed values to be added to the change. |
| 7932 | |`remove` |optional|The list of custom keys to be removed from the change. |
| 7933 | |======================= |
| 7934 | |
Sharad Bagri | bdb582d | 2022-03-26 01:32:35 -0700 | [diff] [blame] | 7935 | [options="header",cols="1,6"] |
| 7936 | |======================= |
| 7937 | |Field Name |Description |
| 7938 | |`fix_replacement_infos` |A list of <<fix-replacement-info,FixReplacementInfo>>. |
| 7939 | |======================= |
| 7940 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 7941 | [[edit-file-info]] |
| 7942 | === EditFileInfo |
| 7943 | The `EditFileInfo` entity contains additional information |
| 7944 | of a file within a change edit. |
| 7945 | |
| 7946 | [options="header",cols="1,^1,5"] |
| 7947 | |=========================== |
| 7948 | |Field Name ||Description |
| 7949 | |`web_links` |optional| |
| 7950 | Links to the diff info in external sites as a list of |
| 7951 | link:#web-link-info[WebLinkInfo] entities. |
| 7952 | |=========================== |
| 7953 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7954 | [[edit-info]] |
| 7955 | === EditInfo |
| 7956 | The `EditInfo` entity contains information about a change edit. |
| 7957 | |
| 7958 | [options="header",cols="1,^1,5"] |
| 7959 | |=========================== |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7960 | |Field Name ||Description |
| 7961 | |`commit` ||The commit of change edit as |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7962 | link:#commit-info[CommitInfo] entity. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7963 | |`base_patch_set_number`||The patch set number of the patch set the change edit is based on. |
| 7964 | |`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] | 7965 | |`ref` ||The ref of the change edit. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7966 | |`fetch` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7967 | Information about how to fetch this patch set. The fetch information is |
| 7968 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 7969 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7970 | |`files` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7971 | The files of the change edit as a map that maps the file names to |
| 7972 | link:#file-info[FileInfo] entities. |
| 7973 | |=========================== |
| 7974 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7975 | [[fetch-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7976 | === FetchInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7977 | The `FetchInfo` entity contains information about how to fetch a patch |
| 7978 | set via a certain protocol. |
| 7979 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7980 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7981 | |========================== |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 7982 | |Field Name ||Description |
| 7983 | |`url` ||The URL of the project. |
| 7984 | |`ref` ||The ref of the patch set. |
| 7985 | |`commands` |optional| |
| 7986 | The download commands for this patch set as a map that maps the command |
| 7987 | names to the commands. + |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 7988 | Only set if link:#download-commands[download commands] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7989 | |========================== |
| 7990 | |
| 7991 | [[file-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7992 | === FileInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7993 | The `FileInfo` entity contains information about a file in a patch set. |
| 7994 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7995 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7996 | |============================= |
| 7997 | |Field Name ||Description |
| 7998 | |`status` |optional| |
| 7999 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 8000 | "`C`"=Copied, "`W`"=Rewritten). + |
| 8001 | Not set if the file was Modified ("`M`"). |
| 8002 | |`binary` |not set if `false`|Whether the file is binary. |
| 8003 | |`old_path` |optional| |
| 8004 | The old file path. + |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 8005 | Only set if the file was renamed or copied. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8006 | |`lines_inserted`|optional| |
| 8007 | Number of inserted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 8008 | Not set for binary files or if no lines were inserted. + |
| 8009 | An empty last line is not included in the count and hence this number can |
Sharad Bagri | 6fc4898 | 2022-06-25 14:11:50 -0700 | [diff] [blame] | 8010 | differ by one from details provided in <<diff-info,DiffInfo>>. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8011 | |`lines_deleted` |optional| |
| 8012 | Number of deleted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 8013 | Not set for binary files or if no lines were deleted. + |
| 8014 | An empty last line is not included in the count and hence this number can |
Sharad Bagri | 6fc4898 | 2022-06-25 14:11:50 -0700 | [diff] [blame] | 8015 | differ by one from details provided in <<diff-info,DiffInfo>>. |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 8016 | |`size_delta` || |
| 8017 | Number of bytes by which the file size increased/decreased. |
Youssef Elghareeb | 1ae12c0 | 2022-06-28 13:49:18 +0200 | [diff] [blame] | 8018 | |`size` || File size in bytes. |
| 8019 | |`old_mode` |optional|File mode in octal (e.g. 100644) at the old commit. |
| 8020 | The first three digits indicate the file type and the last three digits contain |
| 8021 | the file permission bits. For added files, this field will not be present. |
| 8022 | |`new_mode` |optional|File mode in octal (e.g. 100644) at the new commit. |
| 8023 | The first three digits indicate the file type and the last three digits contain |
| 8024 | the file permission bits. For deleted files, this field will not be present. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8025 | |============================= |
| 8026 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 8027 | [[fix-input]] |
| 8028 | === FixInput |
| 8029 | The `FixInput` entity contains options for fixing commits using the |
| 8030 | link:#fix-change[fix change] endpoint. |
| 8031 | |
| 8032 | [options="header",cols="1,6"] |
| 8033 | |========================== |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 8034 | |Field Name |Description |
| 8035 | |`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] | 8036 | database if they refer to missing commit options. |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 8037 | |`expect_merged_as` |If set, check that the change is |
Dave Borowitz | a828fed | 2015-05-05 14:43:40 -0700 | [diff] [blame] | 8038 | merged into the destination branch as this exact SHA-1. If not, insert |
| 8039 | a new patch set referring to this commit. |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 8040 | |========================== |
| 8041 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 8042 | [[fix-suggestion-info]] |
| 8043 | === FixSuggestionInfo |
| 8044 | The `FixSuggestionInfo` entity represents a suggested fix. |
| 8045 | |
| 8046 | [options="header",cols="1,^1,5"] |
| 8047 | |========================== |
| 8048 | |Field Name ||Description |
| 8049 | |`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested |
| 8050 | fix. It will be generated automatically and hence will be ignored if it's set |
| 8051 | for input objects. |
| 8052 | |`description` ||A description of the suggested fix. |
| 8053 | |`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>> |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 8054 | entities indicating how the content of one or several files should be modified. |
| 8055 | Within a file, they should refer to non-overlapping regions. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 8056 | |========================== |
| 8057 | |
| 8058 | [[fix-replacement-info]] |
| 8059 | === FixReplacementInfo |
Alice Kober-Sotzek | 110f60f | 2016-12-19 14:53:40 +0100 | [diff] [blame] | 8060 | The `FixReplacementInfo` entity describes how the content of a file should be |
| 8061 | replaced by another content. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 8062 | |
| 8063 | [options="header",cols="1,6"] |
| 8064 | |========================== |
| 8065 | |Field Name |Description |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 8066 | |`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] | 8067 | the repository may be modified. The commit message can be modified via the |
| 8068 | magic file `/COMMIT_MSG` though only the part below the generated header of |
| 8069 | that magic file can be modified. References to the header lines will result in |
| 8070 | errors when the fix is applied. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 8071 | |`range` |A <<comment-range,CommentRange>> indicating which content |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 8072 | 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] | 8073 | by the line feed character. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 8074 | |`replacement` |The content which should be used instead of the current one. |
| 8075 | |========================== |
| 8076 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8077 | [[git-person-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8078 | === GitPersonInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8079 | The `GitPersonInfo` entity contains information about the |
| 8080 | author/committer of a commit. |
| 8081 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8082 | [options="header",cols="1,6"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8083 | |========================== |
| 8084 | |Field Name |Description |
| 8085 | |`name` |The name of the author/committer. |
| 8086 | |`email` |The email address of the author/committer. |
| 8087 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 8088 | this identity was constructed. |
| 8089 | |`tz` |The timezone offset from UTC of when this identity was |
| 8090 | constructed. |
| 8091 | |========================== |
| 8092 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8093 | [[group-base-info]] |
| 8094 | === GroupBaseInfo |
| 8095 | The `GroupBaseInfo` entity contains base information about the group. |
| 8096 | |
| 8097 | [options="header",cols="1,6"] |
| 8098 | |========================== |
| 8099 | |Field Name |Description |
Edwin Kempin | 703613c | 2016-11-25 16:06:04 +0100 | [diff] [blame] | 8100 | |`id` |The UUID of the group. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8101 | |`name` |The name of the group. |
| 8102 | |========================== |
| 8103 | |
David Pursehouse | d9dac37 | 2016-11-24 19:41:10 +0900 | [diff] [blame] | 8104 | [[hashtags-input]] |
| 8105 | === HashtagsInput |
| 8106 | |
| 8107 | The `HashtagsInput` entity contains information about hashtags to add to, |
| 8108 | and/or remove from, a change. |
| 8109 | |
| 8110 | [options="header",cols="1,^1,5"] |
| 8111 | |======================= |
| 8112 | |Field Name||Description |
| 8113 | |`add` |optional|The list of hashtags to be added to the change. |
Mike Frysinger | 136ecbd | 2021-02-09 14:26:02 -0500 | [diff] [blame] | 8114 | |`remove` |optional|The list of hashtags to be removed from the change. |
David Pursehouse | d9dac37 | 2016-11-24 19:41:10 +0900 | [diff] [blame] | 8115 | |======================= |
| 8116 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8117 | [[included-in-info]] |
| 8118 | === IncludedInInfo |
| 8119 | The `IncludedInInfo` entity contains information about the branches a |
Xinan Lin | dc40ff1 | 2021-07-26 23:26:28 -0700 | [diff] [blame] | 8120 | change was merged into and tags it was tagged with. The branch or tag |
| 8121 | must have 'refs/head/' or 'refs/tags/' prefix respectively. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8122 | |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 8123 | [options="header",cols="1,^1,5"] |
| 8124 | |======================= |
| 8125 | |Field Name||Description |
| 8126 | |`branches`||The list of branches this change was merged into. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8127 | Each branch is listed without the 'refs/head/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 8128 | |`tags` ||The list of tags this change was tagged with. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8129 | Each tag is listed without the 'refs/tags/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 8130 | |`external`|optional|A map that maps a name to a list of external |
| 8131 | systems that include this change, e.g. a list of servers on which this |
| 8132 | change is deployed. |
| 8133 | |======================= |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8134 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8135 | [[label-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8136 | === LabelInfo |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8137 | The `LabelInfo` entity contains information about a label on a change, always |
| 8138 | corresponding to the current patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8139 | |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8140 | There are two options that control the contents of `LabelInfo`: |
Dave Borowitz | 7d6aa01 | 2013-06-14 16:53:48 -0700 | [diff] [blame] | 8141 | link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`]. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8142 | |
Youssef Elghareeb | 9b3e021 | 2022-01-21 14:40:18 +0100 | [diff] [blame] | 8143 | * Using `LABELS` will skip the `all.permitted_voting_range` attribute. |
| 8144 | * Using `DETAILED_LABELS` will include the `all.permitted_voting_range` |
| 8145 | attribute. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8146 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8147 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8148 | |=========================== |
| 8149 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8150 | |`optional` |not set if `false`| |
| 8151 | Whether the label is optional. Optional means the label may be set, but |
| 8152 | it's neither necessary for submission nor does it block submission if |
| 8153 | set. |
Youssef Elghareeb | 261691a | 2021-11-17 13:01:08 +0100 | [diff] [blame] | 8154 | |`description` |optional| The description of the label. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8155 | |`approved` |optional|One user who approved this label on the change |
| 8156 | (voted the maximum value) as an |
| 8157 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 8158 | |`rejected` |optional|One user who rejected this label on the change |
| 8159 | (voted the minimum value) as an |
| 8160 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 8161 | |`recommended` |optional|One user who recommended this label on the |
| 8162 | change (voted positively, but not the maximum value) as an |
| 8163 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 8164 | |`disliked` |optional|One user who disliked this label on the change |
| 8165 | (voted negatively, but not the minimum value) as an |
| 8166 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
David Ostrovsky | 5292fd7 | 2014-02-27 21:56:35 +0100 | [diff] [blame] | 8167 | |`blocking` |optional|If `true`, the label blocks submit operation. |
| 8168 | If not set, the default is false. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8169 | |`value` |optional|The voting value of the user who |
| 8170 | recommended/disliked this label on the change if it is not |
| 8171 | "`+1`"/"`-1`". |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 8172 | |`default_value`|optional|The default voting value for the label. |
| 8173 | This value may be outside the range specified in permitted_labels. |
Youssef Elghareeb | 9b3e021 | 2022-01-21 14:40:18 +0100 | [diff] [blame] | 8174 | |votes|optional|A list of integers containing the vote values applied to this |
| 8175 | label at the latest patchset. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8176 | |`all` |optional|List of all approvals for this label as a list |
Aaron Gable | ea8a211 | 2017-04-25 14:18:16 -0700 | [diff] [blame] | 8177 | of link:#approval-info[ApprovalInfo] entities. Items in this list may |
| 8178 | not represent actual votes cast by users; if a user votes on any label, |
Youssef Elghareeb | 9b3e021 | 2022-01-21 14:40:18 +0100 | [diff] [blame] | 8179 | a corresponding ApprovalInfo will appear in this list for all labels. + |
| 8180 | The `permitted_voting_range` attribute is only set if the `DETAILED_LABELS` |
| 8181 | option is requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8182 | |`values` |optional|A map of all values that are allowed for this |
| 8183 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8184 | to the value descriptions. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8185 | |=========================== |
| 8186 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8187 | [[mergeable-info]] |
| 8188 | === MergeableInfo |
| 8189 | The `MergeableInfo` entity contains information about the mergeability of a |
| 8190 | change. |
| 8191 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8192 | [options="header",cols="1,^1,5"] |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8193 | |============================ |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 8194 | |Field Name ||Description |
| 8195 | |`submit_type` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8196 | Submit type used for this change, can be `MERGE_IF_NECESSARY`, |
Gert van Dijk | a4e49d0 | 2017-08-27 22:50:40 +0200 | [diff] [blame] | 8197 | `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8198 | `CHERRY_PICK`. |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 8199 | |`strategy` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8200 | The strategy of the merge, can be `recursive`, `resolve`, |
| 8201 | `simple-two-way-in-core`, `ours` or `theirs`. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 8202 | |`mergeable` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8203 | `true` if this change is cleanly mergeable, `false` otherwise |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 8204 | |`commit_merged` |optional| |
Zhen Chen | 8f00d55 | 2016-07-26 16:54:59 -0700 | [diff] [blame] | 8205 | `true` if this change is already merged, `false` otherwise |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 8206 | |`content_merged`|optional| |
Zhen Chen | 8f00d55 | 2016-07-26 16:54:59 -0700 | [diff] [blame] | 8207 | `true` if the content of this change is already merged, `false` otherwise |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 8208 | |`conflicts` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8209 | A list of paths with conflicts |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 8210 | |`mergeable_into`|optional| |
| 8211 | 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] | 8212 | |============================ |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8213 | |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8214 | [[merge-input]] |
| 8215 | === MergeInput |
| 8216 | The `MergeInput` entity contains information about the merge |
| 8217 | |
| 8218 | [options="header",cols="1,^1,5"] |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 8219 | |============================== |
| 8220 | |Field Name ||Description |
| 8221 | |`source` || |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8222 | 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] | 8223 | a complete reference name, a short reference name under `refs/heads`, `refs/tags`, |
| 8224 | or `refs/remotes` namespace, etc. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 8225 | |`source_branch` |optional| |
Han-Wen Nienhuys | 9ec1f6a | 2020-01-07 17:32:08 +0100 | [diff] [blame] | 8226 | A branch from which `source` is reachable. If specified, |
| 8227 | `source` is checked for visibility and reachability against only this |
| 8228 | branch. This speeds up the operation, especially for large repos with |
| 8229 | many branches. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 8230 | |`strategy` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8231 | The strategy of the merge, can be `recursive`, `resolve`, |
| 8232 | `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] | 8233 | |`allow_conflicts`|optional, defaults to false| |
| 8234 | If `true`, creating the merge succeeds also if there are conflicts. + |
| 8235 | If there are conflicts the file contents of the created change contain |
| 8236 | git conflict markers to indicate the conflicts. + |
| 8237 | Callers can find out whether there were conflicts by checking the |
| 8238 | `contains_git_conflicts` field in the link:#change-info[ChangeInfo]. + |
| 8239 | If there are conflicts the change is marked as work-in-progress. + |
| 8240 | This option is not supported for all merge strategies (e.g. it's |
| 8241 | supported for `recursive` and `resolve`, but not for |
| 8242 | `simple-two-way-in-core`). |
| 8243 | |============================== |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8244 | |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 8245 | [[merge-patch-set-input]] |
| 8246 | === MergePatchSetInput |
| 8247 | The `MergePatchSetInput` entity contains information about updating a new |
| 8248 | change by creating a new merge commit. |
| 8249 | |
| 8250 | [options="header",cols="1,^1,5"] |
| 8251 | |================================== |
| 8252 | |Field Name ||Description |
| 8253 | |`subject` |optional| |
| 8254 | The new subject for the change, if not specified, will reuse the current patch |
| 8255 | set's subject |
Han-Wen Nienhuys | bd2af0c | 2020-01-09 16:39:26 +0100 | [diff] [blame] | 8256 | |`inherit_parent` |optional, default to `false`| |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 8257 | 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] | 8258 | |`base_change` |optional| |
Han-Wen Nienhuys | 69917fe | 2020-01-09 16:39:26 +0100 | [diff] [blame] | 8259 | 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] | 8260 | is `false`, the merge tip will be the current patch set of the `base_change` if |
| 8261 | 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] | 8262 | |`merge` || |
| 8263 | The detail of the source commit for merge as a link:#merge-input[MergeInput] |
| 8264 | entity. |
Patrick Hiesel | e8fc797 | 2020-10-06 13:22:07 +0200 | [diff] [blame] | 8265 | |`author` |optional| |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 8266 | The author of the commit to create. Must be an |
| 8267 | link:rest-api-accounts.html#account-input[AccountInput] entity with at least |
| 8268 | the `name` and `email` fields set. |
Patrick Hiesel | e8fc797 | 2020-10-06 13:22:07 +0200 | [diff] [blame] | 8269 | The caller needs "Forge Author" permission when using this field. |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 8270 | This field does not affect the owner or the committer of the change, which will |
Patrick Hiesel | e8fc797 | 2020-10-06 13:22:07 +0200 | [diff] [blame] | 8271 | continue to use the identity of the caller. |
chengyang | 8b10b085 | 2023-07-24 21:49:35 +0800 | [diff] [blame] | 8272 | |`validation_options` |optional| |
| 8273 | Map with key-value pairs that are forwarded as options to the commit validation |
| 8274 | listeners (e.g. can be used to skip certain validations). Which validation |
| 8275 | options are supported depends on the installed commit validation listeners. |
| 8276 | Gerrit core doesn't support any validation options, but commit validation |
| 8277 | listeners that are implemented in plugins may. Please refer to the |
| 8278 | documentation of the installed plugins to learn whether they support validation |
| 8279 | options. Unknown validation options are silently ignored. |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 8280 | |================================== |
| 8281 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 8282 | [[move-input]] |
| 8283 | === MoveInput |
| 8284 | The `MoveInput` entity contains information for moving a change to a new branch. |
| 8285 | |
| 8286 | [options="header",cols="1,^1,5"] |
| 8287 | |=========================== |
Michael Zhou | d03fe28 | 2016-04-25 17:13:17 -0400 | [diff] [blame] | 8288 | |Field Name ||Description |
| 8289 | |`destination_branch`||Destination branch |
| 8290 | |`message` |optional| |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 8291 | A message to be posted in this change's comments |
Marija Savtchouk | d89fefc | 2020-12-15 06:46:15 +0000 | [diff] [blame] | 8292 | |`keep_all_votes` |optional, defaults to false| |
Marija Savtchouk | cee6a8f | 2020-12-03 12:58:04 +0000 | [diff] [blame] | 8293 | By default, only veto votes that are blocking the change from submission are moved to |
| 8294 | the destination branch. Using this option is only allowed for administrators, |
| 8295 | because it can affect the submission behaviour of the change (depending on the label access |
| 8296 | configuration and submissions rules). |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 8297 | |=========================== |
| 8298 | |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8299 | [[notify-info]] |
| 8300 | === NotifyInfo |
| 8301 | The `NotifyInfo` entity contains detailed information about who should |
| 8302 | be notified about an update. These notifications are sent out even if a |
| 8303 | `notify` option in the request input disables normal notifications. |
| 8304 | `NotifyInfo` entities are normally contained in a `notify_details` map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8305 | in the request input where the key is the |
| 8306 | link:user-notify.html#recipient-types[recipient type]. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8307 | |
| 8308 | [options="header",cols="1,^1,5"] |
| 8309 | |======================= |
| 8310 | |Field Name||Description |
| 8311 | |`accounts`|optional| |
| 8312 | A list of link:rest-api-accounts.html#account-id[account IDs] that |
| 8313 | identify the accounts that should be should be notified. |
| 8314 | |======================= |
| 8315 | |
Youssef Elghareeb | a112144 | 2023-06-14 14:53:59 +0200 | [diff] [blame] | 8316 | [[parent-info]] |
| 8317 | === ParentInfo |
| 8318 | The `ParentInfo` entity contains information about the parent commit of a |
| 8319 | patch-set. |
| 8320 | |
| 8321 | [options="header",cols="1,^1,5"] |
| 8322 | |======================= |
| 8323 | |Field Name||Description |
| 8324 | |`branch_name` |optional|Name of the target branch into which the parent commit |
| 8325 | is merged. |
| 8326 | |`commit_id` |optional|The commit SHA-1 of the parent commit, or null if the |
| 8327 | current commit is root. |
| 8328 | |`is_merged_in_target_branch` |optional, default to false| Set to true if the |
| 8329 | parent commit is merged into the target branch. |
| 8330 | |`change_id` |optional| If the parent commit is a patch-set of another gerrit |
| 8331 | change, this field will hold the change ID of the parent change. Otherwise, |
| 8332 | will be null. |
| 8333 | |`change_number` |optional|If the parent commit is a patch-set of another gerrit |
| 8334 | change, this field will hold the change number of the parent change. Otherwise, |
| 8335 | will be null. |
| 8336 | |`patch_set_number` |optional|If the parent commit is a patch-set of another gerrit |
| 8337 | change, this field will hold the patch-set number of the parent change. Otherwise, |
| 8338 | will be null. |
| 8339 | |`change_status` |optional|If the parent commit is a patch-set of another gerrit |
| 8340 | change, this field will hold the change status of the parent change. Otherwise, |
| 8341 | will be null. |
| 8342 | |======================= |
| 8343 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 8344 | [[private-input]] |
| 8345 | === PrivateInput |
| 8346 | The `PrivateInput` entity contains information for changing the private |
| 8347 | flag on a change. |
| 8348 | |
| 8349 | [options="header",cols="1,^1,5"] |
| 8350 | |======================= |
| 8351 | |Field Name||Description |
| 8352 | |`message` |optional|Message describing why the private flag was changed. |
| 8353 | |======================= |
| 8354 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8355 | [[problem-info]] |
| 8356 | === ProblemInfo |
| 8357 | The `ProblemInfo` entity contains a description of a potential consistency problem |
| 8358 | with a change. These are not related to the code review process, but rather |
| 8359 | indicate some inconsistency in Gerrit's database or repository metadata related |
| 8360 | to the enclosing change. |
| 8361 | |
| 8362 | [options="header",cols="1,^1,5"] |
| 8363 | |=========================== |
| 8364 | |Field Name||Description |
| 8365 | |`message` ||Plaintext message describing the problem with the change. |
| 8366 | |`status` |optional| |
| 8367 | The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a |
| 8368 | fix was attempted. |
| 8369 | |`outcome` |optional| |
| 8370 | If `status` is set, an additional plaintext message describing the |
| 8371 | outcome of the fix. |
| 8372 | |=========================== |
| 8373 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 8374 | [[publish-change-edit-input]] |
| 8375 | === PublishChangeEditInput |
| 8376 | The `PublishChangeEditInput` entity contains options for the publishing of |
| 8377 | change edit. |
| 8378 | |
| 8379 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8380 | |============================= |
| 8381 | |Field Name ||Description |
| 8382 | |`notify` |optional| |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 8383 | Notify handling that defines to whom email notifications should be sent |
| 8384 | after the change edit is published. + |
| 8385 | Allowed values are `NONE` and `ALL`. + |
| 8386 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8387 | |`notify_details`|optional| |
| 8388 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8389 | of link:user-notify.html#recipient-types[recipient type] to |
| 8390 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8391 | |============================= |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 8392 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 8393 | [[pure-revert-info]] |
| 8394 | === PureRevertInfo |
| 8395 | The `PureRevertInfo` entity describes the result of a pure revert check. |
| 8396 | |
| 8397 | [options="header",cols="1,6"] |
| 8398 | |====================== |
| 8399 | |Field Name |Description |
| 8400 | |`is_pure_revert` |Outcome of the check as boolean. |
| 8401 | |====================== |
| 8402 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 8403 | [[push-certificate-info]] |
| 8404 | === PushCertificateInfo |
| 8405 | The `PushCertificateInfo` entity contains information about a push |
| 8406 | certificate provided when the user pushed for review with `git push |
| 8407 | --signed HEAD:refs/for/<branch>`. Only used when signed push is |
| 8408 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the server. |
| 8409 | |
| 8410 | [options="header",cols="1,6"] |
| 8411 | |=========================== |
| 8412 | |Field Name|Description |
| 8413 | |`certificate`|Signed certificate payload and GPG signature block. |
| 8414 | |`key` | |
| 8415 | Information about the key that signed the push, along with any problems |
| 8416 | found while checking the signature or the key itself, as a |
| 8417 | link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity. |
| 8418 | |=========================== |
| 8419 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 8420 | [[range-info]] |
| 8421 | === RangeInfo |
| 8422 | The `RangeInfo` entity stores the coordinates of a range. |
| 8423 | |
| 8424 | [options="header",cols="1,6"] |
| 8425 | |=========================== |
| 8426 | |Field Name | Description |
| 8427 | |`start` | First index. |
| 8428 | |`end` | Last index. |
| 8429 | |=========================== |
| 8430 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 8431 | [[rebase-input]] |
| 8432 | === RebaseInput |
| 8433 | The `RebaseInput` entity contains information for changing parent when rebasing. |
| 8434 | |
Edwin Kempin | 2f47eb4 | 2022-02-10 12:48:45 +0100 | [diff] [blame] | 8435 | [options="header",cols="1,^1,5"] |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8436 | |==================================== |
| 8437 | |Field Name ||Description |
| 8438 | |`base` |optional| |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 8439 | 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] | 8440 | Alternatively, a change number can be specified, in which case the current |
| 8441 | patch set is inferred. + |
| 8442 | Empty string is used for rebasing directly on top of the target branch, |
| 8443 | which effectively breaks dependency towards a parent change. |
Michael Kelly | 6d5c9f6 | 2023-04-20 23:09:19 -0700 | [diff] [blame] | 8444 | |`strategy` |optional| |
| 8445 | The strategy of the merge, can be `recursive`, `resolve`, |
| 8446 | `simple-two-way-in-core`, `ours` or `theirs`, default will use project settings. |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8447 | |`allow_conflicts` |optional, defaults to false| |
Edwin Kempin | 9a6f054 | 2021-01-13 13:51:42 +0100 | [diff] [blame] | 8448 | If `true`, the rebase also succeeds if there are conflicts. + |
| 8449 | If there are conflicts the file contents of the rebased patch set contain |
| 8450 | git conflict markers to indicate the conflicts. + |
| 8451 | Callers can find out whether there were conflicts by checking the |
| 8452 | `contains_git_conflicts` field in the returned link:#change-info[ChangeInfo]. + |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8453 | If there are conflicts the change is marked as work-in-progress. + |
| 8454 | Cannot be combined with the `on_behalf_of_uploader` option. |
| 8455 | |`on_behalf_of_uploader`|optional, defaults to false| |
| 8456 | If `true`, the rebase is done on behalf of the uploader. + |
| 8457 | This means the uploader of the current patch set will also be the uploader of |
| 8458 | the rebased patch set. The calling user will be recorded as the real user. + |
| 8459 | Rebasing on behalf of the uploader is only supported for trivial rebases. |
| 8460 | This means this option cannot be combined with the `allow_conflicts` option. + |
| 8461 | In addition, rebasing on behalf of the uploader is only supported for the |
Edwin Kempin | 8bf2d86 | 2023-03-10 08:48:02 +0100 | [diff] [blame] | 8462 | current patch set of a change. + |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8463 | If the caller is the uploader this flag is ignored and a normal rebase is done. |
Kaushik Lingarkar | 95f3b27 | 2023-06-06 14:14:40 -0700 | [diff] [blame] | 8464 | |`committer_email`|optional| |
| 8465 | Rebase is committed using this email address. Only the registered emails |
| 8466 | of the calling user or uploader (when `on_behalf_of_uploader` is `true`) are |
| 8467 | considered valid. This option is not supported when rebasing a chain. |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8468 | |`validation_options` |optional| |
Edwin Kempin | e5ec921 | 2022-02-11 13:37:35 +0100 | [diff] [blame] | 8469 | Map with key-value pairs that are forwarded as options to the commit validation |
| 8470 | listeners (e.g. can be used to skip certain validations). Which validation |
| 8471 | options are supported depends on the installed commit validation listeners. |
| 8472 | Gerrit core doesn't support any validation options, but commit validation |
| 8473 | listeners that are implemented in plugins may. Please refer to the |
| 8474 | documentation of the installed plugins to learn whether they support validation |
| 8475 | options. Unknown validation options are silently ignored. |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8476 | |==================================== |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 8477 | |
Nitzan Gur-Furman | 4655d8b | 2022-12-16 08:46:18 +0100 | [diff] [blame] | 8478 | [[rebase-chain-info]] |
| 8479 | === RebaseChainInfo |
| 8480 | |
| 8481 | The `RebaseChainInfo` entity contains information about a chain of changes |
| 8482 | that were rebased. |
| 8483 | |
| 8484 | [options="header",cols="1,^1,5"] |
| 8485 | |=========================== |
| 8486 | |Field Name ||Description |
| 8487 | |`rebased_changes` ||List of the unsubmitted ancestors, as link:#change-info[ChangeInfo] |
| 8488 | entities. Includes both rebased changes, and previously up-to-date ancestors. The list is ordered by |
| 8489 | ancestry, where the oldest ancestor is the first. |
| 8490 | |`contains_git_conflicts` ||Whether any of the rebased changes has conflicts |
| 8491 | due to rebasing. |
Nitzan Gur-Furman | ca0c55c | 2023-01-11 09:33:38 +0100 | [diff] [blame] | 8492 | |=========================== |
Nitzan Gur-Furman | 4655d8b | 2022-12-16 08:46:18 +0100 | [diff] [blame] | 8493 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8494 | [[related-change-and-commit-info]] |
| 8495 | === RelatedChangeAndCommitInfo |
| 8496 | |
| 8497 | The `RelatedChangeAndCommitInfo` entity contains information about |
| 8498 | a related change and commit. |
| 8499 | |
| 8500 | [options="header",cols="1,^1,5"] |
| 8501 | |=========================== |
| 8502 | |Field Name ||Description |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 8503 | |`project` ||The project of the change or commit. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8504 | |`change_id` |optional|The Change-Id of the change. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8505 | |`commit` ||The commit as a |
| 8506 | link:#commit-info[CommitInfo] entity. |
| 8507 | |`_change_number` |optional|The change number. |
| 8508 | |`_revision_number` |optional|The revision number. |
| 8509 | |`_current_revision_number`|optional|The current revision number. |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 8510 | |`status` |optional|The status of the change. The status of |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 8511 | the change is one of (`NEW`, `MERGED`, `ABANDONED`). |
Joerg Zieren | 75e9538 | 2022-07-08 11:30:35 +0200 | [diff] [blame] | 8512 | |`submittable` |optional|Boolean indicating whether the change is |
| 8513 | submittable. + |
| 8514 | Only populated if link:#get-related-changes-submittable[requested]. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8515 | |=========================== |
| 8516 | |
| 8517 | [[related-changes-info]] |
| 8518 | === RelatedChangesInfo |
| 8519 | The `RelatedChangesInfo` entity contains information about related |
| 8520 | changes. |
| 8521 | |
| 8522 | [options="header",cols="1,6"] |
| 8523 | |=========================== |
| 8524 | |Field Name |Description |
| 8525 | |`changes` |A list of |
| 8526 | link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities |
| 8527 | describing the related changes. Sorted by git commit order, newest to |
| 8528 | oldest. Empty if there are no related changes. |
| 8529 | |=========================== |
| 8530 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 8531 | |
| 8532 | [[requirement]] |
| 8533 | === Requirement |
| 8534 | The `Requirement` entity contains information about a requirement relative to a change. |
| 8535 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 8536 | [options="header",cols="1,^1,5"] |
| 8537 | |=========================== |
| 8538 | |Field Name | |Description |
| 8539 | |`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] | 8540 | |`fallback_text` | | A human readable reason |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 8541 | |`type` | | |
| 8542 | Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it |
| 8543 | was triggered. Can be seen as a class: requirements sharing the same type were created for a similar |
| 8544 | reason, and the data structure will follow one set of rules. |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 8545 | |=========================== |
| 8546 | |
| 8547 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 8548 | [[restore-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8549 | === RestoreInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 8550 | The `RestoreInput` entity contains information for restoring a change. |
| 8551 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8552 | [options="header",cols="1,^1,5"] |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 8553 | |=========================== |
| 8554 | |Field Name ||Description |
| 8555 | |`message` |optional| |
| 8556 | Message to be added as review comment to the change when restoring the |
| 8557 | change. |
| 8558 | |=========================== |
| 8559 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 8560 | [[revert-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8561 | === RevertInput |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 8562 | The `RevertInput` entity contains information for reverting a change. |
| 8563 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8564 | [options="header",cols="1,^1,5"] |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8565 | |================================= |
| 8566 | |Field Name ||Description |
| 8567 | |`message` |optional| |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 8568 | Message to be added as review comment to the change when reverting the |
| 8569 | change. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8570 | |`notify` |optional| |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 8571 | Notify handling that defines to whom email notifications should be sent |
| 8572 | for reverting the change. + |
| 8573 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 8574 | If not set, the default is `ALL`. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8575 | |`notify_details` |optional| |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 8576 | Additional information about whom to notify about the revert as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8577 | of link:user-notify.html#recipient-types[recipient type] to |
| 8578 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8579 | |`topic` |optional| |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 8580 | Name of the topic for the revert change. If not set, the default for Revert |
| 8581 | endpoint is the topic of the change being reverted, and the default for the |
| 8582 | RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`. |
Gal Paikin | 44dbd7e | 2020-04-15 15:23:44 +0200 | [diff] [blame] | 8583 | Topic can't contain quotation marks. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8584 | |`work_in_progress` |optional| |
Youssef Elghareeb | 8609544 | 2021-08-02 18:18:22 +0200 | [diff] [blame] | 8585 | When present, change is marked as Work In Progress. The `notify` input is |
Nitzan Gur-Furman | 08765cb | 2022-10-18 13:27:34 +0200 | [diff] [blame] | 8586 | used if it's present, otherwise it will be overridden to `NONE`. + |
| 8587 | Notifications for the reverted change will only sent once the result change is |
| 8588 | no longer WIP. + |
Youssef Elghareeb | fd02dae | 2020-09-03 21:56:30 +0200 | [diff] [blame] | 8589 | If not set, the default is false. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8590 | |`validation_options`|optional| |
| 8591 | Map with key-value pairs that are forwarded as options to the commit validation |
| 8592 | listeners (e.g. can be used to skip certain validations). Which validation |
| 8593 | options are supported depends on the installed commit validation listeners. |
| 8594 | Gerrit core doesn't support any validation options, but commit validation |
| 8595 | listeners that are implemented in plugins may. Please refer to the |
| 8596 | documentation of the installed plugins to learn whether they support validation |
| 8597 | options. Unknown validation options are silently ignored. |
| 8598 | |================================= |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 8599 | |
| 8600 | [[revert-submission-info]] |
| 8601 | === RevertSubmissionInfo |
Gal Paikin | 64777c7 | 2019-12-18 14:11:13 +0100 | [diff] [blame] | 8602 | The `RevertSubmissionInfo` entity describes the revert changes. |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 8603 | |
| 8604 | [options="header",cols="1,6"] |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 8605 | |============================== |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 8606 | |Field Name | Description |
| 8607 | |`revert_changes` | |
Edwin Kempin | 6e7fb4e | 2019-10-24 17:20:51 +0200 | [diff] [blame] | 8608 | A list of link:#change-info[ChangeInfo] that describes the revert changes. Each |
| 8609 | entity in that list is a revert change that was created in that revert |
| 8610 | submission. |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 8611 | |============================== |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 8612 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8613 | [[review-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8614 | === ReviewInfo |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8615 | The `ReviewInfo` entity contains information about a review. |
| 8616 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8617 | [options="header",cols="1,6"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8618 | |=========================== |
| 8619 | |Field Name |Description |
| 8620 | |`labels` | |
| 8621 | The labels of the review as a map that maps the label names to the |
| 8622 | voting values. |
| 8623 | |=========================== |
| 8624 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 8625 | [[review-update-info]] |
| 8626 | === ReviewerUpdateInfo |
| 8627 | The `ReviewerUpdateInfo` entity contains information about updates to |
| 8628 | change's reviewers set. |
| 8629 | |
| 8630 | [options="header",cols="1,6"] |
| 8631 | |=========================== |
| 8632 | |Field Name |Description |
| 8633 | |`updated`| |
| 8634 | Timestamp of the update. |
| 8635 | |`updated_by`| |
| 8636 | The account which modified state of the reviewer in question as |
| 8637 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 8638 | |`reviewer`| |
Edwin Kempin | d9329d2 | 2024-02-01 10:10:53 +0000 | [diff] [blame] | 8639 | The reviewer added or removed from the change as an |
| 8640 | link:rest-api-accounts.html#account-info[AccountInfo] entity. For |
| 8641 | reviewers by email the `AccountInfo` doesn't contain an account ID but |
| 8642 | only the email and optionally a name. |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 8643 | |`state`| |
| 8644 | The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`. |
| 8645 | |=========================== |
| 8646 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8647 | [[review-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8648 | === ReviewInput |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8649 | The `ReviewInput` entity contains information for adding a review to a |
| 8650 | revision. |
| 8651 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8652 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8653 | |============================ |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8654 | |Field Name ||Description |
| 8655 | |`message` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8656 | The message to be added as review comment. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8657 | |`tag` |optional| |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 8658 | Apply this tag to the review comment message, votes, and inline |
Ben Rohlfs | d9be63f | 2021-02-04 09:01:46 +0100 | [diff] [blame] | 8659 | comments. Tags with an 'autogenerated:' prefix may be used by CI or other |
| 8660 | automated systems to distinguish them from human reviews. If another |
| 8661 | message was posted on a newer patchset, but with the same tag, then the older |
| 8662 | message will be hidden in the UI. Suffixes starting with `~` are not considered, |
| 8663 | so `autogenerated:my-ci-system~trigger` and `autogenerated:my-ci-system~result` |
| 8664 | 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] | 8665 | |`labels` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8666 | The votes that should be added to the revision as a map that maps the |
| 8667 | label names to the voting values. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8668 | |`comments` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8669 | The comments that should be added as a map that maps a file path to a |
| 8670 | list of link:#comment-input[CommentInput] entities. |
Patrick Hiesel | ad9efd4 | 2024-01-18 15:16:20 +0100 | [diff] [blame] | 8671 | |`robot_comments` |optional, deprecated| |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8672 | The robot comments that should be added as a map that maps a file path |
| 8673 | to a list of link:#robot-comment-input[RobotCommentInput] entities. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8674 | |`drafts` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8675 | Draft handling that defines how draft comments are handled that are |
| 8676 | already in the database but that were not also described in this |
| 8677 | input. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 8678 | Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values |
| 8679 | except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. + |
Dave Borowitz | c064054 | 2016-10-05 16:19:21 -0400 | [diff] [blame] | 8680 | Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 8681 | If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value |
| 8682 | besides `KEEP` is allowed. |
Youssef Elghareeb | 3e4bf51 | 2021-05-12 18:40:27 +0200 | [diff] [blame] | 8683 | |`draft_ids_to_publish` |optional| |
| 8684 | List of draft IDs to be published. The draft IDs should belong to the current |
| 8685 | user and be valid. If `drafts` is set to `PUBLISH`, then draft IDs should |
| 8686 | contain drafts for the same revision that is requested for review. If `drafts` |
| 8687 | is set to `KEEP`, then `draft_ids_to_publish` will be ignored and no draft |
| 8688 | comments will be published. + |
| 8689 | 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] | 8690 | |`notify` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8691 | Notify handling that defines to whom email notifications should be sent |
| 8692 | after the review is stored. + |
| 8693 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 8694 | If not set, the default is `ALL`. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8695 | |`notify_details` |optional| |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8696 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8697 | of link:user-notify.html#recipient-types[recipient type] to |
| 8698 | link:#notify-info[NotifyInfo] entity. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8699 | |`omit_duplicate_comments` |optional| |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 8700 | 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] | 8701 | |`on_behalf_of` |optional| |
Shawn Pearce | 9d78312 | 2013-06-11 18:18:03 -0700 | [diff] [blame] | 8702 | link:rest-api-accounts.html#account-id[\{account-id\}] the review |
| 8703 | should be posted on behalf of. To use this option the caller must |
| 8704 | have been granted `labelAs-NAME` permission for all keys of labels. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8705 | |`reviewers` |optional| |
Patrick Hiesel | cf6d935 | 2017-04-13 10:15:42 +0200 | [diff] [blame] | 8706 | A list of link:rest-api-changes.html#reviewer-input[ReviewerInput] |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8707 | representing reviewers that should be added/removed to/from the change. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8708 | |`ready` |optional| |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 8709 | If true, and if the change is work in progress, then start review. |
| 8710 | 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] | 8711 | |`work_in_progress` |optional| |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 8712 | If true, mark the change as work in progress. It is an error for both |
| 8713 | `ready` and `work_in_progress` to be true. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8714 | |`add_to_attention_set` |optional| |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 8715 | list of link:#attention-set-input[AttentionSetInput] entities to add |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 8716 | to the link:user-attention-set.html[attention set]. Users that are not reviewers, |
Gal Paikin | e631de2 | 2020-10-29 12:19:11 +0100 | [diff] [blame] | 8717 | ccs, owner, or uploader are silently ignored. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8718 | |`remove_from_attention_set` |optional| |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 8719 | list of link:#attention-set-input[AttentionSetInput] entities to remove |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 8720 | from the link:user-attention-set.html[attention set]. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8721 | |`ignore_automatic_attention_set_rules`|optional| |
| 8722 | If set to true, ignore all automatic attention set rules described in the |
Edwin Kempin | c921900 | 2023-09-08 08:07:21 +0000 | [diff] [blame] | 8723 | link:user-attention-set.html[attention set]. Updates in add_to_attention_set |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 8724 | and remove_from_attention_set are not ignored. |
Patrick Hiesel | 055aac6 | 2023-08-03 11:37:58 +0000 | [diff] [blame] | 8725 | |`response_format_options` |optional| |
| 8726 | List of link:#query-options[query options] to format the response. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8727 | |============================ |
| 8728 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 8729 | [[review-result]] |
| 8730 | === ReviewResult |
| 8731 | The `ReviewResult` entity contains information regarding the updates |
| 8732 | that were made to a review. |
| 8733 | |
| 8734 | [options="header",cols="1,^1,5"] |
| 8735 | |============================ |
| 8736 | |Field Name ||Description |
| 8737 | |`labels` |optional| |
| 8738 | Map of labels to values after the review was posted. Null if any reviewer |
| 8739 | additions were rejected. |
| 8740 | |`reviewers` |optional| |
| 8741 | Map of account or group identifier to |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8742 | link:rest-api-changes.html#reviewer-result[ReviewerResult] |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8743 | representing the outcome of adding/removing a reviewer. |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 8744 | Absent if no reviewer additions were requested. |
Logan Hanks | e81ad8e | 2017-07-18 09:45:46 -0700 | [diff] [blame] | 8745 | |`ready` |optional| |
| 8746 | If true, the change was moved from WIP to ready for review as a result of this |
| 8747 | action. Not set if false. |
Edwin Kempin | ddcf6f9 | 2022-08-02 11:21:05 +0200 | [diff] [blame] | 8748 | |`error` |optional| |
| 8749 | Error message for non-200 responses. |
Patrick Hiesel | 055aac6 | 2023-08-03 11:37:58 +0000 | [diff] [blame] | 8750 | |`change_info` |optional| |
| 8751 | Post-update change information. Only set if `response_format_options` were |
| 8752 | set. |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 8753 | |============================ |
| 8754 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8755 | [[reviewer-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8756 | === ReviewerInfo |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8757 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 8758 | votes on a change. |
| 8759 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 8760 | `ReviewerInfo` has the same fields as |
| 8761 | link:rest-api-accounts.html#account-info[AccountInfo] and includes |
| 8762 | link:#detailed-accounts[detailed account information]. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8763 | In addition `ReviewerInfo` has the following fields: |
| 8764 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8765 | [options="header",cols="1,6"] |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8766 | |========================== |
| 8767 | |Field Name |Description |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8768 | |`approvals` | |
| 8769 | 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] | 8770 | approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`"). |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 8771 | |`_account_id` | |
| 8772 | This field is inherited from `AccountInfo` but is optional here if an |
| 8773 | unregistered reviewer was added by email. See |
| 8774 | link:rest-api-changes.html#add-reviewer[add-reviewer] for details. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8775 | |========================== |
| 8776 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8777 | [[reviewer-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8778 | === ReviewerInput |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8779 | The `ReviewerInput` entity contains information for adding or removing |
| 8780 | reviewers to/from the change. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8781 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8782 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8783 | |============================= |
| 8784 | |Field Name ||Description |
| 8785 | |`reviewer` || |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8786 | 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] | 8787 | 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] | 8788 | 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] | 8789 | If an ID identifies both an account and a group, only the account is |
| 8790 | added as reviewer to the change. |
Han-Wen Nienhuys | e622905 | 2020-01-29 12:51:36 +0100 | [diff] [blame] | 8791 | External groups, such as LDAP groups, will be silently omitted from a |
| 8792 | link:#set-review[set-review] or |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8793 | link:rest-api-changes.html#add-reviewer[add-reviewer] call. A group can only be |
| 8794 | specified for adding reviewers, not for removing them. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8795 | |`state` |optional| |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8796 | Add reviewer in this state. Possible reviewer states are `REVIEWER`, |
| 8797 | `CC` and `REMOVED`. If not given, defaults to `REVIEWER`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8798 | |`confirmed` |optional| |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8799 | Whether adding the reviewer is confirmed. + |
| 8800 | The Gerrit server may be configured to |
| 8801 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 8802 | confirmation] when adding a group as reviewer that has many members. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8803 | |`notify` |optional| |
Sven Selberg | 4d64f97 | 2016-09-26 16:15:02 +0200 | [diff] [blame] | 8804 | Notify handling that defines to whom email notifications should be sent |
| 8805 | after the reviewer is added. + |
| 8806 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 8807 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8808 | |`notify_details`|optional| |
| 8809 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8810 | of link:user-notify.html#recipient-types[recipient type] to |
| 8811 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8812 | |============================= |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8813 | |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8814 | [[reviewer-result]] |
| 8815 | === ReviewerResult |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8816 | The `ReviewerResult` entity describes the result of modifying reviewers of |
| 8817 | a change. |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8818 | |
| 8819 | [options="header",cols="1,^1,5"] |
| 8820 | |=========================== |
| 8821 | |Field Name ||Description |
| 8822 | |`input` || |
| 8823 | Value of the `reviewer` field from link:#reviewer-input[ReviewerInput] |
| 8824 | set while adding the reviewer. |
| 8825 | |`reviewers` |optional| |
| 8826 | The newly added reviewers as a list of link:#reviewer-info[ |
| 8827 | ReviewerInfo] entities. |
| 8828 | |`ccs` |optional| |
Gal Paikin | efb4ad5 | 2021-04-15 09:44:40 +0200 | [diff] [blame] | 8829 | The newly CCed accounts as a list of |
| 8830 | link:rest-api-accounts.html#account-info[AccountInfo] entities. This field will |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8831 | only appear if the requested `state` for the reviewer was `CC`. |
| 8832 | |`removed` |optional| |
| 8833 | The newly removed accounts as a list of |
| 8834 | link:rest-api-accounts.html#account-info[AccountInfo] entities. |
| 8835 | This field will only appear if the requested `state` for the reviewer was |
| 8836 | `REMOVED`. |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8837 | |`error` |optional| |
| 8838 | Error message explaining why the reviewer could not be added. + |
| 8839 | If a group was specified in the input and an error is returned, it |
| 8840 | means that none of the members were added as reviewer. |
| 8841 | |`confirm` |`false` if not set| |
| 8842 | Whether adding the reviewer requires confirmation. |
| 8843 | |=========================== |
| 8844 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8845 | [[revision-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8846 | === RevisionInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8847 | The `RevisionInfo` entity contains information about a patch set. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 8848 | Not all fields are returned by default. Additional fields can |
| 8849 | be obtained by adding `o` parameters as described in |
| 8850 | link:#list-changes[Query Changes]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8851 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8852 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8853 | |=========================== |
| 8854 | |Field Name ||Description |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 8855 | |`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`, |
| 8856 | `MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`. |
Kasper Nilsson | be3616d | 2018-01-23 14:10:36 -0800 | [diff] [blame] | 8857 | |`_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] | 8858 | |`created` || |
| 8859 | The link:rest-api.html#timestamp[timestamp] of when the patch set was |
| 8860 | created. |
| 8861 | |`uploader` || |
| 8862 | The uploader of the patch set as an |
| 8863 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8864 | |`real_uploader`|optional| |
| 8865 | The real uploader of the patch set as an |
| 8866 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 8867 | Only set if the upload was done on behalf of another user. |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 8868 | |`ref` ||The Git reference for the patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8869 | |`fetch` || |
| 8870 | Information about how to fetch this patch set. The fetch information is |
| 8871 | provided as a map that maps the protocol name ("`git`", "`http`", |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 8872 | "`ssh`") to link:#fetch-info[FetchInfo] entities. This information is |
| 8873 | only included if a plugin implementing the |
| 8874 | link:intro-project-owner.html#download-commands[download commands] |
| 8875 | interface is installed. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 8876 | |`commit` |optional|The commit of the patch set as |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8877 | link:#commit-info[CommitInfo] entity. |
Youssef Elghareeb | a112144 | 2023-06-14 14:53:59 +0200 | [diff] [blame] | 8878 | |`parents_data` |optional| |
| 8879 | The parent commits of this patch-set commit as a list of |
| 8880 | link:#parent-info[ParentInfo] entities. In each parent, we include the target |
| 8881 | branch name if the parent is a merged commit in the target branch. Otherwise, |
| 8882 | we include the change and patch-set numbers of the parent change. + |
| 8883 | Only set if the `PARENTS` option is set. |
Youssef Elghareeb | 4c11544 | 2023-06-15 18:16:42 +0200 | [diff] [blame] | 8884 | |`branch` | optional|The name of the target branch that this revision is |
| 8885 | set to be merged into. + |
| 8886 | Note that if the change is moved with the link:#move-change[Move Change] |
| 8887 | endpoint, this field can be different for different patchsets. For example, |
| 8888 | if the change is moved and a new patchset is uploaded afterwards, the |
| 8889 | link:#revision-info[RevisionInfo] of the previous patchset will contain the old |
| 8890 | `branch`, but the newer patchset will contain the new `branch`. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 8891 | |`files` |optional| |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8892 | 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] | 8893 | link:#file-info[FileInfo] entities. Only set if |
| 8894 | link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES] |
| 8895 | option is requested. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 8896 | |`actions` |optional| |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 8897 | Actions the caller might be able to perform on this revision. The |
| 8898 | information is a map of view name to link:#action-info[ActionInfo] |
| 8899 | entities. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 8900 | |`reviewed` |optional| |
| 8901 | Indicates whether the caller is authenticated and has commented on the |
| 8902 | current revision. Only set if link:#reviewed[REVIEWED] option is requested. |
Quinten Yearsley | 28cd212 | 2019-06-10 14:41:13 -0700 | [diff] [blame] | 8903 | |`commit_with_footers` |optional| |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 8904 | If the link:#commit-footers[COMMIT_FOOTERS] option is requested and |
| 8905 | this is the current patch set, contains the full commit message with |
| 8906 | Gerrit-specific commit footers, as if this revision were submitted |
| 8907 | using the link:project-configuration.html#cherry_pick[Cherry Pick] |
| 8908 | submit type. |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 8909 | |`push_certificate` |optional| |
| 8910 | If the link:#push-certificates[PUSH_CERTIFICATES] option is requested, |
| 8911 | contains the push certificate provided by the user when uploading this |
| 8912 | patch set as a link:#push-certificate-info[PushCertificateInfo] entity. |
| 8913 | This field is always set if the option is requested; if no push |
| 8914 | certificate was provided, it is set to an empty object. |
Aaron Gable | 621c9b6 | 2017-04-21 09:24:20 -0700 | [diff] [blame] | 8915 | |`description` |optional| |
| 8916 | The description of this patchset, as displayed in the patchset |
| 8917 | selector menu. May be null if no description is set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8918 | |=========================== |
| 8919 | |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8920 | [[robot-comment-info]] |
Patrick Hiesel | ad9efd4 | 2024-01-18 15:16:20 +0100 | [diff] [blame] | 8921 | === RobotCommentInfo (deprecated) |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8922 | The `RobotCommentInfo` entity contains information about a robot inline |
| 8923 | comment. |
| 8924 | |
Alice Kober-Sotzek | 7d890be | 2020-10-01 17:41:56 +0200 | [diff] [blame] | 8925 | `RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>> |
| 8926 | except for the `unresolved` field which doesn't exist for robot comments. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8927 | In addition `RobotCommentInfo` has the following fields: |
| 8928 | |
| 8929 | [options="header",cols="1,^1,5"] |
| 8930 | |=========================== |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 8931 | |Field Name ||Description |
| 8932 | |`robot_id` ||The ID of the robot that generated this comment. |
| 8933 | |`robot_run_id` ||An ID of the run of the robot. |
| 8934 | |`url` |optional|URL to more information. |
| 8935 | |`properties` |optional|Robot specific properties as map that maps arbitrary |
| 8936 | keys to values. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8937 | |=========================== |
| 8938 | |
| 8939 | [[robot-comment-input]] |
Patrick Hiesel | ad9efd4 | 2024-01-18 15:16:20 +0100 | [diff] [blame] | 8940 | === RobotCommentInput (deprecated) |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8941 | The `RobotCommentInput` entity contains information for creating an inline |
| 8942 | robot comment. |
| 8943 | |
Alice Kober-Sotzek | 7d890be | 2020-10-01 17:41:56 +0200 | [diff] [blame] | 8944 | [options="header",cols="1,^1,5"] |
| 8945 | |=========================== |
| 8946 | |Field Name ||Description |
| 8947 | |`path` || |
| 8948 | link:#file-id[The file path] for which the inline comment should be added. |
| 8949 | |`side` |optional| |
| 8950 | The side on which the comment should be added. + |
| 8951 | Allowed values are `REVISION` and `PARENT`. + |
| 8952 | If not set, the default is `REVISION`. |
| 8953 | |`line` |optional| |
| 8954 | The number of the line for which the comment should be added. + |
| 8955 | `0` if it is a file comment. + |
| 8956 | If neither line nor range is set, a file comment is added. + |
| 8957 | If range is set, this value is ignored in favor of the `end_line` of the range. |
| 8958 | |`range` |optional| |
| 8959 | The range of the comment as a link:#comment-range[CommentRange] |
| 8960 | entity. |
| 8961 | |`in_reply_to` |optional| |
| 8962 | The URL encoded UUID of the comment to which this comment is a reply. |
| 8963 | |`message` |optional| |
| 8964 | The comment message. |
| 8965 | |`robot_id` ||The ID of the robot that generated this comment. |
| 8966 | |`robot_run_id` ||An ID of the run of the robot. |
| 8967 | |`url` |optional|URL to more information. |
| 8968 | |`properties` |optional|Robot specific properties as map that maps arbitrary |
| 8969 | keys to values. |
Alice Kober-Sotzek | 7d890be | 2020-10-01 17:41:56 +0200 | [diff] [blame] | 8970 | |=========================== |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8971 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8972 | [[rule-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8973 | === RuleInput |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8974 | The `RuleInput` entity contains information to test a Prolog rule. |
| 8975 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8976 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8977 | |=========================== |
| 8978 | |Field Name ||Description |
| 8979 | |`rule`|| |
| 8980 | Prolog code to execute instead of the code in `refs/meta/config`. |
| 8981 | |`filters`|`RUN` if not set| |
| 8982 | When `RUN` filter rules in the parent projects are called to |
| 8983 | post-process the results of the project specific rule. This |
| 8984 | behavior matches how the rule will execute if installed. + |
| 8985 | If `SKIP` the parent filters are not called, allowing the test |
| 8986 | to return results from the input rule. |
| 8987 | |=========================== |
| 8988 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8989 | [[submit-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8990 | === SubmitInput |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8991 | The `SubmitInput` entity contains information for submitting a change. |
| 8992 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8993 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8994 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8995 | |Field Name ||Description |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8996 | |`on_behalf_of` |optional| |
Dave Borowitz | c6d143d | 2016-02-24 12:32:23 -0500 | [diff] [blame] | 8997 | If set, submit the change on behalf of the given user. The value may take any |
| 8998 | format link:rest-api-accounts.html#account-id[accepted by the accounts REST |
| 8999 | API]. Using this option requires |
| 9000 | link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)] |
| 9001 | permission on the branch. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 9002 | |`notify` |optional| |
Stephen Li | a5a5ef0 | 2016-03-31 16:55:53 -0700 | [diff] [blame] | 9003 | Notify handling that defines to whom email notifications should be sent after |
| 9004 | the change is submitted. + |
| 9005 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Nitzan Gur-Furman | 9da317c | 2022-10-07 11:19:53 +0200 | [diff] [blame] | 9006 | If not set, the default is `ALL`.+ |
| 9007 | Ignored if a post approval diff is present (i.e. if the change is submitted |
| 9008 | with copied approvals), because in this case everyone should be informed |
| 9009 | about the non-reviewed diff which has been applied after the change has been |
| 9010 | approved so that they can take action if the post approval diff looks |
| 9011 | unexpected. In other words if a post approval diff is present `ALL` is |
| 9012 | enforced. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 9013 | |`notify_details`|optional| |
| 9014 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 9015 | of link:user-notify.html#recipient-types[recipient type] to |
| 9016 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 9017 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 9018 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 9019 | [[submit-record]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 9020 | === SubmitRecord |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 9021 | The `SubmitRecord` entity describes results from a submit_rule. |
Dave Borowitz | 6453fce | 2016-09-22 16:11:56 +0200 | [diff] [blame] | 9022 | Fields in this entity roughly correspond to the fields set by `LABELS` |
| 9023 | in link:#label-info[LabelInfo]. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 9024 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 9025 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 9026 | |=========================== |
| 9027 | |Field Name ||Description |
| 9028 | |`status`|| |
| 9029 | `OK`, the change can be submitted. + |
| 9030 | `NOT_READY`, additional labels are required before submit. + |
| 9031 | `CLOSED`, closed changes cannot be submitted. + |
| 9032 | `RULE_ERROR`, rule code failed with an error. |
| 9033 | |`ok`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 9034 | Map of labels that are approved; an |
| 9035 | link:rest-api-accounts.html#account-info[AccountInfo] identifies the |
| 9036 | voter chosen by the rule. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 9037 | |`reject`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 9038 | Map of labels that are preventing submit; |
| 9039 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 9040 | |`need`|optional| |
| 9041 | Map of labels that need to be given to submit. The value is |
| 9042 | currently an empty object. |
| 9043 | |`may`|optional| |
| 9044 | Map of labels that can be used, but do not affect submit. |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 9045 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter, |
| 9046 | if the label has been applied. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 9047 | |`impossible`|optional| |
| 9048 | Map of labels that should have been in `need` but cannot be |
| 9049 | used by any user because of access restrictions. The value |
| 9050 | is currently an empty object. |
| 9051 | |`error_message`|optional| |
| 9052 | When status is RULE_ERROR this message provides some text describing |
| 9053 | the failure of the rule predicate. |
| 9054 | |=========================== |
| 9055 | |
Youssef Elghareeb | 02d33aa | 2021-10-04 13:24:52 +0200 | [diff] [blame] | 9056 | [[submit-record-info]] |
| 9057 | === SubmitRecordInfo |
| 9058 | The `SubmitRecordInfo` entity describes results from a submit_rule. |
| 9059 | |
| 9060 | [options="header",cols="1,^1,5"] |
| 9061 | |=========================== |
| 9062 | |Field Name ||Description |
| 9063 | |`rule_name`|| |
| 9064 | The name of the submit rule that created this submit record. The submit rule is |
| 9065 | specified in the form of "$plugin~$rule" where `$plugin` is the plugin name |
| 9066 | and `$rule` is the name of the class that implemented the submit rule. |
| 9067 | |`status`|| |
| 9068 | `OK`, the change can be submitted. + |
| 9069 | `NOT_READY`, additional labels are required before submit. + |
| 9070 | `CLOSED`, closed changes cannot be submitted. + |
| 9071 | `FORCED`, the change was submitted bypassing the submit rule. + |
| 9072 | `RULE_ERROR`, rule code failed with an error. |
| 9073 | |`labels`|optional| |
| 9074 | A list of labels, each containing the following fields. + |
| 9075 | * `label`: the label name. + |
| 9076 | * `status`: the label status: {`OK`, `REJECT`, `MAY`, `NEED`, `IMPOSSIBLE`}. + |
| 9077 | * `appliedBy`: the link:rest-api-accounts.html#account-info[AccountInfo] |
| 9078 | that applied the vote to the label. |
| 9079 | |`requirements`|optional| |
| 9080 | List of the link:rest-api-changes.html#requirement[requirements] to be met |
| 9081 | before this change can be submitted. |
| 9082 | |`error_message`|optional| |
| 9083 | When status is RULE_ERROR this message provides some text describing |
| 9084 | the failure of the rule predicate. |
| 9085 | |=========================== |
| 9086 | |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9087 | [[submit-requirement-expression-info]] |
| 9088 | === SubmitRequirementExpressionInfo |
| 9089 | The `SubmitRequirementExpressionInfo` describes the result of evaluating a |
| 9090 | single submit requirement expression, for example `label:code-review=+2`. |
| 9091 | |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 9092 | [options="header",cols="1,^1,5"] |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9093 | |=========================== |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 9094 | |Field Name ||Description |
| 9095 | |`expression`|optional| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9096 | The submit requirement expression as a string, for example |
| 9097 | `branch:refs/heads/foo and label:verified=+1`. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 9098 | |`fulfilled`|| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9099 | True if the submit requirement is fulfilled for the change. |
Youssef Elghareeb | df62c5a | 2022-04-08 12:23:23 +0200 | [diff] [blame] | 9100 | |`status`|| |
| 9101 | A string containing the status of evaluating the expression which can be one |
| 9102 | of the following: + |
| 9103 | * `PASS` - expression was evaluated and result is true. + |
| 9104 | * `FAIL` - expression was evaluated and result is false. + |
| 9105 | * `ERROR` - an error occurred while evaluating the expression. + |
| 9106 | * `NOT_EVALUATED` - expression was not evaluated. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 9107 | |`passing_atoms`|optional| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9108 | A list of passing atoms as strings. For the above expression, |
| 9109 | `passing_atoms` can contain ["branch:refs/heads/foo"] if the branch predicate is |
| 9110 | fulfilled for the change. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 9111 | |`failing_atoms`|optional| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9112 | A list of failing atoms. This is similar to `passing_atoms` except that it |
| 9113 | contains the list of predicates that are not fulfilled for the change. |
Youssef Elghareeb | 393be61 | 2021-11-16 13:39:33 +0100 | [diff] [blame] | 9114 | |`error_message`|optional| |
| 9115 | If the submit requirement fails during evaluation, this string will contain |
| 9116 | an error message describing why it failed. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9117 | |=========================== |
| 9118 | |
Youssef Elghareeb | d598693 | 2021-10-15 11:45:23 +0200 | [diff] [blame] | 9119 | [[submit-requirement-input]] |
| 9120 | === SubmitRequirementInput |
| 9121 | The `SubmitRequirementInput` entity describes a submit requirement. |
| 9122 | |
| 9123 | [options="header",cols="1,^1,5"] |
| 9124 | |=========================== |
| 9125 | |Field Name ||Description |
| 9126 | |`name`|| |
| 9127 | The submit requirement name. |
| 9128 | |`description`|optional| |
| 9129 | Description of the submit requirement. |
| 9130 | |`applicability_expression`|optional| |
| 9131 | Query expression that can be evaluated on any change. If evaluated to true on a |
| 9132 | change, the submit requirement is then applicable for this change. |
| 9133 | If not specified, the submit requirement is applicable for all changes. |
| 9134 | |`submittability_expression`|| |
| 9135 | Query expression that can be evaluated on any change. If evaluated to true on a |
| 9136 | change, the submit requirement is fulfilled and not blocking change submission. |
| 9137 | |`override_expression`|optional| |
| 9138 | Query expression that can be evaluated on any change. If evaluated to true on a |
| 9139 | change, the submit requirement is overridden and not blocking change submission. |
| 9140 | |`allow_override_in_child_projects`|optional| |
| 9141 | Whether this submit requirement can be overridden in child projects. Default is |
| 9142 | `true`. |
| 9143 | |=========================== |
| 9144 | |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9145 | [[submit-requirement-result-info]] |
| 9146 | === SubmitRequirementResultInfo |
| 9147 | The `SubmitRequirementResultInfo` describes the result of evaluating a |
| 9148 | submit requirement on a change. |
| 9149 | |
| 9150 | [options="header",cols="1,^1,5"] |
| 9151 | |=========================== |
| 9152 | |Field Name ||Description |
| 9153 | |`name`|| |
| 9154 | The submit requirement name. |
| 9155 | |`description`|optional| |
| 9156 | Description of the submit requirement. |
| 9157 | |`status`|| |
| 9158 | Status describing the result of evaluating the submit requirement. The status |
Youssef Elghareeb | f592ed1 | 2021-11-26 15:52:06 +0100 | [diff] [blame] | 9159 | is one of (`SATISFIED`, `UNSATISFIED`, `OVERRIDDEN`, `NOT_APPLICABLE`, `ERROR`, |
| 9160 | `FORCED`). |
Youssef Elghareeb | 024103e | 2021-09-06 14:41:04 +0200 | [diff] [blame] | 9161 | |`is_legacy`|| |
| 9162 | If true, this submit requirement result was created from a legacy |
| 9163 | link:#submit-record[SubmitRecord]. Otherwise, it was created by evaluating a |
| 9164 | submit requirement. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9165 | |`applicability_expression_result`|optional| |
| 9166 | A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo] |
| 9167 | containing the result of evaluating the applicability expression. Not set if the |
| 9168 | submit requirement did not define an applicability expression. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 9169 | Note that fields `expression`, `passing_atoms` and `failing_atoms` are always |
| 9170 | omitted for the `applicability_expression_result`. |
Youssef Elghareeb | df62c5a | 2022-04-08 12:23:23 +0200 | [diff] [blame] | 9171 | |`submittability_expression_result`|| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9172 | A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo] |
Marija Savtchouk | 6d87bae | 2022-01-20 17:06:22 +0000 | [diff] [blame] | 9173 | containing the result of evaluating the submittability expression. + |
Youssef Elghareeb | df62c5a | 2022-04-08 12:23:23 +0200 | [diff] [blame] | 9174 | If the submit requirement does not apply, the `status` field of the result |
| 9175 | will be set to `NOT_EVALUATED`. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9176 | |`override_expression_result`|optional| |
| 9177 | A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo] |
Marija Savtchouk | 6d87bae | 2022-01-20 17:06:22 +0000 | [diff] [blame] | 9178 | containing the result of evaluating the override expression. + |
Youssef Elghareeb | df62c5a | 2022-04-08 12:23:23 +0200 | [diff] [blame] | 9179 | Not set if the submit requirement did not define an override expression. If the |
| 9180 | submit requirement does not apply, the `status` field of the result will be set |
| 9181 | to `NOT_EVALUATED`. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9182 | |=========================== |
| 9183 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 9184 | [[submitted-together-info]] |
| 9185 | === SubmittedTogetherInfo |
| 9186 | The `SubmittedTogetherInfo` entity contains information about a |
| 9187 | collection of changes that would be submitted together. |
| 9188 | |
| 9189 | [options="header",cols="1,6"] |
| 9190 | |=========================== |
| 9191 | |Field Name |Description |
| 9192 | |`changes` | |
| 9193 | A list of ChangeInfo entities representing the changes to be submitted together. |
| 9194 | |`non_visible_changes`| |
| 9195 | The number of changes to be submitted together that the current user |
| 9196 | cannot see. (This count includes changes that are visible to the |
| 9197 | current user when their reason for being submitted together involves |
| 9198 | changes the user cannot see.) |
| 9199 | |=========================== |
| 9200 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 9201 | [[suggested-reviewer-info]] |
| 9202 | === SuggestedReviewerInfo |
| 9203 | The `SuggestedReviewerInfo` entity contains information about a reviewer |
| 9204 | that can be added to a change (an account or a group). |
| 9205 | |
| 9206 | `SuggestedReviewerInfo` has either the `account` field that contains |
| 9207 | the link:rest-api-accounts.html#account-info[AccountInfo] entity, or |
| 9208 | the `group` field that contains the |
| 9209 | link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity. |
| 9210 | |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 9211 | [options="header",cols="1,^1,5"] |
| 9212 | |=========================== |
| 9213 | |Field Name ||Description |
| 9214 | |`account` |optional| |
| 9215 | An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the |
| 9216 | suggestion is an account. |
| 9217 | |`group` |optional| |
| 9218 | A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the |
| 9219 | suggestion is a group. |
| 9220 | |`count` || |
| 9221 | The total number of accounts in the suggestion. This is `1` if `account` is |
| 9222 | present. If `group` is present, the total number of accounts that are |
| 9223 | members of the group is returned (this count includes members of nested |
| 9224 | groups). |
| 9225 | |`confirm` |optional| |
| 9226 | True if `group` is present and `count` is above the threshold where the |
| 9227 | `confirmed` flag must be passed to add the group as a reviewer. |
| 9228 | |=========================== |
| 9229 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 9230 | [[topic-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 9231 | === TopicInput |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 9232 | The `TopicInput` entity contains information for setting a topic. |
| 9233 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 9234 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 9235 | |=========================== |
| 9236 | |Field Name ||Description |
| 9237 | |`topic` |optional|The topic. + |
| 9238 | The topic will be deleted if not set. |
Gal Paikin | 44dbd7e | 2020-04-15 15:23:44 +0200 | [diff] [blame] | 9239 | Topic can't contain quotation marks. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 9240 | |=========================== |
| 9241 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 9242 | [[tracking-id-info]] |
| 9243 | === TrackingIdInfo |
| 9244 | The `TrackingIdInfo` entity describes a reference to an external tracking system. |
| 9245 | |
| 9246 | [options="header",cols="1,6"] |
| 9247 | |====================== |
| 9248 | |Field Name|Description |
| 9249 | |`system` |The name of the external tracking system. |
| 9250 | |`id` |The tracking id. |
| 9251 | |====================== |
| 9252 | |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 9253 | [[voting-range-info]] |
| 9254 | === VotingRangeInfo |
| 9255 | The `VotingRangeInfo` entity describes the continuous voting range from min |
| 9256 | to max values. |
| 9257 | |
| 9258 | [options="header",cols="1,6"] |
| 9259 | |====================== |
| 9260 | |Field Name|Description |
| 9261 | |`min` |The minimum voting value. |
| 9262 | |`max` |The maximum voting value. |
| 9263 | |====================== |
| 9264 | |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 9265 | [[web-link-info]] |
| 9266 | === WebLinkInfo |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 9267 | The `WebLinkInfo` entity describes a link to an external site. Depending on the |
| 9268 | context and the provided data the UI may decide to show the link as a text link, |
| 9269 | a linkified icon, or both. |
| 9270 | |
| 9271 | If the `tooltip` is not provided, then the UI may fall back to showing something |
| 9272 | like "Open in External Tool". |
| 9273 | |
| 9274 | Weblinks will always be opened in a new tab. |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 9275 | |
Edwin Kempin | af35ce4 | 2021-01-29 13:50:04 +0100 | [diff] [blame] | 9276 | [options="header",cols="1,^1,5"] |
| 9277 | |======================== |
| 9278 | |Field Name ||Description |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 9279 | |`name` ||The text to be linkified. |
| 9280 | |`tooltip` |optional|Tooltip to show when hovering over the link. Using "Open |
| 9281 | in $NAME_OF_EXTERNAL_TOOL" is a good option here. |
Edwin Kempin | af35ce4 | 2021-01-29 13:50:04 +0100 | [diff] [blame] | 9282 | |`url` ||The link URL. |
| 9283 | |`image_url`|optional|URL to the icon of the link. |
Edwin Kempin | af35ce4 | 2021-01-29 13:50:04 +0100 | [diff] [blame] | 9284 | |======================== |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 9285 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 9286 | [[work-in-progress-input]] |
| 9287 | === WorkInProgressInput |
| 9288 | The `WorkInProgressInput` entity contains additional information for a change |
| 9289 | set to WorkInProgress/ReadyForReview. |
| 9290 | |
| 9291 | [options="header",cols="1,^1,5"] |
| 9292 | |============================= |
| 9293 | |Field Name ||Description |
| 9294 | |`message` |optional| |
| 9295 | Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview. |
| 9296 | |============================= |
| 9297 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 9298 | GERRIT |
| 9299 | ------ |
| 9300 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 9301 | |
| 9302 | SEARCHBOX |
| 9303 | --------- |