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 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 164 | Clients are allowed to specify more than one query by setting the `q` |
| 165 | parameter multiple times. In this case the result is an array of |
| 166 | arrays, one per query in the same order the queries were given in. |
| 167 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 168 | .Query for the 25 most recent open changes of the projects that you watch |
| 169 | **** |
| 170 | get::/changes/?q=status:open+is:watched&n=25 |
| 171 | **** |
| 172 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 173 | Query that retrieves changes for a user's dashboard: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 174 | |
| 175 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 176 | ---- |
| 177 | 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] | 178 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 179 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 180 | .Response |
| 181 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 182 | HTTP/1.1 200 OK |
| 183 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 184 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 185 | |
| 186 | )]}' |
| 187 | [ |
| 188 | [ |
| 189 | { |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 190 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 191 | "project": "demo", |
| 192 | "branch": "master", |
| 193 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 194 | "subject": "One change", |
| 195 | "status": "NEW", |
| 196 | "created": "2012-07-17 07:18:30.854000000", |
| 197 | "updated": "2012-07-17 07:19:27.766000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 198 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 199 | "insertions": 4, |
| 200 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 201 | "_number": 1756, |
| 202 | "owner": { |
| 203 | "name": "John Doe" |
| 204 | }, |
| 205 | "labels": { |
| 206 | "Verified": {}, |
| 207 | "Code-Review": {} |
| 208 | } |
| 209 | } |
| 210 | ], |
| 211 | [], |
| 212 | [] |
| 213 | ] |
| 214 | ---- |
| 215 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 216 | .Query the changes for your user dashboard |
| 217 | **** |
| 218 | get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS |
| 219 | **** |
| 220 | |
David Pursehouse | 2cf2843 | 2016-08-21 23:20:08 +0900 | [diff] [blame] | 221 | [[query-options]] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 222 | Additional fields can be obtained by adding `o` parameters, each |
| 223 | option requires more database lookups and slows down the query |
| 224 | response time to the client so they are generally disabled by |
| 225 | default. Optional fields are: |
| 226 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 227 | [[labels]] |
| 228 | -- |
Youssef Elghareeb | 9b3e021 | 2022-01-21 14:40:18 +0100 | [diff] [blame] | 229 | * `LABELS`: Includes the `labels` field which contains all information about |
| 230 | labels and approvers that have granted (or rejected) that label. Does not |
| 231 | include the `permitted_voting_range` attribute with the list of |
| 232 | link:#approval-info[ApprovalInfo] of the `all` attribute. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 233 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 234 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 235 | [[detailed-labels]] |
| 236 | -- |
Youssef Elghareeb | 9b3e021 | 2022-01-21 14:40:18 +0100 | [diff] [blame] | 237 | * `DETAILED_LABELS`: Includes the `labels` field which contains all information |
| 238 | about labels and approvers that have granted (or rejected) that label, including |
| 239 | the `permitted_voting_range` attribute with the list of |
| 240 | link:#approval-info[ApprovalInfo] of the `all` attribute. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 241 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 242 | |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 243 | [[submit-requirements]] |
| 244 | -- |
| 245 | * `SUBMIT_REQUIREMENTS`: detailed result of the evaluated submit requirements |
| 246 | for this change. |
| 247 | -- |
| 248 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 249 | [[current-revision]] |
| 250 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 251 | * `CURRENT_REVISION`: describe the current revision (patch set) |
| 252 | 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] | 253 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 254 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 255 | [[all-revisions]] |
| 256 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 257 | * `ALL_REVISIONS`: describe all revisions, not just current. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 258 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 259 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 260 | [[download-commands]] |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 261 | -- |
| 262 | * `DOWNLOAD_COMMANDS`: include the `commands` field in the |
| 263 | link:#fetch-info[FetchInfo] for revisions. Only valid when the |
| 264 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
| 265 | -- |
| 266 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 267 | [[current-commit]] |
| 268 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 269 | * `CURRENT_COMMIT`: parse and output all header fields from the |
David Pursehouse | 98006e8 | 2013-10-02 10:15:52 +0900 | [diff] [blame] | 270 | commit object, including message. Only valid when the |
| 271 | `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 272 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 273 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 274 | [[all-commits]] |
| 275 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 276 | * `ALL_COMMITS`: parse and output all header fields from the |
| 277 | output revisions. If only `CURRENT_REVISION` was requested |
| 278 | then only the current revision's commit data will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 279 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 280 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 281 | [[current-files]] |
| 282 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 283 | * `CURRENT_FILES`: list files modified by the commit and magic files, |
| 284 | including basic line counts inserted/deleted per file. Only valid |
| 285 | when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 286 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 287 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 288 | [[all-files]] |
| 289 | -- |
Edwin Kempin | 8fd96b9 | 2016-12-05 16:39:03 +0100 | [diff] [blame] | 290 | * `ALL_FILES`: list files modified by the commit and magic files, |
| 291 | including basic line counts inserted/deleted per file. If only the |
| 292 | `CURRENT_REVISION` was requested then only that commit's modified |
| 293 | files will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 294 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 295 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 296 | [[detailed-accounts]] |
| 297 | -- |
Edwin Kempin | 4a00e22 | 2013-10-16 14:34:24 +0200 | [diff] [blame] | 298 | * `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username` |
| 299 | fields when referencing accounts. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 300 | -- |
Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 301 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 302 | [[reviewer-updates]] |
| 303 | -- |
| 304 | * `REVIEWER_UPDATES`: include updates to reviewers set as |
| 305 | link:#review-update-info[ReviewerUpdateInfo] entities. |
| 306 | -- |
| 307 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 308 | [[messages]] |
| 309 | -- |
| 310 | * `MESSAGES`: include messages associated with the change. |
| 311 | -- |
| 312 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 313 | [[actions]] |
| 314 | -- |
| 315 | * `CURRENT_ACTIONS`: include information on available actions |
Stefan Beller | 09cd95d | 2015-02-12 13:40:23 -0800 | [diff] [blame] | 316 | for the change and its current revision. Ignored if the caller |
| 317 | is not authenticated. |
| 318 | -- |
| 319 | |
| 320 | [[change-actions]] |
| 321 | -- |
| 322 | * `CHANGE_ACTIONS`: include information on available |
| 323 | change actions for the change. Ignored if the caller |
| 324 | is not authenticated. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 325 | -- |
| 326 | |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 327 | [[reviewed]] |
| 328 | -- |
Dave Borowitz | 86669b3 | 2015-05-27 14:56:10 -0700 | [diff] [blame] | 329 | * `REVIEWED`: include the `reviewed` field if all of the following are |
| 330 | true: |
Ardo Septama | 505f9ad | 2016-12-06 16:28:00 +0100 | [diff] [blame] | 331 | - the change is open |
| 332 | - the caller is authenticated |
| 333 | - 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] | 334 | from the change owner, i.e. this change would show up in the results of |
| 335 | link:user-search.html#reviewedby[reviewedby:self]. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 336 | -- |
Gal Paikin | 3a2aa01 | 2019-06-21 18:30:01 +0200 | [diff] [blame] | 337 | [[skip_diffstat]] |
| 338 | -- |
| 339 | * `SKIP_DIFFSTAT`: skip the 'insertions' and 'deletions' field in link:#change-info[ChangeInfo]. |
| 340 | For large trees, their computation may be expensive. |
| 341 | -- |
Han-Wen Nienhuys | 19de6cd | 2018-01-16 13:15:38 +0100 | [diff] [blame] | 342 | |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 343 | [[submittable]] |
| 344 | -- |
Jonathan Nieder | ad5240f | 2016-10-04 11:03:23 -0700 | [diff] [blame] | 345 | * `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo], |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 346 | which can be used to tell if the change is reviewed and ready for submit. |
| 347 | -- |
| 348 | |
Khai Do | 2a23ec8 | 2014-09-19 16:33:02 -0700 | [diff] [blame] | 349 | [[web-links]] |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 350 | -- |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 351 | * `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo], |
| 352 | therefore only valid in combination with `CURRENT_COMMIT` or |
| 353 | `ALL_COMMITS`. |
Sven Selberg | ae1a10c | 2014-02-14 14:24:29 +0100 | [diff] [blame] | 354 | -- |
| 355 | |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 356 | [[check]] |
| 357 | -- |
| 358 | * `CHECK`: include potential problems with the change. |
| 359 | -- |
| 360 | |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 361 | [[commit-footers]] |
| 362 | -- |
| 363 | * `COMMIT_FOOTERS`: include the full commit message with |
| 364 | Gerrit-specific commit footers in the |
| 365 | link:#revision-info[RevisionInfo]. |
Yuxuan 'fishy' Wang | 16baf21 | 2015-05-05 16:49:55 -0700 | [diff] [blame] | 366 | -- |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 367 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 368 | [[push-certificates]] |
| 369 | -- |
| 370 | * `PUSH_CERTIFICATES`: include push certificate information in the |
| 371 | link:#revision-info[RevisionInfo]. Ignored if signed push is not |
| 372 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the |
| 373 | server. |
| 374 | -- |
| 375 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 376 | [[tracking-ids]] |
| 377 | -- |
| 378 | * `TRACKING_IDS`: include references to external tracking systems |
| 379 | as link:#tracking-id-info[TrackingIdInfo]. |
| 380 | -- |
| 381 | |
Chris Poucet | c2962dc | 2023-03-07 17:19:25 +0100 | [diff] [blame] | 382 | [[custom-keyed-values]] |
| 383 | -- |
| 384 | * `CUSTOM_KEYED_VALUES`: include the custom key-value map |
Kamil Musin | 5338200 | 2023-05-04 10:18:14 +0200 | [diff] [blame] | 385 | -- |
Chris Poucet | c2962dc | 2023-03-07 17:19:25 +0100 | [diff] [blame] | 386 | |
Youssef Elghareeb | f4f4948 | 2023-04-26 18:02:33 +0200 | [diff] [blame] | 387 | [[star]] |
| 388 | -- |
| 389 | * `STAR`: include the `starred` field in |
| 390 | link:#change-info[ChangeInfo], which indicates if the change is starred |
| 391 | by the current user or not. |
| 392 | -- |
| 393 | |
Youssef Elghareeb | a112144 | 2023-06-14 14:53:59 +0200 | [diff] [blame] | 394 | [[parents-data]] |
| 395 | -- |
| 396 | * `PARENTS`: include the `parents_data` field in |
| 397 | link:#revision-info[RevisionInfo], which provides information of whether the |
| 398 | parent commit of this revision, e.g. if it's merged in the target branch |
| 399 | and whether it points to a patch-set of another change. |
| 400 | -- |
| 401 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 402 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 403 | ---- |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 404 | 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] | 405 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 406 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 407 | .Response |
| 408 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 409 | HTTP/1.1 200 OK |
| 410 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 411 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 412 | |
| 413 | )]}' |
| 414 | [ |
| 415 | { |
David Pursehouse | c3be6ad | 2014-07-18 12:03:06 +0900 | [diff] [blame] | 416 | "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 417 | "project": "gerrit", |
| 418 | "branch": "master", |
| 419 | "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 420 | "subject": "Use an EventBus to manage star icons", |
| 421 | "status": "NEW", |
| 422 | "created": "2012-04-25 00:52:25.580000000", |
| 423 | "updated": "2012-04-25 00:52:25.586000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 424 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 425 | "insertions": 16, |
| 426 | "deletions": 7, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 427 | "_number": 97, |
| 428 | "owner": { |
| 429 | "name": "Shawn Pearce" |
| 430 | }, |
| 431 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", |
| 432 | "revisions": { |
| 433 | "184ebe53805e102605d11f6b143486d15c23a09c": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 434 | "kind": "REWORK", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 435 | "_number": 1, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 436 | "ref": "refs/changes/97/97/1", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 437 | "fetch": { |
| 438 | "git": { |
| 439 | "url": "git://localhost/gerrit", |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 440 | "ref": "refs/changes/97/97/1", |
| 441 | "commands": { |
| 442 | "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 443 | "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 444 | "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 445 | "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1" |
| 446 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 447 | }, |
| 448 | "http": { |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 449 | "url": "http://myuser@127.0.0.1:8080/gerrit", |
| 450 | "ref": "refs/changes/97/97/1", |
| 451 | "commands": { |
| 452 | "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 453 | "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 454 | "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", |
| 455 | "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1" |
| 456 | } |
| 457 | }, |
| 458 | "ssh": { |
| 459 | "url": "ssh://myuser@*:29418/gerrit", |
| 460 | "ref": "refs/changes/97/97/1", |
| 461 | "commands": { |
| 462 | "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD", |
| 463 | "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD", |
| 464 | "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD", |
| 465 | "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1" |
| 466 | } |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 467 | } |
| 468 | }, |
| 469 | "commit": { |
| 470 | "parents": [ |
| 471 | { |
| 472 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 473 | "subject": "Migrate contributor agreements to All-Projects." |
| 474 | } |
| 475 | ], |
| 476 | "author": { |
| 477 | "name": "Shawn O. Pearce", |
| 478 | "email": "sop@google.com", |
| 479 | "date": "2012-04-24 18:08:08.000000000", |
| 480 | "tz": -420 |
| 481 | }, |
| 482 | "committer": { |
| 483 | "name": "Shawn O. Pearce", |
| 484 | "email": "sop@google.com", |
| 485 | "date": "2012-04-24 18:08:08.000000000", |
| 486 | "tz": -420 |
| 487 | }, |
| 488 | "subject": "Use an EventBus to manage star icons", |
| 489 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 490 | }, |
| 491 | "files": { |
| 492 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 493 | "lines_deleted": 8, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 494 | "size_delta": -412, |
| 495 | "size": 7782 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 496 | }, |
| 497 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 498 | "lines_inserted": 1, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 499 | "size_delta": 23, |
| 500 | "size": 6762 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 501 | }, |
| 502 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { |
| 503 | "lines_inserted": 11, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 504 | "lines_deleted": 19, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 505 | "size_delta": -298, |
| 506 | "size": 47023 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 507 | }, |
| 508 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { |
| 509 | "lines_inserted": 23, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 510 | "lines_deleted": 20, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 511 | "size_delta": 132, |
| 512 | "size": 17727 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 513 | }, |
| 514 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { |
| 515 | "status": "D", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 516 | "lines_deleted": 139, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 517 | "size_delta": -5512, |
| 518 | "size": 13098 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 519 | }, |
| 520 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { |
| 521 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 522 | "lines_inserted": 204, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 523 | "size_delta": 8345, |
| 524 | "size": 8345 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 525 | }, |
| 526 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 527 | "lines_deleted": 9, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 528 | "size_delta": -343, |
| 529 | "size": 5385 |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 530 | } |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 | ] |
| 536 | ---- |
| 537 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 538 | [[get-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 539 | === Get Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 540 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 541 | 'GET /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 542 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 543 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 544 | Retrieves a change. |
| 545 | |
Dave Borowitz | 0314f73 | 2013-10-03 09:34:30 -0700 | [diff] [blame] | 546 | Additional fields can be obtained by adding `o` parameters, each |
| 547 | option requires more database lookups and slows down the query |
| 548 | response time to the client so they are generally disabled by |
| 549 | default. Fields are described in link:#list-changes[Query Changes]. |
| 550 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 551 | .Request |
| 552 | ---- |
| 553 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 554 | ---- |
| 555 | |
| 556 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 557 | describes the change. |
| 558 | |
| 559 | .Response |
| 560 | ---- |
| 561 | HTTP/1.1 200 OK |
| 562 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 563 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 564 | |
| 565 | )]}' |
| 566 | { |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 567 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 568 | "project": "myProject", |
| 569 | "branch": "master", |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 570 | "attention_set": { |
| 571 | "1000096": { |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 572 | "account": { |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 573 | "_account_id": 1000096, |
| 574 | "name": "John Doe", |
| 575 | "email": "john.doe@example.com" |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 576 | }, |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 577 | "last_update": "2013-02-21 11:16:36.775000000", |
| 578 | "reason": "reviewer or cc replied" |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 579 | } |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 580 | }, |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 581 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 582 | "subject": "Implementing Feature X", |
| 583 | "status": "NEW", |
| 584 | "created": "2013-02-01 09:59:32.126000000", |
| 585 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 586 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 587 | "insertions": 34, |
| 588 | "deletions": 101, |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 589 | "_number": 3965, |
| 590 | "owner": { |
| 591 | "name": "John Doe" |
| 592 | } |
| 593 | } |
| 594 | ---- |
| 595 | |
Han-Wen Nienhuys | 63b81f2 | 2021-02-17 10:31:01 +0100 | [diff] [blame] | 596 | Historical state of the change can be retrieved by specifying the |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 597 | `meta=SHA-1` parameter. This will use a historical NoteDb snapshot to |
| 598 | 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] | 599 | status code 412 is returned. |
| 600 | |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 601 | [[get-meta-diff]] |
| 602 | === Get Meta Diff |
| 603 | -- |
Han-Wen Nienhuys | 524317a | 2021-04-08 12:12:35 +0200 | [diff] [blame] | 604 | '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] | 605 | -- |
| 606 | |
| 607 | Retrieves the difference between two historical states of a change |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 608 | by specifying the `old=SHA-1` and the `meta=SHA-1` parameters. |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 609 | |
| 610 | 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] | 611 | 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] | 612 | state of the change is used. If neither are provided, the |
| 613 | difference between the current state of the change and its previous |
| 614 | state is returned. |
| 615 | |
| 616 | Additional fields can be obtained by adding `o` parameters, analogous |
| 617 | to link:#get-change[Get Change], and the same concerns for Get Change hold for |
| 618 | this endpoint too. Fields are described in link:#list-changes[Query Changes]. |
| 619 | |
| 620 | .Request |
| 621 | ---- |
| 622 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/meta_diff?old=b083abc34eb6dbdb9e154ba092fc198000e997b4&meta=63b81f2bde703ae07787a940e8fdf9a1828605b1 HTTP/1.0 |
| 623 | ---- |
| 624 | |
| 625 | As a response, two link:#change-info[ChangeInfo] entities are returned |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 626 | that describe information added and removed from the `old` change state, and |
| 627 | the two link:#change-info[ChangeInfo] entities that generated the diff are |
| 628 | 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] | 629 | |
| 630 | .Response |
| 631 | ---- |
| 632 | HTTP/1.1 200 OK |
| 633 | Content-Disposition: attachment |
| 634 | Content-Type: application/json; charset=UTF-8 |
| 635 | |
| 636 | )]}' |
| 637 | { |
| 638 | "added": { |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 639 | "attention_set": { |
| 640 | "1000096": { |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 641 | "account": { |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 642 | "_account_id": 1000096, |
| 643 | "name": "John Doe", |
| 644 | "email": "john.doe@example.com" |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 645 | }, |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 646 | "last_update": "2013-02-21 11:16:36.775000000", |
| 647 | "reason": "reviewer or cc replied" |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 648 | } |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 649 | }, |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 650 | "updated": "2013-02-21 11:16:36.775000000", |
| 651 | "topic": "new-topic" |
| 652 | }, |
| 653 | "removed": { |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 654 | "updated": "2013-02-01 09:59:32.126000000", |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 655 | "topic": "old-topic" |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 656 | }, |
| 657 | "old_change_info": { |
| 658 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 659 | "project": "myProject", |
| 660 | "branch": "master", |
| 661 | "attention_set": [], |
| 662 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 663 | "subject": "Implementing Feature X", |
| 664 | "status": "NEW", |
| 665 | "topic": "old-topic", |
| 666 | "created": "2013-02-01 09:59:32.126000000", |
| 667 | "updated": "2013-02-01 09:59:32.126000000", |
| 668 | "mergeable": true, |
| 669 | "insertions": 34, |
| 670 | "deletions": 101, |
| 671 | "_number": 3965, |
| 672 | "owner": { |
| 673 | "name": "John Doe" |
| 674 | } |
| 675 | }, |
| 676 | "new_change_info": { |
| 677 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 678 | "project": "myProject", |
| 679 | "branch": "master", |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 680 | "attention_set": { |
| 681 | "1000096": { |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 682 | "account": { |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 683 | "_account_id": 1000096, |
| 684 | "name": "John Doe", |
| 685 | "email": "john.doe@example.com" |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 686 | }, |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 687 | "last_update": "2013-02-21 11:16:36.775000000", |
| 688 | "reason": "reviewer or cc replied" |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 689 | } |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 690 | }, |
Alex Spradlin | 94099b6 | 2021-09-29 13:15:23 -0700 | [diff] [blame] | 691 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 692 | "subject": "Implementing Feature X", |
| 693 | "status": "NEW", |
| 694 | "topic": "new-topic", |
| 695 | "created": "2013-02-01 09:59:32.126000000", |
| 696 | "updated": "2013-02-21 11:16:36.775000000", |
| 697 | "mergeable": true, |
| 698 | "insertions": 34, |
| 699 | "deletions": 101, |
| 700 | "_number": 3965, |
| 701 | "owner": { |
| 702 | "name": "John Doe" |
| 703 | } |
| 704 | }, |
Alex Spradlin | b65494f | 2021-03-03 11:22:27 -0800 | [diff] [blame] | 705 | } |
| 706 | ---- |
| 707 | |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 708 | If the provided SHA-1 for `meta` is not reachable as a NoteDb |
| 709 | 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] | 710 | is not reachable, the difference between the change at state |
| 711 | `meta` and an empty change is returned. |
Han-Wen Nienhuys | 63b81f2 | 2021-02-17 10:31:01 +0100 | [diff] [blame] | 712 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 713 | [[get-change-detail]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 714 | === Get Change Detail |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 715 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 716 | 'GET /changes/link:#change-id[\{change-id\}]/detail' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 717 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 718 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 719 | Retrieves a change with link:#labels[labels], link:#detailed-labels[ |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 720 | detailed labels], link:#detailed-accounts[detailed accounts], |
| 721 | link:#reviewer-updates[reviewer updates], and link:#messages[messages]. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 722 | |
Shawn Pearce | 7f3dccf | 2013-07-06 19:24:29 -0700 | [diff] [blame] | 723 | Additional fields can be obtained by adding `o` parameters, each |
| 724 | option requires more database lookups and slows down the query |
| 725 | response time to the client so they are generally disabled by |
| 726 | default. Fields are described in link:#list-changes[Query Changes]. |
| 727 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 728 | .Request |
| 729 | ---- |
| 730 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0 |
| 731 | ---- |
| 732 | |
| 733 | As response a link:#change-info[ChangeInfo] entity is returned that |
Khai Do | ad63201 | 2014-06-22 08:29:57 -0700 | [diff] [blame] | 734 | describes the change. This response will contain all votes for each |
| 735 | label and include one combined vote. The combined label vote is |
| 736 | calculated in the following order (from highest to lowest): |
| 737 | REJECTED > APPROVED > DISLIKED > RECOMMENDED. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 738 | |
| 739 | .Response |
| 740 | ---- |
| 741 | HTTP/1.1 200 OK |
| 742 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 743 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 744 | |
| 745 | )]}' |
| 746 | { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 747 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 748 | "project": "myProject", |
| 749 | "branch": "master", |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 750 | "attention_set": { |
| 751 | "1000096": { |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 752 | "account": { |
| 753 | "_account_id": 1000096, |
| 754 | "name": "John Doe", |
| 755 | "email": "john.doe@example.com", |
| 756 | "username": "jdoe" |
| 757 | }, |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 758 | "last_update": "2013-02-21 11:16:36.775000000", |
| 759 | "reason": "reviewer or cc replied" |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 760 | } |
Edwin Kempin | 065e5a2 | 2022-12-19 13:34:10 +0100 | [diff] [blame] | 761 | }, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 762 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 763 | "subject": "Implementing Feature X", |
| 764 | "status": "NEW", |
| 765 | "created": "2013-02-01 09:59:32.126000000", |
| 766 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 767 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 768 | "insertions": 126, |
| 769 | "deletions": 11, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 770 | "_number": 3965, |
| 771 | "owner": { |
| 772 | "_account_id": 1000096, |
| 773 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 774 | "email": "john.doe@example.com", |
| 775 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 776 | }, |
| 777 | "labels": { |
| 778 | "Verified": { |
| 779 | "all": [ |
| 780 | { |
| 781 | "value": 0, |
| 782 | "_account_id": 1000096, |
| 783 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 784 | "email": "john.doe@example.com", |
| 785 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 786 | }, |
| 787 | { |
| 788 | "value": 0, |
| 789 | "_account_id": 1000097, |
| 790 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 791 | "email": "jane.roe@example.com", |
| 792 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 793 | } |
| 794 | ], |
| 795 | "values": { |
| 796 | "-1": "Fails", |
| 797 | " 0": "No score", |
| 798 | "+1": "Verified" |
| 799 | } |
| 800 | }, |
| 801 | "Code-Review": { |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 802 | "disliked": { |
| 803 | "_account_id": 1000096, |
| 804 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 805 | "email": "john.doe@example.com", |
| 806 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 807 | }, |
| 808 | "all": [ |
| 809 | { |
| 810 | "value": -1, |
| 811 | "_account_id": 1000096, |
| 812 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 813 | "email": "john.doe@example.com", |
| 814 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 815 | }, |
| 816 | { |
| 817 | "value": 1, |
| 818 | "_account_id": 1000097, |
| 819 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 820 | "email": "jane.roe@example.com", |
| 821 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 822 | } |
| 823 | ] |
| 824 | "values": { |
Oswald Buddenhagen | f887770 | 2022-02-15 14:01:34 +0100 | [diff] [blame] | 825 | "-2": "This shall not be submitted", |
| 826 | "-1": "I would prefer this is not submitted as is", |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 827 | " 0": "No score", |
| 828 | "+1": "Looks good to me, but someone else must approve", |
| 829 | "+2": "Looks good to me, approved" |
| 830 | } |
| 831 | } |
| 832 | }, |
| 833 | "permitted_labels": { |
| 834 | "Verified": [ |
| 835 | "-1", |
| 836 | " 0", |
| 837 | "+1" |
| 838 | ], |
| 839 | "Code-Review": [ |
| 840 | "-2", |
| 841 | "-1", |
| 842 | " 0", |
| 843 | "+1", |
| 844 | "+2" |
| 845 | ] |
| 846 | }, |
Nitzan Gur-Furman | d122357 | 2023-01-16 12:07:46 +0000 | [diff] [blame] | 847 | "removable_labels": { |
| 848 | "Code-Review": { |
| 849 | "-1": [ |
| 850 | { |
| 851 | "_account_id": 1000096, |
| 852 | "name": "John Doe", |
| 853 | "email": "john.doe@example.com", |
| 854 | "username": "jdoe" |
| 855 | } |
| 856 | ], |
| 857 | "+1": [ |
| 858 | { |
| 859 | "_account_id": 1000097, |
| 860 | "name": "Jane Roe", |
| 861 | "email": "jane.roe@example.com", |
| 862 | "username": "jroe" |
| 863 | } |
| 864 | ] |
| 865 | } |
| 866 | }, |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 867 | "removable_reviewers": [ |
| 868 | { |
| 869 | "_account_id": 1000096, |
| 870 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 871 | "email": "john.doe@example.com", |
| 872 | "username": "jdoe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 873 | }, |
| 874 | { |
| 875 | "_account_id": 1000097, |
| 876 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 877 | "email": "jane.roe@example.com", |
| 878 | "username": "jroe" |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 879 | } |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 880 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 881 | "reviewers": { |
| 882 | "REVIEWER": [ |
| 883 | { |
| 884 | "_account_id": 1000096, |
| 885 | "name": "John Doe", |
| 886 | "email": "john.doe@example.com", |
| 887 | "username": "jdoe" |
| 888 | }, |
| 889 | { |
| 890 | "_account_id": 1000097, |
| 891 | "name": "Jane Roe", |
| 892 | "email": "jane.roe@example.com", |
| 893 | "username": "jroe" |
| 894 | } |
| 895 | ] |
| 896 | }, |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 897 | "reviewer_updates": [ |
| 898 | { |
| 899 | "state": "REVIEWER", |
| 900 | "reviewer": { |
| 901 | "_account_id": 1000096, |
| 902 | "name": "John Doe", |
| 903 | "email": "john.doe@example.com", |
| 904 | "username": "jdoe" |
| 905 | }, |
| 906 | "updated_by": { |
| 907 | "_account_id": 1000096, |
| 908 | "name": "John Doe", |
| 909 | "email": "john.doe@example.com", |
| 910 | "username": "jdoe" |
| 911 | }, |
| 912 | "updated": "2016-07-21 20:12:39.000000000" |
| 913 | }, |
| 914 | { |
| 915 | "state": "REMOVED", |
| 916 | "reviewer": { |
| 917 | "_account_id": 1000096, |
| 918 | "name": "John Doe", |
| 919 | "email": "john.doe@example.com", |
| 920 | "username": "jdoe" |
| 921 | }, |
| 922 | "updated_by": { |
| 923 | "_account_id": 1000096, |
| 924 | "name": "John Doe", |
| 925 | "email": "john.doe@example.com", |
| 926 | "username": "jdoe" |
| 927 | }, |
| 928 | "updated": "2016-07-21 20:12:33.000000000" |
| 929 | }, |
| 930 | { |
| 931 | "state": "CC", |
| 932 | "reviewer": { |
| 933 | "_account_id": 1000096, |
| 934 | "name": "John Doe", |
| 935 | "email": "john.doe@example.com", |
| 936 | "username": "jdoe" |
| 937 | }, |
| 938 | "updated_by": { |
| 939 | "_account_id": 1000096, |
| 940 | "name": "John Doe", |
| 941 | "email": "john.doe@example.com", |
| 942 | "username": "jdoe" |
| 943 | }, |
| 944 | "updated": "2016-03-23 21:34:02.419000000", |
| 945 | }, |
| 946 | ], |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 947 | "messages": [ |
| 948 | { |
| 949 | "id": "YH-egE", |
| 950 | "author": { |
| 951 | "_account_id": 1000096, |
| 952 | "name": "John Doe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 953 | "email": "john.doe@example.com", |
| 954 | "username": "jdoe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 955 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 956 | "date": "2013-03-23 21:34:02.419000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 957 | "message": "Patch Set 1:\n\nThis is the first message.", |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 958 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 959 | }, |
| 960 | { |
| 961 | "id": "WEEdhU", |
| 962 | "author": { |
| 963 | "_account_id": 1000097, |
| 964 | "name": "Jane Roe", |
Edwin Kempin | 65886f0 | 2013-10-16 15:03:17 +0200 | [diff] [blame] | 965 | "email": "jane.roe@example.com", |
| 966 | "username": "jroe" |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 967 | }, |
Gustaf Lundh | 3c4f3f0 | 2017-11-06 13:52:28 +0100 | [diff] [blame] | 968 | "date": "2013-03-23 21:36:52.332000000", |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 969 | "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] | 970 | "_revision_number": 1 |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 971 | } |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 972 | ] |
| 973 | } |
| 974 | ---- |
| 975 | |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 976 | [[create-merge-patch-set-for-change]] |
| 977 | === Create Merge Patch Set For Change |
| 978 | -- |
| 979 | 'POST /changes/link:#change-id[\{change-id\}]/merge' |
| 980 | -- |
| 981 | |
| 982 | Update an existing change by using a |
| 983 | link:#merge-patch-set-input[MergePatchSetInput] entity. |
| 984 | |
| 985 | Gerrit will create a merge commit based on the information of |
| 986 | MergePatchSetInput and add a new patch set to the change corresponding |
| 987 | to the new merge commit. |
| 988 | |
| 989 | .Request |
| 990 | ---- |
| 991 | POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0 |
| 992 | Content-Type: application/json; charset=UTF-8 |
| 993 | |
| 994 | { |
| 995 | "subject": "Merge dev_branch into master", |
| 996 | "merge": { |
David Pursehouse | f4fb104 | 2018-03-18 23:03:46 +0900 | [diff] [blame] | 997 | "source": "refs/changes/34/1234/1" |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 998 | } |
| 999 | } |
| 1000 | ---- |
| 1001 | |
| 1002 | As response a link:#change-info[ChangeInfo] entity with current revision is |
| 1003 | returned that describes the resulting change. |
| 1004 | |
| 1005 | .Response |
| 1006 | ---- |
| 1007 | HTTP/1.1 200 OK |
| 1008 | Content-Disposition: attachment |
| 1009 | Content-Type: application/json; charset=UTF-8 |
| 1010 | |
| 1011 | )]}' |
| 1012 | { |
| 1013 | "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 1014 | "project": "test", |
| 1015 | "branch": "master", |
| 1016 | "hashtags": [], |
| 1017 | "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc", |
| 1018 | "subject": "Merge dev_branch into master", |
| 1019 | "status": "NEW", |
| 1020 | "created": "2016-09-23 18:08:53.238000000", |
| 1021 | "updated": "2016-09-23 18:09:25.934000000", |
| 1022 | "submit_type": "MERGE_IF_NECESSARY", |
| 1023 | "mergeable": true, |
| 1024 | "insertions": 5, |
| 1025 | "deletions": 0, |
| 1026 | "_number": 72, |
| 1027 | "owner": { |
| 1028 | "_account_id": 1000000 |
| 1029 | }, |
| 1030 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822" |
| 1031 | } |
| 1032 | ---- |
| 1033 | |
| 1034 | [[set-message]] |
| 1035 | === Set Commit Message |
| 1036 | -- |
| 1037 | 'PUT /changes/link:#change-id[\{change-id\}]/message' |
| 1038 | -- |
| 1039 | |
| 1040 | Creates a new patch set with a new commit message. |
| 1041 | |
| 1042 | 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] | 1043 | link:#commit-message-input[CommitMessageInput] entity. If a Change-Id |
| 1044 | footer is specified, it must match the current Change-Id footer. If |
| 1045 | the Change-Id footer is absent, the current Change-Id is added to the |
| 1046 | message. |
Aaron Gable | 9b41307 | 2017-08-24 13:15:21 -0700 | [diff] [blame] | 1047 | |
| 1048 | .Request |
| 1049 | ---- |
| 1050 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0 |
| 1051 | Content-Type: application/json; charset=UTF-8 |
| 1052 | |
| 1053 | { |
| 1054 | "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n" |
| 1055 | } |
| 1056 | ---- |
| 1057 | |
| 1058 | .Notifications |
| 1059 | |
| 1060 | An email will be sent using the "newpatchset" template. |
| 1061 | |
| 1062 | [options="header",cols="1,1"] |
| 1063 | |============================= |
| 1064 | |WIP State |Default |
| 1065 | |Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers |
| 1066 | |Work in progress|owner |
| 1067 | |============================= |
| 1068 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1069 | [[get-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1070 | === Get Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1071 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1072 | 'GET /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1073 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1074 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1075 | Retrieves the topic of a change. |
| 1076 | |
| 1077 | .Request |
| 1078 | ---- |
| 1079 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 1080 | ---- |
| 1081 | |
| 1082 | .Response |
| 1083 | ---- |
| 1084 | HTTP/1.1 200 OK |
| 1085 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1086 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1087 | |
| 1088 | )]}' |
| 1089 | "Documentation" |
| 1090 | ---- |
| 1091 | |
| 1092 | If the change does not have a topic an empty string is returned. |
| 1093 | |
| 1094 | [[set-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1095 | === Set Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1096 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1097 | 'PUT /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1098 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1099 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1100 | Sets the topic of a change. |
| 1101 | |
| 1102 | The new topic must be provided in the request body inside a |
Patrick Hiesel | 4aa1456 | 2018-06-19 15:07:50 +0200 | [diff] [blame] | 1103 | link:#topic-input[TopicInput] entity. Any leading or trailing whitespace |
| 1104 | in the topic name will be removed. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1105 | |
| 1106 | .Request |
| 1107 | ---- |
| 1108 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1109 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1110 | |
| 1111 | { |
| 1112 | "topic": "Documentation" |
| 1113 | } |
| 1114 | ---- |
| 1115 | |
| 1116 | As response the new topic is returned. |
| 1117 | |
| 1118 | .Response |
| 1119 | ---- |
| 1120 | HTTP/1.1 200 OK |
| 1121 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1122 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1123 | |
| 1124 | )]}' |
| 1125 | "Documentation" |
| 1126 | ---- |
| 1127 | |
| 1128 | If the topic was deleted the response is "`204 No Content`". |
| 1129 | |
| 1130 | [[delete-topic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1131 | === Delete Topic |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1132 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1133 | 'DELETE /changes/link:#change-id[\{change-id\}]/topic' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1134 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1135 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1136 | Deletes the topic of a change. |
| 1137 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1138 | .Request |
| 1139 | ---- |
| 1140 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 1141 | ---- |
| 1142 | |
| 1143 | .Response |
| 1144 | ---- |
| 1145 | HTTP/1.1 204 No Content |
| 1146 | ---- |
| 1147 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 1148 | [[get-pure-revert]] |
| 1149 | === Get Pure Revert |
| 1150 | -- |
| 1151 | 'GET /changes/link:#change-id[\{change-id\}]/pure_revert' |
| 1152 | -- |
| 1153 | |
| 1154 | 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] | 1155 | 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] | 1156 | 40 digit hex representation) to check against. It takes precedence over `revertOf`. |
| 1157 | If the change has no reference in `revertOf`, the parameter is mandatory. |
| 1158 | |
| 1159 | As response a link:#pure-revert-info[PureRevertInfo] entity is returned. |
| 1160 | |
| 1161 | .Request |
| 1162 | ---- |
| 1163 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0 |
| 1164 | ---- |
| 1165 | |
| 1166 | .Response |
| 1167 | ---- |
| 1168 | HTTP/1.1 200 OK |
| 1169 | Content-Disposition: attachment |
| 1170 | Content-Type: application/json; charset=UTF-8 |
| 1171 | |
| 1172 | )]}' |
| 1173 | { |
| 1174 | "is_pure_revert" : false |
| 1175 | } |
| 1176 | ---- |
| 1177 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1178 | [[abandon-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1179 | === Abandon Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1180 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1181 | 'POST /changes/link:#change-id[\{change-id\}]/abandon' |
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 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1184 | Abandons a change. |
| 1185 | |
| 1186 | The request body does not need to include a link:#abandon-input[ |
| 1187 | AbandonInput] entity if no review comment is added. |
| 1188 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 1189 | Abandoning a change also removes all users from the link:#attention-set[attention set]. |
| 1190 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1191 | .Request |
| 1192 | ---- |
| 1193 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0 |
| 1194 | ---- |
| 1195 | |
| 1196 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1197 | describes the abandoned change. |
| 1198 | |
| 1199 | .Response |
| 1200 | ---- |
| 1201 | HTTP/1.1 200 OK |
| 1202 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1203 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1204 | |
| 1205 | )]}' |
| 1206 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1207 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1208 | "project": "myProject", |
| 1209 | "branch": "master", |
| 1210 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1211 | "subject": "Implementing Feature X", |
| 1212 | "status": "ABANDONED", |
| 1213 | "created": "2013-02-01 09:59:32.126000000", |
| 1214 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1215 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1216 | "insertions": 3, |
| 1217 | "deletions": 310, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1218 | "_number": 3965, |
| 1219 | "owner": { |
| 1220 | "name": "John Doe" |
| 1221 | } |
| 1222 | } |
| 1223 | ---- |
| 1224 | |
| 1225 | If the change cannot be abandoned because the change state doesn't |
| 1226 | allow abandoning of the change, the response is "`409 Conflict`" and |
| 1227 | the error message is contained in the response body. |
| 1228 | |
| 1229 | .Response |
| 1230 | ---- |
| 1231 | HTTP/1.1 409 Conflict |
| 1232 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1233 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1234 | |
| 1235 | change is merged |
| 1236 | ---- |
| 1237 | |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1238 | .Notifications |
| 1239 | |
| 1240 | An email will be sent using the "abandon" template. The notify handling is ALL. |
| 1241 | Notifications are suppressed on WIP changes that have never started review. |
| 1242 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1243 | [options="header",cols="1,2"] |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1244 | |============================= |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 1245 | |WIP State |notify=ALL |
Logan Hanks | e43b68e | 2017-05-23 13:16:22 -0700 | [diff] [blame] | 1246 | |Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1247 | |Work in progress|not sent |
| 1248 | |Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers |
| 1249 | |============================= |
| 1250 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1251 | [[restore-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1252 | === Restore Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1253 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1254 | 'POST /changes/link:#change-id[\{change-id\}]/restore' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1255 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1256 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1257 | Restores a change. |
| 1258 | |
| 1259 | The request body does not need to include a link:#restore-input[ |
| 1260 | RestoreInput] entity if no review comment is added. |
| 1261 | |
| 1262 | .Request |
| 1263 | ---- |
| 1264 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0 |
| 1265 | ---- |
| 1266 | |
| 1267 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1268 | describes the restored change. |
| 1269 | |
| 1270 | .Response |
| 1271 | ---- |
| 1272 | HTTP/1.1 200 OK |
| 1273 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1274 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1275 | |
| 1276 | )]}' |
| 1277 | { |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1278 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1279 | "project": "myProject", |
| 1280 | "branch": "master", |
| 1281 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1282 | "subject": "Implementing Feature X", |
| 1283 | "status": "NEW", |
| 1284 | "created": "2013-02-01 09:59:32.126000000", |
| 1285 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1286 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1287 | "insertions": 2, |
| 1288 | "deletions": 13, |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1289 | "_number": 3965, |
| 1290 | "owner": { |
| 1291 | "name": "John Doe" |
| 1292 | } |
| 1293 | } |
| 1294 | ---- |
| 1295 | |
| 1296 | If the change cannot be restored because the change state doesn't |
| 1297 | allow restoring the change, the response is "`409 Conflict`" and |
| 1298 | the error message is contained in the response body. |
| 1299 | |
| 1300 | .Response |
| 1301 | ---- |
| 1302 | HTTP/1.1 409 Conflict |
| 1303 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1304 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1305 | |
| 1306 | change is new |
| 1307 | ---- |
| 1308 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1309 | [[rebase-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1310 | === Rebase Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1311 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1312 | 'POST /changes/link:#change-id[\{change-id\}]/rebase' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1313 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1314 | |
| 1315 | Rebases a change. |
| 1316 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1317 | Optionally, the parent revision can be changed to another patch set through the |
| 1318 | link:#rebase-input[RebaseInput] entity. |
| 1319 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1320 | .Request |
| 1321 | ---- |
| 1322 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 1323 | Content-Type: application/json;charset=UTF-8 |
| 1324 | |
| 1325 | { |
| 1326 | "base" : "1234", |
| 1327 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1328 | ---- |
| 1329 | |
| 1330 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1331 | describes the rebased change. Information about the current patch set |
| 1332 | is included. |
| 1333 | |
| 1334 | .Response |
| 1335 | ---- |
| 1336 | HTTP/1.1 200 OK |
| 1337 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1338 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1339 | |
| 1340 | )]}' |
| 1341 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1342 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1343 | "project": "myProject", |
| 1344 | "branch": "master", |
| 1345 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1346 | "subject": "Implement Feature X", |
| 1347 | "status": "NEW", |
| 1348 | "created": "2013-02-01 09:59:32.126000000", |
| 1349 | "updated": "2013-02-21 11:16:36.775000000", |
| 1350 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1351 | "insertions": 33, |
| 1352 | "deletions": 9, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1353 | "_number": 4799, |
| 1354 | "owner": { |
| 1355 | "name": "John Doe" |
| 1356 | }, |
| 1357 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 1358 | "revisions": { |
| 1359 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 1360 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1361 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 1362 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1363 | "fetch": { |
| 1364 | "http": { |
| 1365 | "url": "http://gerrit:8080/myProject", |
| 1366 | "ref": "refs/changes/99/4799/2" |
| 1367 | } |
| 1368 | }, |
| 1369 | "commit": { |
| 1370 | "parents": [ |
| 1371 | { |
| 1372 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 1373 | "subject": "Implement Feature A" |
| 1374 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 1375 | ], |
| 1376 | "author": { |
| 1377 | "name": "John Doe", |
| 1378 | "email": "john.doe@example.com", |
| 1379 | "date": "2013-05-07 15:21:27.000000000", |
| 1380 | "tz": 120 |
| 1381 | }, |
| 1382 | "committer": { |
| 1383 | "name": "Gerrit Code Review", |
| 1384 | "email": "gerrit-server@example.com", |
| 1385 | "date": "2013-05-07 15:35:43.000000000", |
| 1386 | "tz": 120 |
| 1387 | }, |
| 1388 | "subject": "Implement Feature X", |
| 1389 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1390 | } |
| 1391 | } |
| 1392 | } |
| 1393 | ---- |
| 1394 | |
| 1395 | If the change cannot be rebased, e.g. due to conflicts, the response is |
| 1396 | "`409 Conflict`" and the error message is contained in the response |
| 1397 | body. |
| 1398 | |
| 1399 | .Response |
| 1400 | ---- |
| 1401 | HTTP/1.1 409 Conflict |
| 1402 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1403 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1404 | |
| 1405 | The change could not be rebased due to a path conflict during merge. |
| 1406 | ---- |
| 1407 | |
Edwin Kempin | 8b2ff7f | 2023-03-24 12:14:44 +0100 | [diff] [blame] | 1408 | Rebasing a change is allowed for the change owner, users with the |
| 1409 | link:access-control.html#category_rebase[Rebase] permission and users |
| 1410 | with the link:access-control.html#category_submit[Submit] permission. |
| 1411 | |
| 1412 | In addition, the rebaser or the original uploader, if rebasing is done |
| 1413 | on behalf of the uploader (see `rebase_on_behalf_of_uploader` option in |
| 1414 | link:#rebase-input[RebaseInput]), needs to have all permissions that |
| 1415 | are required to create the new patch set: |
| 1416 | |
| 1417 | * the link:access-control.html#category_push[Push] permission |
| 1418 | * the link:access-control.html#category_add_patch_set[Add Patch Set] |
| 1419 | permission (only if the user is not the change owner) |
| 1420 | * the link:access-control.html#category_forge_author[Forge Author] |
| 1421 | permission (only if the commit author is forged) |
| 1422 | * the link:access-control.html#category_forge_server[Forge Server] |
| 1423 | permission (only if the commit author is the server identity) |
| 1424 | |
| 1425 | The same permissions were required for the upload of the original patch |
| 1426 | set. This means if the rebase is done on behalf of the uploader these |
| 1427 | permission checks should just pass, unless the uploader lost |
| 1428 | permissions after the upload of the original patch set. In this case |
| 1429 | rebasing on behalf of the uploader is not possible and a normal rebase |
| 1430 | (on behalf of the rebaser) must be done, which means that the rebaser |
| 1431 | becomes the uploader and takes over the change. If self approvals are |
| 1432 | disallowed, this means that the rebaser can no longer approve the |
| 1433 | change (as approvals of the uploader are ignored). |
| 1434 | |
Nitzan Gur-Furman | 4655d8b | 2022-12-16 08:46:18 +0100 | [diff] [blame] | 1435 | [[rebase-chain]] |
| 1436 | === Rebase Chain |
| 1437 | -- |
| 1438 | 'POST /changes/link:#change-id[\{change-id\}]/rebase:chain' |
| 1439 | -- |
| 1440 | |
| 1441 | Rebases an ancestry chain of changes. |
| 1442 | |
| 1443 | The operated change is treated as the chain tip. All unsubmitted ancestors are rebased. |
| 1444 | |
| 1445 | Requires a linear ancestry relation (single parenting throughout the chain). |
| 1446 | |
| 1447 | Optionally, the parent revision (of the oldest ancestor to be rebased) can be changed to another |
| 1448 | change, revision or branch through the link:#rebase-input[RebaseInput] entity. |
| 1449 | |
| 1450 | If the chain is outdated, i.e., there's a change that depends on an old revision of its parent, the |
| 1451 | result is the same as individually rebasing all outdated changes on top of their parent's latest |
| 1452 | revision before running the rebase chain action. |
| 1453 | |
| 1454 | .Request |
| 1455 | ---- |
| 1456 | POST /changes/myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f/rebase:chain HTTP/1.0 |
| 1457 | Content-Type: application/json;charset=UTF-8 |
| 1458 | |
| 1459 | { |
| 1460 | "base" : "1234", |
| 1461 | } |
| 1462 | ---- |
| 1463 | |
| 1464 | As response a link:#rebase-chain-info[RebaseChainInfo] entity is returned that |
| 1465 | describes the rebased changes. Information about the current patch sets |
| 1466 | are included. |
| 1467 | |
| 1468 | .Response |
| 1469 | ---- |
| 1470 | HTTP/1.1 200 OK |
| 1471 | Content-Disposition: attachment |
| 1472 | Content-Type: application/json; charset=UTF-8 |
| 1473 | |
| 1474 | )]}' |
| 1475 | { |
| 1476 | "rebased_changes": [ |
| 1477 | { |
| 1478 | "id": "myProject~master~I0e534de9d7f0d6f35b71f7d726acf835b2110c66", |
| 1479 | "project": "myProject", |
| 1480 | "branch": "master", |
| 1481 | "hashtags": [ |
| 1482 | |
| 1483 | ], |
| 1484 | "change_id": "I0e534de9d7f0d6f35b71f7d726acf835b2110c66", |
| 1485 | "subject": "456", |
| 1486 | "status": "NEW", |
| 1487 | "created": "2022-11-21 20: 51: 31.000000000", |
| 1488 | "updated": "2022-11-21 20: 56: 49.000000000", |
| 1489 | "submit_type": "MERGE_IF_NECESSARY", |
| 1490 | "insertions": 0, |
| 1491 | "deletions": 0, |
| 1492 | "total_comment_count": 0, |
| 1493 | "unresolved_comment_count": 0, |
| 1494 | "has_review_started": true, |
| 1495 | "meta_rev_id": "a2a6692213f546e1045ecf4647439fac8d6d8faa", |
| 1496 | "_number": 21, |
| 1497 | "owner": { |
| 1498 | "_account_id": 1000000 |
| 1499 | }, |
| 1500 | "current_revision": "c3b2ba222d42a56e05c90f88d4509a124620517d", |
| 1501 | "revisions": { |
| 1502 | "c3b2ba222d42a56e05c90f88d4509a124620517d": { |
| 1503 | "kind": "NO_CHANGE", |
| 1504 | "_number": 2, |
| 1505 | "created": "2022-11-21 20: 56: 49.000000000", |
| 1506 | "uploader": { |
| 1507 | "_account_id": 1000000 |
| 1508 | }, |
| 1509 | "ref": "refs/changes/21/21/2", |
| 1510 | "fetch": { |
| 1511 | |
| 1512 | }, |
| 1513 | "commit": { |
| 1514 | "parents": [ |
| 1515 | { |
| 1516 | "commit": "7803f427dd7c4a2441466e4d740a1850dcee1af4", |
| 1517 | "subject": "123" |
| 1518 | } |
| 1519 | ], |
| 1520 | "author": { |
| 1521 | "name": "Nitzan Gur-Furman", |
| 1522 | "email": "nitzan@google.com", |
| 1523 | "date": "2022-11-21 20: 49: 39.000000000", |
| 1524 | "tz": 60 |
| 1525 | }, |
| 1526 | "committer": { |
| 1527 | "name": "Administrator", |
| 1528 | "email": "admin@example.com", |
| 1529 | "date": "2022-11-21 20: 56: 49.000000000", |
| 1530 | "tz": 60 |
| 1531 | }, |
| 1532 | "subject": "456", |
| 1533 | "message": "456\n" |
| 1534 | }, |
| 1535 | "description": "Rebase" |
| 1536 | } |
| 1537 | }, |
| 1538 | "requirements": [ |
| 1539 | |
| 1540 | ], |
| 1541 | "submit_records": [ |
| 1542 | { |
| 1543 | "rule_name": "gerrit~DefaultSubmitRule", |
| 1544 | "status": "NOT_READY", |
| 1545 | "labels": [ |
| 1546 | { |
| 1547 | "label": "Code-Review", |
| 1548 | "status": "NEED" |
| 1549 | } |
| 1550 | ] |
| 1551 | } |
| 1552 | ] |
| 1553 | }, |
| 1554 | { |
| 1555 | "id": "myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f", |
| 1556 | "project": "myProject", |
| 1557 | "branch": "master", |
| 1558 | "hashtags": [ |
| 1559 | |
| 1560 | ], |
| 1561 | "change_id": "I08a021fb07b83fe845140a2c11508b3bdd93b48f", |
| 1562 | "subject": "789", |
| 1563 | "status": "NEW", |
| 1564 | "created": "2022-11-21 20: 51: 31.000000000", |
| 1565 | "updated": "2022-11-21 20: 56: 49.000000000", |
| 1566 | "submit_type": "MERGE_IF_NECESSARY", |
| 1567 | "insertions": 0, |
| 1568 | "deletions": 0, |
| 1569 | "total_comment_count": 0, |
| 1570 | "unresolved_comment_count": 0, |
| 1571 | "has_review_started": true, |
| 1572 | "meta_rev_id": "3bfb843fea471f96e16b9199c3a30fff0285bc45", |
| 1573 | "_number": 22, |
| 1574 | "owner": { |
| 1575 | "_account_id": 1000000 |
| 1576 | }, |
| 1577 | "current_revision": "77eb17a9501a5c21963bc6af56085e60f281acbb", |
| 1578 | "revisions": { |
| 1579 | "77eb17a9501a5c21963bc6af56085e60f281acbb": { |
| 1580 | "kind": "NO_CHANGE", |
| 1581 | "_number": 2, |
| 1582 | "created": "2022-11-21 20: 56: 49.000000000", |
| 1583 | "uploader": { |
| 1584 | "_account_id": 1000000 |
| 1585 | }, |
| 1586 | "ref": "refs/changes/22/22/2", |
| 1587 | "fetch": { |
| 1588 | |
| 1589 | }, |
| 1590 | "commit": { |
| 1591 | "parents": [ |
| 1592 | { |
| 1593 | "commit": "c3b2ba222d42a56e05c90f88d4509a124620517d", |
| 1594 | "subject": "456" |
| 1595 | } |
| 1596 | ], |
| 1597 | "author": { |
| 1598 | "name": "Nitzan Gur-Furman", |
| 1599 | "email": "nitzan@google.com", |
| 1600 | "date": "2022-11-21 20: 51: 07.000000000", |
| 1601 | "tz": 60 |
| 1602 | }, |
| 1603 | "committer": { |
| 1604 | "name": "Administrator", |
| 1605 | "email": "admin@example.com", |
| 1606 | "date": "2022-11-21 20: 56: 49.000000000", |
| 1607 | "tz": 60 |
| 1608 | }, |
| 1609 | "subject": "789", |
| 1610 | "message": "789\n" |
| 1611 | }, |
| 1612 | "description": "Rebase" |
| 1613 | } |
| 1614 | }, |
| 1615 | "requirements": [ |
| 1616 | |
| 1617 | ], |
| 1618 | "submit_records": [ |
| 1619 | { |
| 1620 | "rule_name": "gerrit~DefaultSubmitRule", |
| 1621 | "status": "NOT_READY", |
| 1622 | "labels": [ |
| 1623 | { |
| 1624 | "label": "Code-Review", |
| 1625 | "status": "NEED" |
| 1626 | } |
| 1627 | ] |
| 1628 | } |
| 1629 | ] |
| 1630 | } |
| 1631 | ], |
| 1632 | } |
| 1633 | ---- |
| 1634 | |
| 1635 | If the change cannot be rebased, e.g. due to conflicts, the response is |
| 1636 | "`409 Conflict`" and the error message is contained in the response |
| 1637 | body. |
| 1638 | |
| 1639 | .Response |
| 1640 | ---- |
| 1641 | HTTP/1.1 409 Conflict |
| 1642 | Content-Disposition: attachment |
| 1643 | Content-Type: text/plain; charset=UTF-8 |
| 1644 | |
| 1645 | Change I0e534de9d7f0d6f35b71f7d726acf835b2110c66 could not be rebased due to a conflict during |
| 1646 | merge. |
| 1647 | |
| 1648 | merge conflict(s): |
| 1649 | a.txt |
| 1650 | ---- |
| 1651 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1652 | [[move-change]] |
| 1653 | === Move Change |
| 1654 | -- |
| 1655 | 'POST /changes/link:#change-id[\{change-id\}]/move' |
| 1656 | -- |
| 1657 | |
| 1658 | Move a change. |
| 1659 | |
| 1660 | The destination branch must be provided in the request body inside a |
| 1661 | link:#move-input[MoveInput] entity. |
Marija Savtchouk | cee6a8f | 2020-12-03 12:58:04 +0000 | [diff] [blame] | 1662 | Only veto votes that are blocking the change from submission are moved to |
| 1663 | the destination branch by default. |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1664 | |
| 1665 | .Request |
| 1666 | ---- |
| 1667 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0 |
| 1668 | Content-Type: application/json; charset=UTF-8 |
| 1669 | |
| 1670 | { |
| 1671 | "destination_branch" : "release-branch" |
| 1672 | } |
| 1673 | |
| 1674 | ---- |
| 1675 | |
| 1676 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1677 | describes the moved change. |
| 1678 | |
| 1679 | .Response |
| 1680 | ---- |
| 1681 | HTTP/1.1 200 OK |
| 1682 | Content-Disposition: attachment |
| 1683 | Content-Type: application/json; charset=UTF-8 |
| 1684 | |
| 1685 | )]}' |
| 1686 | { |
| 1687 | "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1688 | "project": "myProject", |
| 1689 | "branch": "release-branch", |
| 1690 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1691 | "subject": "Implementing Feature X", |
| 1692 | "status": "NEW", |
| 1693 | "created": "2013-02-01 09:59:32.126000000", |
| 1694 | "updated": "2013-02-21 11:16:36.775000000", |
| 1695 | "mergeable": true, |
| 1696 | "insertions": 2, |
| 1697 | "deletions": 13, |
| 1698 | "_number": 3965, |
| 1699 | "owner": { |
| 1700 | "name": "John Doe" |
| 1701 | } |
| 1702 | } |
| 1703 | ---- |
| 1704 | |
Changcheng Xiao | 6dc9042 | 2017-08-09 10:21:58 +0200 | [diff] [blame] | 1705 | Note that this endpoint will not update the change's parents, which is |
| 1706 | different from the link:#cherry-pick[cherry-pick] endpoint. |
| 1707 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 1708 | If the change cannot be moved because the change state doesn't |
| 1709 | allow moving the change, the response is "`409 Conflict`" and |
| 1710 | the error message is contained in the response body. |
| 1711 | |
| 1712 | .Response |
| 1713 | ---- |
| 1714 | HTTP/1.1 409 Conflict |
| 1715 | Content-Disposition: attachment |
| 1716 | Content-Type: text/plain; charset=UTF-8 |
| 1717 | |
| 1718 | change is merged |
| 1719 | ---- |
| 1720 | |
| 1721 | If the change cannot be moved because the user doesn't have |
| 1722 | abandon permission on the change or upload permission on the destination, |
| 1723 | the response is "`409 Conflict`" and the error message is contained in the |
| 1724 | response body. |
| 1725 | |
| 1726 | .Response |
| 1727 | ---- |
| 1728 | HTTP/1.1 409 Conflict |
| 1729 | Content-Disposition: attachment |
| 1730 | Content-Type: text/plain; charset=UTF-8 |
| 1731 | |
| 1732 | move not permitted |
| 1733 | ---- |
| 1734 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1735 | [[revert-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1736 | === Revert Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1737 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1738 | 'POST /changes/link:#change-id[\{change-id\}]/revert' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1739 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1740 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1741 | Reverts a change. |
| 1742 | |
Gal Paikin | 006d52b | 2019-12-19 11:22:09 +0100 | [diff] [blame] | 1743 | The subject of the newly created change will be |
| 1744 | 'Revert "<subject-of-reverted-change>"'. If the subject of the change reverted is |
| 1745 | above 63 characters, it will be cut down to 59 characters with "..." in the end. |
| 1746 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1747 | The request body does not need to include a link:#revert-input[ |
| 1748 | RevertInput] entity if no review comment is added. |
| 1749 | |
| 1750 | .Request |
| 1751 | ---- |
Michael Zhou | 1027049 | 2016-03-24 22:35:40 -0400 | [diff] [blame] | 1752 | POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1753 | ---- |
| 1754 | |
| 1755 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1756 | describes the reverting change. |
| 1757 | |
| 1758 | .Response |
| 1759 | ---- |
| 1760 | HTTP/1.1 200 OK |
| 1761 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1762 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1763 | |
| 1764 | )]}' |
| 1765 | { |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1766 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1767 | "project": "myProject", |
| 1768 | "branch": "master", |
| 1769 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1770 | "subject": "Revert \"Implementing Feature X\"", |
| 1771 | "status": "NEW", |
| 1772 | "created": "2013-02-01 09:59:32.126000000", |
| 1773 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1774 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 1775 | "insertions": 6, |
| 1776 | "deletions": 4, |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1777 | "_number": 3965, |
| 1778 | "owner": { |
| 1779 | "name": "John Doe" |
| 1780 | } |
| 1781 | } |
| 1782 | ---- |
| 1783 | |
Gal Paikin | 6c9ed95 | 2020-01-22 10:36:35 +0100 | [diff] [blame] | 1784 | If the user doesn't have revert permission on the change or upload permission on |
| 1785 | the destination branch, the response is "`403 Forbidden`", and the error message is |
| 1786 | contained in the response body. |
| 1787 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1788 | If the change cannot be reverted because the change state doesn't |
Gal Paikin | 6c9ed95 | 2020-01-22 10:36:35 +0100 | [diff] [blame] | 1789 | allow reverting the change the response is "`409 Conflict`", and the error |
| 1790 | message is contained in the response body. |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1791 | |
| 1792 | .Response |
| 1793 | ---- |
| 1794 | HTTP/1.1 409 Conflict |
| 1795 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1796 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1797 | |
| 1798 | change is new |
| 1799 | ---- |
| 1800 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1801 | [[revert-submission]] |
| 1802 | === Revert Submission |
| 1803 | -- |
| 1804 | 'POST /changes/link:#change-id[\{change-id\}]/revert_submission' |
| 1805 | -- |
| 1806 | |
| 1807 | Creates open revert changes for all of the changes of a certain submission. |
| 1808 | |
Gal Paikin | 006d52b | 2019-12-19 11:22:09 +0100 | [diff] [blame] | 1809 | 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] | 1810 | If the subject is above 60 characters, the subject will be cut to 56 characters |
| 1811 | with "..." in the end. However, whenever reverting the submission of a revert |
| 1812 | submission, the subject will be shortened from |
| 1813 | 'Revert "Revert "<subject-of-reverted-change""' to |
| 1814 | 'Revert^2 "<subject-of-reverted-change"'. Also, for every future revert submission, |
| 1815 | the only difference in the subject will be the number of the revert (instead of |
| 1816 | Revert^2 the subject will change to Revert^3 and so on). |
| 1817 | 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] | 1818 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1819 | Details for the revert can be specified in the request body inside a link:#revert-input[ |
| 1820 | RevertInput] The topic of all created revert changes will be |
| 1821 | `revert-{submission_id}-{random_string_of_size_10}`. |
| 1822 | |
| 1823 | The changes will not be rebased on onto the destination branch so the users may still |
| 1824 | have to manually rebase them to resolve conflicts and make them submittable. |
| 1825 | |
Gal Paikin | 653a852 | 2019-11-25 11:40:10 +0100 | [diff] [blame] | 1826 | However, the changes that have the same project and branch will be rebased on top |
| 1827 | of each other. E.g, the first revert change will have the original change as a |
| 1828 | parent, and the second revert change will have the first revert change as a |
| 1829 | parent. |
| 1830 | |
| 1831 | There is one special case that involves merge commits; if a user has multiple |
| 1832 | changes in the same project and branch, but not in the same change series, those |
| 1833 | changes can still get submitted together if they have the same topic and |
| 1834 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] in |
| 1835 | gerrit.config is set to true. In the case, Gerrit may create merge commits on |
| 1836 | submit (depending on the link:config-project-config.html#submit-type[submit types] |
| 1837 | of the project). |
| 1838 | The first parent for the reverts will be the most recent merge commit that was |
| 1839 | created by Gerrit to merge the different change series into the target branch. |
| 1840 | |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1841 | .Request |
| 1842 | ---- |
| 1843 | POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0 |
| 1844 | ---- |
| 1845 | |
| 1846 | As response link:#revert-submission-info[RevertSubmissionInfo] entity |
| 1847 | is returned. That entity describes the revert changes. |
| 1848 | |
| 1849 | .Response |
| 1850 | ---- |
| 1851 | HTTP/1.1 200 OK |
| 1852 | Content-Disposition: attachment |
| 1853 | Content-Type: application/json; charset=UTF-8 |
| 1854 | |
| 1855 | )]}' |
| 1856 | "revert_changes": |
| 1857 | [ |
| 1858 | { |
| 1859 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1860 | "project": "myProject", |
| 1861 | "branch": "master", |
| 1862 | "topic": "revert--1571043962462-3640749-ABCEEZGHIJ", |
| 1863 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1864 | "subject": "Revert \"Implementing Feature X\"", |
| 1865 | "status": "NEW", |
| 1866 | "created": "2013-02-01 09:59:32.126000000", |
| 1867 | "updated": "2013-02-21 11:16:36.775000000", |
| 1868 | "mergeable": true, |
| 1869 | "insertions": 6, |
| 1870 | "deletions": 4, |
| 1871 | "_number": 3965, |
| 1872 | "owner": { |
| 1873 | "name": "John Doe" |
| 1874 | } |
| 1875 | }, |
| 1876 | { |
| 1877 | "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 1878 | "project": "anyProject", |
| 1879 | "branch": "master", |
| 1880 | "topic": "revert--1571043962462-3640749-ABCEEZGHIJ", |
| 1881 | "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 1882 | "subject": "Revert \"Implementing Feature Y\"", |
| 1883 | "status": "NEW", |
| 1884 | "created": "2013-02-04 09:59:33.126000000", |
| 1885 | "updated": "2013-02-21 11:16:37.775000000", |
| 1886 | "mergeable": true, |
| 1887 | "insertions": 62, |
| 1888 | "deletions": 11, |
| 1889 | "_number": 3966, |
| 1890 | "owner": { |
| 1891 | "name": "Jane Doe" |
| 1892 | } |
| 1893 | } |
| 1894 | ] |
| 1895 | ---- |
| 1896 | |
Gal Paikin | 6c9ed95 | 2020-01-22 10:36:35 +0100 | [diff] [blame] | 1897 | If the user doesn't have revert permission on the change or upload permission on |
| 1898 | the destination, the response is "`403 Forbidden`", and the error message is |
| 1899 | contained in the response body. |
| 1900 | |
| 1901 | If the change cannot be reverted because the change state doesn't |
| 1902 | allow reverting the change the response is "`409 Conflict`", and the error |
| 1903 | message is contained in the response body. |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 1904 | |
| 1905 | .Response |
| 1906 | ---- |
| 1907 | HTTP/1.1 409 Conflict |
| 1908 | Content-Disposition: attachment |
| 1909 | Content-Type: text/plain; charset=UTF-8 |
| 1910 | |
| 1911 | change is new |
| 1912 | ---- |
| 1913 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1914 | [[submit-change]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1915 | === Submit Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1916 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1917 | 'POST /changes/link:#change-id[\{change-id\}]/submit' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 1918 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1919 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1920 | Submits a change. |
| 1921 | |
| 1922 | The request body only needs to include a link:#submit-input[ |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 1923 | SubmitInput] entity if submitting on behalf of another user. |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1924 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 1925 | Submitting a change also removes all users from the link:#attention-set[attention set]. |
| 1926 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1927 | .Request |
| 1928 | ---- |
| 1929 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1930 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1931 | |
| 1932 | { |
David Pursehouse | a8f48f8 | 2016-03-10 15:27:47 +0900 | [diff] [blame] | 1933 | "on_behalf_of": 1001439 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1934 | } |
| 1935 | ---- |
| 1936 | |
| 1937 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1938 | describes the submitted/merged change. |
| 1939 | |
Gal Paikin | e2849a8 | 2021-04-19 13:41:10 +0200 | [diff] [blame] | 1940 | Submission may submit multiple changes, but we still only return one ChangeInfo |
| 1941 | object. To query for all submitted changes, please use the submission_id that is |
| 1942 | part of the response. |
| 1943 | |
| 1944 | Changes that will also be submitted: |
| 1945 | 1. All changes of the same topic if |
| 1946 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 1947 | configuration is set to true. |
| 1948 | 2. All dependent changes. |
| 1949 | 3. The closure of the above (e.g if a dependent change has a topic, all changes |
| 1950 | of *that* topic will also be submitted). |
| 1951 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1952 | .Response |
| 1953 | ---- |
| 1954 | HTTP/1.1 200 OK |
| 1955 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1956 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1957 | |
| 1958 | )]}' |
| 1959 | { |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1960 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1961 | "project": "myProject", |
| 1962 | "branch": "master", |
| 1963 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1964 | "subject": "Implementing Feature X", |
| 1965 | "status": "MERGED", |
| 1966 | "created": "2013-02-01 09:59:32.126000000", |
| 1967 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 1968 | "submitted": "2013-02-21 11:16:36.615000000", |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1969 | "_number": 3965, |
| 1970 | "owner": { |
| 1971 | "name": "John Doe" |
| 1972 | } |
| 1973 | } |
| 1974 | ---- |
| 1975 | |
| 1976 | If the change cannot be submitted because the submit rule doesn't allow |
| 1977 | submitting the change, the response is "`409 Conflict`" and the error |
| 1978 | message is contained in the response body. |
| 1979 | |
| 1980 | .Response |
| 1981 | ---- |
| 1982 | HTTP/1.1 409 Conflict |
| 1983 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 1984 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1985 | |
| 1986 | blocked by Verified |
| 1987 | ---- |
| 1988 | |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 1989 | [[submitted-together]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1990 | === Changes Submitted Together |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1991 | -- |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1992 | '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] | 1993 | -- |
| 1994 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 1995 | Computes list of all changes which are submitted when |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 1996 | link:#submit-change[Submit] is called for this change, |
Stefan Beller | 460f354 | 2015-07-20 14:10:41 -0700 | [diff] [blame] | 1997 | including the current change itself. |
| 1998 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 1999 | The list consists of: |
| 2000 | |
| 2001 | * The given change. |
| 2002 | * If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
Gal Paikin | e7a208d | 2021-11-30 12:08:27 +0100 | [diff] [blame] | 2003 | is enabled OR if the `o=TOPIC_CLOSURE` query parameter is passed, include all |
| 2004 | open changes with the same topic. |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2005 | * For each change whose submit type is not CHERRY_PICK, include unmerged |
| 2006 | ancestors targeting the same branch. |
| 2007 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2008 | As a special case, the list is empty if this change would be |
| 2009 | submitted by itself (without other changes). |
| 2010 | |
| 2011 | .Request |
| 2012 | ---- |
| 2013 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0 |
| 2014 | Content-Type: application/json; charset=UTF-8 |
| 2015 | ---- |
| 2016 | |
| 2017 | As a response a link:#submitted-together-info[SubmittedTogetherInfo] |
| 2018 | entity is returned that describes what would happen if the change were |
| 2019 | submitted. This response contains a list of changes and a count of |
| 2020 | changes that are not visible to the caller that are part of the set of |
| 2021 | changes to be merged. |
| 2022 | |
| 2023 | The listed changes use the same format as in |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2024 | link:#list-changes[Query Changes] with the |
| 2025 | link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`], |
Patrick Hiesel | 6fbbdaa | 2018-04-05 15:10:13 +0200 | [diff] [blame] | 2026 | link:#current-revision[`CURRENT_REVISION`],and |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 2027 | link:#submittable[`SUBMITTABLE`] options set. |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2028 | |
Shawn Pearce | 8080c3d | 2016-09-19 19:15:04 -0700 | [diff] [blame] | 2029 | Standard link:#query-options[formatting options] can be specified |
| 2030 | with the `o` parameter, as well as the `submitted_together` specific |
Gal Paikin | e7a208d | 2021-11-30 12:08:27 +0100 | [diff] [blame] | 2031 | options `NON_VISIBLE_CHANGES` and `TOPIC_CLOSURE`. |
Shawn Pearce | 8080c3d | 2016-09-19 19:15:04 -0700 | [diff] [blame] | 2032 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2033 | .Response |
| 2034 | ---- |
| 2035 | HTTP/1.1 200 OK |
| 2036 | Content-Disposition: attachment |
| 2037 | Content-Type: application/json; charset=UTF-8 |
| 2038 | |
| 2039 | )]}' |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2040 | { |
| 2041 | "changes": [ |
| 2042 | { |
| 2043 | "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 2044 | "project": "gerrit", |
| 2045 | "branch": "master", |
| 2046 | "hashtags": [], |
| 2047 | "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14", |
| 2048 | "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes", |
| 2049 | "status": "NEW", |
| 2050 | "created": "2015-05-01 15:39:57.979000000", |
| 2051 | "updated": "2015-05-20 19:25:21.592000000", |
| 2052 | "mergeable": true, |
| 2053 | "insertions": 303, |
| 2054 | "deletions": 210, |
| 2055 | "_number": 1779, |
| 2056 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2057 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2058 | }, |
| 2059 | "labels": { |
| 2060 | "Code-Review": { |
| 2061 | "approved": { |
| 2062 | "_account_id": 1000000 |
| 2063 | }, |
| 2064 | "all": [ |
| 2065 | { |
| 2066 | "value": 2, |
| 2067 | "date": "2015-05-20 19:25:21.592000000", |
| 2068 | "_account_id": 1000000 |
| 2069 | } |
| 2070 | ], |
| 2071 | "values": { |
Oswald Buddenhagen | f887770 | 2022-02-15 14:01:34 +0100 | [diff] [blame] | 2072 | "-2": "This shall not be submitted", |
| 2073 | "-1": "I would prefer this is not submitted as is", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2074 | " 0": "No score", |
| 2075 | "+1": "Looks good to me, but someone else must approve", |
| 2076 | "+2": "Looks good to me, approved" |
| 2077 | }, |
| 2078 | "default_value": 0 |
| 2079 | }, |
| 2080 | "Verified": { |
| 2081 | "approved": { |
| 2082 | "_account_id": 1000000 |
| 2083 | }, |
| 2084 | "all": [ |
| 2085 | { |
| 2086 | "value": 1, |
| 2087 | "date": "2015-05-20 19:25:21.592000000", |
| 2088 | "_account_id": 1000000 |
| 2089 | } |
| 2090 | ], |
| 2091 | "values": { |
| 2092 | "-1": "Fails", |
| 2093 | " 0": "No score", |
| 2094 | "+1": "Verified" |
| 2095 | }, |
| 2096 | "default_value": 0 |
| 2097 | } |
| 2098 | }, |
| 2099 | "permitted_labels": { |
| 2100 | "Code-Review": [ |
| 2101 | "-2", |
| 2102 | "-1", |
| 2103 | " 0", |
| 2104 | "+1", |
| 2105 | "+2" |
| 2106 | ], |
| 2107 | "Verified": [ |
| 2108 | "-1", |
| 2109 | " 0", |
| 2110 | "+1" |
| 2111 | ] |
| 2112 | }, |
| 2113 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 2114 | { |
| 2115 | "_account_id": 1000000 |
| 2116 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2117 | ], |
| 2118 | "reviewers": { |
| 2119 | "REVIEWER": [ |
| 2120 | { |
| 2121 | "_account_id": 1000000 |
| 2122 | } |
| 2123 | ] |
| 2124 | }, |
| 2125 | "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379", |
| 2126 | "revisions": { |
| 2127 | "9adb9f4c7b40eeee0646e235de818d09164d7379": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 2128 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2129 | "_number": 1, |
| 2130 | "created": "2015-05-01 15:39:57.979000000", |
| 2131 | "uploader": { |
| 2132 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2133 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2134 | "ref": "refs/changes/79/1779/1", |
| 2135 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2136 | } |
| 2137 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2138 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2139 | { |
| 2140 | "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 2141 | "project": "gerrit", |
| 2142 | "branch": "master", |
| 2143 | "hashtags": [], |
| 2144 | "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22", |
| 2145 | "subject": "AbstractSubmoduleSubscription: Split up createSubscription", |
| 2146 | "status": "NEW", |
| 2147 | "created": "2015-05-01 15:39:57.979000000", |
| 2148 | "updated": "2015-05-20 19:25:21.546000000", |
| 2149 | "mergeable": true, |
| 2150 | "insertions": 15, |
| 2151 | "deletions": 6, |
| 2152 | "_number": 1780, |
| 2153 | "owner": { |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2154 | "_account_id": 1000000 |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2155 | }, |
| 2156 | "labels": { |
| 2157 | "Code-Review": { |
| 2158 | "approved": { |
| 2159 | "_account_id": 1000000 |
| 2160 | }, |
| 2161 | "all": [ |
| 2162 | { |
| 2163 | "value": 2, |
| 2164 | "date": "2015-05-20 19:25:21.546000000", |
| 2165 | "_account_id": 1000000 |
| 2166 | } |
| 2167 | ], |
| 2168 | "values": { |
Oswald Buddenhagen | f887770 | 2022-02-15 14:01:34 +0100 | [diff] [blame] | 2169 | "-2": "This shall not be submitted", |
| 2170 | "-1": "I would prefer this is not submitted as is", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2171 | " 0": "No score", |
| 2172 | "+1": "Looks good to me, but someone else must approve", |
| 2173 | "+2": "Looks good to me, approved" |
| 2174 | }, |
| 2175 | "default_value": 0 |
| 2176 | }, |
| 2177 | "Verified": { |
| 2178 | "approved": { |
| 2179 | "_account_id": 1000000 |
| 2180 | }, |
| 2181 | "all": [ |
| 2182 | { |
| 2183 | "value": 1, |
| 2184 | "date": "2015-05-20 19:25:21.546000000", |
| 2185 | "_account_id": 1000000 |
| 2186 | } |
| 2187 | ], |
| 2188 | "values": { |
| 2189 | "-1": "Fails", |
| 2190 | " 0": "No score", |
| 2191 | "+1": "Verified" |
| 2192 | }, |
| 2193 | "default_value": 0 |
| 2194 | } |
| 2195 | }, |
| 2196 | "permitted_labels": { |
| 2197 | "Code-Review": [ |
| 2198 | "-2", |
| 2199 | "-1", |
| 2200 | " 0", |
| 2201 | "+1", |
| 2202 | "+2" |
| 2203 | ], |
| 2204 | "Verified": [ |
| 2205 | "-1", |
| 2206 | " 0", |
| 2207 | "+1" |
| 2208 | ] |
| 2209 | }, |
| 2210 | "removable_reviewers": [ |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 2211 | { |
| 2212 | "_account_id": 1000000 |
| 2213 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2214 | ], |
| 2215 | "reviewers": { |
| 2216 | "REVIEWER": [ |
| 2217 | { |
| 2218 | "_account_id": 1000000 |
| 2219 | } |
| 2220 | ] |
| 2221 | }, |
| 2222 | "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4", |
| 2223 | "revisions": { |
| 2224 | "1bd7c12a38854a2c6de426feec28800623f492c4": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 2225 | "kind": "REWORK", |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2226 | "_number": 1, |
| 2227 | "created": "2015-05-01 15:39:57.979000000", |
| 2228 | "uploader": { |
| 2229 | "_account_id": 1000000 |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2230 | }, |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2231 | "ref": "refs/changes/80/1780/1", |
| 2232 | "fetch": {}, |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2233 | } |
| 2234 | } |
| 2235 | } |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2236 | ], |
| 2237 | "non_visible_changes": 0 |
| 2238 | } |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2239 | ---- |
| 2240 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 2241 | If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then |
| 2242 | instead of a link:#submitted-together-info[SubmittedTogetherInfo] |
| 2243 | entity, the response is a list of changes, or a 403 response with a |
| 2244 | message if the set of changes to be submitted with this change |
| 2245 | includes changes the caller cannot read. |
| 2246 | |
Stefan Beller | a7ad661 | 2015-06-26 10:05:43 -0700 | [diff] [blame] | 2247 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 2248 | [[delete-change]] |
| 2249 | === Delete Change |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2250 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2251 | 'DELETE /changes/link:#change-id[\{change-id\}]' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2252 | -- |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2253 | |
Alice Kober-Sotzek | 31c8333 | 2016-10-19 14:23:03 +0200 | [diff] [blame] | 2254 | Deletes a change. |
| 2255 | |
Paladox none | 580ae0e | 2017-02-12 18:15:48 +0000 | [diff] [blame] | 2256 | New or abandoned changes can be deleted by their owner if the user is granted |
| 2257 | the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission, |
| 2258 | otherwise only by administrators. |
| 2259 | |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2260 | .Request |
| 2261 | ---- |
| 2262 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2263 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 0d69c23 | 2013-09-10 23:10:23 +0200 | [diff] [blame] | 2264 | ---- |
| 2265 | |
| 2266 | .Response |
| 2267 | ---- |
| 2268 | HTTP/1.1 204 No Content |
| 2269 | ---- |
| 2270 | |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 2271 | [[apply-patch]] |
| 2272 | === Create patch-set from patch |
| 2273 | -- |
| 2274 | 'POST /changes/link:#change-id[\{change-id\}]/patch:apply' |
| 2275 | -- |
| 2276 | |
| 2277 | Creates a new patch set on a destination change from the provided patch. |
| 2278 | |
| 2279 | The patch must be provided in the request body, inside a |
| 2280 | link:#applypatchpatchset-input[ApplyPatchPatchSetInput] entity. |
| 2281 | |
| 2282 | 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] | 2283 | 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] | 2284 | |
| 2285 | Applying the patch will fail if the destination change is closed, or in case of any conflicts. |
| 2286 | |
| 2287 | .Request |
| 2288 | ---- |
| 2289 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/patch:apply HTTP/1.0 |
| 2290 | Content-Type: application/json; charset=UTF-8 |
| 2291 | |
| 2292 | { |
| 2293 | "patch": { |
| 2294 | "patch": "new file mode 100644\n--- /dev/null\n+++ b/a_new_file.txt\n@@ -0,0 +1,2 @@ \ |
| 2295 | +Patch compatible `git diff` output \ |
| 2296 | +For example: `link:#get-patch[<gerrit patch>] | base64 -d | sed -z 's/\n/\\n/g'`" |
| 2297 | } |
| 2298 | } |
| 2299 | ---- |
| 2300 | |
| 2301 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 2302 | describes the destination change after applying the patch. |
| 2303 | |
| 2304 | .Response |
| 2305 | ---- |
| 2306 | HTTP/1.1 200 OK |
| 2307 | Content-Disposition: attachment |
| 2308 | Content-Type: application/json; charset=UTF-8 |
| 2309 | |
| 2310 | )]}' |
| 2311 | { |
| 2312 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2313 | "project": "myProject", |
| 2314 | "branch": "release-branch", |
| 2315 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2316 | "subject": "Original change subject", |
| 2317 | "status": "NEW", |
| 2318 | "created": "2013-02-01 09:59:32.126000000", |
| 2319 | "updated": "2013-02-21 11:16:36.775000000", |
| 2320 | "mergeable": true, |
| 2321 | "insertions": 12, |
| 2322 | "deletions": 11, |
| 2323 | "_number": 3965, |
| 2324 | "owner": { |
| 2325 | "name": "John Doe" |
| 2326 | }, |
| 2327 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c" |
| 2328 | } |
| 2329 | ---- |
| 2330 | |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2331 | [[get-included-in]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2332 | === Get Included In |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2333 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2334 | 'GET /changes/link:#change-id[\{change-id\}]/in' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 2335 | -- |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2336 | |
| 2337 | Retrieves the branches and tags in which a change is included. As result |
| 2338 | an link:#included-in-info[IncludedInInfo] entity is returned. |
| 2339 | |
| 2340 | .Request |
| 2341 | ---- |
| 2342 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0 |
| 2343 | ---- |
| 2344 | |
| 2345 | .Response |
| 2346 | ---- |
| 2347 | HTTP/1.1 200 OK |
| 2348 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2349 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2350 | |
| 2351 | )]}' |
| 2352 | { |
David Ostrovsky | 83e8aee | 2013-09-30 22:37:26 +0200 | [diff] [blame] | 2353 | "branches": [ |
| 2354 | "master" |
| 2355 | ], |
| 2356 | "tags": [] |
| 2357 | } |
| 2358 | ---- |
| 2359 | |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 2360 | [[index-change]] |
| 2361 | === Index Change |
| 2362 | -- |
| 2363 | 'POST /changes/link:#change-id[\{change-id\}]/index' |
| 2364 | -- |
| 2365 | |
| 2366 | Adds or updates the change in the secondary index. |
| 2367 | |
| 2368 | .Request |
| 2369 | ---- |
| 2370 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0 |
| 2371 | ---- |
| 2372 | |
| 2373 | .Response |
| 2374 | ---- |
| 2375 | HTTP/1.1 204 No Content |
| 2376 | ---- |
| 2377 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2378 | [[list-change-comments]] |
| 2379 | === List Change Comments |
| 2380 | -- |
| 2381 | 'GET /changes/link:#change-id[\{change-id\}]/comments' |
| 2382 | -- |
| 2383 | |
| 2384 | Lists the published comments of all revisions of the change. |
| 2385 | |
| 2386 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 2387 | entries. The entries in the map are sorted by file path, and the |
| 2388 | comments for each path are sorted by patch set number. Each comment has |
| 2389 | the `patch_set` and `author` fields set. |
| 2390 | |
Youssef Elghareeb | 68e87b6 | 2021-01-11 13:20:03 +0100 | [diff] [blame] | 2391 | 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] | 2392 | will contain a list of link:#context-line[ContextLine] containing the lines of |
| 2393 | the source file where the comment was written. |
| 2394 | |
Youssef Elghareeb | 87b7450 | 2021-02-05 18:53:05 +0100 | [diff] [blame] | 2395 | The `context-padding` request parameter can be used to specify an extra number |
| 2396 | of context lines to be added before and after the comment range. This parameter |
| 2397 | only works if `enable-context` is set to true. |
| 2398 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2399 | .Request |
| 2400 | ---- |
| 2401 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0 |
| 2402 | ---- |
| 2403 | |
| 2404 | .Response |
| 2405 | ---- |
| 2406 | HTTP/1.1 200 OK |
| 2407 | Content-Disposition: attachment |
| 2408 | Content-Type: application/json; charset=UTF-8 |
| 2409 | |
| 2410 | )]}' |
| 2411 | { |
| 2412 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2413 | { |
| 2414 | "patch_set": 1, |
| 2415 | "id": "TvcXrmjM", |
| 2416 | "line": 23, |
| 2417 | "message": "[nit] trailing whitespace", |
| 2418 | "updated": "2013-02-26 15:40:43.986000000" |
| 2419 | "author": { |
| 2420 | "_account_id": 1000096, |
| 2421 | "name": "John Doe", |
| 2422 | "email": "john.doe@example.com" |
| 2423 | } |
| 2424 | }, |
| 2425 | { |
| 2426 | "patch_set": 2, |
| 2427 | "id": "TveXwFiA", |
| 2428 | "line": 49, |
| 2429 | "in_reply_to": "TfYX-Iuo", |
| 2430 | "message": "Done", |
| 2431 | "updated": "2013-02-26 15:40:45.328000000" |
| 2432 | "author": { |
| 2433 | "_account_id": 1000097, |
| 2434 | "name": "Jane Roe", |
| 2435 | "email": "jane.roe@example.com" |
| 2436 | } |
| 2437 | } |
| 2438 | ] |
| 2439 | } |
| 2440 | ---- |
| 2441 | |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2442 | [[list-change-robot-comments]] |
| 2443 | === List Change Robot Comments |
| 2444 | -- |
| 2445 | 'GET /changes/link:#change-id[\{change-id\}]/robotcomments' |
| 2446 | -- |
| 2447 | |
| 2448 | Lists the robot comments of all revisions of the change. |
| 2449 | |
| 2450 | Return a map that maps the file path to a list of |
| 2451 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 2452 | map are sorted by file path. |
| 2453 | |
| 2454 | .Request |
| 2455 | ---- |
| 2456 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0 |
| 2457 | ---- |
| 2458 | |
| 2459 | .Response |
| 2460 | ---- |
| 2461 | HTTP/1.1 200 OK |
| 2462 | Content-Disposition: attachment |
| 2463 | Content-Type: application/json; charset=UTF-8 |
| 2464 | |
| 2465 | )]}' |
| 2466 | { |
| 2467 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2468 | { |
| 2469 | "id": "TvcXrmjM", |
| 2470 | "line": 23, |
| 2471 | "message": "unused import", |
| 2472 | "updated": "2016-02-26 15:40:43.986000000", |
| 2473 | "author": { |
| 2474 | "_account_id": 1000110, |
| 2475 | "name": "Code Analyzer", |
| 2476 | "email": "code.analyzer@example.com" |
| 2477 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 2478 | "robot_id": "importChecker", |
| 2479 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2480 | }, |
| 2481 | { |
| 2482 | "id": "TveXwFiA", |
| 2483 | "line": 49, |
| 2484 | "message": "wrong indention", |
| 2485 | "updated": "2016-02-26 15:40:45.328000000", |
| 2486 | "author": { |
| 2487 | "_account_id": 1000110, |
| 2488 | "name": "Code Analyzer", |
| 2489 | "email": "code.analyzer@example.com" |
| 2490 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 2491 | "robot_id": "styleChecker", |
| 2492 | "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
Changcheng Xiao | 9b04c04 | 2016-12-28 12:45:29 +0100 | [diff] [blame] | 2493 | } |
| 2494 | ] |
| 2495 | } |
| 2496 | ---- |
| 2497 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2498 | [[list-change-drafts]] |
| 2499 | === List Change Drafts |
| 2500 | -- |
| 2501 | 'GET /changes/link:#change-id[\{change-id\}]/drafts' |
| 2502 | -- |
| 2503 | |
| 2504 | Lists the draft comments of all revisions of the change that belong to |
| 2505 | the calling user. |
| 2506 | |
| 2507 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 2508 | entries. The entries in the map are sorted by file path, and the |
| 2509 | comments for each path are sorted by patch set number. Each comment has |
| 2510 | the `patch_set` field set, and no `author`. |
| 2511 | |
Youssef Elghareeb | 59580cb | 2021-03-17 15:02:49 +0100 | [diff] [blame] | 2512 | The `enable-context` and `context-padding` request parameters can be used to |
| 2513 | request comment context. See link:#list-change-comments[List Change Comments] |
| 2514 | for more details. |
| 2515 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 2516 | .Request |
| 2517 | ---- |
| 2518 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0 |
| 2519 | ---- |
| 2520 | |
| 2521 | .Response |
| 2522 | ---- |
| 2523 | HTTP/1.1 200 OK |
| 2524 | Content-Disposition: attachment |
| 2525 | Content-Type: application/json; charset=UTF-8 |
| 2526 | |
| 2527 | )]}' |
| 2528 | { |
| 2529 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 2530 | { |
| 2531 | "patch_set": 1, |
| 2532 | "id": "TvcXrmjM", |
| 2533 | "line": 23, |
| 2534 | "message": "[nit] trailing whitespace", |
| 2535 | "updated": "2013-02-26 15:40:43.986000000" |
| 2536 | }, |
| 2537 | { |
| 2538 | "patch_set": 2, |
| 2539 | "id": "TveXwFiA", |
| 2540 | "line": 49, |
| 2541 | "in_reply_to": "TfYX-Iuo", |
| 2542 | "message": "Done", |
| 2543 | "updated": "2013-02-26 15:40:45.328000000" |
| 2544 | } |
| 2545 | ] |
| 2546 | } |
| 2547 | ---- |
| 2548 | |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2549 | [[check-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2550 | === Check Change |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2551 | -- |
| 2552 | 'GET /changes/link:#change-id[\{change-id\}]/check' |
| 2553 | -- |
| 2554 | |
| 2555 | Performs consistency checks on the change, and returns a |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2556 | link:#change-info[ChangeInfo] entity with the `problems` field set to a |
| 2557 | list of link:#problem-info[ProblemInfo] entities. |
| 2558 | |
| 2559 | Depending on the type of problem, some fields not marked optional may be |
| 2560 | missing from the result. At least `id`, `project`, `branch`, and |
| 2561 | `_number` will be present. |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2562 | |
| 2563 | .Request |
| 2564 | ---- |
| 2565 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2566 | ---- |
| 2567 | |
| 2568 | .Response |
| 2569 | ---- |
| 2570 | HTTP/1.1 200 OK |
| 2571 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2572 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2573 | |
| 2574 | )]}' |
| 2575 | { |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2576 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2577 | "project": "myProject", |
| 2578 | "branch": "master", |
| 2579 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2580 | "subject": "Implementing Feature X", |
| 2581 | "status": "NEW", |
| 2582 | "created": "2013-02-01 09:59:32.126000000", |
| 2583 | "updated": "2013-02-21 11:16:36.775000000", |
| 2584 | "mergeable": true, |
| 2585 | "insertions": 34, |
| 2586 | "deletions": 101, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2587 | "_number": 3965, |
| 2588 | "owner": { |
| 2589 | "name": "John Doe" |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2590 | }, |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 2591 | "problems": [ |
| 2592 | { |
| 2593 | "message": "Current patch set 1 not found" |
| 2594 | } |
Dave Borowitz | fd508ca | 2014-11-06 15:24:04 -0800 | [diff] [blame] | 2595 | ] |
| 2596 | } |
| 2597 | ---- |
| 2598 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2599 | [[fix-change]] |
David Pursehouse | aa1f77a | 2016-09-09 14:00:53 +0900 | [diff] [blame] | 2600 | === Fix Change |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2601 | -- |
| 2602 | 'POST /changes/link:#change-id[\{change-id\}]/check' |
| 2603 | -- |
| 2604 | |
| 2605 | Performs consistency checks on the change as with link:#check-change[GET |
| 2606 | /check], and additionally fixes any problems that can be fixed |
| 2607 | automatically. The returned field values reflect any fixes. |
| 2608 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 2609 | Some fixes have options controlling their behavior, which can be set in the |
| 2610 | link:#fix-input[FixInput] entity body. |
| 2611 | |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2612 | Only the change owner, a project owner, or an administrator may fix changes. |
| 2613 | |
| 2614 | .Request |
| 2615 | ---- |
| 2616 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0 |
| 2617 | ---- |
| 2618 | |
| 2619 | .Response |
| 2620 | ---- |
| 2621 | HTTP/1.1 200 OK |
| 2622 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 2623 | Content-Type: application/json; charset=UTF-8 |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2624 | |
| 2625 | )]}' |
| 2626 | { |
| 2627 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2628 | "project": "myProject", |
| 2629 | "branch": "master", |
| 2630 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 2631 | "subject": "Implementing Feature X", |
| 2632 | "status": "MERGED", |
| 2633 | "created": "2013-02-01 09:59:32.126000000", |
| 2634 | "updated": "2013-02-21 11:16:36.775000000", |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 2635 | "submitted": "2013-02-21 11:16:36.615000000", |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2636 | "mergeable": true, |
| 2637 | "insertions": 34, |
| 2638 | "deletions": 101, |
Dave Borowitz | 3be39d0 | 2014-12-03 17:57:38 -0800 | [diff] [blame] | 2639 | "_number": 3965, |
| 2640 | "owner": { |
| 2641 | "name": "John Doe" |
| 2642 | }, |
| 2643 | "problems": [ |
| 2644 | { |
| 2645 | "message": "Current patch set 2 not found" |
| 2646 | }, |
| 2647 | { |
| 2648 | "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW", |
| 2649 | "status": FIXED, |
| 2650 | "outcome": "Marked change as merged" |
| 2651 | } |
| 2652 | ] |
| 2653 | } |
| 2654 | ---- |
| 2655 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2656 | [[set-work-in-pogress]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2657 | === Set Work-In-Progress |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2658 | -- |
| 2659 | 'POST /changes/link:#change-id[\{change-id\}]/wip' |
| 2660 | -- |
| 2661 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2662 | Marks the change as not ready for review yet. Changes may only be marked not |
| 2663 | ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2664 | |
| 2665 | The request body does not need to include a |
| 2666 | link:#work-in-progress-input[WorkInProgressInput] entity if no review comment |
| 2667 | is added. Actions that create a new patch set in a WIP change default to |
| 2668 | notifying *OWNER* instead of *ALL*. |
| 2669 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 2670 | Marking a change work in progress also removes all users from the |
| 2671 | link:#attention-set[attention set]. |
| 2672 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2673 | .Request |
| 2674 | ---- |
| 2675 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0 |
| 2676 | Content-Type: application/json; charset=UTF-8 |
| 2677 | |
| 2678 | { |
| 2679 | "message": "Refactoring needs to be done before we can proceed here." |
| 2680 | } |
| 2681 | ---- |
| 2682 | |
| 2683 | .Response |
| 2684 | ---- |
| 2685 | HTTP/1.1 200 OK |
| 2686 | ---- |
| 2687 | |
| 2688 | [[set-ready-for-review]] |
Aaron Gable | ce92bdd | 2017-06-28 15:36:32 -0700 | [diff] [blame] | 2689 | === Set Ready-For-Review |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2690 | -- |
| 2691 | 'POST /changes/link:#change-id[\{change-id\}]/ready' |
| 2692 | -- |
| 2693 | |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 2694 | Marks the change as ready for review (set WIP property to false). Changes may |
| 2695 | only be marked ready by the owner, project owners or site administrators. |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2696 | |
| 2697 | Activates notifications of reviewer. The request body does not need |
| 2698 | to include a link:#work-in-progress-input[WorkInProgressInput] entity |
| 2699 | if no review comment is added. |
| 2700 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 2701 | Marking a change ready for review also adds all of the reviewers of the change |
| 2702 | to the link:#attention-set[attention set]. |
| 2703 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 2704 | .Request |
| 2705 | ---- |
| 2706 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0 |
| 2707 | Content-Type: application/json;charset=UTF-8 |
| 2708 | |
| 2709 | { |
| 2710 | "message": "Refactoring is done." |
| 2711 | } |
| 2712 | |
| 2713 | ---- |
| 2714 | |
| 2715 | .Response |
| 2716 | ---- |
| 2717 | HTTP/1.1 200 OK |
| 2718 | ---- |
| 2719 | |
David Pursehouse | 7c5c3a5 | 2017-04-10 11:37:23 +0900 | [diff] [blame] | 2720 | [[mark-private]] |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2721 | === Mark Private |
| 2722 | -- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2723 | 'POST /changes/link:#change-id[\{change-id\}]/private' |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2724 | -- |
| 2725 | |
Patrick Hiesel | 707e61a | 2019-02-13 18:28:48 +0100 | [diff] [blame] | 2726 | Marks the change to be private. Only open changes can be marked private. |
| 2727 | Changes may only be marked private by the owner or site administrators. |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2728 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2729 | A message can be specified in the request body inside a |
| 2730 | link:#private-input[PrivateInput] entity. |
| 2731 | |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2732 | .Request |
| 2733 | ---- |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2734 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2735 | Content-Type: application/json; charset=UTF-8 |
| 2736 | |
| 2737 | { |
| 2738 | "message": "After this security fix has been released we can make it public now." |
| 2739 | } |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 2740 | ---- |
| 2741 | |
| 2742 | .Response |
| 2743 | ---- |
| 2744 | HTTP/1.1 201 Created |
| 2745 | ---- |
| 2746 | |
| 2747 | If the change was already private the response is "`200 OK`". |
| 2748 | |
| 2749 | [[unmark-private]] |
| 2750 | === Unmark Private |
| 2751 | -- |
| 2752 | 'DELETE /changes/link:#change-id[\{change-id\}]/private' |
| 2753 | -- |
| 2754 | |
| 2755 | Marks the change to be non-private. Note users can only unmark own private |
| 2756 | changes. |
| 2757 | |
| 2758 | .Request |
| 2759 | ---- |
| 2760 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0 |
| 2761 | ---- |
| 2762 | |
| 2763 | .Response |
| 2764 | ---- |
| 2765 | HTTP/1.1 204 No Content |
| 2766 | ---- |
| 2767 | |
| 2768 | If the change was already not private, the response is "`409 Conflict`". |
| 2769 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 2770 | A message can be specified in the request body inside a |
| 2771 | link:#private-input[PrivateInput] entity. Historically, this method allowed |
| 2772 | a body in the DELETE, but that behavior is |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 2773 | 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] | 2774 | In this case, use a POST request instead: |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 2775 | |
| 2776 | .Request |
| 2777 | ---- |
| 2778 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0 |
| 2779 | Content-Type: application/json; charset=UTF-8 |
| 2780 | |
| 2781 | { |
| 2782 | "message": "This is a security fix that must not be public." |
| 2783 | } |
| 2784 | ---- |
| 2785 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2786 | [[get-hashtags]] |
| 2787 | === Get Hashtags |
| 2788 | -- |
| 2789 | 'GET /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2790 | -- |
| 2791 | |
| 2792 | Gets the hashtags associated with a change. |
| 2793 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2794 | .Request |
| 2795 | ---- |
| 2796 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2797 | ---- |
| 2798 | |
| 2799 | As response the change's hashtags are returned as a list of strings. |
| 2800 | |
| 2801 | .Response |
| 2802 | ---- |
| 2803 | HTTP/1.1 200 OK |
| 2804 | Content-Disposition: attachment |
| 2805 | Content-Type: application/json; charset=UTF-8 |
| 2806 | |
| 2807 | )]}' |
| 2808 | [ |
| 2809 | "hashtag1", |
| 2810 | "hashtag2" |
| 2811 | ] |
| 2812 | ---- |
| 2813 | |
| 2814 | [[set-hashtags]] |
| 2815 | === Set Hashtags |
| 2816 | -- |
| 2817 | 'POST /changes/link:#change-id[\{change-id\}]/hashtags' |
| 2818 | -- |
| 2819 | |
| 2820 | Adds and/or removes hashtags from a change. |
| 2821 | |
David Pursehouse | 7c79b68 | 2017-08-25 13:18:32 +0900 | [diff] [blame] | 2822 | The hashtags to add or remove must be provided in the request body inside a |
| 2823 | link:#hashtags-input[HashtagsInput] entity. |
| 2824 | |
| 2825 | .Request |
| 2826 | ---- |
| 2827 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0 |
| 2828 | Content-Type: application/json; charset=UTF-8 |
| 2829 | |
| 2830 | { |
| 2831 | "add" : [ |
| 2832 | "hashtag3" |
| 2833 | ], |
| 2834 | "remove" : [ |
| 2835 | "hashtag2" |
| 2836 | ] |
| 2837 | } |
| 2838 | ---- |
| 2839 | |
| 2840 | As response the change's hashtags are returned as a list of strings. |
| 2841 | |
| 2842 | .Response |
| 2843 | ---- |
| 2844 | HTTP/1.1 200 OK |
| 2845 | Content-Disposition: attachment |
| 2846 | Content-Type: application/json; charset=UTF-8 |
| 2847 | |
| 2848 | )]}' |
| 2849 | [ |
| 2850 | "hashtag1", |
| 2851 | "hashtag3" |
| 2852 | ] |
| 2853 | ---- |
| 2854 | |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 2855 | [[get-custom-keyed-values]] |
| 2856 | === Get Custom Keyed Values |
| 2857 | -- |
| 2858 | 'GET /changes/link:#change-id[\{change-id\}]/custom-keyed-values' |
| 2859 | -- |
| 2860 | |
| 2861 | Gets the custom keyed values associated with a change. |
| 2862 | |
| 2863 | .Request |
| 2864 | ---- |
| 2865 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/custom-keyed-values HTTP/1.0 |
| 2866 | ---- |
| 2867 | |
| 2868 | As response the change's custom keyed values are returned as a map of strings. |
| 2869 | |
| 2870 | .Response |
| 2871 | ---- |
| 2872 | HTTP/1.1 200 OK |
| 2873 | Content-Disposition: attachment |
| 2874 | Content-Type: application/json; charset=UTF-8 |
| 2875 | |
| 2876 | )]}' |
| 2877 | { |
| 2878 | "key1": "value1", |
| 2879 | "key2": "value2" |
| 2880 | } |
| 2881 | ---- |
| 2882 | |
| 2883 | [[set-custom-keyed-values]] |
| 2884 | === Set Custom Keyed Values |
| 2885 | -- |
| 2886 | 'POST /changes/link:#change-id[\{change-id\}]/custom-keyed-values' |
| 2887 | -- |
| 2888 | |
| 2889 | Adds and/or removes custom keyed values from a change. |
| 2890 | |
| 2891 | The custom keyed values to add or remove must be provided in the request body |
| 2892 | inside a link:#custom-keyed-values-input[CustomKeyedValuesInput] entity. |
| 2893 | |
| 2894 | .Request |
| 2895 | ---- |
| 2896 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/custom-keyed-values HTTP/1.0 |
| 2897 | Content-Type: application/json; charset=UTF-8 |
| 2898 | |
| 2899 | { |
| 2900 | "add" : { |
| 2901 | "key1": "value1" |
| 2902 | }, |
| 2903 | "remove" : [ |
| 2904 | "key2" |
| 2905 | ] |
| 2906 | } |
| 2907 | ---- |
| 2908 | |
| 2909 | As response the change's custom keyed values are returned as a map of strings to strings. |
| 2910 | |
| 2911 | .Response |
| 2912 | ---- |
| 2913 | HTTP/1.1 200 OK |
| 2914 | Content-Disposition: attachment |
| 2915 | Content-Type: application/json; charset=UTF-8 |
| 2916 | |
| 2917 | )]}' |
| 2918 | { |
| 2919 | "key1": "value1", |
| 2920 | "key3": "value3" |
| 2921 | } |
| 2922 | ---- |
| 2923 | |
| 2924 | |
Changcheng Xiao | 7fb7329 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 2925 | [[list-change-messages]] |
| 2926 | === List Change Messages |
| 2927 | -- |
| 2928 | 'GET /changes/link:#change-id[\{change-id\}]/messages' |
| 2929 | -- |
| 2930 | |
| 2931 | Lists all the messages of a change including link:#detailed-accounts[detailed account information]. |
| 2932 | |
| 2933 | .Request |
| 2934 | ---- |
| 2935 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages |
| 2936 | ---- |
| 2937 | |
| 2938 | As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned. |
| 2939 | |
| 2940 | .Response |
| 2941 | ---- |
| 2942 | HTTP/1.1 200 OK |
| 2943 | Content-Disposition: attachment |
| 2944 | Content-Type: application/json; charset=UTF-8 |
| 2945 | |
| 2946 | )]}' |
| 2947 | [ |
| 2948 | { |
| 2949 | "id": "YH-egE", |
| 2950 | "author": { |
| 2951 | "_account_id": 1000096, |
| 2952 | "name": "John Doe", |
| 2953 | "email": "john.doe@example.com", |
| 2954 | "username": "jdoe" |
| 2955 | }, |
| 2956 | "date": "2013-03-23 21:34:02.419000000", |
| 2957 | "message": "Patch Set 1:\n\nThis is the first message.", |
| 2958 | "_revision_number": 1 |
| 2959 | }, |
| 2960 | { |
| 2961 | "id": "WEEdhU", |
| 2962 | "author": { |
| 2963 | "_account_id": 1000097, |
| 2964 | "name": "Jane Roe", |
| 2965 | "email": "jane.roe@example.com", |
| 2966 | "username": "jroe" |
| 2967 | }, |
| 2968 | "date": "2013-03-23 21:36:52.332000000", |
| 2969 | "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.", |
| 2970 | "_revision_number": 1 |
| 2971 | } |
| 2972 | ] |
| 2973 | ---- |
David Pursehouse | c32050d | 2017-08-25 16:27:47 +0900 | [diff] [blame] | 2974 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 2975 | [[get-change-message]] |
| 2976 | === Get Change Message |
| 2977 | |
| 2978 | Retrieves a change message including link:#detailed-accounts[detailed account information]. |
| 2979 | |
| 2980 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 2981 | '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] | 2982 | -- |
| 2983 | |
| 2984 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned. |
| 2985 | |
| 2986 | .Response |
| 2987 | ---- |
| 2988 | HTTP/1.1 200 OK |
| 2989 | Content-Disposition: attachment |
| 2990 | Content-Type: application/json; charset=UTF-8 |
| 2991 | |
| 2992 | )]}' |
| 2993 | { |
| 2994 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 2995 | "author": { |
| 2996 | "_account_id": 1000096, |
| 2997 | "name": "John Doe", |
| 2998 | "email": "john.doe@example.com", |
| 2999 | "username": "jdoe" |
| 3000 | }, |
| 3001 | "date": "2013-03-23 21:34:02.419000000", |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 3002 | "message": "a change message", |
| 3003 | "_revision_number": 1 |
| 3004 | } |
| 3005 | ---- |
| 3006 | |
| 3007 | [[delete-change-message]] |
| 3008 | === Delete Change Message |
| 3009 | -- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 3010 | 'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' + |
| 3011 | '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] | 3012 | -- |
| 3013 | |
| 3014 | Deletes a change message by replacing the change message with a new message, |
| 3015 | which contains the name of the user who deleted the change message and the |
| 3016 | reason why it was deleted. The reason can be provided in the request body as a |
| 3017 | link:#delete-change-message-input[DeleteChangeMessageInput] entity. |
| 3018 | |
| 3019 | Note that only users with the |
| 3020 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 3021 | global capability are permitted to delete a change message. |
| 3022 | |
| 3023 | To delete a change message, send a DELETE request: |
| 3024 | |
| 3025 | .Request |
| 3026 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 3027 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 3028 | ---- |
| 3029 | |
| 3030 | To provide a reason for the deletion, use a POST request: |
| 3031 | |
| 3032 | .Request |
| 3033 | ---- |
Jonathan Nieder | 58c07cf | 2019-03-26 18:52:22 -0700 | [diff] [blame] | 3034 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0 |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 3035 | Content-Type: application/json; charset=UTF-8 |
| 3036 | |
| 3037 | { |
| 3038 | "reason": "spam" |
| 3039 | } |
| 3040 | ---- |
| 3041 | |
| 3042 | As response a link:#change-message-info[ChangeMessageInfo] entity is returned that |
| 3043 | describes the updated change message. |
| 3044 | |
| 3045 | .Response |
| 3046 | ---- |
| 3047 | HTTP/1.1 200 OK |
| 3048 | Content-Disposition: attachment |
| 3049 | Content-Type: application/json; charset=UTF-8 |
| 3050 | |
| 3051 | )]}' |
| 3052 | { |
| 3053 | "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780", |
| 3054 | "author": { |
| 3055 | "_account_id": 1000096, |
| 3056 | "name": "John Doe", |
| 3057 | "email": "john.doe@example.com", |
| 3058 | "username": "jdoe" |
| 3059 | }, |
| 3060 | "date": "2013-03-23 21:34:02.419000000", |
| 3061 | "message": "Change message removed by: Administrator\nReason: spam", |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 3062 | "_revision_number": 1 |
| 3063 | } |
| 3064 | ---- |
Gustaf Lundh | e8647c6 | 2017-04-28 06:51:26 +0200 | [diff] [blame] | 3065 | |
Youssef Elghareeb | d598693 | 2021-10-15 11:45:23 +0200 | [diff] [blame] | 3066 | [[check-submit-requirement]] |
| 3067 | === Check Submit Requirement |
| 3068 | -- |
| 3069 | 'POST /changes/link:#change-id[\{change-id\}]/check.submit_requirement' |
| 3070 | -- |
| 3071 | |
| 3072 | Tests a submit requirement and returns the result as a |
Youssef Elghareeb | 1a24df6 | 2022-06-24 17:52:28 +0200 | [diff] [blame] | 3073 | link:#submit-requirement-result-info[SubmitRequirementResultInfo]. |
| 3074 | |
| 3075 | The submit requirement can be specified in one of the following ways: |
| 3076 | |
| 3077 | * In the request body as a link:#submit-requirement-input[SubmitRequirementInput]. |
| 3078 | * By passing the two request parameters `sr-name` and |
| 3079 | `refs-config-change-id`. The submit requirement will then be loaded from |
| 3080 | the project config pointed to by the latest patchset of this change ID. |
| 3081 | The `sr-name` should point to an existing submit-requirement and the |
| 3082 | `refs-config-change-id` must be a valid change identifier for a change in the |
| 3083 | refs/meta/config branch, otherwise the request would fail with |
| 3084 | `400 Bad Request`. |
Youssef Elghareeb | d598693 | 2021-10-15 11:45:23 +0200 | [diff] [blame] | 3085 | |
| 3086 | Note that this endpoint does not modify the change resource. |
| 3087 | |
| 3088 | .Request |
| 3089 | ---- |
| 3090 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check.submit_requirement HTTP/1.0 |
| 3091 | Content-Type: application/json; charset=UTF-8 |
| 3092 | |
| 3093 | { |
| 3094 | "name": "Code-Review", |
| 3095 | "submittability_expression": "label:Code-Review=+2" |
| 3096 | } |
| 3097 | ---- |
| 3098 | |
| 3099 | As response a link:#submit-requirement-result-info[SubmitRequirementResultInfo] |
| 3100 | entity is returned that describes the submit requirement result. |
| 3101 | |
| 3102 | .Response |
| 3103 | ---- |
| 3104 | HTTP/1.1 200 OK |
| 3105 | Content-Disposition: attachment |
| 3106 | Content-Type: application/json; charset=UTF-8 |
| 3107 | |
| 3108 | )]}' |
| 3109 | { |
| 3110 | "name": "Code-Review", |
| 3111 | "status": "SATISFIED", |
| 3112 | "submittability_expression_result": { |
| 3113 | "expression": "label:Code-Review=+2", |
| 3114 | "fulfilled": true, |
| 3115 | "passingAtoms": [ |
| 3116 | "label:Code-Review=+2" |
| 3117 | ] |
| 3118 | }, |
| 3119 | "is_legacy": false |
| 3120 | } |
| 3121 | ---- |
| 3122 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3123 | [[edit-endpoints]] |
| 3124 | == Change Edit Endpoints |
| 3125 | |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3126 | [[get-edit-detail]] |
| 3127 | === Get Change Edit Details |
| 3128 | -- |
| 3129 | 'GET /changes/link:#change-id[\{change-id\}]/edit |
| 3130 | -- |
| 3131 | |
Nitzan Gur-Furman | cbf9a8f | 2023-03-08 13:21:18 +0100 | [diff] [blame] | 3132 | 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] | 3133 | |
| 3134 | .Request |
| 3135 | ---- |
| 3136 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 3137 | ---- |
| 3138 | |
| 3139 | As response an link:#edit-info[EditInfo] entity is returned that |
| 3140 | describes the change edit, or "`204 No Content`" when change edit doesn't |
| 3141 | exist for this change. Change edits are stored on special branches and there |
| 3142 | 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] | 3143 | When request parameter `list` is provided the response also includes the file |
| 3144 | list. When `base` request parameter is provided the file list is computed |
David Ostrovsky | 5562fe5 | 2014-08-12 22:36:27 +0200 | [diff] [blame] | 3145 | against this base revision. When request parameter `download-commands` is |
| 3146 | provided fetch info map is also included. |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3147 | |
| 3148 | .Response |
| 3149 | ---- |
| 3150 | HTTP/1.1 200 OK |
| 3151 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3152 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3153 | |
| 3154 | )]}' |
| 3155 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3156 | "commit": { |
| 3157 | "parents": [ |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3158 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3159 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3160 | } |
| 3161 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3162 | "author": { |
| 3163 | "name": "Shawn O. Pearce", |
| 3164 | "email": "sop@google.com", |
| 3165 | "date": "2012-04-24 18:08:08.000000000", |
| 3166 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3167 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3168 | "committer": { |
| 3169 | "name": "Shawn O. Pearce", |
| 3170 | "email": "sop@google.com", |
| 3171 | "date": "2012-04-24 18:08:08.000000000", |
| 3172 | "tz": -420 |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3173 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3174 | "subject": "Use an EventBus to manage star icons", |
| 3175 | "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] | 3176 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3177 | "base_patch_set_number": 1, |
| 3178 | "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3", |
| 3179 | "ref": "refs/users/01/1000001/edit-76482/1" |
David Ostrovsky | 1a49f62 | 2014-07-29 00:40:02 +0200 | [diff] [blame] | 3180 | } |
| 3181 | ---- |
David Pursehouse | 4e38b97 | 2014-05-30 10:36:40 +0900 | [diff] [blame] | 3182 | |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 3183 | [[put-edit-file]] |
| 3184 | === Change file content in Change Edit |
| 3185 | -- |
| 3186 | 'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile |
| 3187 | -- |
| 3188 | |
| 3189 | Put content of a file to a change edit. |
| 3190 | |
| 3191 | .Request |
| 3192 | ---- |
| 3193 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3194 | ---- |
| 3195 | |
Paladox none | 28920b4 | 2020-02-22 19:28:21 +0000 | [diff] [blame] | 3196 | To upload a file as binary data in the request body: |
| 3197 | |
| 3198 | .Request |
| 3199 | ---- |
| 3200 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3201 | Content-Type: application/json; charset=UTF-8 |
| 3202 | |
| 3203 | { |
jtrinh | 4ca1041 | 2022-10-04 10:05:34 -0700 | [diff] [blame] | 3204 | "binary_content": "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==", |
| 3205 | "file_mode": 100755 |
Paladox none | 28920b4 | 2020-02-22 19:28:21 +0000 | [diff] [blame] | 3206 | } |
| 3207 | ---- |
| 3208 | |
| 3209 | Note that it must be base-64 encoded data uri. |
| 3210 | |
jtrinh | 4ca1041 | 2022-10-04 10:05:34 -0700 | [diff] [blame] | 3211 | The "file_mode" field is optional, and if provided must be in octal format. The field |
| 3212 | indicates whether the file is executable or not and has a value of either 100755 |
| 3213 | (executable) or 100644 (not executable). If it's unset, this indicates no change |
| 3214 | has been made. New files default to not being executable if this parameter is not |
| 3215 | provided |
| 3216 | |
David Ostrovsky | a5ab829 | 2014-08-01 02:11:39 +0200 | [diff] [blame] | 3217 | When change edit doesn't exist for this change yet it is created. When file |
| 3218 | content isn't provided, it is wiped out for that file. As response |
| 3219 | "`204 No Content`" is returned. |
| 3220 | |
| 3221 | .Response |
| 3222 | ---- |
| 3223 | HTTP/1.1 204 No Content |
| 3224 | ---- |
| 3225 | |
Gal Paikin | 68d217b | 2019-10-07 21:01:22 +0200 | [diff] [blame] | 3226 | When the change edit is a no-op, for example when providing the same file |
| 3227 | content that the file already has, '409 no changes were made' is returned. |
| 3228 | |
| 3229 | .Response |
| 3230 | ---- |
| 3231 | HTTP/1.1 409 no changes were made |
| 3232 | ---- |
| 3233 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3234 | [[post-edit]] |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 3235 | === Restore file content or rename files in Change Edit |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3236 | -- |
| 3237 | 'POST /changes/link:#change-id[\{change-id\}]/edit |
| 3238 | -- |
| 3239 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 3240 | Creates empty change edit, restores file content or renames files in change |
| 3241 | edit. The request body needs to include a |
| 3242 | link:#change-edit-input[ChangeEditInput] entity when a file within change |
| 3243 | 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] | 3244 | |
| 3245 | .Request |
| 3246 | ---- |
| 3247 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3248 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3249 | |
| 3250 | { |
David Ostrovsky | bd12e17 | 2014-08-21 23:08:15 +0200 | [diff] [blame] | 3251 | "restore_path": "foo" |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3252 | } |
| 3253 | ---- |
| 3254 | |
David Ostrovsky | a00c953 | 2015-01-21 00:17:49 +0100 | [diff] [blame] | 3255 | or for rename: |
| 3256 | |
| 3257 | .Request |
| 3258 | ---- |
| 3259 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 3260 | Content-Type: application/json; charset=UTF-8 |
| 3261 | |
| 3262 | { |
| 3263 | "old_path": "foo", |
| 3264 | "new_path": "bar" |
| 3265 | } |
| 3266 | ---- |
| 3267 | |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3268 | 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] | 3269 | and restore flag are provided in request body, this file is restored. When |
| 3270 | old and new file names are provided, the file is renamed. As response |
| 3271 | "`204 No Content`" is returned. |
David Ostrovsky | 138edb4 | 2014-08-15 21:31:43 +0200 | [diff] [blame] | 3272 | |
| 3273 | .Response |
| 3274 | ---- |
| 3275 | HTTP/1.1 204 No Content |
| 3276 | ---- |
| 3277 | |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 3278 | [[put-change-edit-message]] |
| 3279 | === Change commit message in Change Edit |
| 3280 | -- |
| 3281 | 'PUT /changes/link:#change-id[\{change-id\}]/edit:message |
| 3282 | -- |
| 3283 | |
| 3284 | Modify commit message. The request body needs to include a |
| 3285 | link:#change-edit-message-input[ChangeEditMessageInput] |
| 3286 | entity. |
| 3287 | |
| 3288 | .Request |
| 3289 | ---- |
| 3290 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3291 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | c967e15 | 2014-10-24 17:36:16 +0200 | [diff] [blame] | 3292 | |
| 3293 | { |
| 3294 | "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444" |
| 3295 | } |
| 3296 | ---- |
| 3297 | |
| 3298 | If a change edit doesn't exist for this change yet, it is created. As |
| 3299 | response "`204 No Content`" is returned. |
| 3300 | |
| 3301 | .Response |
| 3302 | ---- |
| 3303 | HTTP/1.1 204 No Content |
| 3304 | ---- |
| 3305 | |
David Ostrovsky | 2830c29 | 2014-08-01 02:24:31 +0200 | [diff] [blame] | 3306 | [[delete-edit-file]] |
| 3307 | === Delete file in Change Edit |
| 3308 | -- |
| 3309 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile' |
| 3310 | -- |
| 3311 | |
| 3312 | Deletes a file from a change edit. This deletes the file from the repository |
| 3313 | completely. This is not the same as reverting or restoring a file to its |
| 3314 | previous contents. |
| 3315 | |
| 3316 | .Request |
| 3317 | ---- |
| 3318 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3319 | ---- |
| 3320 | |
| 3321 | When change edit doesn't exist for this change yet it is created. |
| 3322 | |
| 3323 | .Response |
| 3324 | ---- |
| 3325 | HTTP/1.1 204 No Content |
| 3326 | ---- |
| 3327 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3328 | [[get-edit-file]] |
| 3329 | === Retrieve file content from Change Edit |
| 3330 | -- |
| 3331 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile |
| 3332 | -- |
| 3333 | |
| 3334 | Retrieves content of a file from a change edit. |
| 3335 | |
| 3336 | .Request |
| 3337 | ---- |
| 3338 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0 |
| 3339 | ---- |
| 3340 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 3341 | The content of the file is returned as text encoded inside base64. |
| 3342 | The Content-Type header will always be `text/plain` reflecting the |
| 3343 | outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header |
| 3344 | can be examined to find the server detected content type of the file. |
| 3345 | |
| 3346 | When the specified file was deleted in the change edit |
| 3347 | "`204 No Content`" is returned. |
| 3348 | |
| 3349 | If only the content type is required, callers should use HEAD to |
| 3350 | avoid downloading the encoded file contents. |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3351 | |
Michael Zhou | 551ad0c | 2016-04-26 01:21:42 -0400 | [diff] [blame] | 3352 | If the `base` parameter is set to true, the returned content is from the |
| 3353 | revision that the edit is based on. |
| 3354 | |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3355 | .Response |
| 3356 | ---- |
| 3357 | HTTP/1.1 200 OK |
| 3358 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3359 | Content-Type: text/plain; charset=ISO-8859-1 |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3360 | X-FYI-Content-Encoding: base64 |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 3361 | X-FYI-Content-Type: text/xml |
David Ostrovsky | fd6c175 | 2014-08-01 19:43:21 +0200 | [diff] [blame] | 3362 | |
| 3363 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
| 3364 | ---- |
| 3365 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 3366 | Alternatively, if the only value of the Accept request header is |
| 3367 | `application/json` the content is returned as JSON string and |
| 3368 | `X-FYI-Content-Encoding` is set to `json`. |
| 3369 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 3370 | [[get-edit-meta-data]] |
| 3371 | === Retrieve meta data of a file from Change Edit |
| 3372 | -- |
| 3373 | 'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta |
| 3374 | -- |
| 3375 | |
| 3376 | Retrieves meta data of a file from a change edit. Currently only |
| 3377 | web links are returned. |
| 3378 | |
| 3379 | .Request |
| 3380 | ---- |
| 3381 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0 |
| 3382 | ---- |
| 3383 | |
| 3384 | This REST endpoint retrieves additional information for a file in a |
| 3385 | change edit. As result an link:#edit-file-info[EditFileInfo] entity is |
| 3386 | returned. |
| 3387 | |
| 3388 | .Response |
| 3389 | ---- |
| 3390 | HTTP/1.1 200 OK |
| 3391 | Content-Disposition: attachment |
| 3392 | Content-Type: application/json; charset=UTF-8 |
| 3393 | |
| 3394 | )]}' |
| 3395 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 3396 | "web_links": [ |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 3397 | { |
| 3398 | "show_on_side_by_side_diff_view": true, |
| 3399 | "name": "side-by-side preview diff", |
| 3400 | "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png", |
| 3401 | "url": "#/x/xdocs/c/42/1..0/README.md", |
| 3402 | "target": "_self" |
| 3403 | }, |
| 3404 | { |
| 3405 | "show_on_unified_diff_view": true, |
| 3406 | "name": "unified preview diff", |
| 3407 | "image_url": "plugins/xdocs/static/unifiedDiffPreview.png", |
| 3408 | "url": "#/x/xdocs/c/42/1..0/README.md,unified", |
| 3409 | "target": "_self" |
| 3410 | } |
| 3411 | ]} |
| 3412 | ---- |
| 3413 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 3414 | [[get-edit-message]] |
| 3415 | === Retrieve commit message from Change Edit or current patch set of the change |
| 3416 | -- |
| 3417 | 'GET /changes/link:#change-id[\{change-id\}]/edit:message |
| 3418 | -- |
| 3419 | |
David Ostrovsky | 25ad15e | 2014-12-15 21:18:59 +0100 | [diff] [blame] | 3420 | Retrieves commit message from change edit. |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 3421 | |
David Ostrovsky | 0ee0bb2 | 2016-05-31 22:47:47 +0200 | [diff] [blame] | 3422 | If the `base` parameter is set to true, the returned message is from the |
| 3423 | revision that the edit is based on. |
| 3424 | |
David Ostrovsky | 3d2c070 | 2014-10-28 23:44:27 +0100 | [diff] [blame] | 3425 | .Request |
| 3426 | ---- |
| 3427 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0 |
| 3428 | ---- |
| 3429 | |
| 3430 | The commit message is returned as base64 encoded string. |
| 3431 | |
| 3432 | .Response |
| 3433 | ---- |
| 3434 | HTTP/1.1 200 OK |
| 3435 | |
| 3436 | VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz |
| 3437 | M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg== |
| 3438 | ---- |
| 3439 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 3440 | Alternatively, if the only value of the Accept request header is |
| 3441 | `application/json` the commit message is returned as JSON string: |
| 3442 | |
| 3443 | .Response |
| 3444 | ---- |
| 3445 | HTTP/1.1 200 OK |
| 3446 | |
| 3447 | )]}' |
| 3448 | "Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n" |
| 3449 | ---- |
| 3450 | |
| 3451 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3452 | [[publish-edit]] |
| 3453 | === Publish Change Edit |
| 3454 | -- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3455 | 'POST /changes/link:#change-id[\{change-id\}]/edit:publish |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3456 | -- |
| 3457 | |
| 3458 | Promotes change edit to a regular patch set. |
| 3459 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 3460 | Options can be provided in the request body as a |
| 3461 | link:#publish-change-edit-input[PublishChangeEditInput] entity. |
| 3462 | |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3463 | .Request |
| 3464 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3465 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0 |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 3466 | Content-Type: application/json; charset=UTF-8 |
| 3467 | |
| 3468 | { |
| 3469 | "notify": "NONE" |
| 3470 | } |
David Ostrovsky | e9988f9 | 2014-08-01 09:56:34 +0200 | [diff] [blame] | 3471 | ---- |
| 3472 | |
| 3473 | As response "`204 No Content`" is returned. |
| 3474 | |
| 3475 | .Response |
| 3476 | ---- |
| 3477 | HTTP/1.1 204 No Content |
| 3478 | ---- |
| 3479 | |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3480 | [[rebase-edit]] |
| 3481 | === Rebase Change Edit |
| 3482 | -- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3483 | 'POST /changes/link:#change-id[\{change-id\}]/edit:rebase |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3484 | -- |
| 3485 | |
| 3486 | Rebases change edit on top of latest patch set. |
| 3487 | |
| 3488 | .Request |
| 3489 | ---- |
David Ostrovsky | 9cbdb20 | 2014-11-11 22:39:59 +0100 | [diff] [blame] | 3490 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0 |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3491 | ---- |
| 3492 | |
| 3493 | When change was rebased on top of latest patch set, response |
David Pursehouse | 56fbc08 | 2015-05-19 16:33:03 +0900 | [diff] [blame] | 3494 | "`204 No Content`" is returned. When change edit is already |
David Ostrovsky | 46999d2 | 2014-08-16 02:19:13 +0200 | [diff] [blame] | 3495 | based on top of the latest patch set, the response |
| 3496 | "`409 Conflict`" is returned. |
| 3497 | |
| 3498 | .Response |
| 3499 | ---- |
| 3500 | HTTP/1.1 204 No Content |
| 3501 | ---- |
| 3502 | |
David Ostrovsky | 8e75f50 | 2014-08-10 00:36:31 +0200 | [diff] [blame] | 3503 | [[delete-edit]] |
| 3504 | === Delete Change Edit |
| 3505 | -- |
| 3506 | 'DELETE /changes/link:#change-id[\{change-id\}]/edit' |
| 3507 | -- |
| 3508 | |
| 3509 | Deletes change edit. |
| 3510 | |
| 3511 | .Request |
| 3512 | ---- |
| 3513 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0 |
| 3514 | ---- |
| 3515 | |
| 3516 | As response "`204 No Content`" is returned. |
| 3517 | |
| 3518 | .Response |
| 3519 | ---- |
| 3520 | HTTP/1.1 204 No Content |
| 3521 | ---- |
| 3522 | |
Edwin Kempin | 9a9f1c0 | 2017-01-02 15:10:49 +0100 | [diff] [blame] | 3523 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3524 | [[reviewer-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3525 | == Reviewer Endpoints |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3526 | |
| 3527 | [[list-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3528 | === List Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3529 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3530 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3531 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3532 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3533 | Lists the reviewers of a change. |
| 3534 | |
| 3535 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 3536 | |
| 3537 | .Request |
| 3538 | ---- |
| 3539 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0 |
| 3540 | ---- |
| 3541 | |
| 3542 | .Response |
| 3543 | ---- |
| 3544 | HTTP/1.1 200 OK |
| 3545 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3546 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3547 | |
| 3548 | )]}' |
| 3549 | [ |
| 3550 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3551 | "approvals": { |
| 3552 | "Verified": "+1", |
| 3553 | "Code-Review": "+2" |
| 3554 | }, |
| 3555 | "_account_id": 1000096, |
| 3556 | "name": "John Doe", |
| 3557 | "email": "john.doe@example.com" |
| 3558 | }, |
| 3559 | { |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 3560 | "approvals": { |
| 3561 | "Verified": " 0", |
| 3562 | "Code-Review": "-1" |
| 3563 | }, |
| 3564 | "_account_id": 1000097, |
| 3565 | "name": "Jane Roe", |
| 3566 | "email": "jane.roe@example.com" |
| 3567 | } |
| 3568 | ] |
| 3569 | ---- |
| 3570 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3571 | [[suggest-reviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3572 | === Suggest Reviewers |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3573 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3574 | '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] | 3575 | -- |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3576 | |
| 3577 | Suggest the reviewers for a given query `q` and result limit `n`. If result |
| 3578 | limit is not passed, then the default 10 is used. |
| 3579 | |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3580 | This REST endpoint only suggests accounts that |
| 3581 | |
| 3582 | * are active |
| 3583 | * can see the change |
| 3584 | * are visible to the calling user |
| 3585 | * are not already reviewer on the change |
| 3586 | * don't own the change |
Edwin Kempin | ad55dde | 2021-09-28 11:30:55 +0200 | [diff] [blame] | 3587 | * are not service users (unless |
| 3588 | link:config.html#suggest.skipServiceUsers[skipServiceUsers] is set to `false`) |
Edwin Kempin | 2639eaa | 2019-08-27 09:47:27 +0200 | [diff] [blame] | 3589 | |
Edwin Kempin | ec02a55 | 2019-08-27 09:30:15 +0200 | [diff] [blame] | 3590 | Groups can be excluded from the results by specifying the 'exclude-groups' |
| 3591 | request parameter: |
| 3592 | |
| 3593 | -- |
| 3594 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups' |
| 3595 | -- |
Patrick Hiesel | c79ae0e | 2017-06-28 14:50:53 +0200 | [diff] [blame] | 3596 | |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3597 | As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned. |
| 3598 | |
| 3599 | .Request |
| 3600 | ---- |
| 3601 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0 |
| 3602 | ---- |
| 3603 | |
| 3604 | .Response |
| 3605 | ---- |
| 3606 | HTTP/1.1 200 OK |
| 3607 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3608 | Content-Type: application/json; charset=UTF-8 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3609 | |
| 3610 | )]}' |
| 3611 | [ |
| 3612 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3613 | "account": { |
| 3614 | "_account_id": 1000097, |
| 3615 | "name": "Jane Roe", |
| 3616 | "email": "jane.roe@example.com" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3617 | }, |
| 3618 | "count": 1 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3619 | }, |
| 3620 | { |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3621 | "group": { |
| 3622 | "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279", |
| 3623 | "name": "Joiner" |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 3624 | }, |
| 3625 | "count": 5 |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 3626 | } |
| 3627 | ] |
| 3628 | ---- |
| 3629 | |
Edwin Kempin | 0ca3f72 | 2019-08-27 09:43:31 +0200 | [diff] [blame] | 3630 | To suggest CCs `reviewer-state=CC` can be specified as additional URL |
| 3631 | parameter. This includes existing reviewers in the result, but excludes |
| 3632 | existing CCs. |
| 3633 | |
| 3634 | -- |
| 3635 | 'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC' |
| 3636 | -- |
| 3637 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3638 | [[get-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3639 | === Get Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3640 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3641 | '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] | 3642 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3643 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3644 | Retrieves a reviewer of a change. |
| 3645 | |
| 3646 | As response a link:#reviewer-info[ReviewerInfo] entity is returned that |
| 3647 | describes the reviewer. |
| 3648 | |
| 3649 | .Request |
| 3650 | ---- |
| 3651 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0 |
| 3652 | ---- |
| 3653 | |
| 3654 | .Response |
| 3655 | ---- |
| 3656 | HTTP/1.1 200 OK |
| 3657 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3658 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3659 | |
| 3660 | )]}' |
| 3661 | { |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 3662 | "approvals": { |
| 3663 | "Verified": "+1", |
| 3664 | "Code-Review": "+2" |
| 3665 | }, |
| 3666 | "_account_id": 1000096, |
| 3667 | "name": "John Doe", |
| 3668 | "email": "john.doe@example.com" |
| 3669 | } |
| 3670 | ---- |
| 3671 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3672 | [[add-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3673 | === Add Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3674 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3675 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3676 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3677 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3678 | Adds one user or all members of one group as reviewer to the change. |
| 3679 | |
| 3680 | The reviewer to be added to the change must be provided in the request |
| 3681 | body as a link:#reviewer-input[ReviewerInput] entity. |
| 3682 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3683 | Users can be moved from reviewer to CC and vice versa. This means if a |
| 3684 | user is added as CC that is already a reviewer on the change, the |
| 3685 | reviewer state of that user is updated to CC. If a user that is already |
| 3686 | a CC on the change is added as reviewer, the reviewer state of that |
| 3687 | user is updated to reviewer. |
| 3688 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 3689 | Adding a new reviewer also adds that reviewer to the attention set, unless |
| 3690 | the change is work in progress. |
| 3691 | Also, moving a reviewer to CC removes that user from the attention set. |
| 3692 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3693 | .Request |
| 3694 | ---- |
| 3695 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3696 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3697 | |
| 3698 | { |
| 3699 | "reviewer": "john.doe@example.com" |
| 3700 | } |
| 3701 | ---- |
| 3702 | |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 3703 | As response an link:#reviewer-result[ReviewerResult] entity is |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3704 | returned that describes the newly added reviewers. |
| 3705 | |
| 3706 | .Response |
| 3707 | ---- |
| 3708 | HTTP/1.1 200 OK |
| 3709 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3710 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3711 | |
| 3712 | )]}' |
| 3713 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3714 | "input": "john.doe@example.com", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3715 | "reviewers": [ |
| 3716 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 3717 | "_account_id": 1000096, |
| 3718 | "name": "John Doe", |
| 3719 | "email": "john.doe@example.com" |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3720 | "approvals": { |
| 3721 | "Verified": " 0", |
| 3722 | "Code-Review": " 0" |
| 3723 | }, |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3724 | } |
| 3725 | ] |
| 3726 | } |
| 3727 | ---- |
| 3728 | |
| 3729 | If a group is specified, adding the group members as reviewers is an |
| 3730 | atomic operation. This means if an error is returned, none of the |
| 3731 | members are added as reviewer. |
| 3732 | |
| 3733 | If a group with many members is added as reviewer a confirmation may be |
| 3734 | required. |
| 3735 | |
Edwin Kempin | f9f1941 | 2019-08-28 09:28:51 +0200 | [diff] [blame] | 3736 | If a group is added as CC and members of this group are already |
| 3737 | reviewers on the change, these members stay reviewers on the change |
| 3738 | (they are not downgraded to CC). However if a group is added as |
| 3739 | reviewer, all group members become reviewer of the change, even if they |
| 3740 | have been added as CC before. |
| 3741 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3742 | .Request |
| 3743 | ---- |
| 3744 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3745 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3746 | |
| 3747 | { |
| 3748 | "reviewer": "MyProjectVerifiers" |
| 3749 | } |
| 3750 | ---- |
| 3751 | |
| 3752 | .Response |
| 3753 | ---- |
| 3754 | HTTP/1.1 200 OK |
| 3755 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3756 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3757 | |
| 3758 | )]}' |
| 3759 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3760 | "input": "MyProjectVerifiers", |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3761 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 3762 | "confirm": true |
| 3763 | } |
| 3764 | ---- |
| 3765 | |
| 3766 | To confirm the addition of the reviewers, resend the request with the |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3767 | `confirmed` flag being set. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3768 | |
| 3769 | .Request |
| 3770 | ---- |
| 3771 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3772 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3773 | |
| 3774 | { |
Logan Hanks | 23e7028 | 2016-07-06 14:31:56 -0700 | [diff] [blame] | 3775 | "input": "MyProjectVerifiers", |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 3776 | "confirmed": true |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 3777 | } |
| 3778 | ---- |
| 3779 | |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 3780 | If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set |
| 3781 | for the project, reviewers and CCs are not required to have a Gerrit account. If you POST |
| 3782 | an email address of a reviewer or CC then, they will be added to the change even if they |
| 3783 | don't have a Gerrit account. |
| 3784 | |
| 3785 | If this option is disabled, the request would fail with `400 Bad Request` if the email |
| 3786 | address can't be resolved to an active Gerrit account. |
| 3787 | |
| 3788 | Note that the name is optional so both "un.registered@reviewer.com" and |
| 3789 | "John Doe <un.registered@reviewer.com>" are valid inputs. |
| 3790 | |
| 3791 | Reviewers without Gerrit accounts can only be added on changes visible to anonymous users. |
| 3792 | |
| 3793 | .Request |
| 3794 | ---- |
| 3795 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 3796 | Content-Type: application/json; charset=UTF-8 |
| 3797 | |
| 3798 | { |
| 3799 | "reviewer": "John Doe <un.registered@reviewer.com>" |
| 3800 | } |
| 3801 | ---- |
| 3802 | |
| 3803 | .Response |
| 3804 | ---- |
| 3805 | HTTP/1.1 200 OK |
| 3806 | Content-Disposition: attachment |
| 3807 | Content-Type: application/json; charset=UTF-8 |
| 3808 | |
| 3809 | )]}' |
| 3810 | { |
| 3811 | "input": "John Doe <un.registered@reviewer.com>" |
| 3812 | } |
| 3813 | ---- |
| 3814 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 3815 | .Notifications |
| 3816 | |
| 3817 | An email will be sent using the "newchange" template. |
| 3818 | |
| 3819 | [options="header",cols="1,1,1"] |
| 3820 | |============================= |
| 3821 | |WIP State |Default|notify=ALL |
| 3822 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 3823 | |Work in progress|not sent|owner, reviewers, CCs |
| 3824 | |============================= |
| 3825 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3826 | [[delete-reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3827 | === Delete Reviewer |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3828 | -- |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3829 | 'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' + |
| 3830 | '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] | 3831 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 3832 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3833 | Deletes a reviewer from a change. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 3834 | Deleting a reviewer also removes that user from the attention set. |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3835 | |
| 3836 | .Request |
| 3837 | ---- |
| 3838 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0 |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3839 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3840 | ---- |
| 3841 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3842 | Options can be provided in the request body as a |
| 3843 | link:#delete-reviewer-input[DeleteReviewerInput] entity. |
| 3844 | 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] | 3845 | 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] | 3846 | In this case, use a POST request instead: |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 3847 | |
| 3848 | .Request |
| 3849 | ---- |
| 3850 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0 |
| 3851 | Content-Type: application/json; charset=UTF-8 |
| 3852 | |
| 3853 | { |
| 3854 | "notify": "NONE" |
| 3855 | } |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 3856 | ---- |
| 3857 | |
| 3858 | .Response |
| 3859 | ---- |
| 3860 | HTTP/1.1 204 No Content |
| 3861 | ---- |
| 3862 | |
Logan Hanks | 8760741 | 2017-05-30 13:49:04 -0700 | [diff] [blame] | 3863 | .Notifications |
| 3864 | |
| 3865 | An email will be sent using the "deleteReviewer" template. If deleting the |
| 3866 | reviewer resulted in one or more approvals being removed, then the deleted |
| 3867 | reviewer will also receive a notification (unless notify=NONE). |
| 3868 | |
| 3869 | [options="header",cols="1,5"] |
| 3870 | |============================= |
| 3871 | |WIP State |Default Recipients |
| 3872 | |Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers |
| 3873 | |Work in progress|notify=NONE: deleted reviewer (if voted) |
| 3874 | |============================= |
| 3875 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3876 | [[list-votes]] |
| 3877 | === List Votes |
| 3878 | -- |
| 3879 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 3880 | -- |
| 3881 | |
| 3882 | Lists the votes for a specific reviewer of the change. |
| 3883 | |
| 3884 | .Request |
| 3885 | ---- |
Edwin Kempin | 314f10a | 2016-07-11 11:39:05 +0200 | [diff] [blame] | 3886 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0 |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3887 | ---- |
| 3888 | |
| 3889 | As result a map is returned that maps the label name to the label value. |
| 3890 | The entries in the map are sorted by label name. |
| 3891 | |
| 3892 | .Response |
| 3893 | ---- |
| 3894 | HTTP/1.1 200 OK |
| 3895 | Content-Disposition: attachment |
| 3896 | Content-Type: application/json;charset=UTF-8 |
| 3897 | |
| 3898 | )]}' |
| 3899 | { |
| 3900 | "Code-Review": -1, |
| 3901 | "Verified": 1 |
| 3902 | "Work-In-Progress": 1, |
| 3903 | } |
| 3904 | ---- |
| 3905 | |
| 3906 | [[delete-vote]] |
| 3907 | === Delete Vote |
| 3908 | -- |
Edwin Kempin | 5488dc1 | 2016-08-29 11:13:31 +0200 | [diff] [blame] | 3909 | '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] | 3910 | '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] | 3911 | -- |
| 3912 | |
| 3913 | Deletes a single vote from a change. Note, that even when the last vote of |
| 3914 | a reviewer is removed the reviewer itself is still listed on the change. |
| 3915 | |
Gal Paikin | 6ce56dc | 2021-03-29 12:28:43 +0200 | [diff] [blame] | 3916 | If another user removed a user's vote, the user with the deleted vote will be |
| 3917 | added to the attention set. |
| 3918 | |
Dmitrii Filippov | 3e0bbb7 | 2023-02-22 12:57:00 +0100 | [diff] [blame] | 3919 | The request returns: |
| 3920 | * '204 No Content' if the vote is deleted successfully; |
| 3921 | * '404 Not Found' when the vote to be deleted is zero or not present. |
| 3922 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3923 | .Request |
| 3924 | ---- |
| 3925 | 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] | 3926 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 3927 | ---- |
| 3928 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 3929 | Options can be provided in the request body as a |
| 3930 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 3931 | 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] | 3932 | 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] | 3933 | In this case, use a POST request instead: |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 3934 | |
| 3935 | .Request |
| 3936 | ---- |
| 3937 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 3938 | Content-Type: application/json; charset=UTF-8 |
| 3939 | |
| 3940 | { |
| 3941 | "notify": "NONE" |
| 3942 | } |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 3943 | ---- |
| 3944 | |
| 3945 | .Response |
| 3946 | ---- |
| 3947 | HTTP/1.1 204 No Content |
| 3948 | ---- |
| 3949 | |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 3950 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3951 | [[revision-endpoints]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3952 | == Revision Endpoints |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 3953 | |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3954 | [[get-commit]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3955 | === Get Commit |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 3956 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3957 | '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] | 3958 | -- |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3959 | |
| 3960 | Retrieves a parsed commit of a revision. |
| 3961 | |
| 3962 | .Request |
| 3963 | ---- |
| 3964 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0 |
| 3965 | ---- |
| 3966 | |
| 3967 | As response a link:#commit-info[CommitInfo] entity is returned that |
| 3968 | describes the revision. |
| 3969 | |
| 3970 | .Response |
| 3971 | ---- |
| 3972 | HTTP/1.1 200 OK |
| 3973 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 3974 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3975 | |
| 3976 | )]}' |
| 3977 | { |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 3978 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 3979 | "parents": [ |
| 3980 | { |
| 3981 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 3982 | "subject": "Migrate contributor agreements to All-Projects." |
| 3983 | } |
| 3984 | ], |
| 3985 | "author": { |
| 3986 | "name": "Shawn O. Pearce", |
| 3987 | "email": "sop@google.com", |
| 3988 | "date": "2012-04-24 18:08:08.000000000", |
| 3989 | "tz": -420 |
| 3990 | }, |
| 3991 | "committer": { |
| 3992 | "name": "Shawn O. Pearce", |
| 3993 | "email": "sop@google.com", |
| 3994 | "date": "2012-04-24 18:08:08.000000000", |
| 3995 | "tz": -420 |
| 3996 | }, |
| 3997 | "subject": "Use an EventBus to manage star icons", |
| 3998 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 3999 | } |
| 4000 | ---- |
| 4001 | |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 4002 | Adding query parameter `links` (for example `/changes/.../commit?links`) |
| 4003 | returns a link:#commit-info[CommitInfo] with the additional field `web_links`. |
Shawn Pearce | 728ba88 | 2013-07-08 23:13:08 -0700 | [diff] [blame] | 4004 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 4005 | [[get-description]] |
| 4006 | === Get Description |
| 4007 | -- |
| 4008 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 4009 | -- |
| 4010 | |
| 4011 | Retrieves the description of a patch set. |
| 4012 | |
| 4013 | .Request |
| 4014 | ---- |
| 4015 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 4016 | ---- |
| 4017 | |
| 4018 | .Response |
| 4019 | ---- |
| 4020 | HTTP/1.1 200 OK |
| 4021 | Content-Disposition: attachment |
| 4022 | Content-Type: application/json; charset=UTF-8 |
| 4023 | |
| 4024 | )]}' |
| 4025 | "Added Documentation" |
| 4026 | ---- |
| 4027 | |
| 4028 | If the patch set does not have a description an empty string is returned. |
| 4029 | |
| 4030 | [[set-description]] |
| 4031 | === Set Description |
| 4032 | -- |
| 4033 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description' |
| 4034 | -- |
| 4035 | |
| 4036 | Sets the description of a patch set. |
| 4037 | |
| 4038 | The new description must be provided in the request body inside a |
| 4039 | link:#description-input[DescriptionInput] entity. |
| 4040 | |
| 4041 | .Request |
| 4042 | ---- |
| 4043 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0 |
| 4044 | Content-Type: application/json; charset=UTF-8 |
| 4045 | |
| 4046 | { |
| 4047 | "description": "Added Documentation" |
| 4048 | } |
| 4049 | ---- |
| 4050 | |
| 4051 | As response the new description is returned. |
| 4052 | |
| 4053 | .Response |
| 4054 | ---- |
| 4055 | HTTP/1.1 200 OK |
| 4056 | Content-Disposition: attachment |
| 4057 | Content-Type: application/json; charset=UTF-8 |
| 4058 | |
| 4059 | )]}' |
| 4060 | "Added Documentation" |
| 4061 | ---- |
| 4062 | |
Edwin Kempin | 0f22944 | 2016-09-09 13:06:12 +0200 | [diff] [blame] | 4063 | [[get-merge-list]] |
| 4064 | === Get Merge List |
| 4065 | -- |
| 4066 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist' |
| 4067 | -- |
| 4068 | |
| 4069 | Returns the list of commits that are being integrated into a target |
| 4070 | branch by a merge commit. By default the first parent is assumed to be |
| 4071 | uninteresting. By using the `parent` option another parent can be set |
| 4072 | as uninteresting (parents are 1-based). |
| 4073 | |
| 4074 | The list of commits is returned as a list of |
| 4075 | link:#commit-info[CommitInfo] entities. Web links are only included if |
| 4076 | the `links` option was set. |
| 4077 | |
| 4078 | .Request |
| 4079 | ---- |
| 4080 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0 |
| 4081 | ---- |
| 4082 | |
| 4083 | .Response |
| 4084 | ---- |
| 4085 | HTTP/1.1 200 OK |
| 4086 | Content-Disposition: attachment |
| 4087 | Content-Type: application/json; charset=UTF-8 |
| 4088 | |
| 4089 | )]}' |
| 4090 | [ |
| 4091 | { |
| 4092 | "commit": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 4093 | "parents": [ |
| 4094 | { |
| 4095 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 4096 | "subject": "Migrate contributor agreements to All-Projects." |
| 4097 | } |
| 4098 | ], |
| 4099 | "author": { |
| 4100 | "name": "Shawn O. Pearce", |
| 4101 | "email": "sop@google.com", |
| 4102 | "date": "2012-04-24 18:08:08.000000000", |
| 4103 | "tz": -420 |
| 4104 | }, |
| 4105 | "committer": { |
| 4106 | "name": "Shawn O. Pearce", |
| 4107 | "email": "sop@google.com", |
| 4108 | "date": "2012-04-24 18:08:08.000000000", |
| 4109 | "tz": -420 |
| 4110 | }, |
| 4111 | "subject": "Use an EventBus to manage star icons", |
| 4112 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 4113 | } |
| 4114 | ] |
| 4115 | ---- |
| 4116 | |
Stefan Beller | c725966 | 2015-02-12 17:23:05 -0800 | [diff] [blame] | 4117 | [[get-revision-actions]] |
| 4118 | === Get Revision Actions |
| 4119 | -- |
| 4120 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions' |
| 4121 | -- |
| 4122 | |
| 4123 | Retrieves revision link:#action-info[actions] of the revision of a change. |
| 4124 | |
| 4125 | .Request |
| 4126 | ---- |
| 4127 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0 |
| 4128 | ---- |
| 4129 | |
| 4130 | .Response |
| 4131 | ---- |
| 4132 | HTTP/1.1 200 OK |
| 4133 | Content-Disposition: attachment |
| 4134 | Content-Type: application/json; charset=UTF-8 |
| 4135 | |
| 4136 | )]}' |
| 4137 | |
| 4138 | { |
| 4139 | "submit": { |
| 4140 | "method": "POST", |
| 4141 | "label": "Submit", |
| 4142 | "title": "Submit patch set 1 into master", |
| 4143 | "enabled": true |
| 4144 | }, |
| 4145 | "cherrypick": { |
| 4146 | "method": "POST", |
| 4147 | "label": "Cherry Pick", |
| 4148 | "title": "Cherry pick change to a different branch", |
| 4149 | "enabled": true |
| 4150 | } |
| 4151 | } |
| 4152 | ---- |
| 4153 | |
Han-Wen Nienhuys | 86db767 | 2021-08-10 12:45:58 +0200 | [diff] [blame] | 4154 | The response is a flat map of possible revision REST endpoint names |
| 4155 | mapped to their link:#action-info[ActionInfo]. |
Stefan Beller | c725966 | 2015-02-12 17:23:05 -0800 | [diff] [blame] | 4156 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4157 | [[get-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4158 | === Get Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4159 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4160 | '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] | 4161 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4162 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4163 | Retrieves a review of a revision. |
| 4164 | |
| 4165 | .Request |
| 4166 | ---- |
| 4167 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 4168 | ---- |
| 4169 | |
| 4170 | As response a link:#change-info[ChangeInfo] entity with |
| 4171 | link:#detailed-labels[detailed labels] and link:#detailed-accounts[ |
| 4172 | detailed accounts] is returned that describes the review of the |
| 4173 | revision. The revision for which the review is retrieved is contained |
| 4174 | in the `revisions` field. In addition the `current_revision` field is |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 4175 | 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] | 4176 | revision of the change. Please note that the returned labels are always |
| 4177 | for the current patch set. |
| 4178 | |
| 4179 | .Response |
| 4180 | ---- |
| 4181 | HTTP/1.1 200 OK |
| 4182 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4183 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4184 | |
| 4185 | )]}' |
| 4186 | { |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4187 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4188 | "project": "myProject", |
| 4189 | "branch": "master", |
| 4190 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4191 | "subject": "Implementing Feature X", |
| 4192 | "status": "NEW", |
| 4193 | "created": "2013-02-01 09:59:32.126000000", |
| 4194 | "updated": "2013-02-21 11:16:36.775000000", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4195 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 4196 | "insertions": 34, |
| 4197 | "deletions": 45, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4198 | "_number": 3965, |
| 4199 | "owner": { |
| 4200 | "_account_id": 1000096, |
| 4201 | "name": "John Doe", |
| 4202 | "email": "john.doe@example.com" |
| 4203 | }, |
| 4204 | "labels": { |
| 4205 | "Verified": { |
| 4206 | "all": [ |
| 4207 | { |
| 4208 | "value": 0, |
| 4209 | "_account_id": 1000096, |
| 4210 | "name": "John Doe", |
| 4211 | "email": "john.doe@example.com" |
| 4212 | }, |
| 4213 | { |
| 4214 | "value": 0, |
| 4215 | "_account_id": 1000097, |
| 4216 | "name": "Jane Roe", |
| 4217 | "email": "jane.roe@example.com" |
| 4218 | } |
| 4219 | ], |
| 4220 | "values": { |
| 4221 | "-1": "Fails", |
| 4222 | " 0": "No score", |
| 4223 | "+1": "Verified" |
| 4224 | } |
| 4225 | }, |
| 4226 | "Code-Review": { |
| 4227 | "all": [ |
| 4228 | { |
| 4229 | "value": -1, |
| 4230 | "_account_id": 1000096, |
| 4231 | "name": "John Doe", |
| 4232 | "email": "john.doe@example.com" |
| 4233 | }, |
| 4234 | { |
| 4235 | "value": 1, |
| 4236 | "_account_id": 1000097, |
| 4237 | "name": "Jane Roe", |
| 4238 | "email": "jane.roe@example.com" |
| 4239 | } |
| 4240 | ] |
| 4241 | "values": { |
Oswald Buddenhagen | f887770 | 2022-02-15 14:01:34 +0100 | [diff] [blame] | 4242 | "-2": "This shall not be submitted", |
| 4243 | "-1": "I would prefer this is not submitted as is", |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4244 | " 0": "No score", |
| 4245 | "+1": "Looks good to me, but someone else must approve", |
| 4246 | "+2": "Looks good to me, approved" |
| 4247 | } |
| 4248 | } |
| 4249 | }, |
| 4250 | "permitted_labels": { |
| 4251 | "Verified": [ |
| 4252 | "-1", |
| 4253 | " 0", |
| 4254 | "+1" |
| 4255 | ], |
| 4256 | "Code-Review": [ |
| 4257 | "-2", |
| 4258 | "-1", |
| 4259 | " 0", |
| 4260 | "+1", |
| 4261 | "+2" |
| 4262 | ] |
| 4263 | }, |
| 4264 | "removable_reviewers": [ |
| 4265 | { |
| 4266 | "_account_id": 1000096, |
| 4267 | "name": "John Doe", |
| 4268 | "email": "john.doe@example.com" |
| 4269 | }, |
| 4270 | { |
| 4271 | "_account_id": 1000097, |
| 4272 | "name": "Jane Roe", |
| 4273 | "email": "jane.roe@example.com" |
| 4274 | } |
| 4275 | ], |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 4276 | "reviewers": { |
| 4277 | "REVIEWER": [ |
| 4278 | { |
| 4279 | "_account_id": 1000096, |
| 4280 | "name": "John Doe", |
| 4281 | "email": "john.doe@example.com" |
| 4282 | }, |
| 4283 | { |
| 4284 | "_account_id": 1000097, |
| 4285 | "name": "Jane Roe", |
| 4286 | "email": "jane.roe@example.com" |
| 4287 | } |
| 4288 | ] |
| 4289 | }, |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4290 | "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 4291 | "revisions": { |
| 4292 | "674ac754f91e64a0efb8087e59a176484bd534d1": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 4293 | "kind": "REWORK", |
| 4294 | "_number": 2, |
| 4295 | "ref": "refs/changes/65/3965/2", |
| 4296 | "fetch": { |
| 4297 | "http": { |
| 4298 | "url": "http://gerrit/myProject", |
| 4299 | "ref": "refs/changes/65/3965/2" |
| 4300 | } |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 4301 | } |
| 4302 | } |
| 4303 | } |
| 4304 | } |
| 4305 | ---- |
| 4306 | |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4307 | [[get-related-changes]] |
| 4308 | === Get Related Changes |
| 4309 | -- |
| 4310 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related' |
| 4311 | -- |
| 4312 | |
| 4313 | Retrieves related changes of a revision. Related changes are changes that either |
| 4314 | depend on, or are dependencies of the revision. |
| 4315 | |
Joerg Zieren | 75e9538 | 2022-07-08 11:30:35 +0200 | [diff] [blame] | 4316 | Additional fields can be obtained by adding `o` parameters. Since these may slow |
| 4317 | down processing they are disabled by default. Currently a single parameter is |
| 4318 | supported: |
| 4319 | |
| 4320 | [[get-related-changes-submittable]] |
| 4321 | -- |
| 4322 | * `SUBMITTABLE`: Compute the `submittable` field in the returned |
| 4323 | link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities. |
| 4324 | -- |
| 4325 | |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4326 | .Request |
| 4327 | ---- |
| 4328 | GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0 |
| 4329 | ---- |
| 4330 | |
| 4331 | As result a link:#related-changes-info[RelatedChangesInfo] entity is returned |
| 4332 | describing the related changes. |
| 4333 | |
| 4334 | .Response |
| 4335 | ---- |
| 4336 | HTTP/1.1 200 OK |
| 4337 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4338 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4339 | |
| 4340 | )]}' |
| 4341 | { |
| 4342 | "changes": [ |
| 4343 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 4344 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4345 | "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5", |
| 4346 | "commit": { |
| 4347 | "commit": "78847477532e386f5a2185a4e8c90b2509e354e3", |
| 4348 | "parents": [ |
| 4349 | { |
| 4350 | "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e" |
| 4351 | } |
| 4352 | ], |
| 4353 | "author": { |
| 4354 | "name": "David Ostrovsky", |
| 4355 | "email": "david@ostrovsky.org", |
| 4356 | "date": "2014-07-12 15:04:24.000000000", |
| 4357 | "tz": 120 |
| 4358 | }, |
| 4359 | "subject": "Remove Solr" |
| 4360 | }, |
| 4361 | "_change_number": 58478, |
| 4362 | "_revision_number": 2, |
| 4363 | "_current_revision_number": 2 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 4364 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4365 | }, |
| 4366 | { |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 4367 | "project": "gerrit", |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4368 | "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774", |
| 4369 | "commit": { |
| 4370 | "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe", |
| 4371 | "parents": [ |
| 4372 | { |
| 4373 | "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad" |
| 4374 | } |
| 4375 | ], |
| 4376 | "author": { |
| 4377 | "name": "David Pursehouse", |
| 4378 | "email": "david.pursehouse@sonymobile.com", |
| 4379 | "date": "2014-06-24 02:01:28.000000000", |
| 4380 | "tz": 540 |
| 4381 | }, |
| 4382 | "subject": "Add support for secondary index with Elasticsearch" |
| 4383 | }, |
| 4384 | "_change_number": 58081, |
| 4385 | "_revision_number": 10, |
| 4386 | "_current_revision_number": 10 |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 4387 | "status": "NEW" |
David Pursehouse | 669f251 | 2014-07-18 11:41:42 +0900 | [diff] [blame] | 4388 | } |
| 4389 | ] |
| 4390 | } |
| 4391 | ---- |
| 4392 | |
| 4393 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4394 | [[set-review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4395 | === Set Review |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4396 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4397 | '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] | 4398 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4399 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 4400 | Sets a review on a revision, optionally also publishing draft comments, setting |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 4401 | labels, adding reviewers or CCs, and modifying the work in progress property. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4402 | |
| 4403 | The review must be provided in the request body as a |
| 4404 | link:#review-input[ReviewInput] entity. |
| 4405 | |
Youssef Elghareeb | 12add16 | 2019-12-18 18:43:23 +0100 | [diff] [blame] | 4406 | If the labels are set, the user sending the request will automatically be |
| 4407 | added as a reviewer, otherwise (if they only commented) they are added to |
| 4408 | the CC list. |
| 4409 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 4410 | Some updates to the attention set occur here. If more than one update should |
| 4411 | occur, only the first update in the order of the below documentation occurs: |
| 4412 | |
| 4413 | If a user is part of remove_from_attention_set, the user will be explicitly |
| 4414 | removed from the attention set. |
| 4415 | |
| 4416 | If a user is part of add_to_attention_set, the user will be explicitly |
| 4417 | added to the attention set. |
| 4418 | |
| 4419 | If the boolean ignore_default_attention_set_rules is set to true, all |
| 4420 | other rules below will be ignored: |
| 4421 | |
| 4422 | The user who created the review is removed from the attention set. |
| 4423 | |
| 4424 | If the change is ready for review, the following also apply: |
| 4425 | |
| 4426 | When the uploader replies, the owner is added to the attention set. |
| 4427 | |
| 4428 | When the owner or uploader replies, all the reviewers are added to |
| 4429 | the attention set. |
| 4430 | |
| 4431 | When neither the owner nor the uploader replies, add the owner and the |
| 4432 | uploader to the attention set. |
| 4433 | |
| 4434 | Then, new reviewers are added to the attention set, and removed reviewers |
| 4435 | (by becoming CC) are removed from the attention set. |
| 4436 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4437 | A review cannot be set on a change edit. Trying to post a review for a |
| 4438 | change edit fails with `409 Conflict`. |
| 4439 | |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 4440 | Here is an example of using this method to set labels: |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4441 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4442 | .Request |
| 4443 | ---- |
| 4444 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4445 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4446 | |
| 4447 | { |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 4448 | "tag": "jenkins", |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4449 | "message": "Some nits need to be fixed.", |
| 4450 | "labels": { |
| 4451 | "Code-Review": -1 |
| 4452 | }, |
| 4453 | "comments": { |
| 4454 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 4455 | { |
| 4456 | "line": 23, |
| 4457 | "message": "[nit] trailing whitespace" |
| 4458 | }, |
| 4459 | { |
| 4460 | "line": 49, |
| 4461 | "message": "[nit] s/conrtol/control" |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 4462 | }, |
| 4463 | { |
| 4464 | "range": { |
| 4465 | "start_line": 50, |
| 4466 | "start_character": 0, |
| 4467 | "end_line": 55, |
| 4468 | "end_character": 20 |
| 4469 | }, |
David Pursehouse | b53c1f6 | 2014-08-26 14:51:33 +0900 | [diff] [blame] | 4470 | "message": "Incorrect indentation" |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4471 | } |
| 4472 | ] |
| 4473 | } |
| 4474 | } |
| 4475 | ---- |
| 4476 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 4477 | As response a link:#review-result[ReviewResult] entity is returned that |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4478 | describes the applied labels and any added reviewers (e.g. yourself, |
| 4479 | 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] | 4480 | |
| 4481 | .Response |
| 4482 | ---- |
| 4483 | HTTP/1.1 200 OK |
| 4484 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4485 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 4486 | |
| 4487 | )]}' |
| 4488 | { |
| 4489 | "labels": { |
| 4490 | "Code-Review": -1 |
| 4491 | } |
| 4492 | } |
| 4493 | ---- |
| 4494 | |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4495 | It is also possible to add one or more reviewers or CCs |
Logan Hanks | f03040e | 2017-05-03 09:40:56 -0700 | [diff] [blame] | 4496 | to a change simultaneously with a review: |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4497 | |
| 4498 | .Request |
| 4499 | ---- |
| 4500 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 4501 | Content-Type: application/json; charset=UTF-8 |
| 4502 | |
| 4503 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4504 | "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] | 4505 | "reviewers": [ |
| 4506 | { |
| 4507 | "reviewer": "jane.roe@example.com" |
| 4508 | }, |
| 4509 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4510 | "reviewer": "john.doe@example.com", |
| 4511 | "state": "CC" |
| 4512 | } |
| 4513 | { |
| 4514 | "reviewer": "MyProjectVerifiers", |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4515 | } |
| 4516 | ] |
| 4517 | } |
| 4518 | ---- |
| 4519 | |
| 4520 | Each element of the `reviewers` list is an instance of |
| 4521 | link:#reviewer-input[ReviewerInput]. The corresponding result of |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4522 | adding each reviewer will be returned in a map of inputs to |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 4523 | link:#reviewer-result[ReviewerResult]s. |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4524 | |
| 4525 | .Response |
| 4526 | ---- |
| 4527 | HTTP/1.1 200 OK |
| 4528 | Content-Disposition: attachment |
| 4529 | Content-Type: application/json; charset=UTF-8 |
| 4530 | |
| 4531 | )]}' |
| 4532 | { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4533 | "reviewers": { |
| 4534 | "jane.roe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4535 | "input": "jane.roe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4536 | "reviewers": [ |
| 4537 | { |
| 4538 | "_account_id": 1000097, |
| 4539 | "name": "Jane Roe", |
| 4540 | "email": "jane.roe@example.com" |
| 4541 | "approvals": { |
| 4542 | "Verified": " 0", |
| 4543 | "Code-Review": " 0" |
| 4544 | }, |
| 4545 | }, |
| 4546 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4547 | }, |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4548 | "john.doe@example.com": { |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4549 | "input": "john.doe@example.com", |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4550 | "ccs": [ |
| 4551 | { |
| 4552 | "_account_id": 1000096, |
| 4553 | "name": "John Doe", |
| 4554 | "email": "john.doe@example.com" |
| 4555 | "approvals": { |
| 4556 | "Verified": " 0", |
| 4557 | "Code-Review": " 0" |
| 4558 | }, |
| 4559 | } |
| 4560 | ] |
| 4561 | }, |
| 4562 | "MyProjectVerifiers": { |
| 4563 | "input": "MyProjectVerifiers", |
| 4564 | "reviewers": [ |
| 4565 | { |
| 4566 | "_account_id": 1000098, |
| 4567 | "name": "Alice Ansel", |
| 4568 | "email": "alice.ansel@example.com" |
| 4569 | "approvals": { |
| 4570 | "Verified": " 0", |
| 4571 | "Code-Review": " 0" |
| 4572 | }, |
| 4573 | }, |
| 4574 | { |
| 4575 | "_account_id": 1000099, |
| 4576 | "name": "Bob Bollard", |
| 4577 | "email": "bob.bollard@example.com" |
| 4578 | "approvals": { |
| 4579 | "Verified": " 0", |
| 4580 | "Code-Review": " 0" |
| 4581 | }, |
| 4582 | }, |
| 4583 | ] |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4584 | } |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4585 | } |
Logan Hanks | 5f1c759 | 2016-07-06 14:39:33 -0700 | [diff] [blame] | 4586 | } |
| 4587 | ---- |
| 4588 | |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4589 | 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] | 4590 | be rejected with `400 Bad Request`. None of the entries will have the |
| 4591 | `reviewers` or `ccs` field set, and those which specifically failed will have |
| 4592 | the `errors` field set containing details of why they failed. |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4593 | |
| 4594 | .Error Response |
| 4595 | ---- |
| 4596 | HTTP/1.1 400 Bad Request |
| 4597 | Content-Disposition: attachment |
| 4598 | Content-Type: application/json; charset=UTF-8 |
| 4599 | |
| 4600 | )]}' |
| 4601 | { |
| 4602 | "reviewers": { |
Aaron Gable | 8c65021 | 2017-04-25 12:03:37 -0700 | [diff] [blame] | 4603 | "jane.roe@example.com": { |
| 4604 | "input": "jane.roe@example.com", |
| 4605 | "error": "Account of jane.roe@example.com is inactive." |
| 4606 | }, |
| 4607 | "john.doe@example.com": { |
| 4608 | "input": "john.doe@example.com" |
| 4609 | }, |
Logan Hanks | e2aacef | 2016-07-22 15:54:52 -0700 | [diff] [blame] | 4610 | "MyProjectVerifiers": { |
| 4611 | "input": "MyProjectVerifiers", |
| 4612 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 4613 | "confirm": true |
| 4614 | } |
| 4615 | } |
| 4616 | } |
| 4617 | ---- |
| 4618 | |
Dave Borowitz | d2e4145 | 2017-10-26 08:06:23 -0400 | [diff] [blame] | 4619 | [[set-review-notifications]] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4620 | .Notifications |
| 4621 | |
| 4622 | An email will be sent using the "comment" template. |
| 4623 | |
| 4624 | If the top-level notify property is null or not set, then notification behavior |
| 4625 | depends on whether the change is WIP, whether it has started review, and whether |
| 4626 | the tag property is null. |
| 4627 | |
| 4628 | NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*. |
| 4629 | Use the notify property of the top-level link:#review-input[ReviewInput] instead. |
| 4630 | |
| 4631 | For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS |
| 4632 | watchers*. |
| 4633 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4634 | [options="header",cols="2,1,1,2,2"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4635 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4636 | |WIP State |Review Started|Tag Given|Default |notify=ALL |
| 4637 | |Ready for review|N/A |N/A |everyone|everyone |
| 4638 | |Work in progress|no |no |not sent|everyone |
| 4639 | |Work in progress|no |yes |owner |everyone |
| 4640 | |Work in progress|yes |no |everyone|everyone |
| 4641 | |Work in progress|yes |yes |owner |everyone |
| 4642 | |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4643 | |============================= |
| 4644 | |
| 4645 | If reviewers are added, then a second email will be sent using the "newchange" |
| 4646 | template. The notification logic for this email is the same as for |
| 4647 | link:#add-reviewer[Add Reviewer]. |
| 4648 | |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4649 | [options="header",cols="1,1,1"] |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4650 | |============================= |
Logan Hanks | ea3e3b7 | 2017-06-12 14:21:47 -0700 | [diff] [blame] | 4651 | |WIP State |Default |notify=ALL |
| 4652 | |Ready for review|owner, reviewers, CCs|owner, reviewers, CCs |
| 4653 | |Work in progress|not sent |owner, reviewers, CCs |
Logan Hanks | fc05596 | 2017-06-12 14:20:53 -0700 | [diff] [blame] | 4654 | |============================= |
| 4655 | |
| 4656 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4657 | [[rebase-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4658 | === Rebase Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4659 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4660 | '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] | 4661 | -- |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4662 | |
| 4663 | Rebases a revision. |
| 4664 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4665 | Optionally, the parent revision can be changed to another patch set through the |
| 4666 | link:#rebase-input[RebaseInput] entity. |
| 4667 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4668 | .Request |
| 4669 | ---- |
| 4670 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0 |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 4671 | Content-Type: application/json;charset=UTF-8 |
| 4672 | |
| 4673 | { |
| 4674 | "base" : "1234", |
| 4675 | } |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4676 | ---- |
| 4677 | |
| 4678 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 4679 | describes the rebased change. Information about the current patch set |
| 4680 | is included. |
| 4681 | |
| 4682 | .Response |
| 4683 | ---- |
| 4684 | HTTP/1.1 200 OK |
| 4685 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4686 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4687 | |
| 4688 | )]}' |
| 4689 | { |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4690 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4691 | "project": "myProject", |
| 4692 | "branch": "master", |
| 4693 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 4694 | "subject": "Implement Feature X", |
| 4695 | "status": "NEW", |
| 4696 | "created": "2013-02-01 09:59:32.126000000", |
| 4697 | "updated": "2013-02-21 11:16:36.775000000", |
| 4698 | "mergeable": false, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 4699 | "insertions": 21, |
| 4700 | "deletions": 21, |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4701 | "_number": 4799, |
| 4702 | "owner": { |
| 4703 | "name": "John Doe" |
| 4704 | }, |
| 4705 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 4706 | "revisions": { |
| 4707 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 4708 | "kind": "REWORK", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4709 | "_number": 2, |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 4710 | "ref": "refs/changes/99/4799/2", |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4711 | "fetch": { |
| 4712 | "http": { |
| 4713 | "url": "http://gerrit:8080/myProject", |
| 4714 | "ref": "refs/changes/99/4799/2" |
| 4715 | } |
| 4716 | }, |
| 4717 | "commit": { |
| 4718 | "parents": [ |
| 4719 | { |
| 4720 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 4721 | "subject": "Implement Feature A" |
| 4722 | } |
Yuxuan Wang | cc598ac | 2016-07-12 17:11:05 +0000 | [diff] [blame] | 4723 | ], |
| 4724 | "author": { |
| 4725 | "name": "John Doe", |
| 4726 | "email": "john.doe@example.com", |
| 4727 | "date": "2013-05-07 15:21:27.000000000", |
| 4728 | "tz": 120 |
| 4729 | }, |
| 4730 | "committer": { |
| 4731 | "name": "Gerrit Code Review", |
| 4732 | "email": "gerrit-server@example.com", |
| 4733 | "date": "2013-05-07 15:35:43.000000000", |
| 4734 | "tz": 120 |
| 4735 | }, |
| 4736 | "subject": "Implement Feature X", |
| 4737 | "message": "Implement Feature X\n\nAdded feature X." |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4738 | } |
| 4739 | } |
| 4740 | } |
| 4741 | ---- |
| 4742 | |
| 4743 | If the revision cannot be rebased, e.g. due to conflicts, the response is |
| 4744 | "`409 Conflict`" and the error message is contained in the response |
| 4745 | body. |
| 4746 | |
| 4747 | .Response |
| 4748 | ---- |
| 4749 | HTTP/1.1 409 Conflict |
| 4750 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4751 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 4752 | |
| 4753 | The change could not be rebased due to a path conflict during merge. |
| 4754 | ---- |
| 4755 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4756 | [[submit-revision]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4757 | === Submit Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4758 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4759 | '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] | 4760 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4761 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4762 | Submits a revision. |
Gal Paikin | c85d352 | 2021-04-19 13:34:54 +0200 | [diff] [blame] | 4763 | Submitting a change also removes all users from the link:#attention-set[attention set]. |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4764 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4765 | .Request |
| 4766 | ---- |
| 4767 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4768 | ---- |
| 4769 | |
Gal Paikin | 3d6cdec | 2021-04-19 13:32:13 +0200 | [diff] [blame] | 4770 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 4771 | describes the submitted/merged change. |
| 4772 | |
Gal Paikin | e2849a8 | 2021-04-19 13:41:10 +0200 | [diff] [blame] | 4773 | Submission may submit multiple changes, but we still only return one ChangeInfo |
| 4774 | object. To query for all submitted changes, please use the submission_id that is |
| 4775 | part of the response. |
| 4776 | |
| 4777 | Changes that will also be submitted: |
| 4778 | 1. All changes of the same topic if |
| 4779 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 4780 | configuration is set to true. |
| 4781 | 2. All dependent changes. |
| 4782 | 3. The closure of the above (e.g if a dependent change has a topic, all changes |
| 4783 | of *that* topic will also be submitted). |
| 4784 | |
Gal Paikin | 3d6cdec | 2021-04-19 13:32:13 +0200 | [diff] [blame] | 4785 | .Response |
| 4786 | ---- |
| 4787 | HTTP/1.1 200 OK |
| 4788 | Content-Disposition: attachment |
| 4789 | Content-Type: application/json; charset=UTF-8 |
| 4790 | |
| 4791 | )]}' |
| 4792 | { |
| 4793 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4794 | "project": "myProject", |
| 4795 | "branch": "master", |
| 4796 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 4797 | "subject": "Implementing Feature X", |
| 4798 | "status": "MERGED", |
| 4799 | "created": "2013-02-01 09:59:32.126000000", |
| 4800 | "updated": "2013-02-21 11:16:36.775000000", |
| 4801 | "submitted": "2013-02-21 11:16:36.615000000", |
| 4802 | "_number": 3965, |
| 4803 | "owner": { |
| 4804 | "name": "John Doe" |
| 4805 | } |
| 4806 | } |
| 4807 | ---- |
| 4808 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4809 | If the revision cannot be submitted, e.g. because the submit rule |
| 4810 | doesn't allow submitting the revision or the revision is not the |
| 4811 | current revision, the response is "`409 Conflict`" and the error |
| 4812 | message is contained in the response body. |
| 4813 | |
| 4814 | .Response |
| 4815 | ---- |
| 4816 | HTTP/1.1 409 Conflict |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4817 | Content-Type: text/plain; charset=UTF-8 |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 4818 | |
| 4819 | "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision" |
| 4820 | ---- |
| 4821 | |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4822 | [[get-patch]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4823 | === Get Patch |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4824 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4825 | '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] | 4826 | -- |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4827 | |
| 4828 | Gets the formatted patch for one revision. |
| 4829 | |
| 4830 | .Request |
| 4831 | ---- |
| 4832 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0 |
| 4833 | ---- |
| 4834 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4835 | The formatted patch is returned as text encoded inside base64: |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4836 | |
| 4837 | .Response |
| 4838 | ---- |
| 4839 | HTTP/1.1 200 OK |
| 4840 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4841 | Content-Type: text/plain; charset=ISO-8859-1 |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4842 | X-FYI-Content-Encoding: base64 |
| 4843 | X-FYI-Content-Type: application/mbox |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4844 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 4845 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 4846 | ---- |
| 4847 | |
David Ostrovsky | 973f38b | 2013-08-22 00:24:51 -0700 | [diff] [blame] | 4848 | Adding query parameter `zip` (for example `/changes/.../patch?zip`) |
| 4849 | returns the patch as a single file inside of a ZIP archive. Clients |
| 4850 | can expand the ZIP to obtain the plain text patch, avoiding the |
| 4851 | need for a base64 decoding step. This option implies `download`. |
| 4852 | |
| 4853 | Query parameter `download` (e.g. `/changes/.../patch?download`) |
| 4854 | will suggest the browser save the patch as `commitsha1.diff.base64`, |
| 4855 | for later processing by command line tools. |
| 4856 | |
Kasper Nilsson | 8144807 | 2016-10-17 15:04:33 -0700 | [diff] [blame] | 4857 | If the `path` parameter is set, the returned content is a diff of the single |
| 4858 | file that the path refers to. |
| 4859 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4860 | [[get-mergeable]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4861 | === Get Mergeable |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4862 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4863 | '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] | 4864 | -- |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4865 | |
| 4866 | Gets the method the server will use to submit (merge) the change and |
| 4867 | an indicator if the change is currently mergeable. |
| 4868 | |
| 4869 | .Request |
| 4870 | ---- |
| 4871 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0 |
| 4872 | ---- |
| 4873 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 4874 | As response a link:#mergeable-info[MergeableInfo] entity is returned. |
| 4875 | |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4876 | .Response |
| 4877 | ---- |
| 4878 | HTTP/1.1 200 OK |
| 4879 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4880 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4881 | |
| 4882 | )]}' |
| 4883 | { |
| 4884 | submit_type: "MERGE_IF_NECESSARY", |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 4885 | strategy: "recursive", |
| 4886 | mergeable: true |
Shawn Pearce | 3a2a247 | 2013-07-17 16:40:45 -0700 | [diff] [blame] | 4887 | } |
| 4888 | ---- |
| 4889 | |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4890 | If the `other-branches` parameter is specified, the mergeability will also be |
Zhen Chen | 6729b63 | 2016-11-11 17:32:32 -0800 | [diff] [blame] | 4891 | checked for all other branches which are listed in the |
| 4892 | link:config-project-config.html#branchOrder-section[branchOrder] section in the |
| 4893 | project.config file. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4894 | |
| 4895 | .Request |
| 4896 | ---- |
| 4897 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0 |
| 4898 | ---- |
| 4899 | |
| 4900 | The response will then contain a list of all other branches where this changes |
| 4901 | could merge cleanly. |
| 4902 | |
| 4903 | .Response |
| 4904 | ---- |
| 4905 | HTTP/1.1 200 OK |
| 4906 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4907 | Content-Type: application/json; charset=UTF-8 |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 4908 | |
| 4909 | )]}' |
| 4910 | { |
| 4911 | submit_type: "MERGE_IF_NECESSARY", |
| 4912 | mergeable: true, |
| 4913 | mergeable_into: [ |
| 4914 | "refs/heads/stable-2.7", |
| 4915 | "refs/heads/stable-2.8", |
| 4916 | ] |
| 4917 | } |
| 4918 | ---- |
| 4919 | |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4920 | [[get-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4921 | === Get Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4922 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4923 | '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] | 4924 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4925 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4926 | Gets the method the server will use to submit (merge) the change. |
| 4927 | |
| 4928 | .Request |
| 4929 | ---- |
| 4930 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0 |
| 4931 | ---- |
| 4932 | |
| 4933 | .Response |
| 4934 | ---- |
| 4935 | HTTP/1.1 200 OK |
| 4936 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4937 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4938 | |
| 4939 | )]}' |
| 4940 | "MERGE_IF_NECESSARY" |
| 4941 | ---- |
| 4942 | |
| 4943 | [[test-submit-type]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4944 | === Test Submit Type |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4945 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4946 | '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] | 4947 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4948 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4949 | Tests the submit_type Prolog rule in the project, or the one given. |
| 4950 | |
| 4951 | Request body may be either the Prolog code as `text/plain` or a |
| 4952 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 4953 | may be set to `SKIP` to bypass parent project filters while testing |
| 4954 | a project-specific rule. |
| 4955 | |
| 4956 | .Request |
| 4957 | ---- |
| 4958 | 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] | 4959 | Content-Type: text/plain; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4960 | |
| 4961 | submit_type(cherry_pick). |
| 4962 | ---- |
| 4963 | |
| 4964 | .Response |
| 4965 | ---- |
| 4966 | HTTP/1.1 200 OK |
| 4967 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 4968 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4969 | |
| 4970 | )]}' |
Shawn Pearce | 7076f4e | 2013-08-20 22:11:51 -0700 | [diff] [blame] | 4971 | "CHERRY_PICK" |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4972 | ---- |
| 4973 | |
| 4974 | [[test-submit-rule]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4975 | === Test Submit Rule |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 4976 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4977 | '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] | 4978 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 4979 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4980 | Tests the submit_rule Prolog rule in the project, or the one given. |
| 4981 | |
| 4982 | Request body may be either the Prolog code as `text/plain` or a |
| 4983 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 4984 | may be set to `SKIP` to bypass parent project filters while testing |
| 4985 | a project-specific rule. |
| 4986 | |
| 4987 | .Request |
| 4988 | ---- |
Shawn Pearce | a3cce71 | 2014-03-21 08:16:11 -0700 | [diff] [blame] | 4989 | 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] | 4990 | Content-Type: text/plain; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 4991 | |
| 4992 | submit_rule(submit(R)) :- |
| 4993 | R = label('Any-Label-Name', reject(_)). |
| 4994 | ---- |
| 4995 | |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 4996 | The response is a link:#submit-record[SubmitRecord] describing the |
| 4997 | permutations that satisfy the tested submit rule. |
| 4998 | |
David Pursehouse | 87a3fb0 | 2019-10-29 16:01:27 +0900 | [diff] [blame] | 4999 | 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] | 5000 | |
| 5001 | .Response |
| 5002 | ---- |
| 5003 | HTTP/1.1 200 OK |
| 5004 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5005 | Content-Type: application/json; charset=UTF-8 |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5006 | |
| 5007 | )]}' |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 5008 | { |
| 5009 | "status": "NOT_READY", |
| 5010 | "reject": { |
| 5011 | "Any-Label-Name": {} |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5012 | } |
Patrick Hiesel | 7ab1b18 | 2019-08-13 15:29:27 +0200 | [diff] [blame] | 5013 | } |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 5014 | ---- |
| 5015 | |
Shawn Pearce | b42e303 | 2015-04-02 10:28:10 -0700 | [diff] [blame] | 5016 | When testing with the `curl` command line client the |
| 5017 | `--data-binary @rules.pl` flag should be used to ensure |
| 5018 | all LFs are included in the Prolog code: |
| 5019 | |
| 5020 | ---- |
| 5021 | curl -X POST \ |
| 5022 | -H 'Content-Type: text/plain; charset=UTF-8' \ |
| 5023 | --data-binary @rules.pl \ |
| 5024 | http://.../test.submit_rule |
| 5025 | ---- |
| 5026 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5027 | [[list-drafts]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 5028 | === List Revision Drafts |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5029 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5030 | '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] | 5031 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5032 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5033 | Lists the draft comments of a revision that belong to the calling |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5034 | user. |
| 5035 | |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 5036 | Returns a map of file paths to lists of link:#comment-info[CommentInfo] |
| 5037 | entries. The entries in the map are sorted by file path. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5038 | |
| 5039 | .Request |
| 5040 | ---- |
| 5041 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0 |
| 5042 | ---- |
| 5043 | |
| 5044 | .Response |
| 5045 | ---- |
| 5046 | HTTP/1.1 200 OK |
| 5047 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5048 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5049 | |
| 5050 | )]}' |
| 5051 | { |
| 5052 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5053 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5054 | "id": "TvcXrmjM", |
| 5055 | "line": 23, |
| 5056 | "message": "[nit] trailing whitespace", |
| 5057 | "updated": "2013-02-26 15:40:43.986000000" |
| 5058 | }, |
| 5059 | { |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 5060 | "id": "TveXwFiA", |
| 5061 | "line": 49, |
| 5062 | "in_reply_to": "TfYX-Iuo", |
| 5063 | "message": "Done", |
| 5064 | "updated": "2013-02-26 15:40:45.328000000" |
| 5065 | } |
| 5066 | ] |
| 5067 | } |
| 5068 | ---- |
| 5069 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5070 | [[create-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5071 | === Create Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5072 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5073 | '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] | 5074 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5075 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5076 | Creates a draft comment on a revision. |
| 5077 | |
| 5078 | The new draft comment must be provided in the request body inside a |
| 5079 | link:#comment-input[CommentInput] entity. |
| 5080 | |
| 5081 | .Request |
| 5082 | ---- |
| 5083 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5084 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5085 | |
| 5086 | { |
| 5087 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5088 | "line": 23, |
| 5089 | "message": "[nit] trailing whitespace" |
| 5090 | } |
| 5091 | ---- |
| 5092 | |
| 5093 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5094 | describes the draft comment. |
| 5095 | |
| 5096 | .Response |
| 5097 | ---- |
| 5098 | HTTP/1.1 200 OK |
| 5099 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5100 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5101 | |
| 5102 | )]}' |
| 5103 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5104 | "id": "TvcXrmjM", |
| 5105 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5106 | "line": 23, |
| 5107 | "message": "[nit] trailing whitespace", |
| 5108 | "updated": "2013-02-26 15:40:43.986000000" |
| 5109 | } |
| 5110 | ---- |
| 5111 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5112 | [[get-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5113 | === Get Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5114 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5115 | '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] | 5116 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5117 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5118 | Retrieves a draft comment of a revision that belongs to the calling |
| 5119 | user. |
| 5120 | |
| 5121 | .Request |
| 5122 | ---- |
| 5123 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 5124 | ---- |
| 5125 | |
| 5126 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5127 | describes the draft comment. |
| 5128 | |
| 5129 | .Response |
| 5130 | ---- |
| 5131 | HTTP/1.1 200 OK |
| 5132 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5133 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5134 | |
| 5135 | )]}' |
| 5136 | { |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 5137 | "id": "TvcXrmjM", |
| 5138 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5139 | "line": 23, |
| 5140 | "message": "[nit] trailing whitespace", |
| 5141 | "updated": "2013-02-26 15:40:43.986000000" |
| 5142 | } |
| 5143 | ---- |
| 5144 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5145 | [[update-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5146 | === Update Draft |
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 | '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] | 5149 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5150 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5151 | Updates a draft comment on a revision. |
| 5152 | |
| 5153 | The new draft comment must be provided in the request body inside a |
| 5154 | link:#comment-input[CommentInput] entity. |
| 5155 | |
| 5156 | .Request |
| 5157 | ---- |
| 5158 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5159 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5160 | |
| 5161 | { |
| 5162 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5163 | "line": 23, |
| 5164 | "message": "[nit] trailing whitespace" |
| 5165 | } |
| 5166 | ---- |
| 5167 | |
| 5168 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5169 | describes the draft comment. |
| 5170 | |
| 5171 | .Response |
| 5172 | ---- |
| 5173 | HTTP/1.1 200 OK |
| 5174 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5175 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5176 | |
| 5177 | )]}' |
| 5178 | { |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5179 | "id": "TvcXrmjM", |
| 5180 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5181 | "line": 23, |
| 5182 | "message": "[nit] trailing whitespace", |
| 5183 | "updated": "2013-02-26 15:40:43.986000000" |
| 5184 | } |
| 5185 | ---- |
| 5186 | |
| 5187 | [[delete-draft]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5188 | === Delete Draft |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5189 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5190 | '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] | 5191 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 5192 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 5193 | Deletes a draft comment from a revision. |
| 5194 | |
| 5195 | .Request |
| 5196 | ---- |
| 5197 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 5198 | ---- |
| 5199 | |
| 5200 | .Response |
| 5201 | ---- |
| 5202 | HTTP/1.1 204 No Content |
| 5203 | ---- |
| 5204 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5205 | [[list-comments]] |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 5206 | === List Revision Comments |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5207 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5208 | '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] | 5209 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5210 | |
| 5211 | Lists the published comments of a revision. |
| 5212 | |
| 5213 | As result a map is returned that maps the file path to a list of |
| 5214 | link:#comment-info[CommentInfo] entries. The entries in the map are |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 5215 | sorted by file path and only include file (or inline) comments. Use |
| 5216 | the link:#get-change-detail[Get Change Detail] endpoint to retrieve |
| 5217 | the general change message (or comment). |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5218 | |
| 5219 | .Request |
| 5220 | ---- |
| 5221 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0 |
| 5222 | ---- |
| 5223 | |
| 5224 | .Response |
| 5225 | ---- |
| 5226 | HTTP/1.1 200 OK |
| 5227 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5228 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5229 | |
| 5230 | )]}' |
| 5231 | { |
| 5232 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5233 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5234 | "id": "TvcXrmjM", |
| 5235 | "line": 23, |
| 5236 | "message": "[nit] trailing whitespace", |
| 5237 | "updated": "2013-02-26 15:40:43.986000000", |
| 5238 | "author": { |
| 5239 | "_account_id": 1000096, |
| 5240 | "name": "John Doe", |
| 5241 | "email": "john.doe@example.com" |
| 5242 | } |
| 5243 | }, |
| 5244 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5245 | "id": "TveXwFiA", |
| 5246 | "line": 49, |
| 5247 | "in_reply_to": "TfYX-Iuo", |
| 5248 | "message": "Done", |
| 5249 | "updated": "2013-02-26 15:40:45.328000000", |
| 5250 | "author": { |
| 5251 | "_account_id": 1000097, |
| 5252 | "name": "Jane Roe", |
| 5253 | "email": "jane.roe@example.com" |
| 5254 | } |
| 5255 | } |
| 5256 | ] |
| 5257 | } |
| 5258 | ---- |
| 5259 | |
| 5260 | [[get-comment]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5261 | === Get Comment |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5262 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5263 | '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] | 5264 | -- |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5265 | |
| 5266 | Retrieves a published comment of a revision. |
| 5267 | |
| 5268 | .Request |
| 5269 | ---- |
| 5270 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0 |
| 5271 | ---- |
| 5272 | |
| 5273 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5274 | describes the published comment. |
| 5275 | |
| 5276 | .Response |
| 5277 | ---- |
| 5278 | HTTP/1.1 200 OK |
| 5279 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5280 | Content-Type: application/json; charset=UTF-8 |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5281 | |
| 5282 | )]}' |
| 5283 | { |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 5284 | "id": "TvcXrmjM", |
| 5285 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5286 | "line": 23, |
| 5287 | "message": "[nit] trailing whitespace", |
| 5288 | "updated": "2013-02-26 15:40:43.986000000", |
| 5289 | "author": { |
| 5290 | "_account_id": 1000096, |
| 5291 | "name": "John Doe", |
| 5292 | "email": "john.doe@example.com" |
| 5293 | } |
| 5294 | } |
| 5295 | ---- |
| 5296 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5297 | [[delete-comment]] |
| 5298 | === Delete Comment |
| 5299 | -- |
| 5300 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' + |
| 5301 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete' |
| 5302 | -- |
| 5303 | |
| 5304 | Deletes a published comment of a revision. Instead of deleting the |
| 5305 | whole comment, this endpoint just replaces the comment's message |
| 5306 | 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] | 5307 | the comment and the reason why it's deleted. |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5308 | |
Gal Paikin | 8d02723 | 2021-12-09 12:39:19 +0100 | [diff] [blame] | 5309 | This endpoint also marks the comment as resolved since deleted comments are not |
| 5310 | actionable. |
| 5311 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5312 | Note that only users with the |
| 5313 | link:access-control.html#capability_administrateServer[Administrate Server] |
| 5314 | global capability are permitted to delete a comment. |
| 5315 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 5316 | Deletion reason can be provided in the request body as a |
| 5317 | link:#delete-comment-input[DeleteCommentInput] entity. |
| 5318 | 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] | 5319 | 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] | 5320 | In this case, use a POST request instead: |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 5321 | |
| 5322 | .Request |
| 5323 | ---- |
| 5324 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0 |
| 5325 | Content-Type: application/json; charset=UTF-8 |
| 5326 | |
| 5327 | { |
| 5328 | "reason": "contains confidential information" |
| 5329 | } |
| 5330 | ---- |
| 5331 | |
| 5332 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 5333 | describes the updated comment. |
| 5334 | |
| 5335 | .Response |
| 5336 | ---- |
| 5337 | HTTP/1.1 200 OK |
| 5338 | Content-Disposition: attachment |
| 5339 | Content-Type: application/json; charset=UTF-8 |
| 5340 | |
| 5341 | )]}' |
| 5342 | { |
| 5343 | "id": "TvcXrmjM", |
| 5344 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5345 | "line": 23, |
| 5346 | "message": "Comment removed by: Administrator; Reason: contains confidential information", |
| 5347 | "updated": "2013-02-26 15:40:43.986000000", |
| 5348 | "author": { |
| 5349 | "_account_id": 1000096, |
| 5350 | "name": "John Doe", |
| 5351 | "email": "john.doe@example.com" |
| 5352 | } |
| 5353 | } |
| 5354 | ---- |
| 5355 | |
Edwin Kempin | b050a48 | 2016-12-01 09:11:19 +0100 | [diff] [blame] | 5356 | [[list-robot-comments]] |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5357 | === List Robot Comments |
| 5358 | -- |
| 5359 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/' |
| 5360 | -- |
| 5361 | |
| 5362 | Lists the link:config-robot-comments.html[robot comments] of a |
| 5363 | revision. |
| 5364 | |
| 5365 | As result a map is returned that maps the file path to a list of |
| 5366 | link:#robot-comment-info[RobotCommentInfo] entries. The entries in the |
| 5367 | map are sorted by file path. |
| 5368 | |
| 5369 | .Request |
| 5370 | ---- |
| 5371 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0 |
| 5372 | ---- |
| 5373 | |
| 5374 | .Response |
| 5375 | ---- |
| 5376 | HTTP/1.1 200 OK |
| 5377 | Content-Disposition: attachment |
| 5378 | Content-Type: application/json; charset=UTF-8 |
| 5379 | |
| 5380 | )]}' |
| 5381 | { |
| 5382 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5383 | { |
| 5384 | "id": "TvcXrmjM", |
| 5385 | "line": 23, |
| 5386 | "message": "unused import", |
| 5387 | "updated": "2016-02-26 15:40:43.986000000", |
| 5388 | "author": { |
| 5389 | "_account_id": 1000110, |
| 5390 | "name": "Code Analyzer", |
| 5391 | "email": "code.analyzer@example.com" |
| 5392 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 5393 | "robot_id": "importChecker", |
| 5394 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5395 | }, |
| 5396 | { |
| 5397 | "id": "TveXwFiA", |
| 5398 | "line": 49, |
| 5399 | "message": "wrong indention", |
| 5400 | "updated": "2016-02-26 15:40:45.328000000", |
| 5401 | "author": { |
| 5402 | "_account_id": 1000110, |
| 5403 | "name": "Code Analyzer", |
| 5404 | "email": "code.analyzer@example.com" |
| 5405 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 5406 | "robot_id": "styleChecker", |
| 5407 | "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5408 | } |
| 5409 | ] |
| 5410 | } |
| 5411 | ---- |
| 5412 | |
| 5413 | [[get-robot-comment]] |
| 5414 | === Get Robot Comment |
| 5415 | -- |
| 5416 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]' |
| 5417 | -- |
| 5418 | |
| 5419 | Retrieves a link:config-robot-comments.html[robot comment] of a |
| 5420 | revision. |
| 5421 | |
| 5422 | .Request |
| 5423 | ---- |
| 5424 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0 |
| 5425 | ---- |
| 5426 | |
| 5427 | As response a link:#robot-comment-info[RobotCommentInfo] entity is |
| 5428 | returned that describes the robot comment. |
| 5429 | |
| 5430 | .Response |
| 5431 | ---- |
| 5432 | HTTP/1.1 200 OK |
| 5433 | Content-Disposition: attachment |
| 5434 | Content-Type: application/json; charset=UTF-8 |
| 5435 | |
| 5436 | )]}' |
| 5437 | { |
| 5438 | "id": "TvcXrmjM", |
| 5439 | "line": 23, |
| 5440 | "message": "unused import", |
| 5441 | "updated": "2016-02-26 15:40:43.986000000", |
| 5442 | "author": { |
| 5443 | "_account_id": 1000110, |
| 5444 | "name": "Code Analyzer", |
| 5445 | "email": "code.analyzer@example.com" |
| 5446 | }, |
David Pursehouse | b23a5ae | 2020-01-27 13:53:11 +0900 | [diff] [blame] | 5447 | "robot_id": "importChecker", |
| 5448 | "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04" |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 5449 | } |
| 5450 | ---- |
| 5451 | |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5452 | [[list-ported-comments]] |
| 5453 | === List Ported Comments |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5454 | -- |
| 5455 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_comments' |
| 5456 | -- |
| 5457 | |
| 5458 | Ports comments of other revisions to the requested revision. |
| 5459 | |
| 5460 | Only comments added on earlier patchsets are ported. That set of comments is filtered even further |
| 5461 | due to some additional rules. Callers of this endpoint shouldn't rely on the exact logic of which |
| 5462 | comments are ported as that logic might change in the future. Instead, callers must be able to |
| 5463 | handle any smaller/larger set of comments returned by this endpoint. |
| 5464 | |
| 5465 | Typically, a comment thread is returned fully or excluded fully. However, draft comments and |
| 5466 | robot comments are ignored and not returned via this endpoint. Hence, it's possible to get ported |
| 5467 | comments from this endpoint which are a reply to a non-ported robot comment. Callers must be |
| 5468 | able to deal with this situation. |
| 5469 | |
| 5470 | The returned comments are organized in a map of file path to link:#comment-info[CommentInfo] entries |
| 5471 | in the same fashion as for the link:#list-comments[List Revision Comments] endpoint. |
| 5472 | The map is filled with the original comment attributes except for these attributes: `path`, `line`, |
| 5473 | and `range` point to the computed position in the target revision. If the exactly correct position |
| 5474 | can't be determined, those fields will be filled with the next best position. That can also mean |
| 5475 | not filling the `line` or `range` attribute anymore and thus converting the comment to a file |
| 5476 | comment (or even moving the comment to a different file or the patchset level). Callers of this |
| 5477 | endpoint must be able to deal with this and not rely on the original comment position. |
| 5478 | |
| 5479 | It's possible that this endpoint returns different link:#comment-info[CommentInfo] entries with |
| 5480 | the same comment UUID. This is not a bug but a feature. If a comment appears on a file which Gerrit |
| 5481 | recognizes as copied between patchsets, the ported version of this comment consists of two ported |
| 5482 | instances having the same UUID but different `file`/`line`/`range` positions. Callers must be able |
| 5483 | to handle this situation. |
| 5484 | |
| 5485 | Repeated calls of this endpoint might produce different results. Internal errors during the |
| 5486 | position computation are mapped to fallback locations for affected comments. Those errors might |
| 5487 | have vanished on later calls, upon which this endpoint returns the actually mapped position. In |
| 5488 | addition, comments can be deleted and draft comments can be published, upon which the set of ported |
| 5489 | comments may change. |
| 5490 | |
| 5491 | .Request |
| 5492 | ---- |
| 5493 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/4/ported_comments/ HTTP/1.0 |
| 5494 | ---- |
| 5495 | |
| 5496 | .Response |
| 5497 | ---- |
| 5498 | HTTP/1.1 200 OK |
| 5499 | Content-Disposition: attachment |
| 5500 | Content-Type: application/json; charset=UTF-8 |
| 5501 | |
| 5502 | )]}' |
| 5503 | { |
| 5504 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5505 | { |
| 5506 | "id": "TvcXrmjM", |
| 5507 | "patch_set": 2, |
| 5508 | "line": 23, |
| 5509 | "message": "[nit] trailing whitespace", |
| 5510 | "updated": "2013-02-26 15:40:43.986000000", |
| 5511 | "author": { |
| 5512 | "_account_id": 1000096, |
| 5513 | "name": "John Doe", |
| 5514 | "email": "john.doe@example.com" |
| 5515 | }, |
| 5516 | "unresolved": true |
| 5517 | }, |
| 5518 | { |
| 5519 | "id": "TveXwFiA", |
| 5520 | "patch_set": 2, |
| 5521 | "line": 23, |
| 5522 | "in_reply_to": "TvcXrmjM", |
| 5523 | "message": "Done", |
| 5524 | "updated": "2013-02-26 15:40:45.328000000", |
| 5525 | "author": { |
| 5526 | "_account_id": 1000097, |
| 5527 | "name": "Jane Roe", |
| 5528 | "email": "jane.roe@example.com" |
| 5529 | }, |
| 5530 | "unresolved": true |
| 5531 | } |
| 5532 | ] |
| 5533 | } |
| 5534 | ---- |
| 5535 | |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5536 | [[list-ported-drafts]] |
| 5537 | === List Ported Drafts |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5538 | -- |
| 5539 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_drafts' |
| 5540 | -- |
| 5541 | |
| 5542 | Ports draft comments of other revisions to the requested revision. |
| 5543 | |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5544 | 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] | 5545 | With this endpoint, only draft comments of the calling user are ported, though. If a draft comment |
| 5546 | is a reply to a published comment, only the ported draft comment is returned. |
| 5547 | |
| 5548 | Depending on the filtering rules, it's possible that this endpoint returns a draft comment which is |
| 5549 | a reply to a comment thread which is not returned by the |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5550 | 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] | 5551 | able to handle this situation. The same holds for drafts which are a reply to a robot comment. |
| 5552 | |
Youssef Elghareeb | cdc33b9 | 2021-04-29 18:18:35 +0200 | [diff] [blame] | 5553 | 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] | 5554 | returned comments is not filled for this endpoint as only comments of the calling user are returned. |
| 5555 | |
Patrick Hiesel | afd6c70 | 2020-11-06 10:21:47 +0100 | [diff] [blame] | 5556 | This endpoint requires authentication. |
| 5557 | |
Alice Kober-Sotzek | 342da96 | 2020-09-11 11:27:00 +0200 | [diff] [blame] | 5558 | .Request |
| 5559 | ---- |
| 5560 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/ported_drafts/ HTTP/1.0 |
| 5561 | ---- |
| 5562 | |
| 5563 | .Response |
| 5564 | ---- |
| 5565 | HTTP/1.1 200 OK |
| 5566 | Content-Disposition: attachment |
| 5567 | Content-Type: application/json; charset=UTF-8 |
| 5568 | |
| 5569 | )]}' |
| 5570 | { |
| 5571 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 5572 | { |
| 5573 | "id": "TveXwFiA", |
| 5574 | "patch_set": 2, |
| 5575 | "line": 23, |
| 5576 | "in_reply_to": "TvcXrmjM", |
| 5577 | "message": "Done", |
| 5578 | "updated": "2013-02-26 15:40:45.328000000", |
| 5579 | "unresolved": true |
| 5580 | } |
| 5581 | ] |
| 5582 | } |
| 5583 | ---- |
| 5584 | |
Sharad Bagri | 3f6ed64 | 2022-06-06 12:41:57 -0700 | [diff] [blame] | 5585 | [[apply-stored-fix]] |
| 5586 | === Apply Stored Fix |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5587 | -- |
| 5588 | 'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply' |
| 5589 | -- |
| 5590 | |
| 5591 | Applies a suggested fix by creating a change edit which includes the |
| 5592 | modifications indicated by the fix suggestion. If a change edit already exists, |
| 5593 | it will be updated accordingly. A fix can only be applied if no change edit |
| 5594 | exists and the fix refers to the current patch set, or the fix refers to the |
| 5595 | patch set on which the change edit is based. |
| 5596 | |
| 5597 | .Request |
| 5598 | ---- |
| 5599 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0 |
| 5600 | ---- |
| 5601 | |
| 5602 | If the fix was successfully applied, an <<edit-info,EditInfo>> describing the |
| 5603 | resulting change edit is returned. |
| 5604 | |
| 5605 | .Response |
| 5606 | ---- |
| 5607 | HTTP/1.1 200 OK |
| 5608 | Content-Disposition: attachment |
| 5609 | Content-Type: application/json; charset=UTF-8 |
| 5610 | |
| 5611 | )]}' |
| 5612 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5613 | "commit": { |
| 5614 | "parents": [ |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5615 | { |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5616 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5617 | } |
| 5618 | ], |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5619 | "author": { |
| 5620 | "name": "John Doe", |
| 5621 | "email": "john.doe@example.com", |
| 5622 | "date": "2013-05-07 15:21:27.000000000", |
| 5623 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5624 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5625 | "committer": { |
| 5626 | "name": "Jane Doe", |
| 5627 | "email": "jane.doe@example.com", |
| 5628 | "date": "2013-05-07 15:35:43.000000000", |
| 5629 | "tz": 120 |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5630 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5631 | "subject": "Implement feature X", |
| 5632 | "message": "Implement feature X\n\nWith this feature ..." |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5633 | }, |
Edwin Kempin | e813c5a | 2019-03-13 09:51:12 +0100 | [diff] [blame] | 5634 | "base_patch_set_number": 1, |
| 5635 | "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1" |
| 5636 | "ref": "refs/users/01/1000001/edit-42622/1" |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 5637 | } |
| 5638 | ---- |
| 5639 | |
| 5640 | If the application failed e.g. due to conflicts with an existing change edit, |
| 5641 | the response "`409 Conflict`" including an error message in the response body |
| 5642 | is returned. |
| 5643 | |
| 5644 | .Response |
| 5645 | ---- |
| 5646 | HTTP/1.1 409 Conflict |
| 5647 | Content-Disposition: attachment |
| 5648 | Content-Type: text/plain; charset=UTF-8 |
| 5649 | |
| 5650 | The existing change edit could not be merged with another tree. |
| 5651 | ---- |
| 5652 | |
Sharad Bagri | bdb582d | 2022-03-26 01:32:35 -0700 | [diff] [blame] | 5653 | [[apply-provided-fix]] |
| 5654 | ==== Apply Provided Fix |
| 5655 | -- |
| 5656 | 'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:apply' |
| 5657 | -- |
| 5658 | Applies a list of <<fix-replacement-info,FixReplacementInfo>> loaded from the |
| 5659 | <<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the request body. The |
| 5660 | application of the fixes creates a new change edit. `Apply Provided Fix` can only be applied on the current |
| 5661 | patchset. |
| 5662 | |
| 5663 | .Request |
| 5664 | ---- |
| 5665 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fix:apply HTTP/1.0 |
| 5666 | Content-Type: application/json; charset=UTF-8 |
| 5667 | |
| 5668 | { |
| 5669 | "fix_replacement_infos": [ |
| 5670 | { |
| 5671 | "path": "abcd.txt", |
| 5672 | "range": { |
| 5673 | "start_line": 2, |
| 5674 | "start_character": 2, |
| 5675 | "end_line": 2, |
| 5676 | "end_character": 5 |
| 5677 | }, |
| 5678 | "replacement": "abcdefg" |
| 5679 | } |
| 5680 | ] |
| 5681 | } |
| 5682 | ---- |
| 5683 | |
| 5684 | If the `ApplyProvidedFixInput` was successfully applied, an link:#edit-info[EditInfo] describing the |
| 5685 | resulting change edit is returned. |
| 5686 | |
| 5687 | .Response |
| 5688 | ---- |
| 5689 | HTTP/1.1 200 OK |
| 5690 | Content-Disposition: attachment |
| 5691 | Content-Type: application/json; charset=UTF-8 |
| 5692 | |
| 5693 | )]}' |
| 5694 | { |
| 5695 | "commit": { |
| 5696 | "commit": "bd43e48c33d2b1a03485040eba38cefc505f7997", |
| 5697 | "parents": [ |
| 5698 | { |
| 5699 | "commit": "9825962f8ab6da89afebad3f5034db05fb4b7560" |
| 5700 | } |
| 5701 | ], |
| 5702 | "author": { |
| 5703 | "name": "John Doe", |
| 5704 | "email": "john.doe@example.com", |
| 5705 | "date": "2022-05-07 15:21:27.000000000", |
| 5706 | "tz": 120 |
| 5707 | }, |
| 5708 | "committer": { |
| 5709 | "name": "Jane Doe", |
| 5710 | "email": "jane.doe@example.com", |
| 5711 | "date": "2022-05-07 15:35:43.000000000", |
| 5712 | "tz": 120 |
| 5713 | }, |
| 5714 | "subject": "Implement feature X", |
| 5715 | "message": "Implement feature X\n\nWith this feature ..." |
| 5716 | }, |
| 5717 | "base_patch_set_number": 1, |
| 5718 | "base_revision": "86d87686ce0ef7f7c536bfc7e9a66f5a6fa5d658", |
| 5719 | "ref": "refs/users/01/1000001/edit-1/1" |
| 5720 | } |
| 5721 | ---- |
| 5722 | |
| 5723 | If the application failed due to presence of an existing change edit, |
| 5724 | the response "`400 Bad Request`" including an error message in the response body |
| 5725 | is returned. |
| 5726 | |
| 5727 | .Response |
| 5728 | ---- |
| 5729 | HTTP/1.1 400 Bad Request |
| 5730 | Content-Disposition: attachment |
| 5731 | Content-Type: text/plain; charset=UTF-8 |
| 5732 | |
| 5733 | Change edit already exists. A new change edit can't be created |
| 5734 | ---- |
| 5735 | |
| 5736 | If the application failed due to application on a previous patch set, the response |
| 5737 | "`409 Conflict`" including an error message in the response body is returned. |
| 5738 | |
| 5739 | .Response |
| 5740 | ---- |
| 5741 | HTTP/1.1 409 Conflict |
| 5742 | Content-Disposition: attachment |
| 5743 | Content-Type: text/plain; charset=UTF-8 |
| 5744 | |
| 5745 | A change edit may only be created for the current patch set 1,2 (and not for 1,1) |
| 5746 | ---- |
| 5747 | |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5748 | [[list-files]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5749 | === List Files |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5750 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5751 | '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] | 5752 | -- |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5753 | |
| 5754 | Lists the files that were modified, added or deleted in a revision. |
| 5755 | |
| 5756 | .Request |
| 5757 | ---- |
| 5758 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0 |
| 5759 | ---- |
| 5760 | |
Makson Lee | faf05c2 | 2018-07-26 22:42:59 +0000 | [diff] [blame] | 5761 | As result a map is returned that maps the link:#file-id[file path] to a |
| 5762 | link:#file-info[FileInfo] entry. The entries in the map are |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5763 | sorted by file path. |
| 5764 | |
| 5765 | .Response |
| 5766 | ---- |
| 5767 | HTTP/1.1 200 OK |
| 5768 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5769 | Content-Type: application/json; charset=UTF-8 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5770 | |
| 5771 | )]}' |
| 5772 | { |
| 5773 | "/COMMIT_MSG": { |
| 5774 | "status": "A", |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 5775 | "lines_inserted": 7, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 5776 | "size_delta": 551, |
| 5777 | "size": 551 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5778 | }, |
| 5779 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": { |
| 5780 | "lines_inserted": 5, |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 5781 | "lines_deleted": 3, |
Edwin Kempin | 971a5f5 | 2015-10-28 10:50:39 +0100 | [diff] [blame] | 5782 | "size_delta": 98, |
| 5783 | "size": 23348 |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 5784 | } |
| 5785 | } |
| 5786 | ---- |
| 5787 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5788 | The request parameter `reviewed` changes the response to return a list |
| 5789 | of the paths the caller has marked as reviewed. Clients that also |
| 5790 | need the FileInfo should make two requests. |
| 5791 | |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 5792 | The request parameter `q` changes the response to return a list |
| 5793 | of all files (modified or unmodified) that contain that substring |
| 5794 | in the path name. This is useful to implement suggestion services |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 5795 | finding a file by partial name. Clients that also need the FileInfo |
| 5796 | should make two requests. |
Shawn Pearce | 8ca03a6 | 2015-01-02 22:03:20 -0800 | [diff] [blame] | 5797 | |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 5798 | For merge commits only, the integer-valued request parameter `parent` |
| 5799 | changes the response to return a map of the files which are different |
| 5800 | 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] | 5801 | 1-based index of the parent's position in the commit object, |
| 5802 | with the first parent always belonging to the target branch. If not |
David Pursehouse | 89c00ca | 2019-08-03 13:47:29 +0900 | [diff] [blame] | 5803 | specified, the response contains a map of the files different in the |
| 5804 | auto merge result. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 5805 | |
David Pursehouse | fcfb29d | 2019-08-01 12:55:16 +0900 | [diff] [blame] | 5806 | The request parameter `base` changes the response to return a map of the |
| 5807 | files which are different in this commit compared to the given revision. The |
| 5808 | revision must correspond to a patch set in the change. |
| 5809 | |
| 5810 | The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive. |
| 5811 | That is, only one of them may be used at a time. |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5812 | |
| 5813 | .Request |
| 5814 | ---- |
| 5815 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0 |
| 5816 | ---- |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5817 | |
Shawn Pearce | 984747d | 2013-07-18 00:42:16 -0700 | [diff] [blame] | 5818 | .Response |
| 5819 | ---- |
| 5820 | HTTP/1.1 200 OK |
| 5821 | Content-Disposition: attachment |
| 5822 | Content-Type: application/json; charset=UTF-8 |
| 5823 | |
| 5824 | )]}' |
| 5825 | [ |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5826 | "/COMMIT_MSG", |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5827 | "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] | 5828 | ] |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 5829 | ---- |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5830 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5831 | [[get-content]] |
| 5832 | === Get Content |
| 5833 | -- |
| 5834 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content' |
| 5835 | -- |
| 5836 | |
| 5837 | Gets the content of a file from a certain revision. |
| 5838 | |
Patrick Hiesel | 38667d4 | 2017-05-02 13:12:48 +0200 | [diff] [blame] | 5839 | The optional, integer-valued `parent` parameter can be specified to request |
| 5840 | the named file from a parent commit of the specified revision. The value is |
| 5841 | the 1-based index of the parent's position in the commit object. If the |
| 5842 | parameter is omitted or the value is non-positive, the patch set is referenced. |
| 5843 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5844 | .Request |
| 5845 | ---- |
| 5846 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0 |
| 5847 | ---- |
| 5848 | |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5849 | The content is returned as base64 encoded string. The HTTP response |
| 5850 | Content-Type is always `text/plain`, reflecting the base64 wrapping. |
| 5851 | A Gerrit-specific `X-FYI-Content-Type` header is returned describing |
| 5852 | the server detected content type of the file. |
| 5853 | |
| 5854 | If only the content type is required, callers should use HEAD to |
| 5855 | avoid downloading the encoded file contents. |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5856 | |
| 5857 | .Response |
| 5858 | ---- |
| 5859 | HTTP/1.1 200 OK |
| 5860 | Content-Disposition: attachment |
Shawn Pearce | fb2b36b | 2015-01-01 23:42:12 -0500 | [diff] [blame] | 5861 | Content-Type: text/plain; charset=ISO-8859-1 |
| 5862 | X-FYI-Content-Encoding: base64 |
| 5863 | X-FYI-Content-Type: text/xml |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 5864 | |
| 5865 | Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY... |
| 5866 | ---- |
| 5867 | |
David Ostrovsky | d007867 | 2015-02-06 21:51:04 +0100 | [diff] [blame] | 5868 | Alternatively, if the only value of the Accept request header is |
| 5869 | `application/json` the content is returned as JSON string and |
| 5870 | `X-FYI-Content-Encoding` is set to `json`. |
| 5871 | |
David Pletcher | d1efb45 | 2015-09-01 17:45:55 -0700 | [diff] [blame] | 5872 | [[get-safe-content]] |
| 5873 | === Download Content |
| 5874 | -- |
| 5875 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download' |
| 5876 | -- |
| 5877 | |
| 5878 | Downloads the content of a file from a certain revision, in a safe format |
| 5879 | that poses no risk for inadvertent execution of untrusted code. |
| 5880 | |
| 5881 | If the content type is defined as safe, the binary file content is returned |
| 5882 | verbatim. If the content type is not safe, the file is stored inside a ZIP |
| 5883 | file, containing a single entry with a random, unpredictable name having the |
| 5884 | same base and suffix as the true filename. The ZIP file is returned in |
| 5885 | verbatim binary form. |
| 5886 | |
| 5887 | See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation] |
| 5888 | for information about safe file type configuration. |
| 5889 | |
| 5890 | The HTTP resource Content-Type is dependent on the file type: the |
| 5891 | applicable type for safe files, or "application/zip" for unsafe files. |
| 5892 | |
David Pletcher | ec622bf | 2015-09-18 14:30:05 -0700 | [diff] [blame] | 5893 | The optional, integer-valued `parent` parameter can be specified to request |
| 5894 | the named file from a parent commit of the specified revision. The value is |
| 5895 | the 1-based index of the parent's position in the commit object. If the |
| 5896 | parameter is omitted or the value non-positive, the patch set is referenced. |
| 5897 | |
| 5898 | Filenames are decorated with a suffix of `_new` for the current patch, |
| 5899 | `_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] | 5900 | |
| 5901 | .Request |
| 5902 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 5903 | 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] | 5904 | ---- |
| 5905 | |
| 5906 | .Response |
| 5907 | ---- |
| 5908 | HTTP/1.1 200 OK |
| 5909 | Content-Disposition: attachment; filename="logo.png" |
| 5910 | Content-Type: image/png |
| 5911 | |
| 5912 | `[binary data for logo.png]` |
| 5913 | ---- |
| 5914 | |
| 5915 | .Request |
| 5916 | ---- |
David Pursehouse | 6147f6d | 2016-10-18 05:40:44 +0000 | [diff] [blame] | 5917 | 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] | 5918 | ---- |
| 5919 | |
| 5920 | .Response |
| 5921 | ---- |
| 5922 | HTTP/1.1 200 OK |
| 5923 | Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip" |
| 5924 | Content-Type:application/zip |
| 5925 | |
| 5926 | `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]` |
| 5927 | ---- |
| 5928 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5929 | [[get-diff]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 5930 | === Get Diff |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 5931 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5932 | '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] | 5933 | -- |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5934 | |
| 5935 | Gets the diff of a file from a certain revision. |
| 5936 | |
| 5937 | .Request |
| 5938 | ---- |
| 5939 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0 |
| 5940 | ---- |
| 5941 | |
| 5942 | As response a link:#diff-info[DiffInfo] entity is returned that describes the diff. |
| 5943 | |
| 5944 | .Response |
| 5945 | ---- |
| 5946 | HTTP/1.1 200 OK |
| 5947 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 5948 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5949 | |
| 5950 | )] |
| 5951 | { |
| 5952 | "meta_a": { |
| 5953 | "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] | 5954 | "content_type": "text/x-java-source", |
| 5955 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5956 | }, |
| 5957 | "meta_b": { |
| 5958 | "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] | 5959 | "content_type": "text/x-java-source", |
| 5960 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 5961 | }, |
| 5962 | "change_type": "MODIFIED", |
| 5963 | "diff_header": [ |
| 5964 | "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", |
| 5965 | "index 59b7670..9faf81c 100644", |
| 5966 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 5967 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 5968 | ], |
| 5969 | "content": [ |
| 5970 | { |
| 5971 | "ab": [ |
| 5972 | "// Copyright (C) 2010 The Android Open Source Project", |
| 5973 | "//", |
| 5974 | "// Licensed under the Apache License, Version 2.0 (the \"License\");", |
| 5975 | "// you may not use this file except in compliance with the License.", |
| 5976 | "// You may obtain a copy of the License at", |
| 5977 | "//", |
| 5978 | "// http://www.apache.org/licenses/LICENSE-2.0", |
| 5979 | "//", |
| 5980 | "// Unless required by applicable law or agreed to in writing, software", |
| 5981 | "// distributed under the License is distributed on an \"AS IS\" BASIS,", |
| 5982 | "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", |
| 5983 | "// See the License for the specific language governing permissions and", |
| 5984 | "// limitations under the License." |
| 5985 | ] |
| 5986 | }, |
| 5987 | { |
| 5988 | "b": [ |
| 5989 | "//", |
| 5990 | "// Add some more lines in the header." |
| 5991 | ] |
| 5992 | }, |
| 5993 | { |
| 5994 | "ab": [ |
| 5995 | "", |
| 5996 | "package com.google.gerrit.server.project;", |
| 5997 | "", |
| 5998 | "import com.google.common.collect.Maps;", |
| 5999 | ... |
| 6000 | ] |
| 6001 | } |
| 6002 | ... |
| 6003 | ] |
| 6004 | } |
| 6005 | ---- |
| 6006 | |
| 6007 | If the `intraline` parameter is specified, intraline differences are included in the diff. |
| 6008 | |
| 6009 | .Request |
| 6010 | ---- |
| 6011 | 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 |
| 6012 | ---- |
| 6013 | |
| 6014 | .Response |
| 6015 | ---- |
| 6016 | HTTP/1.1 200 OK |
| 6017 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 6018 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6019 | |
| 6020 | )] |
| 6021 | { |
| 6022 | "meta_a": { |
| 6023 | "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] | 6024 | "content_type": "text/x-java-source", |
| 6025 | "lines": 372 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6026 | }, |
| 6027 | "meta_b": { |
| 6028 | "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] | 6029 | "content_type": "text/x-java-source", |
| 6030 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6031 | }, |
| 6032 | "change_type": "MODIFIED", |
| 6033 | "diff_header": [ |
| 6034 | "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", |
| 6035 | "index 59b7670..9faf81c 100644", |
| 6036 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 6037 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 6038 | ], |
| 6039 | "content": [ |
| 6040 | ... |
| 6041 | { |
| 6042 | "a": [ |
| 6043 | "/** Manages access control for Git references (aka branches, tags). */" |
| 6044 | ], |
| 6045 | "b": [ |
| 6046 | "/** Manages access control for the Git references (aka branches, tags). */" |
| 6047 | ], |
| 6048 | "edit_a": [], |
| 6049 | "edit_b": [ |
| 6050 | [ |
| 6051 | 31, |
| 6052 | 4 |
| 6053 | ] |
| 6054 | ] |
| 6055 | } |
| 6056 | ] |
| 6057 | } |
| 6058 | ---- |
| 6059 | |
| 6060 | The `base` parameter can be specified to control the base patch set from which the diff should |
| 6061 | be generated. |
| 6062 | |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 6063 | The integer-valued request parameter `parent` can be specified to control the |
| 6064 | parent commit number against which the diff should be generated. This is useful |
| 6065 | for supporting review of merge commits. The value is the 1-based index of the |
| 6066 | parent's position in the commit object. |
| 6067 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6068 | .Request |
| 6069 | ---- |
| 6070 | 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 |
| 6071 | ---- |
| 6072 | |
| 6073 | .Response |
| 6074 | ---- |
| 6075 | HTTP/1.1 200 OK |
| 6076 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 6077 | Content-Type: application/json; charset=UTF-8 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6078 | |
| 6079 | )] |
| 6080 | { |
| 6081 | "meta_a": { |
| 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 | "meta_b": { |
| 6087 | "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] | 6088 | "content_type": "text/x-java-source", |
| 6089 | "lines": 578 |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6090 | }, |
| 6091 | "change_type": "MODIFIED", |
| 6092 | "content": [ |
| 6093 | { |
| 6094 | "skip": 578 |
| 6095 | } |
| 6096 | ] |
| 6097 | } |
| 6098 | ---- |
| 6099 | |
Edwin Kempin | 0b7c40f | 2016-02-09 17:13:23 +0100 | [diff] [blame] | 6100 | The `whitespace` parameter can be specified to control how whitespace |
| 6101 | differences are reported in the result. Valid values are `IGNORE_NONE`, |
| 6102 | `IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 6103 | |
Sharad Bagri | 3f6ed64 | 2022-06-06 12:41:57 -0700 | [diff] [blame] | 6104 | [[preview-stored-fix]] |
| 6105 | === Preview Stored Fix |
Dmitrii Filippov | bf3f08b | 2019-12-06 03:13:06 +0100 | [diff] [blame] | 6106 | -- |
| 6107 | 'GET /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/preview' |
| 6108 | -- |
| 6109 | |
| 6110 | Gets the diffs of all files for a certain <<fix-id,\{fix-id\}>>. |
| 6111 | As response, a map of link:#diff-info[DiffInfo] entities is returned that describes the diffs. |
| 6112 | |
| 6113 | 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. |
| 6114 | |
Sharad Bagri | d1b05fd | 2022-05-18 13:14:17 -0700 | [diff] [blame] | 6115 | [[preview-provided-fix]] |
| 6116 | === Preview Provided fix |
| 6117 | -- |
| 6118 | 'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:preview' |
| 6119 | -- |
| 6120 | |
| 6121 | Gets the diffs of all files for a list of <<fix-replacement-info,FixReplacementInfo>> loaded from |
| 6122 | the <<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the |
| 6123 | request body. |
| 6124 | As response, a map of link:#diff-info[DiffInfo] is returned that describes the diffs. |
| 6125 | |
| 6126 | Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id |
| 6127 | and a virtual patch set with the applied fix. No content on the server will be modified as part of this request. |
| 6128 | |
| 6129 | .Request |
| 6130 | ---- |
| 6131 | POST /changes/myProject~master~Id6f0b9d946791f8aba90ace53074eda565983452/revisions/1/fix:preview HTTP/1.0 |
| 6132 | Content-Type: application/json; charset=UTF-8 |
| 6133 | |
| 6134 | { |
| 6135 | "fix_replacement_infos": [ |
| 6136 | { |
| 6137 | "path": "abcd.txt", |
| 6138 | "range": { |
| 6139 | "start_line": 2, |
| 6140 | "start_character": 2, |
| 6141 | "end_line": 2, |
| 6142 | "end_character": 5 |
| 6143 | }, |
| 6144 | "replacement": "abcdefg" |
| 6145 | } |
| 6146 | ] |
| 6147 | } |
| 6148 | ---- |
| 6149 | |
| 6150 | If the `Preview Provided Fix` operation was successful, a link:#diff-info[DiffInfo] previewing the |
| 6151 | change is returned. |
| 6152 | |
| 6153 | .Response |
| 6154 | ---- |
| 6155 | HTTP/1.1 200 OK |
| 6156 | Content-Disposition: attachment |
| 6157 | Content-Type: application/json; charset=UTF-8 |
| 6158 | |
| 6159 | )]}' |
| 6160 | { |
| 6161 | "abcd.txt": { |
| 6162 | "meta_a": { |
| 6163 | "name": "abcd.txt", |
| 6164 | "content_type": "text/plain", |
| 6165 | "lines": 3 |
| 6166 | }, |
| 6167 | "meta_b": { |
| 6168 | "name": "abcd.txt", |
| 6169 | "content_type": "text/plain", |
| 6170 | "lines": 3 |
| 6171 | }, |
| 6172 | "intraline_status": "OK", |
| 6173 | "change_type": "MODIFIED", |
| 6174 | "content": [ |
| 6175 | { |
| 6176 | "ab": [ |
| 6177 | "ABCDEFGHI" |
| 6178 | ] |
| 6179 | }, |
| 6180 | { |
| 6181 | "a": [ |
| 6182 | "JKLMNOPQR" |
| 6183 | ], |
| 6184 | "b": [ |
| 6185 | "JKabcdefgOPQR" |
| 6186 | ], |
| 6187 | "edit_a": [ |
| 6188 | [ |
| 6189 | 2, |
| 6190 | 3 |
| 6191 | ] |
| 6192 | ], |
| 6193 | "edit_b": [ |
| 6194 | [ |
| 6195 | 2, |
| 6196 | 7 |
| 6197 | ] |
| 6198 | ] |
| 6199 | }, |
| 6200 | { |
| 6201 | "ab": [ |
| 6202 | "" |
| 6203 | ] |
| 6204 | } |
| 6205 | ] |
| 6206 | } |
| 6207 | } |
| 6208 | ---- |
| 6209 | |
| 6210 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 6211 | [[get-blame]] |
| 6212 | === Get Blame |
| 6213 | -- |
| 6214 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame' |
| 6215 | -- |
| 6216 | |
| 6217 | Gets the blame of a file from a certain revision. |
| 6218 | |
| 6219 | .Request |
| 6220 | ---- |
| 6221 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0 |
| 6222 | ---- |
| 6223 | |
| 6224 | As response a link:#blame-info[BlameInfo] entity is returned that describes the |
| 6225 | blame. |
| 6226 | |
| 6227 | .Response |
| 6228 | ---- |
| 6229 | HTTP/1.1 200 OK |
| 6230 | Content-Disposition: attachment |
| 6231 | Content-Type: application/json; charset=UTF-8 |
| 6232 | |
| 6233 | )] |
| 6234 | { |
| 6235 | [ |
| 6236 | { |
| 6237 | "author": "Joe Daw", |
| 6238 | "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7", |
| 6239 | "time": 1421441349, |
| 6240 | "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n", |
| 6241 | "ranges": [ |
| 6242 | { |
| 6243 | "start": 1, |
| 6244 | "end": 10 |
| 6245 | }, |
| 6246 | { |
| 6247 | "start": 16, |
| 6248 | "end": 296 |
| 6249 | } |
| 6250 | ] |
| 6251 | }, |
| 6252 | { |
| 6253 | "author": "Jane Daw", |
| 6254 | "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7", |
| 6255 | "time": 1421825421, |
| 6256 | "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n", |
| 6257 | "ranges": [ |
| 6258 | { |
| 6259 | "start": 13, |
| 6260 | "end": 13 |
| 6261 | } |
| 6262 | ] |
| 6263 | } |
| 6264 | ] |
| 6265 | } |
| 6266 | ---- |
| 6267 | |
| 6268 | The `base` parameter can be specified to control the base patch set from which |
| 6269 | the blame should be generated. |
| 6270 | |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 6271 | [[set-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6272 | === Set Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 6273 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6274 | '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] | 6275 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 6276 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6277 | Marks a file of a revision as reviewed by the calling user. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 6278 | |
| 6279 | .Request |
| 6280 | ---- |
| 6281 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 6282 | ---- |
| 6283 | |
| 6284 | .Response |
| 6285 | ---- |
| 6286 | HTTP/1.1 201 Created |
| 6287 | ---- |
| 6288 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6289 | 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] | 6290 | response is "`200 OK`". |
| 6291 | |
| 6292 | [[delete-reviewed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6293 | === Delete Reviewed |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 6294 | -- |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6295 | '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] | 6296 | -- |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 6297 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6298 | 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] | 6299 | |
| 6300 | .Request |
| 6301 | ---- |
| 6302 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 6303 | ---- |
| 6304 | |
| 6305 | .Response |
| 6306 | ---- |
| 6307 | HTTP/1.1 204 No Content |
| 6308 | ---- |
| 6309 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6310 | [[cherry-pick]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6311 | === Cherry Pick Revision |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 6312 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6313 | '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] | 6314 | -- |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6315 | |
| 6316 | Cherry picks a revision to a destination branch. |
| 6317 | |
Changcheng Xiao | 54b6c0c | 2017-10-23 14:57:42 +0200 | [diff] [blame] | 6318 | To cherry pick a commit with no change-id associated with it, see |
| 6319 | link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit]. |
| 6320 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6321 | 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] | 6322 | link:#cherrypick-input[CherryPickInput] entity. If the commit message |
| 6323 | 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] | 6324 | |
Gal Paikin | 8dadd42 | 2021-05-07 10:21:54 +0200 | [diff] [blame] | 6325 | When cherry-picking a change into a branch that already contains the Change-Id |
| 6326 | that we want to cherry-pick, the cherry-pick will create a new patch-set on the |
| 6327 | destination's branch's appropriate Change-Id. If the change is closed on the |
| 6328 | destination branch, the cherry-pick will fail. |
| 6329 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6330 | .Request |
| 6331 | ---- |
| 6332 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0 |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 6333 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6334 | |
| 6335 | { |
Gustaf Lundh | 98df5b5 | 2013-05-07 19:22:13 +0100 | [diff] [blame] | 6336 | "message" : "Implementing Feature X", |
| 6337 | "destination" : "release-branch" |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6338 | } |
| 6339 | ---- |
| 6340 | |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 6341 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 6342 | describes the resulting cherry-pick change. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6343 | |
| 6344 | .Response |
| 6345 | ---- |
| 6346 | HTTP/1.1 200 OK |
| 6347 | Content-Disposition: attachment |
David Pursehouse | 56bf1cb | 2015-01-06 15:44:00 +0900 | [diff] [blame] | 6348 | Content-Type: application/json; charset=UTF-8 |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6349 | |
| 6350 | )]}' |
| 6351 | { |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6352 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 6353 | "project": "myProject", |
| 6354 | "branch": "release-branch", |
| 6355 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 6356 | "subject": "Implementing Feature X", |
| 6357 | "status": "NEW", |
| 6358 | "created": "2013-02-01 09:59:32.126000000", |
| 6359 | "updated": "2013-02-21 11:16:36.775000000", |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6360 | "mergeable": true, |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 6361 | "insertions": 12, |
| 6362 | "deletions": 11, |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 6363 | "_number": 3965, |
| 6364 | "owner": { |
| 6365 | "name": "John Doe" |
| 6366 | } |
| 6367 | } |
| 6368 | ---- |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6369 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 6370 | [[revision-reviewer-endpoints]] |
| 6371 | == Revision Reviewer Endpoints |
| 6372 | |
| 6373 | [[list-revision-reviewers]] |
| 6374 | === List Revision Reviewers |
| 6375 | -- |
| 6376 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/' |
| 6377 | -- |
| 6378 | |
| 6379 | Lists the reviewers of a revision. |
| 6380 | |
| 6381 | Please note that only the current revision is supported. |
| 6382 | |
| 6383 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 6384 | |
| 6385 | .Request |
| 6386 | ---- |
| 6387 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0 |
| 6388 | ---- |
| 6389 | |
| 6390 | .Response |
| 6391 | ---- |
| 6392 | HTTP/1.1 200 OK |
| 6393 | Content-Disposition: attachment |
| 6394 | Content-Type: application/json; charset=UTF-8 |
| 6395 | |
| 6396 | )]}' |
| 6397 | [ |
| 6398 | { |
| 6399 | "approvals": { |
| 6400 | "Verified": "+1", |
| 6401 | "Code-Review": "+2" |
| 6402 | }, |
| 6403 | "_account_id": 1000096, |
| 6404 | "name": "John Doe", |
| 6405 | "email": "john.doe@example.com" |
| 6406 | }, |
| 6407 | { |
| 6408 | "approvals": { |
| 6409 | "Verified": " 0", |
| 6410 | "Code-Review": "-1" |
| 6411 | }, |
| 6412 | "_account_id": 1000097, |
| 6413 | "name": "Jane Roe", |
| 6414 | "email": "jane.roe@example.com" |
| 6415 | } |
| 6416 | ] |
| 6417 | ---- |
| 6418 | |
| 6419 | [[list-revision-votes]] |
| 6420 | === List Revision Votes |
| 6421 | -- |
| 6422 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/' |
| 6423 | -- |
| 6424 | |
| 6425 | Lists the votes for a specific reviewer of the revision. |
| 6426 | |
| 6427 | Please note that only the current revision is supported. |
| 6428 | |
| 6429 | .Request |
| 6430 | ---- |
| 6431 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0 |
| 6432 | ---- |
| 6433 | |
| 6434 | As result a map is returned that maps the label name to the label value. |
| 6435 | The entries in the map are sorted by label name. |
| 6436 | |
| 6437 | .Response |
| 6438 | ---- |
| 6439 | HTTP/1.1 200 OK |
| 6440 | Content-Disposition: attachment |
| 6441 | Content-Type: application/json;charset=UTF-8 |
| 6442 | |
| 6443 | )]}' |
| 6444 | { |
| 6445 | "Code-Review": -1, |
| 6446 | "Verified": 1, |
| 6447 | "Work-In-Progress": 1 |
| 6448 | } |
| 6449 | ---- |
| 6450 | |
| 6451 | [[delete-revision-vote]] |
| 6452 | === Delete Revision Vote |
| 6453 | -- |
| 6454 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 6455 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' + |
| 6456 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}] |
| 6457 | /reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete' |
| 6458 | -- |
| 6459 | |
| 6460 | Deletes a single vote from a revision. The deletion will be possible only |
| 6461 | if the revision is the current revision. By using this endpoint you can prevent |
| 6462 | deleting the vote (with same label) from a newer patch set by mistake. |
| 6463 | |
| 6464 | Note, that even when the last vote of a reviewer is removed the reviewer itself |
| 6465 | is still listed on the change. |
| 6466 | |
Gal Paikin | 6ce56dc | 2021-03-29 12:28:43 +0200 | [diff] [blame] | 6467 | If another user removed a user's vote, the user with the deleted vote will be |
| 6468 | added to the attention set. |
| 6469 | |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 6470 | .Request |
| 6471 | ---- |
| 6472 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0 |
| 6473 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 6474 | ---- |
| 6475 | |
Changcheng Xiao | 03fc3cc | 2018-07-23 11:16:53 +0200 | [diff] [blame] | 6476 | Options can be provided in the request body as a |
| 6477 | link:#delete-vote-input[DeleteVoteInput] entity. |
| 6478 | 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] | 6479 | 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] | 6480 | In this case, use a POST request instead: |
Changcheng Xiao | 2fcae69 | 2017-01-02 12:38:30 +0100 | [diff] [blame] | 6481 | |
| 6482 | .Request |
| 6483 | ---- |
| 6484 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0 |
| 6485 | Content-Type: application/json; charset=UTF-8 |
| 6486 | |
| 6487 | { |
| 6488 | "notify": "NONE" |
| 6489 | } |
| 6490 | ---- |
| 6491 | |
| 6492 | .Response |
| 6493 | ---- |
| 6494 | HTTP/1.1 204 No Content |
| 6495 | ---- |
| 6496 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6497 | [[attention-set-endpoints]] |
| 6498 | == Attention Set Endpoints |
| 6499 | |
| 6500 | [[get-attention-set]] |
| 6501 | === Get Attention Set |
| 6502 | -- |
| 6503 | 'GET /changes/link:#change-id[\{change-id\}]/attention' |
| 6504 | -- |
| 6505 | |
| 6506 | Returns all users that are currently in the attention set. |
| 6507 | As response a list of link:#attention-set-info[AttentionSetInfo] |
| 6508 | entity is returned. |
| 6509 | |
| 6510 | .Request |
| 6511 | ---- |
| 6512 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0 |
| 6513 | ---- |
| 6514 | |
| 6515 | .Response |
| 6516 | ---- |
| 6517 | HTTP/1.1 200 OK |
| 6518 | Content-Disposition: attachment |
| 6519 | Content-Type: application/json; charset=UTF-8 |
| 6520 | |
| 6521 | )]}' |
| 6522 | [ |
| 6523 | { |
| 6524 | "account": { |
| 6525 | "_account_id": 1000096, |
| 6526 | "name": "John Doe", |
| 6527 | "email": "john.doe@example.com", |
| 6528 | "username": "jdoe" |
| 6529 | }, |
| 6530 | "last_update": "2013-02-01 09:59:32.126000000", |
| 6531 | "reason": "reviewer or cc replied" |
| 6532 | }, |
| 6533 | { |
| 6534 | "account": { |
| 6535 | "_account_id": 1000097, |
| 6536 | "name": "Jane Doe", |
| 6537 | "email": "jane.doe@example.com", |
| 6538 | "username": "janedoe" |
| 6539 | }, |
| 6540 | "last_update": "2013-02-01 09:59:32.126000000", |
| 6541 | "reason": "Reviewer was added" |
| 6542 | } |
| 6543 | ] |
| 6544 | ---- |
| 6545 | |
| 6546 | [[add-to-attention-set]] |
| 6547 | === Add To Attention Set |
| 6548 | -- |
| 6549 | 'POST /changes/link:#change-id[\{change-id\}]/attention' |
| 6550 | -- |
| 6551 | |
| 6552 | Adds a single user to the attention set of a change. |
| 6553 | |
| 6554 | A user can only be added if they are not in the attention set. |
| 6555 | If a user is added while already in the attention set, the |
| 6556 | request is silently ignored. |
| 6557 | |
Gal Paikin | e631de2 | 2020-10-29 12:19:11 +0100 | [diff] [blame] | 6558 | The user must be a reviewer, cc, uploader, or owner on the change. |
| 6559 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6560 | .Request |
| 6561 | ---- |
| 6562 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0 |
| 6563 | ---- |
| 6564 | |
| 6565 | Details should be provided in the request body as an |
| 6566 | link:#attention-set-input[AttentionSetInput] entity. |
| 6567 | |
| 6568 | .Request |
| 6569 | ---- |
| 6570 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0 |
| 6571 | Content-Type: application/json; charset=UTF-8 |
| 6572 | |
| 6573 | { |
| 6574 | "user": "John Doe", |
| 6575 | "reason": "reason" |
| 6576 | } |
| 6577 | ---- |
| 6578 | |
| 6579 | .Response |
| 6580 | ---- |
| 6581 | HTTP/1.1 200 OK |
| 6582 | Content-Disposition: attachment |
| 6583 | Content-Type: application/json; charset=UTF-8 |
| 6584 | |
| 6585 | )]}' |
| 6586 | { |
| 6587 | "_account_id": 1000096, |
| 6588 | "name": "John Doe", |
| 6589 | "email": "john.doe@example.com", |
| 6590 | "username": "jdoe" |
| 6591 | } |
| 6592 | ---- |
| 6593 | |
| 6594 | [[remove-from-attention-set]] |
| 6595 | === Remove from Attention Set |
| 6596 | -- |
| 6597 | 'DELETE /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]' + |
| 6598 | 'POST /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]/delete' |
| 6599 | -- |
| 6600 | |
| 6601 | Deletes a single user from the attention set of a change. |
| 6602 | |
| 6603 | A user can only be removed from the attention set if they |
| 6604 | are currently in the attention set. Otherwise, the request |
| 6605 | is silently ignored. |
| 6606 | |
| 6607 | .Request |
| 6608 | ---- |
| 6609 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe HTTP/1.0 |
| 6610 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0 |
| 6611 | ---- |
| 6612 | |
| 6613 | Reason can be provided in the request body as an |
| 6614 | link:#attention-set-input[AttentionSetInput] entity. |
| 6615 | |
| 6616 | User must be left empty, or the user must be exactly |
| 6617 | the same user as in the request header. |
| 6618 | |
| 6619 | .Request |
| 6620 | ---- |
| 6621 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0 |
| 6622 | Content-Type: application/json; charset=UTF-8 |
| 6623 | |
| 6624 | { |
| 6625 | "reason": "reason" |
| 6626 | } |
| 6627 | ---- |
| 6628 | |
| 6629 | .Response |
| 6630 | ---- |
| 6631 | HTTP/1.1 204 No Content |
| 6632 | ---- |
| 6633 | |
| 6634 | [[attention-set]] |
| 6635 | == Attention Set |
| 6636 | Attention Set is the set of users that should perform some action on the |
| 6637 | change. E.g, reviewers should review the change, owner/uploader should |
| 6638 | add a new patchset or respond to comments. |
| 6639 | |
| 6640 | Users are added to the attention set if one the following apply: |
| 6641 | |
| 6642 | * They are manually added in link:#review-input[ReviewInput] in |
| 6643 | add_to_attention_set. |
| 6644 | * They are added as reviewers. |
| 6645 | * The change is marked ready for review. |
| 6646 | * As an owner/uploader, when someone replies on your change. |
| 6647 | * As a reviewer, when the owner/uploader replies. |
Gal Paikin | 6ce56dc | 2021-03-29 12:28:43 +0200 | [diff] [blame] | 6648 | * When the user's vote is deleted by another user. |
Gal Paikin | 102f6d8 | 2021-04-13 15:21:51 +0200 | [diff] [blame] | 6649 | * The rules above (except manually adding to the attention set) don't apply |
| 6650 | for changes that are work in progress. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6651 | |
| 6652 | Users are removed from the attention set if one the following apply: |
| 6653 | |
| 6654 | * They are manually removed in link:#review-input[ReviewInput] in |
| 6655 | remove_from_attention_set. |
| 6656 | * They are removed from reviewers. |
| 6657 | * The change is marked work in progress, abandoned, or submitted. |
| 6658 | * When the user replies on a change. |
| 6659 | |
| 6660 | If the ignore_default_attention_set_rules in link:#review-input[ReviewInput] |
| 6661 | is set to true, no other changes to the attention set will occur during the |
| 6662 | link:#set-review[set-review]. |
| 6663 | Also, users specified in the list will occur instead of any of the implicit |
| 6664 | changes to the attention set. E.g, if a user is added by add_to_attention_set |
| 6665 | in link:#review-input[ReviewInput], but also the change is marked work in |
| 6666 | progress, the user will still be added. |
| 6667 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6668 | [[ids]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6669 | == IDs |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6670 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 6671 | [[account-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6672 | === link:rest-api-accounts.html#account-id[\{account-id\}] |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 6673 | -- |
| 6674 | -- |
| 6675 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6676 | [[change-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6677 | === \{change-id\} |
Patrick Hiesel | 18da045 | 2017-12-21 14:02:05 +0100 | [diff] [blame] | 6678 | Identifier that uniquely identifies one change. It contains the URL-encoded |
Edwin Kempin | 00ecc02 | 2023-07-26 06:49:09 +0000 | [diff] [blame^] | 6679 | project name as well as the change number: "<project>~<changeNumber>" |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6680 | |
Sven Selberg | 78ce9f4 | 2023-01-05 14:41:04 +0100 | [diff] [blame] | 6681 | ==== Alternative identifiers |
| 6682 | Gerrit also supports an array of other change identifiers. |
| 6683 | |
| 6684 | [NOTE] |
Sven Selberg | aaf8ed8 | 2023-01-11 11:44:08 +0000 | [diff] [blame] | 6685 | 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^] | 6686 | recommended to use "<project>~<changeNumber>" whenever possible. |
Sven Selberg | aaf8ed8 | 2023-01-11 11:44:08 +0000 | [diff] [blame] | 6687 | Since these identifiers require additional lookups from index and caches, to |
Edwin Kempin | 00ecc02 | 2023-07-26 06:49:09 +0000 | [diff] [blame^] | 6688 | be translated to the "<project>~<changeNumber>" identifier, they |
Sven Selberg | aaf8ed8 | 2023-01-11 11:44:08 +0000 | [diff] [blame] | 6689 | may result in both false-positives and false-negatives. |
| 6690 | Furthermore the additional lookup mean that they come with a performance penalty. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6691 | |
Edwin Kempin | 00ecc02 | 2023-07-26 06:49:09 +0000 | [diff] [blame^] | 6692 | * an ID of the change in the format "<project>~<branch>~<Change-Id>", |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6693 | where for the branch the `refs/heads/` prefix can be omitted |
Edwin Kempin | 00ecc02 | 2023-07-26 06:49:09 +0000 | [diff] [blame^] | 6694 | ("myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940") |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6695 | * a Change-Id if it uniquely identifies one change |
| 6696 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 6697 | * a change number if it uniquely identifies one change ("4247") |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6698 | |
Changcheng Xiao | d61590f | 2018-04-30 10:59:14 +0200 | [diff] [blame] | 6699 | [[change-message-id]] |
| 6700 | === \{change-message-id\} |
| 6701 | ID of a change message returned in a link:#change-message-info[ChangeMessageInfo]. |
| 6702 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6703 | [[comment-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6704 | === \{comment-id\} |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 6705 | UUID of a published comment. |
| 6706 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 6707 | [[draft-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6708 | === \{draft-id\} |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 6709 | UUID of a draft comment. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 6710 | |
David Ostrovsky | beb0b84 | 2014-12-13 00:24:29 +0100 | [diff] [blame] | 6711 | [[label-id]] |
| 6712 | === \{label-id\} |
| 6713 | The name of the label. |
| 6714 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6715 | [[file-id]] |
David Pursehouse | b10c266 | 2016-12-06 08:41:33 +0900 | [diff] [blame] | 6716 | === \{file-id\} |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 6717 | The path of the file. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 6718 | |
David Pursehouse | 11badbb | 2017-03-27 10:58:05 +0900 | [diff] [blame] | 6719 | The following magic paths are supported: |
| 6720 | |
| 6721 | * `/COMMIT_MSG`: |
| 6722 | + |
| 6723 | The commit message and headers with the parent commit(s), the author |
| 6724 | information and the committer information. |
| 6725 | |
| 6726 | * `/MERGE_LIST` (for merge commits only): |
| 6727 | + |
| 6728 | The list of commits that are being integrated into the destination |
| 6729 | branch by submitting the merge commit. |
| 6730 | |
Gal Paikin | 3edc142 | 2020-03-19 12:04:52 +0100 | [diff] [blame] | 6731 | * `/PATCHSET_LEVEL`: |
| 6732 | + |
| 6733 | This file path is used exclusively for posting and indicating |
| 6734 | patchset-level comments, thus not relevant for other use-cases. |
| 6735 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 6736 | [[fix-id]] |
| 6737 | === \{fix-id\} |
| 6738 | UUID of a suggested fix. |
| 6739 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6740 | [[revision-id]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6741 | === \{revision-id\} |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6742 | Identifier that uniquely identifies one revision of a change. |
| 6743 | |
| 6744 | This can be: |
| 6745 | |
Shawn Pearce | 9c0722a | 2013-03-02 15:30:31 -0800 | [diff] [blame] | 6746 | * the literal `current` to name the current patch set/revision |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6747 | * a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1") |
| 6748 | * an abbreviated commit ID that uniquely identifies one revision of the |
| 6749 | change ("674ac754"), at least 4 digits are required |
Edwin Kempin | 2582c98 | 2022-12-27 15:47:59 +0100 | [diff] [blame] | 6750 | * a numeric patch number ("1" for first patch set of the change) |
Edwin Kempin | 8cc0bab | 2016-09-15 15:53:37 +0200 | [diff] [blame] | 6751 | * "0" or the literal `edit` for a change edit |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 6752 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6753 | [[json-entities]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6754 | == JSON Entities |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6755 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6756 | [[abandon-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6757 | === AbandonInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6758 | The `AbandonInput` entity contains information for abandoning a change. |
| 6759 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6760 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6761 | |============================= |
| 6762 | |Field Name ||Description |
| 6763 | |`message` |optional| |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6764 | Message to be added as review comment to the change when abandoning the |
| 6765 | change. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6766 | |`notify` |optional| |
Stephen Li | e5fcdf7 | 2016-08-02 11:05:11 -0700 | [diff] [blame] | 6767 | Notify handling that defines to whom email notifications should be sent after |
| 6768 | the change is abandoned. + |
| 6769 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6770 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6771 | |`notify_details`|optional| |
| 6772 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 6773 | of link:user-notify.html#recipient-types[recipient type] to |
| 6774 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 6775 | |============================= |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 6776 | |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6777 | [[action-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6778 | === ActionInfo |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6779 | The `ActionInfo` entity describes a REST API call the client can |
| 6780 | make to manipulate a resource. These are frequently implemented by |
| 6781 | plugins and may be discovered at runtime. |
| 6782 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6783 | [options="header",cols="1,^1,5"] |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6784 | |==================================== |
| 6785 | |Field Name ||Description |
| 6786 | |`method` |optional| |
| 6787 | HTTP method to use with the action. Most actions use `POST`, `PUT` |
| 6788 | or `DELETE` to cause state changes. |
| 6789 | |`label` |optional| |
| 6790 | Short title to display to a user describing the action. In the |
| 6791 | Gerrit web interface the label is used as the text on the button |
| 6792 | presented in the UI. |
| 6793 | |`title` |optional| |
| 6794 | Longer text to display describing the action. In a web UI this |
| 6795 | should be the title attribute of the element, displaying when |
| 6796 | the user hovers the mouse. |
| 6797 | |`enabled` |optional| |
| 6798 | If true the action is permitted at this time and the caller is |
| 6799 | likely allowed to execute it. This may change if state is updated |
| 6800 | at the server or permissions are modified. Not present if false. |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6801 | |`enabled_options` |optional| |
| 6802 | Optional list of enabled options. + |
Edwin Kempin | b7c80b5 | 2023-03-02 12:30:20 +0100 | [diff] [blame] | 6803 | See the list of suppported options link:#action-options[below]. |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 6804 | |==================================== |
| 6805 | |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6806 | [[action-options]] |
| 6807 | ==== Action Options |
| 6808 | |
| 6809 | Options that are returned via the `enabled_options` field of |
| 6810 | link:#action-info[ActionInfo]. |
| 6811 | |
| 6812 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6813 | |=================================== |
| 6814 | |REST view |Option |Description |
| 6815 | |`rebase` |`rebase`| |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6816 | Present if the user can rebase the change. + |
| 6817 | This is the case for the change owner and users with the |
| 6818 | link:access-control.html#category_submit[Submit] or |
| 6819 | link:access-control.html#category_rebase[Rebase] permission if they |
| 6820 | have the link:access-control.html#category_push[Push] permission. |
Edwin Kempin | c8e0a06 | 2023-03-16 11:04:13 +0100 | [diff] [blame] | 6821 | |`rebase` |`rebase_on_behalf_of_uploader`| |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6822 | Present if the user can rebase the change on behalf of the uploader. + |
| 6823 | This is the case for the change owner and users with the |
| 6824 | link:access-control.html#category_submit[Submit] or |
| 6825 | link:access-control.html#category_rebase[Rebase] permission. |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6826 | |`rebase:chain`|`rebase`| |
| 6827 | Present if the user can rebase the chain. + |
| 6828 | 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] | 6829 | chain. |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6830 | Rebasing a change is allowed for the change owner and users with the |
| 6831 | link:access-control.html#category_submit[Submit] or |
| 6832 | link:access-control.html#category_rebase[Rebase] permission if they |
| 6833 | have the link:access-control.html#category_push[Push] permission. |
Edwin Kempin | c8e0a06 | 2023-03-16 11:04:13 +0100 | [diff] [blame] | 6834 | |`rebase:chain`|`rebase_on_behalf_of_uploader`| |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6835 | Present if the user can rebase the chain on behalf of the uploader. + |
| 6836 | 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] | 6837 | chain on behalf of the uploader. |
Edwin Kempin | 3d082a8 | 2023-02-23 16:33:12 +0100 | [diff] [blame] | 6838 | Rebasing a change on behalf of the uploader is allowed for the change |
| 6839 | owner and users with the link:access-control.html#category_submit[Submit] |
| 6840 | or link:access-control.html#category_rebase[Rebase] permission. |
| 6841 | |=================================== |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 6842 | |
| 6843 | For all other REST views no options are returned. |
| 6844 | |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 6845 | [[applypatch-input]] |
| 6846 | === ApplyPatchInput |
| 6847 | The `ApplyPatchInput` entity contains information about a patch to apply. |
| 6848 | |
| 6849 | A new commit will be created from the patch, and saved as a new patch set. |
| 6850 | |
| 6851 | [options="header",cols="1,^1,5"] |
| 6852 | |================================= |
| 6853 | |Field Name ||Description |
| 6854 | |`patch` |required| |
| 6855 | The patch to be applied. Must be compatible with `git diff` output. |
| 6856 | For example, link:#get-patch[Get Patch] output. |
Nitzan Gur-Furman | cf722f6 | 2023-02-15 20:40:33 +0100 | [diff] [blame] | 6857 | 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] | 6858 | |================================= |
| 6859 | |
| 6860 | [[applypatchpatchset-input]] |
| 6861 | === ApplyPatchPatchSetInput |
| 6862 | The `ApplyPatchPatchSetInput` entity contains information for creating a new patch set from a |
| 6863 | given patch. |
| 6864 | |
| 6865 | [options="header",cols="1,^1,5"] |
| 6866 | |================================= |
| 6867 | |Field Name ||Description |
| 6868 | |`patch` |required| |
| 6869 | The details of the patch to be applied as a link:#applypatch-input[ApplyPatchInput] entity. |
| 6870 | |`commit_message` |optional| |
Nitzan Gur-Furman | 9039848 | 2023-02-23 09:48:24 +0100 | [diff] [blame] | 6871 | The commit message for the new patch set. If not specified, the latest patch-set message will be |
| 6872 | used. |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 6873 | |`base` |optional| |
| 6874 | 40-hex digit SHA-1 of the commit which will be the parent commit of the newly created patch set. |
| 6875 | If set, it must be a merged commit or a change revision on the destination branch. |
| 6876 | Otherwise, the target change's branch tip will be used. |
| 6877 | |`author` |optional| |
| 6878 | The author of the commit to create. Must be an |
| 6879 | link:rest-api-accounts.html#account-input[AccountInput] entity with at least |
| 6880 | the `name` and `email` fields set. |
| 6881 | The caller needs "Forge Author" permission when using this field, unless specifies their own details. |
| 6882 | This field does not affect the owner of the change, which will continue to use the identity of the |
| 6883 | caller. |
Patrick Hiesel | e6759d5 | 2023-02-21 15:24:15 +0100 | [diff] [blame] | 6884 | |`response_format_options` |optional| |
| 6885 | List of link:#query-options[query options] to format the response. |
Patrick Hiesel | 257539f | 2023-06-23 13:36:05 +0200 | [diff] [blame] | 6886 | |`amend` |optional| |
| 6887 | If true, the revision from the URL will be amended by the patch. This will use the tree of the |
| 6888 | revision, apply the patch and create a new commit whose tree is the resulting tree of the operation |
| 6889 | 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] | 6890 | |================================= |
| 6891 | |
| 6892 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6893 | [[approval-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6894 | === ApprovalInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6895 | The `ApprovalInfo` entity contains information about an approval from a |
| 6896 | user for a label on a change. |
| 6897 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 6898 | `ApprovalInfo` has the same fields as |
| 6899 | link:rest-api-accounts.html#account-info[AccountInfo]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6900 | In addition `ApprovalInfo` has the following fields: |
| 6901 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 6902 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6903 | |=========================== |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 6904 | |Field Name ||Description |
| 6905 | |`value` |optional| |
Dave Borowitz | a30db91 | 2013-03-22 14:20:33 -0700 | [diff] [blame] | 6906 | The vote that the user has given for the label. If present and zero, the |
| 6907 | user is permitted to vote on the label. If absent, the user is not |
| 6908 | permitted to vote on that label. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 6909 | |`permitted_voting_range` |optional| |
| 6910 | The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote |
| 6911 | on that label. If present, the user is permitted to vote on the label |
| 6912 | regarding the range values. If absent, the user is not permitted to vote |
| 6913 | on that label. |
| 6914 | |`date` |optional| |
Gustaf Lundh | 2e07d502 | 2013-05-08 17:07:42 +0100 | [diff] [blame] | 6915 | The time and date describing when the approval was made. |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 6916 | |`tag` |optional| |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6917 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 6918 | while posting the review. Votes/comments that contain `tag` with |
| 6919 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 6920 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 6921 | invocations of the REST call are required. |
Dave Borowitz | e47fe47 | 2016-09-09 13:57:14 -0400 | [diff] [blame] | 6922 | |`post_submit` |not set if `false`| |
| 6923 | If true, this vote was made after the change was submitted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 6924 | |=========================== |
| 6925 | |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6926 | [[attention-set-info]] |
| 6927 | === AttentionSetInfo |
| 6928 | The `AttentionSetInfo` entity contains details of users that are in |
| 6929 | the link:#attention-set[attention set]. |
| 6930 | |
| 6931 | [options="header",cols="1,^1,5"] |
| 6932 | |=========================== |
| 6933 | |Field Name ||Description |
| 6934 | |`account` || link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 6935 | |`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] | 6936 | |`reason` || |
| 6937 | The reason for adding or removing the user. |
| 6938 | If the update was caused by another user, that account is represented by |
| 6939 | account ID in reason as `<GERRIT_ACCOUNT_18419>` and the corresponding |
| 6940 | link:rest-api-accounts.html#account-info[AccountInfo] can be found in `reason_account` field. |
| 6941 | |`reason_account` || |
| 6942 | 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] | 6943 | |
| 6944 | |=========================== |
| 6945 | [[attention-set-input]] |
| 6946 | === AttentionSetInput |
| 6947 | The `AttentionSetInput` entity contains details for adding users to the |
| 6948 | link:#attention-set[attention set] and removing them from it. |
| 6949 | |
| 6950 | [options="header",cols="1,^1,5"] |
| 6951 | |=========================== |
Gal Paikin | f2b1b33 | 2020-07-06 16:34:36 +0300 | [diff] [blame] | 6952 | |Field Name ||Description |
| 6953 | |`user` |optional| link:rest-api-accounts.html#account-id[ID] |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6954 | of the account that should be added to the attention set. For removals, |
| 6955 | 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] | 6956 | |`reason` || The reason of for adding or removing the user. |
| 6957 | |`notify` |optional| |
| 6958 | Notify handling that defines to whom email notifications should be sent |
| 6959 | after the change is created. + |
| 6960 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 6961 | If not set, the default is `OWNER`. |
| 6962 | |`notify_details` |optional| |
| 6963 | Additional information about whom to notify about the change creation |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 6964 | as a map of link:user-notify.html#recipient-types[recipient type] to |
| 6965 | link:#notify-info[NotifyInfo] entity. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 6966 | |=========================== |
| 6967 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 6968 | [[blame-info]] |
| 6969 | === BlameInfo |
| 6970 | The `BlameInfo` entity stores the commit metadata with the row coordinates where |
| 6971 | it applies. |
| 6972 | |
| 6973 | [options="header",cols="1,6"] |
| 6974 | |=========================== |
| 6975 | |Field Name | Description |
| 6976 | |`author` | The author of the commit. |
| 6977 | |`id` | The id of the commit. |
| 6978 | |`time` | Commit time. |
| 6979 | |`commit_msg` | The commit message. |
| 6980 | |`ranges` | |
| 6981 | The blame row coordinates as link:#range-info[RangeInfo] entities. |
| 6982 | |=========================== |
| 6983 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6984 | [[change-edit-input]] |
| 6985 | === ChangeEditInput |
| 6986 | The `ChangeEditInput` entity contains information for restoring a |
| 6987 | path within change edit. |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 6988 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 6989 | [options="header",cols="1,^1,5"] |
| 6990 | |=========================== |
| 6991 | |Field Name ||Description |
| 6992 | |`restore_path`|optional|Path to file to restore. |
| 6993 | |`old_path` |optional|Old path to file to rename. |
| 6994 | |`new_path` |optional|New path to file to rename. |
| 6995 | |=========================== |
| 6996 | |
| 6997 | [[change-edit-message-input]] |
| 6998 | === ChangeEditMessageInput |
| 6999 | The `ChangeEditMessageInput` entity contains information for changing |
| 7000 | the commit message within a change edit. |
| 7001 | |
| 7002 | [options="header",cols="1,^1,5"] |
| 7003 | |=========================== |
| 7004 | |Field Name ||Description |
| 7005 | |`message` ||New commit message. |
| 7006 | |=========================== |
David Ostrovsky | 8c5f80a | 2013-09-02 20:22:39 +0200 | [diff] [blame] | 7007 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7008 | [[change-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7009 | === ChangeInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7010 | The `ChangeInfo` entity contains information about a change. |
| 7011 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7012 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7013 | |================================== |
| 7014 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7015 | |`id` || |
Marija Savtchouk | 5073525 | 2023-04-27 12:22:44 +0200 | [diff] [blame] | 7016 | The ID of the change. Subject to a 'GerritBackendFeature__return_new_change_info_id' |
| 7017 | experiment, the format is either "'<project>\~<_number>'" (new format), |
| 7018 | or `triplet_id`. The experiment is needed to allow callers to migrate. |
| 7019 | 'project' and '_number' are URL encoded. The callers must not rely on the format. |
| 7020 | |`triplet_id` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7021 | 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] | 7022 | where 'project' and 'branch' are URL encoded. For 'branch' the |
Marija Savtchouk | 5073525 | 2023-04-27 12:22:44 +0200 | [diff] [blame] | 7023 | `refs/heads/` prefix is omitted. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7024 | |`project` ||The name of the project. |
| 7025 | |`branch` || |
| 7026 | The name of the target branch. + |
| 7027 | The `refs/heads/` prefix is omitted. |
Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 7028 | |`topic` |optional|The topic to which this change belongs. |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 7029 | |`attention_set` |optional| |
| 7030 | 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] | 7031 | to link:#attention-set-info[AttentionSetInfo] of that account. Those are all |
| 7032 | accounts that are currently in the attention set. |
| 7033 | |`removed_from_attention_set` |optional| |
| 7034 | The map that maps link:rest-api-accounts.html#account-id[account IDs] |
| 7035 | to link:#attention-set-info[AttentionSetInfo] of that account. Those are all |
| 7036 | accounts that were in the attention set but were removed. The |
| 7037 | link:#attention-set-info[AttentionSetInfo] is the latest and most recent removal |
| 7038 | of the account from the attention set. |
Edwin Kempin | 93b74fb | 2017-08-25 10:42:56 +0200 | [diff] [blame] | 7039 | |`hashtags` |optional| |
Gal Paikin | 07a580c | 2021-04-15 09:47:36 +0200 | [diff] [blame] | 7040 | List of hashtags that are set on the change. |
Chris Poucet | c2962dc | 2023-03-07 17:19:25 +0100 | [diff] [blame] | 7041 | |`custom_keyed_values` |optional| |
| 7042 | A map that maps custom keys to custom values that are tied to a specific change, |
| 7043 | both in the form of strings. Only set if link:#custom-keyed-values[custom keyed |
| 7044 | values] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7045 | |`change_id` ||The Change-Id of the change. |
| 7046 | |`subject` || |
| 7047 | The subject of the change (header line of the commit message). |
| 7048 | |`status` || |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 7049 | The status of the change (`NEW`, `MERGED`, `ABANDONED`). |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7050 | |`created` || |
| 7051 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 7052 | created. |
| 7053 | |`updated` || |
| 7054 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 7055 | updated. |
Khai Do | 96a7caf | 2016-01-07 14:07:54 -0800 | [diff] [blame] | 7056 | |`submitted` |only set for merged changes| |
| 7057 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 7058 | submitted. |
Dave Borowitz | 8ec31f9 | 2017-08-23 10:28:34 -0400 | [diff] [blame] | 7059 | |`submitter` |only set for merged changes| |
| 7060 | The user who submitted the change, as an |
| 7061 | link:rest-api-accounts.html#account-info[ AccountInfo] entity. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7062 | |`starred` |not set if `false`| |
Nitzan Gur-Furman | 70933e5 | 2023-06-30 13:36:41 +0200 | [diff] [blame] | 7063 | Whether the calling user has starred this change. |
Youssef Elghareeb | f4f4948 | 2023-04-26 18:02:33 +0200 | [diff] [blame] | 7064 | Only set if link:#star[requested]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7065 | |`reviewed` |not set if `false`| |
| 7066 | Whether the change was reviewed by the calling user. |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 7067 | Only set if link:#reviewed[reviewed] is requested. |
Dave Borowitz | ace3210 | 2015-12-17 13:08:25 -0500 | [diff] [blame] | 7068 | |`submit_type` |optional| |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 7069 | 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] | 7070 | Not set for merged changes. |
Edwin Kempin | baf70e1 | 2013-02-27 10:36:13 +0100 | [diff] [blame] | 7071 | |`mergeable` |optional| |
| 7072 | Whether the change is mergeable. + |
Patrick Hiesel | a4824db | 2019-12-20 10:55:26 +0100 | [diff] [blame] | 7073 | Only set for open changes if |
| 7074 | link:config-gerrit.html#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior] |
| 7075 | is `API_REF_UPDATED_AND_CHANGE_REINDEX`. |
Shawn Pearce | 4cd05b2 | 2016-09-17 22:45:33 -0700 | [diff] [blame] | 7076 | |`submittable` |optional| |
| 7077 | Whether the change has been approved by the project submit rules. + |
Jonathan Nieder | cb51d74 | 2016-09-23 11:37:57 -0700 | [diff] [blame] | 7078 | Only set if link:#submittable[requested]. |
Edwin Kempin | a6b6eaf | 2013-11-23 11:05:58 +0100 | [diff] [blame] | 7079 | |`insertions` || |
| 7080 | Number of inserted lines. |
| 7081 | |`deletions` || |
| 7082 | Number of deleted lines. |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 7083 | |`total_comment_count` |optional| |
| 7084 | Total number of inline comments across all patch sets. Not set if the current |
| 7085 | change index doesn't have the data. |
Changcheng Xiao | 81c4809 | 2017-02-08 13:04:07 +0100 | [diff] [blame] | 7086 | |`unresolved_comment_count` |optional| |
Dave Borowitz | c001f32 | 2018-10-31 14:31:08 -0700 | [diff] [blame] | 7087 | Number of unresolved inline comment threads across all patch sets. Not set if |
| 7088 | the current change index doesn't have the data. |
Ben Rohlfs | b56e355 | 2021-09-10 09:04:19 +0200 | [diff] [blame] | 7089 | |`_number` || |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 7090 | The change number. (The underscore is just a relict of a prior |
| 7091 | attempt to deprecate the change number.) |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7092 | |`owner` || |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 7093 | The owner of the change as an link:rest-api-accounts.html#account-info[ |
| 7094 | AccountInfo] entity. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 7095 | |`actions` |optional| |
| 7096 | Actions the caller might be able to perform on this revision. The |
| 7097 | information is a map of view name to link:#action-info[ActionInfo] |
| 7098 | entities. |
Youssef Elghareeb | 02d33aa | 2021-10-04 13:24:52 +0200 | [diff] [blame] | 7099 | |`submit_records` || |
| 7100 | List of the link:rest-api-changes.html#submit-record-info[SubmitRecordInfo] |
| 7101 | containing the submit records for the change at the latest patchset. |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 7102 | |`requirements` |optional| |
| 7103 | 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] | 7104 | can be submitted. This field is deprecated in favour of `submit_requirements`. |
| 7105 | |`submit_requirements` |optional| |
| 7106 | List of the link:#submit-requirement-result-info[SubmitRequirementResultInfo] |
| 7107 | containing the evaluated submit requirements for the change. |
| 7108 | Only set if link:#submit-requirements[`SUBMIT_REQUIREMENTS`] is requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7109 | |`labels` |optional| |
| 7110 | The labels of the change as a map that maps the label names to |
| 7111 | link:#label-info[LabelInfo] entries. + |
| 7112 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 7113 | labels] are requested. |
| 7114 | |`permitted_labels` |optional| |
| 7115 | A map of the permitted labels that maps a label name to the list of |
| 7116 | values that are allowed for that label. + |
| 7117 | Only set if link:#detailed-labels[detailed labels] are requested. |
Nitzan Gur-Furman | d122357 | 2023-01-16 12:07:46 +0000 | [diff] [blame] | 7118 | |`removable_labels` |optional| |
| 7119 | A map of the removable labels that maps a label name to the map of |
| 7120 | values and reviewers ( |
| 7121 | link:rest-api-accounts.html#account-info[AccountInfo] entities) |
| 7122 | that are allowed to be removed from the change. + |
| 7123 | Only set if link:#labels[labels] or |
| 7124 | link:#detailed-labels[detailed labels] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7125 | |`removable_reviewers`|optional| |
| 7126 | 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] | 7127 | link:rest-api-accounts.html#account-info[AccountInfo] entities. + |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 7128 | Only set if link:#labels[labels] or |
| 7129 | link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 7130 | |`reviewers` |optional| |
Edwin Kempin | 66af3d8 | 2015-11-10 17:38:40 -0800 | [diff] [blame] | 7131 | The reviewers as a map that maps a reviewer state to a list of |
| 7132 | link:rest-api-accounts.html#account-info[AccountInfo] entities. |
| 7133 | Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. + |
| 7134 | `REVIEWER`: Users with at least one non-zero vote on the change. + |
| 7135 | `CC`: Users that were added to the change, but have not voted. + |
| 7136 | `REMOVED`: Users that were previously reviewers on the change, but have |
| 7137 | been removed. + |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 7138 | Only set if link:#labels[labels] or |
| 7139 | link:#detailed-labels[detailed labels] are requested. |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 7140 | |`pending_reviewers` |optional| |
| 7141 | Updates to `reviewers` that have been made while the change was in the |
| 7142 | WIP state. Only present on WIP changes and only if there are pending |
| 7143 | reviewer updates to report. These are reviewers who have not yet been |
| 7144 | notified about being added to or removed from the change. + |
Patrick Hiesel | ae92ad8 | 2020-11-17 11:09:05 +0100 | [diff] [blame] | 7145 | Only set if link:#labels[labels] or |
| 7146 | link:#detailed-labels[detailed labels] are requested. |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 7147 | |`reviewer_updates`|optional| |
| 7148 | Updates to reviewers set for the change as |
| 7149 | link:#review-update-info[ReviewerUpdateInfo] entities. |
Han-Wen Nienhuys | 3c670be | 2020-06-30 19:17:07 +0200 | [diff] [blame] | 7150 | Only set if link:#reviewer-updates[reviewer updates] are requested. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7151 | |`messages`|optional| |
Shawn Pearce | 414c5ff | 2013-09-06 21:51:02 -0700 | [diff] [blame] | 7152 | Messages associated with the change as a list of |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7153 | link:#change-message-info[ChangeMessageInfo] entities. + |
| 7154 | Only set if link:#messages[messages] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7155 | |`current_revision` |optional| |
| 7156 | The commit ID of the current patch set of this change. + |
| 7157 | Only set if link:#current-revision[the current revision] is requested |
| 7158 | or if link:#all-revisions[all revisions] are requested. |
| 7159 | |`revisions` |optional| |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 7160 | 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] | 7161 | patch set to a link:#revision-info[RevisionInfo] entity. + |
Dave Borowitz | 0adf270 | 2014-01-22 10:41:52 -0800 | [diff] [blame] | 7162 | Only set if link:#current-revision[the current revision] is requested |
| 7163 | (in which case it will only contain a key for the current revision) or |
| 7164 | if link:#all-revisions[all revisions] are requested. |
Han-Wen Nienhuys | 4ec526a | 2021-02-16 19:20:26 +0100 | [diff] [blame] | 7165 | |`meta_rev_id` |optional| |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 7166 | The SHA-1 of the NoteDb meta ref. |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 7167 | |`tracking_ids` |optional| |
| 7168 | A list of link:#tracking-id-info[TrackingIdInfo] entities describing |
| 7169 | references to external tracking systems. Only set if |
| 7170 | link:#tracking-ids[tracking ids] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7171 | |`_more_changes` |optional, not set if `false`| |
| 7172 | Whether the query would deliver more results if not limited. + |
Dave Borowitz | 4241459 | 2014-12-19 11:27:14 -0800 | [diff] [blame] | 7173 | Only set on the last change that is returned. |
Dave Borowitz | 5c894d4 | 2014-11-25 17:43:06 -0500 | [diff] [blame] | 7174 | |`problems` |optional| |
| 7175 | A list of link:#problem-info[ProblemInfo] entities describing potential |
Dave Borowitz | 4c46c24 | 2014-12-03 16:46:45 -0800 | [diff] [blame] | 7176 | problems with this change. Only set if link:#check[CHECK] is set. |
David Ostrovsky | cb19cec | 2017-04-28 11:55:45 +0200 | [diff] [blame] | 7177 | |`is_private` |optional, not set if `false`| |
| 7178 | When present, change is marked as private. |
David Ostrovsky | 258849b | 2017-03-09 23:21:03 +0100 | [diff] [blame] | 7179 | |`work_in_progress` |optional, not set if `false`| |
| 7180 | When present, change is marked as Work In Progress. |
Logan Hanks | 724b24c | 2017-07-14 10:01:05 -0700 | [diff] [blame] | 7181 | |`has_review_started` |optional, not set if `false`| |
Logan Hanks | 296cd89 | 2017-05-03 15:14:41 -0700 | [diff] [blame] | 7182 | When present, change has been marked Ready at some point in time. |
Patrick Hiesel | 828f322 | 2017-07-13 14:18:38 +0200 | [diff] [blame] | 7183 | |`revert_of` |optional| |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 7184 | The change number of the change that this change reverts. |
Gal Paikin | f57225a | 2019-11-13 12:39:12 -0800 | [diff] [blame] | 7185 | |`submission_id` |optional| |
| 7186 | 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] | 7187 | This ID is equal to the change number of the change that triggered the |
| 7188 | submission. If the change that triggered the submission also has a topic, |
| 7189 | it will be "<id>-<topic>" of the change that triggered the submission. |
Gal Paikin | dd31db9 | 2019-12-06 14:43:35 +0100 | [diff] [blame] | 7190 | The callers must not rely on the format of the submission ID. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7191 | |`cherry_pick_of_change` |optional| |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 7192 | 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] | 7193 | Only set if the cherry-pick has been done through the Gerrit REST API (and |
| 7194 | not if a cherry-picked commit was pushed). |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7195 | |`cherry_pick_of_patch_set`|optional| |
Kaushik Lingarkar | 73bcb41 | 2020-01-29 13:00:46 -0800 | [diff] [blame] | 7196 | 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] | 7197 | Only set if the cherry-pick has been done through the Gerrit REST API (and |
| 7198 | not if a cherry-picked commit was pushed). |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7199 | |`contains_git_conflicts` |optional, not set if `false`| |
| 7200 | Whether the change contains conflicts. + |
| 7201 | If `true`, some of the file contents of the change contain git conflict |
| 7202 | markers to indicate the conflicts. + |
| 7203 | Only set if this change info is returned in response to a request that |
| 7204 | creates a new change or patch set and conflicts are allowed. In |
| 7205 | particular this field is only populated if the change info is returned |
| 7206 | by one of the following REST endpoints: link:#create-change[Create |
| 7207 | Change], link:#create-merge-patch-set-for-change[Create Merge Patch Set |
| 7208 | For Change], link:#cherry-pick[Cherry Pick Revision], |
Edwin Kempin | 269a950 | 2022-05-11 12:28:22 +0200 | [diff] [blame] | 7209 | link:rest-api-project.html#cherry-pick-commit[Cherry Pick Commit], |
| 7210 | link:#rebase-change[Rebase Change] |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 7211 | |================================== |
| 7212 | |
| 7213 | [[change-input]] |
| 7214 | === ChangeInput |
| 7215 | The `ChangeInput` entity contains information about creating a new change. |
| 7216 | |
| 7217 | [options="header",cols="1,^1,5"] |
| 7218 | |================================== |
| 7219 | |Field Name ||Description |
| 7220 | |`project` ||The name of the project. |
| 7221 | |`branch` || |
| 7222 | The name of the target branch. + |
| 7223 | The `refs/heads/` prefix is omitted. |
| 7224 | |`subject` || |
Edwin Kempin | ba8388c | 2020-03-06 08:46:59 +0100 | [diff] [blame] | 7225 | The commit message of the change. Comment lines (beginning with `#`) |
| 7226 | will be removed. If the commit message contains a Change-Id (as a |
| 7227 | "Change-Id: I..." footer) that Change-Id will be used for the newly |
| 7228 | created changed. If a change with this Change-Id already exists for |
| 7229 | same repository and branch, the request is rejected since Change-Ids |
| 7230 | must be unique per repository and branch. If the commit message doesn't |
| 7231 | contain a Change-Id, a newly generated Change-Id is automatically |
| 7232 | inserted into the commit message. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 7233 | |`topic` |optional|The topic to which this change belongs. |
Gal Paikin | 44dbd7e | 2020-04-15 15:23:44 +0200 | [diff] [blame] | 7234 | Topic can't contain quotation marks. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 7235 | |`status` |optional, default to `NEW`| |
David Ostrovsky | 4b44bdc | 2017-07-27 08:05:43 +0200 | [diff] [blame] | 7236 | The status of the change (only `NEW` accepted here). |
Edwin Kempin | 14d50ed | 2017-05-03 13:26:30 +0200 | [diff] [blame] | 7237 | |`is_private` |optional, default to `false`| |
| 7238 | Whether the new change should be marked as private. |
| 7239 | |`work_in_progress` |optional, default to `false`| |
| 7240 | Whether the new change should be set to work in progress. |
David Ostrovsky | 9d8ec42 | 2014-12-24 00:52:09 +0100 | [diff] [blame] | 7241 | |`base_change` |optional| |
| 7242 | 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] | 7243 | change operation. + |
| 7244 | Mutually exclusive with `base_commit`. + |
| 7245 | If neither `base_commit` nor `base_change` are set, the target branch tip will |
| 7246 | be used as the parent commit. |
Aaron Gable | e8e7328 | 2018-04-26 11:09:30 -0700 | [diff] [blame] | 7247 | |`base_commit` |optional| |
| 7248 | 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] | 7249 | created change. If set, it must be a merged commit on the destination branch. + |
| 7250 | Mutually exclusive with `base_change`. + |
| 7251 | If neither `base_commit` nor `base_change` are set, the target branch tip will |
| 7252 | be used as the parent commit. |
Yuxuan 'fishy' Wang | af6807f | 2016-02-10 15:11:57 -0800 | [diff] [blame] | 7253 | |`new_branch` |optional, default to `false`| |
Edwin Kempin | e94bb87 | 2019-10-08 13:47:41 +0200 | [diff] [blame] | 7254 | Allow creating a new branch when set to `true`. Using this option is |
| 7255 | 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] | 7256 | |`validation_options` |optional| |
| 7257 | Map with key-value pairs that are forwarded as options to the commit validation |
| 7258 | listeners (e.g. can be used to skip certain validations). Which validation |
| 7259 | options are supported depends on the installed commit validation listeners. |
| 7260 | Gerrit core doesn't support any validation options, but commit validation |
| 7261 | listeners that are implemented in plugins may. Please refer to the |
| 7262 | documentation of the installed plugins to learn whether they support validation |
| 7263 | options. Unknown validation options are silently ignored. |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 7264 | |`custom_keyed_values`|optional|Custom keyed values as a |
| 7265 | map from custom keys to values. |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 7266 | |`merge` |optional| |
| 7267 | 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] | 7268 | If set, the target branch (see `branch` field) must exist (it is not |
| 7269 | possible to create it automatically by setting the `new_branch` field |
| 7270 | to `true`. |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 7271 | |`patch` |optional| |
| 7272 | 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] | 7273 | |`author` |optional| |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 7274 | The author of the commit to create. Must be an |
| 7275 | link:rest-api-accounts.html#account-input[AccountInput] entity with at least |
| 7276 | the `name` and `email` fields set. |
Han-Wen Nienhuys | 2a1029e | 2020-01-30 18:52:45 +0100 | [diff] [blame] | 7277 | The caller needs "Forge Author" permission when using this field. |
| 7278 | This field does not affect the owner of the change, which will |
| 7279 | continue to use the identity of the caller. |
Edwin Kempin | 5f8c383 | 2017-01-13 11:45:06 +0100 | [diff] [blame] | 7280 | |`notify` |optional| |
| 7281 | Notify handling that defines to whom email notifications should be sent |
| 7282 | after the change is created. + |
| 7283 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7284 | If not set, the default is `ALL`. |
| 7285 | |`notify_details` |optional| |
| 7286 | Additional information about whom to notify about the change creation |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7287 | as a map of link:user-notify.html#recipient-types[recipient type] to |
| 7288 | link:#notify-info[NotifyInfo] entity. |
Patrick Hiesel | e6759d5 | 2023-02-21 15:24:15 +0100 | [diff] [blame] | 7289 | |`response_format_options` |optional| |
| 7290 | List of link:#query-options[query options] to format the response. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7291 | |================================== |
| 7292 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7293 | [[change-message-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7294 | === ChangeMessageInfo |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7295 | The `ChangeMessageInfo` entity contains information about a message |
| 7296 | attached to a change. |
| 7297 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7298 | [options="header",cols="1,^1,5"] |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7299 | |================================== |
| 7300 | |Field Name ||Description |
| 7301 | |`id` ||The ID of the message. |
| 7302 | |`author` |optional| |
Khai Do | 23845a1 | 2014-06-02 11:28:16 -0700 | [diff] [blame] | 7303 | Author of the message as an |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7304 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 7305 | Unset if written by the Gerrit system. |
Patrick Hiesel | 9221ef1 | 2017-03-23 16:44:36 +0100 | [diff] [blame] | 7306 | |`real_author` |optional| |
| 7307 | Real author of the message as an |
| 7308 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
Edwin Kempin | e03de5f | 2023-01-31 14:54:51 +0100 | [diff] [blame] | 7309 | Only set if the message was posted on behalf of another user. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7310 | |`date` || |
| 7311 | The link:rest-api.html#timestamp[timestamp] this message was posted. |
Marija Savtchouk | e40dc1a | 2021-04-07 09:56:12 +0100 | [diff] [blame] | 7312 | |`message` || |
| 7313 | The text left by the user or Gerrit system. Accounts are served as account IDs |
| 7314 | inlined in the text as `<GERRIT_ACCOUNT_18419>`. |
| 7315 | All accounts, used in message, can be found in `accountsInMessage` |
| 7316 | field. |
| 7317 | |`accountsInMessage` ||Accounts, used in `message`. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7318 | |`tag` |optional| |
| 7319 | Value of the `tag` field from link:#review-input[ReviewInput] set |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 7320 | while posting the review. Votes/comments that contain `tag` with |
| 7321 | 'autogenerated:' prefix can be filtered out in the web UI. |
| 7322 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7323 | invocations of the REST call are required. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 7324 | |`_revision_number` |optional| |
| 7325 | Which patchset (if any) generated this message. |
| 7326 | |================================== |
| 7327 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 7328 | [[cherrypick-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7329 | === CherryPickInput |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 7330 | The `CherryPickInput` entity contains information for cherry-picking a change to a new branch. |
| 7331 | |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 7332 | [options="header",cols="1,^1,5"] |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 7333 | |=========================== |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7334 | |Field Name ||Description |
| 7335 | |`message` |optional| |
Edwin Kempin | 159804b | 2019-09-23 11:09:39 +0200 | [diff] [blame] | 7336 | Commit message for the cherry-pick change. If not set, the commit message of |
| 7337 | the cherry-picked commit is used. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7338 | |`destination` ||Destination branch |
| 7339 | |`base` |optional| |
Changcheng Xiao | e333258 | 2017-05-26 15:29:41 +0200 | [diff] [blame] | 7340 | 40-hex digit SHA-1 of the commit which will be the parent commit of the newly created change. |
| 7341 | 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] | 7342 | |`parent` |optional, defaults to 1| |
Alice Kober-Sotzek | f271c25 | 2016-10-12 13:13:54 +0200 | [diff] [blame] | 7343 | 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] | 7344 | |`notify` |optional| |
Changcheng Xiao | e04e846 | 2017-05-23 09:39:03 +0200 | [diff] [blame] | 7345 | Notify handling that defines to whom email notifications should be sent |
| 7346 | after the cherry-pick. + |
| 7347 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Saša Živkov | 357e2bd | 2020-06-12 12:06:07 +0200 | [diff] [blame] | 7348 | If not set, the default is `ALL`. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7349 | |`notify_details` |optional| |
Changcheng Xiao | e04e846 | 2017-05-23 09:39:03 +0200 | [diff] [blame] | 7350 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7351 | of link:user-notify.html#recipient-types[recipient type] to |
| 7352 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7353 | |`keep_reviewers` |optional, defaults to false| |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 7354 | 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] | 7355 | |`allow_conflicts` |optional, defaults to false| |
Edwin Kempin | 5ac370d | 2018-10-05 13:39:34 +0200 | [diff] [blame] | 7356 | If `true`, the cherry-pick uses content merge and succeeds also if |
| 7357 | there are conflicts. If there are conflicts the file contents of the |
| 7358 | created change contain git conflict markers to indicate the conflicts. |
| 7359 | Callers can find out if there were conflicts by checking the |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 7360 | `contains_git_conflicts` field in the link:#change-info[ChangeInfo]. If |
| 7361 | there are conflicts the cherry-pick change is marked as |
Edwin Kempin | 3c4113a | 2018-10-12 10:49:33 +0200 | [diff] [blame] | 7362 | work-in-progress. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7363 | |`topic` |optional| |
Gal Paikin | f3abd3c | 2020-03-24 16:39:20 +0100 | [diff] [blame] | 7364 | The topic of the created cherry-picked change. If not set, the default depends |
| 7365 | on the source. If the source is a change with a topic, the resulting topic |
| 7366 | of the cherry-picked change will be {source_change_topic}-{destination_branch}. |
| 7367 | Otherwise, if the source change has no topic, or the source is a commit, |
| 7368 | the created change will have no topic. |
Gal Paikin | 1f83c20 | 2020-03-31 16:23:41 +0200 | [diff] [blame] | 7369 | If the change already exists, the topic will not change if not set. If set, the |
| 7370 | topic will be overridden. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7371 | |`allow_empty` |optional, defaults to false| |
Gal Paikin | 626abe0 | 2020-04-07 12:21:26 +0200 | [diff] [blame] | 7372 | If `true`, the cherry-pick succeeds also if the created commit will be empty. |
| 7373 | If `false`, a cherry-pick that would create an empty commit fails without creating |
| 7374 | the commit. |
Edwin Kempin | bd2d7ab | 2022-02-10 07:54:11 +0100 | [diff] [blame] | 7375 | |`validation_options`|optional| |
| 7376 | Map with key-value pairs that are forwarded as options to the commit validation |
| 7377 | listeners (e.g. can be used to skip certain validations). Which validation |
| 7378 | options are supported depends on the installed commit validation listeners. |
| 7379 | Gerrit core doesn't support any validation options, but commit validation |
| 7380 | listeners that are implemented in plugins may. Please refer to the |
| 7381 | documentation of the installed plugins to learn whether they support validation |
| 7382 | options. Unknown validation options are silently ignored. |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 7383 | |=========================== |
| 7384 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7385 | [[comment-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7386 | === CommentInfo |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 7387 | The `CommentInfo` entity contains information about an inline comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7388 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7389 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7390 | |=========================== |
| 7391 | |Field Name ||Description |
Dave Borowitz | 23fec2b | 2015-04-28 17:40:07 -0700 | [diff] [blame] | 7392 | |`patch_set` |optional| |
| 7393 | The patch set number for the comment; only set in contexts where + |
| 7394 | comments may be returned for multiple patch sets. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 7395 | |`id` ||The URL encoded UUID of the comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7396 | |`path` |optional| |
Gal Paikin | 3edc142 | 2020-03-19 12:04:52 +0100 | [diff] [blame] | 7397 | 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] | 7398 | Not set if returned in a map where the key is the file path. |
| 7399 | |`side` |optional| |
| 7400 | The side on which the comment was added. + |
| 7401 | Allowed values are `REVISION` and `PARENT`. + |
| 7402 | If not set, the default is `REVISION`. |
Dawid Grzegorczyk | 5904524 | 2015-11-07 11:26:02 +0100 | [diff] [blame] | 7403 | |`parent` |optional| |
| 7404 | The 1-based parent number. Used only for merge commits when `side == PARENT`. |
| 7405 | When not set the comment is for the auto-merge tree. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7406 | |`line` |optional| |
| 7407 | The number of the line for which the comment was done. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7408 | If range is set, this equals the end line of the range. + |
| 7409 | If neither line nor range is set, it's a file comment. |
| 7410 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 7411 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7412 | entity. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7413 | |`in_reply_to` |optional| |
| 7414 | The URL encoded UUID of the comment to which this comment is a reply. |
| 7415 | |`message` |optional|The comment message. |
| 7416 | |`updated` || |
| 7417 | The link:rest-api.html#timestamp[timestamp] of when this comment was |
| 7418 | written. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 7419 | |`author` |optional| |
David Pursehouse | c633a57 | 2013-08-26 14:01:59 +0900 | [diff] [blame] | 7420 | The author of the message as an |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 7421 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 7422 | Unset for draft comments, assumed to be the calling user. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7423 | |`tag` |optional| |
| 7424 | Value of the `tag` field from link:#review-input[ReviewInput] set |
| 7425 | while posting the review. |
Sven Selberg | 1a6728d | 2018-09-28 12:30:12 +0200 | [diff] [blame] | 7426 | NOTE: To apply different tags on different votes/comments multiple |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 7427 | invocations of the REST call are required. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 7428 | |`unresolved` |optional| |
| 7429 | Whether or not the comment must be addressed by the user. The state of |
| 7430 | resolution of a comment thread is stored in the last comment in that thread |
| 7431 | chronologically. |
Youssef Elghareeb | 7fdfa44 | 2020-02-03 12:00:52 +0100 | [diff] [blame] | 7432 | |`change_message_id` |optional| |
Youssef Elghareeb | 5bd4e4e | 2020-08-13 17:09:42 +0200 | [diff] [blame] | 7433 | Available with the link:#list-change-comments[list change comments] endpoint. |
| 7434 | Contains the link:rest-api-changes.html#change-message-info[id] of the change |
| 7435 | message that this comment is linked to. |
Youssef Elghareeb | b5e4208 | 2020-07-09 15:24:01 +0200 | [diff] [blame] | 7436 | |`commit_id` |optional| |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 7437 | 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] | 7438 | this comment applies. |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 7439 | |`context_lines` |optional| |
| 7440 | 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] | 7441 | file where the comment was written. Available only if the "enable-context" |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 7442 | parameter (see link:#list-change-comments[List Change Comments]) is set. |
Youssef Elghareeb | 27d6201 | 2021-02-23 18:21:46 +0100 | [diff] [blame] | 7443 | |`source_content_type` |optional| |
| 7444 | Mime type of the file where the comment is written. Available only if the |
| 7445 | "enable-context" parameter (see link:#list-change-comments[List Change Comments]) |
| 7446 | is set. |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 7447 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 7448 | |=========================== |
| 7449 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7450 | [[comment-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7451 | === CommentInput |
Orgad Shaneh | c99da3a | 2014-06-13 14:57:54 +0300 | [diff] [blame] | 7452 | The `CommentInput` entity contains information for creating an inline |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7453 | comment. |
| 7454 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7455 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7456 | |=========================== |
| 7457 | |Field Name ||Description |
| 7458 | |`id` |optional| |
Edwin Kempin | c09826d7 | 2013-02-26 16:10:39 +0100 | [diff] [blame] | 7459 | The URL encoded UUID of the comment if an existing draft comment should |
| 7460 | be updated. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 7461 | |`path` |optional| |
Gal Paikin | 3edc142 | 2020-03-19 12:04:52 +0100 | [diff] [blame] | 7462 | 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] | 7463 | Doesn't need to be set if contained in a map where the key is the file |
| 7464 | path. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7465 | |`side` |optional| |
| 7466 | The side on which the comment should be added. + |
| 7467 | Allowed values are `REVISION` and `PARENT`. + |
| 7468 | If not set, the default is `REVISION`. |
| 7469 | |`line` |optional| |
| 7470 | The number of the line for which the comment should be added. + |
| 7471 | `0` if it is a file comment. + |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7472 | If neither line nor range is set, a file comment is added. + |
David Pursehouse | 4a159a1 | 2014-08-26 15:45:14 +0900 | [diff] [blame] | 7473 | 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] | 7474 | |`range` |optional| |
David Pursehouse | 8d869ea | 2014-08-26 14:09:53 +0900 | [diff] [blame] | 7475 | The range of the comment as a link:#comment-range[CommentRange] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7476 | entity. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7477 | |`in_reply_to` |optional| |
| 7478 | 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] | 7479 | |`updated` |optional| |
| 7480 | The link:rest-api.html#timestamp[timestamp] of this comment. + |
| 7481 | Accepted but ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7482 | |`message` |optional| |
| 7483 | The comment message. + |
| 7484 | If not set and an existing draft comment is updated, the existing draft |
| 7485 | comment is deleted. |
Dave Borowitz | 3dd203b | 2016-04-19 13:52:41 -0400 | [diff] [blame] | 7486 | |`tag` |optional, drafts only| |
| 7487 | Value of the `tag` field. Only allowed on link:#create-draft[draft comment] + |
| 7488 | inputs; for published comments, use the `tag` field in + |
Gal Paikin | b2b81f2 | 2020-02-26 13:14:08 +0100 | [diff] [blame] | 7489 | link:#review-input[ReviewInput]. Votes/comments that contain `tag` with |
Vitaliy Lotorev | ea88281 | 2018-06-28 20:16:39 +0000 | [diff] [blame] | 7490 | 'autogenerated:' prefix can be filtered out in the web UI. |
Kasper Nilsson | 7ec3036 | 2016-12-20 14:13:21 -0800 | [diff] [blame] | 7491 | |`unresolved` |optional| |
| 7492 | Whether or not the comment must be addressed by the user. This value will |
| 7493 | default to false if the comment is an orphan, or the value of the `in_reply_to` |
| 7494 | comment if it is supplied. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 7495 | |=========================== |
| 7496 | |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7497 | [[comment-range]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7498 | === CommentRange |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7499 | The `CommentRange` entity describes the range of an inline comment. |
| 7500 | |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 7501 | The comment range is a range from the start position, specified by `start_line` |
| 7502 | and `start_character`, to the end position, specified by `end_line` and |
| 7503 | `end_character`. The start position is *inclusive* and the end position is |
| 7504 | *exclusive*. |
| 7505 | |
| 7506 | So, a range over part of a line will have `start_line` equal to |
| 7507 | `end_line`; however a range with `end_line` set to 5 and `end_character` equal |
| 7508 | to 0 will not include any characters on line 5, |
| 7509 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7510 | [options="header",cols="1,^1,5"] |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7511 | |=========================== |
Quinten Yearsley | 3178671 | 2018-07-16 13:44:33 -0700 | [diff] [blame] | 7512 | |Field Name ||Description |
| 7513 | |`start_line` ||The start line number of the range. (1-based) |
| 7514 | |`start_character` ||The character position in the start line. (0-based) |
| 7515 | |`end_line` ||The end line number of the range. (1-based) |
| 7516 | |`end_character` ||The character position in the end line. (0-based) |
Michael Zhou | 596c768 | 2013-08-25 05:43:34 -0400 | [diff] [blame] | 7517 | |=========================== |
| 7518 | |
Youssef Elghareeb | 5c4fffb | 2020-07-10 19:14:57 +0200 | [diff] [blame] | 7519 | [[context-line]] |
| 7520 | === ContextLine |
| 7521 | The `ContextLine` entity contains the line number and line text of a single |
| 7522 | line of the source file content. |
| 7523 | |
| 7524 | [options="header",cols="1,6"] |
| 7525 | |=========================== |
| 7526 | |Field Name |Description |
| 7527 | |`line_number` |The line number of the source line. |
| 7528 | |`context_line` |String containing the line text. |
| 7529 | |=========================== |
| 7530 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7531 | [[commit-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7532 | === CommitInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7533 | The `CommitInfo` entity contains information about a commit. |
| 7534 | |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7535 | [options="header",cols="1,^1,5"] |
| 7536 | |=========================== |
| 7537 | |Field Name ||Description |
Edwin Kempin | c823740 | 2015-07-15 18:27:55 +0200 | [diff] [blame] | 7538 | |`commit` |Optional| |
| 7539 | The commit ID. Not set if included in a link:#revision-info[ |
| 7540 | RevisionInfo] entity that is contained in a map which has the commit ID |
| 7541 | as key. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7542 | |`parents` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7543 | The parent commits of this commit as a list of |
Edwin Kempin | cecf90a | 2014-04-09 14:58:35 +0200 | [diff] [blame] | 7544 | link:#commit-info[CommitInfo] entities. In each parent |
| 7545 | only the `commit` and `subject` fields are populated. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7546 | |`author` ||The author of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7547 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7548 | |`committer` ||The committer of the commit as a |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7549 | link:#git-person-info[GitPersonInfo] entity. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7550 | |`subject` || |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7551 | The subject of the commit (header line of the commit message). |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7552 | |`message` ||The commit message. |
Sven Selberg | d26bd54 | 2014-11-21 16:28:10 +0100 | [diff] [blame] | 7553 | |`web_links` |optional| |
Frank Borden | df69edb | 2021-05-05 17:00:15 +0200 | [diff] [blame] | 7554 | Links to the patch set in external sites as a list of |
| 7555 | link:#web-link-info[WebLinkInfo] entities. |
| 7556 | |`resolve_conflicts_web_links` |optional| |
| 7557 | 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] | 7558 | link:#web-link-info[WebLinkInfo] entities. |
Edwin Kempin | f0c5715 | 2015-07-15 18:18:24 +0200 | [diff] [blame] | 7559 | |=========================== |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7560 | |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 7561 | [[commit-message-input]] |
| 7562 | === CommitMessageInput |
| 7563 | The `CommitMessageInput` entity contains information for changing |
| 7564 | the commit message of a change. |
| 7565 | |
| 7566 | [options="header",cols="1,^1,5"] |
| 7567 | |============================= |
| 7568 | |Field Name ||Description |
| 7569 | |`message` ||New commit message. |
| 7570 | |`notify` |optional| |
| 7571 | Notify handling that defines to whom email notifications should be sent |
| 7572 | after the commit message was updated. + |
| 7573 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Logan Hanks | a1e68dc | 2017-06-29 15:13:27 -0700 | [diff] [blame] | 7574 | 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] | 7575 | |`notify_details`|optional| |
| 7576 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7577 | of link:user-notify.html#recipient-types[recipient type] to |
| 7578 | link:#notify-info[NotifyInfo] entity. |
Patrick Hiesel | fda9645 | 2017-06-14 16:44:54 +0200 | [diff] [blame] | 7579 | |============================= |
| 7580 | |
Changcheng Xiao | 6d4ee64 | 2018-04-25 11:43:19 +0200 | [diff] [blame] | 7581 | [[delete-change-message-input]] |
| 7582 | === DeleteChangeMessageInput |
| 7583 | The `DeleteChangeMessageInput` entity contains the options for deleting a change message. |
| 7584 | |
| 7585 | [options="header",cols="1,^1,5"] |
| 7586 | |============================= |
| 7587 | |Field Name ||Description |
| 7588 | |`reason` |optional| |
| 7589 | The reason why the change message should be deleted. + |
| 7590 | If set, the change message will be replaced with |
| 7591 | "Change message removed by: `name`\nReason: `reason`", |
| 7592 | or just "Change message removed by: `name`." if not set. |
| 7593 | |============================= |
| 7594 | |
Changcheng Xiao | e5b14ce | 2017-02-10 09:39:48 +0100 | [diff] [blame] | 7595 | [[delete-comment-input]] |
| 7596 | === DeleteCommentInput |
| 7597 | The `DeleteCommentInput` entity contains the option for deleting a comment. |
| 7598 | |
| 7599 | [options="header",cols="1,^1,5"] |
| 7600 | |============================= |
| 7601 | |Field Name ||Description |
| 7602 | |`reason` |optional| |
| 7603 | The reason why the comment should be deleted. + |
| 7604 | If set, the comment's message will be replaced with |
| 7605 | "Comment removed by: `name`; Reason: `reason`", |
| 7606 | or just "Comment removed by: `name`." if not set. |
| 7607 | |============================= |
| 7608 | |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 7609 | [[delete-reviewer-input]] |
| 7610 | === DeleteReviewerInput |
| 7611 | The `DeleteReviewerInput` entity contains options for the deletion of a |
| 7612 | reviewer. |
| 7613 | |
| 7614 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7615 | |============================= |
| 7616 | |Field Name ||Description |
| 7617 | |`notify` |optional| |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 7618 | Notify handling that defines to whom email notifications should be sent |
| 7619 | after the reviewer is deleted. + |
| 7620 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7621 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7622 | |`notify_details`|optional| |
| 7623 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7624 | of link:user-notify.html#recipient-types[recipient type] to |
| 7625 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7626 | |============================= |
Edwin Kempin | 407fca3 | 2016-08-29 12:01:00 +0200 | [diff] [blame] | 7627 | |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7628 | [[delete-vote-input]] |
| 7629 | === DeleteVoteInput |
| 7630 | The `DeleteVoteInput` entity contains options for the deletion of a |
| 7631 | vote. |
| 7632 | |
| 7633 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7634 | |============================= |
| 7635 | |Field Name ||Description |
| 7636 | |`label` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7637 | The label for which the vote should be deleted. + |
| 7638 | If set, must match the label in the URL. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7639 | |`notify` |optional| |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7640 | Notify handling that defines to whom email notifications should be sent |
| 7641 | after the vote is deleted. + |
| 7642 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 7643 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7644 | |`notify_details`|optional| |
| 7645 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 7646 | of link:user-notify.html#recipient-types[recipient type] to |
| 7647 | link:#notify-info[NotifyInfo] entity. |
Gal Paikin | bd7575d | 2021-11-11 14:42:53 +0100 | [diff] [blame] | 7648 | |`ignore_automatic_attention_set_rules`|optional| |
| 7649 | If set to true, ignore all automatic attention set rules described in the |
| 7650 | link:#attention-set[attention set]. When not set, the default is false. |
Patrick Hiesel | 8c5568a | 2022-05-31 08:33:52 +0200 | [diff] [blame] | 7651 | |`reason` |optional| |
| 7652 | The reason why this vote is deleted. Will + |
| 7653 | go into the change message. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 7654 | |============================= |
Edwin Kempin | 1dfecb6 | 2016-06-16 10:45:00 +0200 | [diff] [blame] | 7655 | |
Kasper Nilsson | 9f2ed6a | 2016-11-15 11:12:37 -0800 | [diff] [blame] | 7656 | [[description-input]] |
| 7657 | === DescriptionInput |
| 7658 | The `DescriptionInput` entity contains information for setting a description. |
| 7659 | |
| 7660 | [options="header",cols="1,6"] |
| 7661 | |=========================== |
| 7662 | |Field Name |Description |
| 7663 | |`description` |The description text. |
| 7664 | |=========================== |
| 7665 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7666 | [[diff-content]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7667 | === DiffContent |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7668 | The `DiffContent` entity contains information about the content differences |
| 7669 | in a file. |
| 7670 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7671 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7672 | |========================== |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7673 | |Field Name ||Description |
| 7674 | |`a` |optional|Content only in the file on side A (deleted in B). |
| 7675 | |`b` |optional|Content only in the file on side B (added in B). |
| 7676 | |`ab` |optional|Content in the file on both sides (unchanged). |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 7677 | |`edit_a` |only present when the `intraline` parameter is set and the |
| 7678 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7679 | Text sections deleted from side A as a |
| 7680 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 7681 | |`edit_b` |only present when the `intraline` parameter is set and the |
| 7682 | DiffContent is a replace, i.e. both `a` and `b` are present| |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7683 | Text sections inserted in side B as a |
| 7684 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7685 | |`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a |
| 7686 | rebase. |
Renan Oliveira | c5077aa | 2020-09-25 18:11:54 +0200 | [diff] [blame] | 7687 | |`due_to_move`|not set if `false`|Indicates whether this entry was introduced by a |
| 7688 | move operation. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7689 | |`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] | 7690 | too large to include all common lines. |
Alice Kober-Sotzek | 2f62486 | 2017-05-04 09:59:28 +0200 | [diff] [blame] | 7691 | |`common` |optional|Set to `true` if the region is common according |
Shawn Pearce | 425a2be | 2014-01-02 16:00:58 -0800 | [diff] [blame] | 7692 | to the requested ignore-whitespace parameter, but a and b contain |
| 7693 | differing amounts of whitespace. When present and true a and b are |
| 7694 | used instead of ab. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7695 | |========================== |
| 7696 | |
| 7697 | [[diff-file-meta-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7698 | === DiffFileMetaInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7699 | The `DiffFileMetaInfo` entity contains meta information about a file diff. |
| 7700 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7701 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7702 | |========================== |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 7703 | |Field Name ||Description |
| 7704 | |`name` ||The name of the file. |
Youssef Elghareeb | 20a91dd | 2022-02-03 13:46:44 +0100 | [diff] [blame] | 7705 | |`content_type`||The content type of the file. For the commit message and merge |
| 7706 | list the value is `text/x-gerrit-commit-message` and `text/x-gerrit-merge-list` |
| 7707 | respectively. For git links the value is `x-git/gitlink`. For symlinks the value |
| 7708 | is `x-git/symlink`. For regular files the value is the file mime type (e.g. |
| 7709 | `text/x-java`, `text/x-c++src`, etc...). |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 7710 | |`lines` ||The total number of lines in the file. |
Edwin Kempin | 26c95a4 | 2014-11-25 16:29:47 +0100 | [diff] [blame] | 7711 | |`web_links` |optional| |
Sven Selberg | e7f3f0a | 2014-10-21 11:04:42 +0200 | [diff] [blame] | 7712 | Links to the file in external sites as a list of |
Shawn Pearce | b62414c | 2014-10-16 22:48:33 -0700 | [diff] [blame] | 7713 | link:rest-api-changes.html#web-link-info[WebLinkInfo] entries. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7714 | |========================== |
| 7715 | |
| 7716 | [[diff-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7717 | === DiffInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7718 | The `DiffInfo` entity contains information about the diff of a file |
| 7719 | in a revision. |
| 7720 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7721 | If the link:#weblinks-only[weblinks-only] parameter is specified, only |
| 7722 | the `web_links` field is set. |
| 7723 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7724 | [options="header",cols="1,^1,5"] |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7725 | |========================== |
| 7726 | |Field Name ||Description |
| 7727 | |`meta_a` |not present when the file is added| |
| 7728 | Meta information about the file on side A as a |
| 7729 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 7730 | |`meta_b` |not present when the file is deleted| |
| 7731 | Meta information about the file on side B as a |
| 7732 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 7733 | |`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED` |
| 7734 | `COPIED`, `REWRITE`). |
| 7735 | |`intraline_status`|only set when the `intraline` parameter was specified in the request| |
| 7736 | Intraline status (`OK`, `ERROR`, `TIMEOUT`). |
| 7737 | |`diff_header` ||A list of strings representing the patch set diff header. |
| 7738 | |`content` ||The content differences in the file as a list of |
| 7739 | link:#diff-content[DiffContent] entities. |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7740 | |`web_links` |optional| |
| 7741 | Links to the file diff in external sites as a list of |
| 7742 | link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries. |
Frank Borden | 1952492 | 2021-05-04 11:40:44 +0200 | [diff] [blame] | 7743 | |`edit_web_links` |optional| |
| 7744 | Links to edit the file in external sites as a list of |
| 7745 | link:rest-api-changes.html#web-link-info[WebLinkInfo] entries. |
David Ostrovsky | cdbef23 | 2015-02-13 01:16:37 +0100 | [diff] [blame] | 7746 | |`binary` |not set if `false`|Whether the file is binary. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7747 | |========================== |
| 7748 | |
| 7749 | [[diff-intraline-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7750 | === DiffIntralineInfo |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7751 | The `DiffIntralineInfo` entity contains information about intraline edits in a |
| 7752 | file. |
| 7753 | |
Ole Rehmsen | 2374b6b | 2019-07-02 16:06:22 +0200 | [diff] [blame] | 7754 | 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] | 7755 | 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] | 7756 | 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] | 7757 | 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] | 7758 | diff content lines. If the list is empty, the entire DiffContent should be considered |
| 7759 | as unedited. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 7760 | |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 7761 | 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] | 7762 | 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] | 7763 | |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7764 | [[diff-web-link-info]] |
| 7765 | === DiffWebLinkInfo |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 7766 | The `DiffWebLinkInfo` entity extends link:#web-link-info[WebLinkInfo] and |
| 7767 | describes a link on a diff screen to an external site. |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7768 | |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 7769 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7770 | |======================= |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 7771 | |Field Name||Description |
| 7772 | |`name` ||See link:#web-link-info[WebLinkInfo] |
| 7773 | |`tooltip` |optional|See link:#web-link-info[WebLinkInfo] |
| 7774 | |`url` ||See link:#web-link-info[WebLinkInfo] |
| 7775 | |`image_url`|optional|See link:#web-link-info[WebLinkInfo] |
| 7776 | |show_on_side_by_side_diff_view|| |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7777 | 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] | 7778 | |show_on_unified_diff_view|| |
Edwin Kempin | 8cdce50 | 2014-12-06 10:55:38 +0100 | [diff] [blame] | 7779 | Whether the web link should be shown on the unified diff screen. |
| 7780 | |======================= |
| 7781 | |
Sharad Bagri | bdb582d | 2022-03-26 01:32:35 -0700 | [diff] [blame] | 7782 | [[apply-provided-fix-input]] |
| 7783 | === ApplyProvidedFixInput |
| 7784 | The `ApplyProvidedFixInput` entity contains the fixes to be applied on a review. |
| 7785 | |
Chris Poucet | f5e6829 | 2023-04-03 16:21:39 +0200 | [diff] [blame] | 7786 | [[custom-keyed-values-input]] |
| 7787 | === CustomKeyedValuesInput |
| 7788 | |
| 7789 | The `CustomKeyedValuesInput` entity contains information about custom keyed values |
| 7790 | to add to, and/or remove from, a change. |
| 7791 | |
| 7792 | [options="header",cols="1,^1,5"] |
| 7793 | |======================= |
| 7794 | |Field Name||Description |
| 7795 | |`add` |optional|The map of custom keyed values to be added to the change. |
| 7796 | |`remove` |optional|The list of custom keys to be removed from the change. |
| 7797 | |======================= |
| 7798 | |
Sharad Bagri | bdb582d | 2022-03-26 01:32:35 -0700 | [diff] [blame] | 7799 | [options="header",cols="1,6"] |
| 7800 | |======================= |
| 7801 | |Field Name |Description |
| 7802 | |`fix_replacement_infos` |A list of <<fix-replacement-info,FixReplacementInfo>>. |
| 7803 | |======================= |
| 7804 | |
David Ostrovsky | 9ea9c11 | 2015-01-25 00:12:38 +0100 | [diff] [blame] | 7805 | [[edit-file-info]] |
| 7806 | === EditFileInfo |
| 7807 | The `EditFileInfo` entity contains additional information |
| 7808 | of a file within a change edit. |
| 7809 | |
| 7810 | [options="header",cols="1,^1,5"] |
| 7811 | |=========================== |
| 7812 | |Field Name ||Description |
| 7813 | |`web_links` |optional| |
| 7814 | Links to the diff info in external sites as a list of |
| 7815 | link:#web-link-info[WebLinkInfo] entities. |
| 7816 | |=========================== |
| 7817 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7818 | [[edit-info]] |
| 7819 | === EditInfo |
| 7820 | The `EditInfo` entity contains information about a change edit. |
| 7821 | |
| 7822 | [options="header",cols="1,^1,5"] |
| 7823 | |=========================== |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7824 | |Field Name ||Description |
| 7825 | |`commit` ||The commit of change edit as |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7826 | link:#commit-info[CommitInfo] entity. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7827 | |`base_patch_set_number`||The patch set number of the patch set the change edit is based on. |
| 7828 | |`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] | 7829 | |`ref` ||The ref of the change edit. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7830 | |`fetch` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7831 | Information about how to fetch this patch set. The fetch information is |
| 7832 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 7833 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
David Pursehouse | 5934d3f | 2019-01-07 15:23:49 +0900 | [diff] [blame] | 7834 | |`files` |optional| |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7835 | The files of the change edit as a map that maps the file names to |
| 7836 | link:#file-info[FileInfo] entities. |
| 7837 | |=========================== |
| 7838 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7839 | [[fetch-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7840 | === FetchInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7841 | The `FetchInfo` entity contains information about how to fetch a patch |
| 7842 | set via a certain protocol. |
| 7843 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7844 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7845 | |========================== |
Edwin Kempin | ea62148 | 2013-10-16 12:58:24 +0200 | [diff] [blame] | 7846 | |Field Name ||Description |
| 7847 | |`url` ||The URL of the project. |
| 7848 | |`ref` ||The ref of the patch set. |
| 7849 | |`commands` |optional| |
| 7850 | The download commands for this patch set as a map that maps the command |
| 7851 | names to the commands. + |
David Pursehouse | 025c1af | 2015-11-20 17:02:50 +0900 | [diff] [blame] | 7852 | Only set if link:#download-commands[download commands] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7853 | |========================== |
| 7854 | |
| 7855 | [[file-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7856 | === FileInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7857 | The `FileInfo` entity contains information about a file in a patch set. |
| 7858 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7859 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7860 | |============================= |
| 7861 | |Field Name ||Description |
| 7862 | |`status` |optional| |
| 7863 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 7864 | "`C`"=Copied, "`W`"=Rewritten). + |
| 7865 | Not set if the file was Modified ("`M`"). |
| 7866 | |`binary` |not set if `false`|Whether the file is binary. |
| 7867 | |`old_path` |optional| |
| 7868 | The old file path. + |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 7869 | Only set if the file was renamed or copied. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7870 | |`lines_inserted`|optional| |
| 7871 | Number of inserted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 7872 | Not set for binary files or if no lines were inserted. + |
| 7873 | 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] | 7874 | differ by one from details provided in <<diff-info,DiffInfo>>. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7875 | |`lines_deleted` |optional| |
| 7876 | Number of deleted lines. + |
Alice Kober-Sotzek | 7eff37c | 2018-07-05 15:58:50 +0200 | [diff] [blame] | 7877 | Not set for binary files or if no lines were deleted. + |
| 7878 | 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] | 7879 | differ by one from details provided in <<diff-info,DiffInfo>>. |
Edwin Kempin | 640f984 | 2015-10-08 15:53:20 +0200 | [diff] [blame] | 7880 | |`size_delta` || |
| 7881 | Number of bytes by which the file size increased/decreased. |
Youssef Elghareeb | 1ae12c0 | 2022-06-28 13:49:18 +0200 | [diff] [blame] | 7882 | |`size` || File size in bytes. |
| 7883 | |`old_mode` |optional|File mode in octal (e.g. 100644) at the old commit. |
| 7884 | The first three digits indicate the file type and the last three digits contain |
| 7885 | the file permission bits. For added files, this field will not be present. |
| 7886 | |`new_mode` |optional|File mode in octal (e.g. 100644) at the new commit. |
| 7887 | The first three digits indicate the file type and the last three digits contain |
| 7888 | 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] | 7889 | |============================= |
| 7890 | |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 7891 | [[fix-input]] |
| 7892 | === FixInput |
| 7893 | The `FixInput` entity contains options for fixing commits using the |
| 7894 | link:#fix-change[fix change] endpoint. |
| 7895 | |
| 7896 | [options="header",cols="1,6"] |
| 7897 | |========================== |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 7898 | |Field Name |Description |
| 7899 | |`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] | 7900 | database if they refer to missing commit options. |
Dave Borowitz | b50a7ed | 2015-07-27 15:10:36 -0700 | [diff] [blame] | 7901 | |`expect_merged_as` |If set, check that the change is |
Dave Borowitz | a828fed | 2015-05-05 14:43:40 -0700 | [diff] [blame] | 7902 | merged into the destination branch as this exact SHA-1. If not, insert |
| 7903 | a new patch set referring to this commit. |
Dave Borowitz | bad53ee | 2015-06-11 10:10:18 -0400 | [diff] [blame] | 7904 | |========================== |
| 7905 | |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7906 | [[fix-suggestion-info]] |
| 7907 | === FixSuggestionInfo |
| 7908 | The `FixSuggestionInfo` entity represents a suggested fix. |
| 7909 | |
| 7910 | [options="header",cols="1,^1,5"] |
| 7911 | |========================== |
| 7912 | |Field Name ||Description |
| 7913 | |`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested |
| 7914 | fix. It will be generated automatically and hence will be ignored if it's set |
| 7915 | for input objects. |
| 7916 | |`description` ||A description of the suggested fix. |
| 7917 | |`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>> |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 7918 | entities indicating how the content of one or several files should be modified. |
| 7919 | Within a file, they should refer to non-overlapping regions. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7920 | |========================== |
| 7921 | |
| 7922 | [[fix-replacement-info]] |
| 7923 | === FixReplacementInfo |
Alice Kober-Sotzek | 110f60f | 2016-12-19 14:53:40 +0100 | [diff] [blame] | 7924 | The `FixReplacementInfo` entity describes how the content of a file should be |
| 7925 | replaced by another content. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7926 | |
| 7927 | [options="header",cols="1,6"] |
| 7928 | |========================== |
| 7929 | |Field Name |Description |
Alice Kober-Sotzek | 791f4af | 2017-03-16 18:02:15 +0100 | [diff] [blame] | 7930 | |`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] | 7931 | the repository may be modified. The commit message can be modified via the |
| 7932 | magic file `/COMMIT_MSG` though only the part below the generated header of |
| 7933 | that magic file can be modified. References to the header lines will result in |
| 7934 | errors when the fix is applied. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7935 | |`range` |A <<comment-range,CommentRange>> indicating which content |
Alice Kober-Sotzek | 30d6c7d | 2017-03-09 13:51:02 +0100 | [diff] [blame] | 7936 | 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] | 7937 | by the line feed character. |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 7938 | |`replacement` |The content which should be used instead of the current one. |
| 7939 | |========================== |
| 7940 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7941 | [[git-person-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 7942 | === GitPersonInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7943 | The `GitPersonInfo` entity contains information about the |
| 7944 | author/committer of a commit. |
| 7945 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 7946 | [options="header",cols="1,6"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7947 | |========================== |
| 7948 | |Field Name |Description |
| 7949 | |`name` |The name of the author/committer. |
| 7950 | |`email` |The email address of the author/committer. |
| 7951 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 7952 | this identity was constructed. |
| 7953 | |`tz` |The timezone offset from UTC of when this identity was |
| 7954 | constructed. |
| 7955 | |========================== |
| 7956 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7957 | [[group-base-info]] |
| 7958 | === GroupBaseInfo |
| 7959 | The `GroupBaseInfo` entity contains base information about the group. |
| 7960 | |
| 7961 | [options="header",cols="1,6"] |
| 7962 | |========================== |
| 7963 | |Field Name |Description |
Edwin Kempin | 703613c | 2016-11-25 16:06:04 +0100 | [diff] [blame] | 7964 | |`id` |The UUID of the group. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7965 | |`name` |The name of the group. |
| 7966 | |========================== |
| 7967 | |
David Pursehouse | d9dac37 | 2016-11-24 19:41:10 +0900 | [diff] [blame] | 7968 | [[hashtags-input]] |
| 7969 | === HashtagsInput |
| 7970 | |
| 7971 | The `HashtagsInput` entity contains information about hashtags to add to, |
| 7972 | and/or remove from, a change. |
| 7973 | |
| 7974 | [options="header",cols="1,^1,5"] |
| 7975 | |======================= |
| 7976 | |Field Name||Description |
| 7977 | |`add` |optional|The list of hashtags to be added to the change. |
Mike Frysinger | 136ecbd | 2021-02-09 14:26:02 -0500 | [diff] [blame] | 7978 | |`remove` |optional|The list of hashtags to be removed from the change. |
David Pursehouse | d9dac37 | 2016-11-24 19:41:10 +0900 | [diff] [blame] | 7979 | |======================= |
| 7980 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7981 | [[included-in-info]] |
| 7982 | === IncludedInInfo |
| 7983 | The `IncludedInInfo` entity contains information about the branches a |
Xinan Lin | dc40ff1 | 2021-07-26 23:26:28 -0700 | [diff] [blame] | 7984 | change was merged into and tags it was tagged with. The branch or tag |
| 7985 | must have 'refs/head/' or 'refs/tags/' prefix respectively. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7986 | |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 7987 | [options="header",cols="1,^1,5"] |
| 7988 | |======================= |
| 7989 | |Field Name||Description |
| 7990 | |`branches`||The list of branches this change was merged into. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7991 | Each branch is listed without the 'refs/head/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 7992 | |`tags` ||The list of tags this change was tagged with. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7993 | Each tag is listed without the 'refs/tags/' prefix. |
Edwin Kempin | 78279ba | 2015-05-22 15:22:41 +0200 | [diff] [blame] | 7994 | |`external`|optional|A map that maps a name to a list of external |
| 7995 | systems that include this change, e.g. a list of servers on which this |
| 7996 | change is deployed. |
| 7997 | |======================= |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 7998 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 7999 | [[label-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8000 | === LabelInfo |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8001 | The `LabelInfo` entity contains information about a label on a change, always |
| 8002 | corresponding to the current patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8003 | |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8004 | There are two options that control the contents of `LabelInfo`: |
Dave Borowitz | 7d6aa01 | 2013-06-14 16:53:48 -0700 | [diff] [blame] | 8005 | link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`]. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8006 | |
Youssef Elghareeb | 9b3e021 | 2022-01-21 14:40:18 +0100 | [diff] [blame] | 8007 | * Using `LABELS` will skip the `all.permitted_voting_range` attribute. |
| 8008 | * Using `DETAILED_LABELS` will include the `all.permitted_voting_range` |
| 8009 | attribute. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8010 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8011 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8012 | |=========================== |
| 8013 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8014 | |`optional` |not set if `false`| |
| 8015 | Whether the label is optional. Optional means the label may be set, but |
| 8016 | it's neither necessary for submission nor does it block submission if |
| 8017 | set. |
Youssef Elghareeb | 261691a | 2021-11-17 13:01:08 +0100 | [diff] [blame] | 8018 | |`description` |optional| The description of the label. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8019 | |`approved` |optional|One user who approved this label on the change |
| 8020 | (voted the maximum value) as an |
| 8021 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 8022 | |`rejected` |optional|One user who rejected this label on the change |
| 8023 | (voted the minimum value) as an |
| 8024 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 8025 | |`recommended` |optional|One user who recommended this label on the |
| 8026 | change (voted positively, but not the maximum value) as an |
| 8027 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 8028 | |`disliked` |optional|One user who disliked this label on the change |
| 8029 | (voted negatively, but not the minimum value) as an |
| 8030 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
David Ostrovsky | 5292fd7 | 2014-02-27 21:56:35 +0100 | [diff] [blame] | 8031 | |`blocking` |optional|If `true`, the label blocks submit operation. |
| 8032 | If not set, the default is false. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8033 | |`value` |optional|The voting value of the user who |
| 8034 | recommended/disliked this label on the change if it is not |
| 8035 | "`+1`"/"`-1`". |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 8036 | |`default_value`|optional|The default voting value for the label. |
| 8037 | This value may be outside the range specified in permitted_labels. |
Youssef Elghareeb | 9b3e021 | 2022-01-21 14:40:18 +0100 | [diff] [blame] | 8038 | |votes|optional|A list of integers containing the vote values applied to this |
| 8039 | label at the latest patchset. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8040 | |`all` |optional|List of all approvals for this label as a list |
Aaron Gable | ea8a211 | 2017-04-25 14:18:16 -0700 | [diff] [blame] | 8041 | of link:#approval-info[ApprovalInfo] entities. Items in this list may |
| 8042 | 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] | 8043 | a corresponding ApprovalInfo will appear in this list for all labels. + |
| 8044 | The `permitted_voting_range` attribute is only set if the `DETAILED_LABELS` |
| 8045 | option is requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8046 | |`values` |optional|A map of all values that are allowed for this |
| 8047 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8048 | to the value descriptions. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8049 | |=========================== |
| 8050 | |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8051 | [[mergeable-info]] |
| 8052 | === MergeableInfo |
| 8053 | The `MergeableInfo` entity contains information about the mergeability of a |
| 8054 | change. |
| 8055 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8056 | [options="header",cols="1,^1,5"] |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8057 | |============================ |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 8058 | |Field Name ||Description |
| 8059 | |`submit_type` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8060 | Submit type used for this change, can be `MERGE_IF_NECESSARY`, |
Gert van Dijk | a4e49d0 | 2017-08-27 22:50:40 +0200 | [diff] [blame] | 8061 | `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8062 | `CHERRY_PICK`. |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 8063 | |`strategy` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8064 | The strategy of the merge, can be `recursive`, `resolve`, |
| 8065 | `simple-two-way-in-core`, `ours` or `theirs`. |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 8066 | |`mergeable` || |
Saša Živkov | 499873f | 2014-05-05 13:34:18 +0200 | [diff] [blame] | 8067 | `true` if this change is cleanly mergeable, `false` otherwise |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 8068 | |`commit_merged` |optional| |
Zhen Chen | 8f00d55 | 2016-07-26 16:54:59 -0700 | [diff] [blame] | 8069 | `true` if this change is already merged, `false` otherwise |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 8070 | |`content_merged`|optional| |
Zhen Chen | 8f00d55 | 2016-07-26 16:54:59 -0700 | [diff] [blame] | 8071 | `true` if the content of this change is already merged, `false` otherwise |
Edwin Kempin | fad66bc | 2020-01-29 10:26:00 +0100 | [diff] [blame] | 8072 | |`conflicts` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8073 | A list of paths with conflicts |
Saša Živkov | 697cab2 | 2014-04-29 16:46:50 +0200 | [diff] [blame] | 8074 | |`mergeable_into`|optional| |
| 8075 | 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] | 8076 | |============================ |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 8077 | |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8078 | [[merge-input]] |
| 8079 | === MergeInput |
| 8080 | The `MergeInput` entity contains information about the merge |
| 8081 | |
| 8082 | [options="header",cols="1,^1,5"] |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 8083 | |============================== |
| 8084 | |Field Name ||Description |
| 8085 | |`source` || |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8086 | 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] | 8087 | a complete reference name, a short reference name under `refs/heads`, `refs/tags`, |
| 8088 | or `refs/remotes` namespace, etc. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 8089 | |`source_branch` |optional| |
Han-Wen Nienhuys | 9ec1f6a | 2020-01-07 17:32:08 +0100 | [diff] [blame] | 8090 | A branch from which `source` is reachable. If specified, |
| 8091 | `source` is checked for visibility and reachability against only this |
| 8092 | branch. This speeds up the operation, especially for large repos with |
| 8093 | many branches. |
Edwin Kempin | aab27d3 | 2020-01-29 13:17:04 +0100 | [diff] [blame] | 8094 | |`strategy` |optional| |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8095 | The strategy of the merge, can be `recursive`, `resolve`, |
| 8096 | `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] | 8097 | |`allow_conflicts`|optional, defaults to false| |
| 8098 | If `true`, creating the merge succeeds also if there are conflicts. + |
| 8099 | If there are conflicts the file contents of the created change contain |
| 8100 | git conflict markers to indicate the conflicts. + |
| 8101 | Callers can find out whether there were conflicts by checking the |
| 8102 | `contains_git_conflicts` field in the link:#change-info[ChangeInfo]. + |
| 8103 | If there are conflicts the change is marked as work-in-progress. + |
| 8104 | This option is not supported for all merge strategies (e.g. it's |
| 8105 | supported for `recursive` and `resolve`, but not for |
| 8106 | `simple-two-way-in-core`). |
| 8107 | |============================== |
Zhen Chen | f7d85ea | 2016-05-02 15:14:43 -0700 | [diff] [blame] | 8108 | |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 8109 | [[merge-patch-set-input]] |
| 8110 | === MergePatchSetInput |
| 8111 | The `MergePatchSetInput` entity contains information about updating a new |
| 8112 | change by creating a new merge commit. |
| 8113 | |
| 8114 | [options="header",cols="1,^1,5"] |
| 8115 | |================================== |
| 8116 | |Field Name ||Description |
| 8117 | |`subject` |optional| |
| 8118 | The new subject for the change, if not specified, will reuse the current patch |
| 8119 | set's subject |
Han-Wen Nienhuys | bd2af0c | 2020-01-09 16:39:26 +0100 | [diff] [blame] | 8120 | |`inherit_parent` |optional, default to `false`| |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 8121 | 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] | 8122 | |`base_change` |optional| |
Han-Wen Nienhuys | 69917fe | 2020-01-09 16:39:26 +0100 | [diff] [blame] | 8123 | 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] | 8124 | is `false`, the merge tip will be the current patch set of the `base_change` if |
| 8125 | 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] | 8126 | |`merge` || |
| 8127 | The detail of the source commit for merge as a link:#merge-input[MergeInput] |
| 8128 | entity. |
Patrick Hiesel | e8fc797 | 2020-10-06 13:22:07 +0200 | [diff] [blame] | 8129 | |`author` |optional| |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 8130 | The author of the commit to create. Must be an |
| 8131 | link:rest-api-accounts.html#account-input[AccountInput] entity with at least |
| 8132 | the `name` and `email` fields set. |
Patrick Hiesel | e8fc797 | 2020-10-06 13:22:07 +0200 | [diff] [blame] | 8133 | The caller needs "Forge Author" permission when using this field. |
Nitzan Gur-Furman | bbfd309 | 2022-06-28 14:53:03 +0300 | [diff] [blame] | 8134 | 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] | 8135 | continue to use the identity of the caller. |
Zhen Chen | b1e07e5 | 2016-09-23 12:59:48 -0700 | [diff] [blame] | 8136 | |================================== |
| 8137 | |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 8138 | [[move-input]] |
| 8139 | === MoveInput |
| 8140 | The `MoveInput` entity contains information for moving a change to a new branch. |
| 8141 | |
| 8142 | [options="header",cols="1,^1,5"] |
| 8143 | |=========================== |
Michael Zhou | d03fe28 | 2016-04-25 17:13:17 -0400 | [diff] [blame] | 8144 | |Field Name ||Description |
| 8145 | |`destination_branch`||Destination branch |
| 8146 | |`message` |optional| |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 8147 | A message to be posted in this change's comments |
Marija Savtchouk | d89fefc | 2020-12-15 06:46:15 +0000 | [diff] [blame] | 8148 | |`keep_all_votes` |optional, defaults to false| |
Marija Savtchouk | cee6a8f | 2020-12-03 12:58:04 +0000 | [diff] [blame] | 8149 | By default, only veto votes that are blocking the change from submission are moved to |
| 8150 | the destination branch. Using this option is only allowed for administrators, |
| 8151 | because it can affect the submission behaviour of the change (depending on the label access |
| 8152 | configuration and submissions rules). |
Raviteja Sunkara | 791f339 | 2015-11-03 13:24:50 +0530 | [diff] [blame] | 8153 | |=========================== |
| 8154 | |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8155 | [[notify-info]] |
| 8156 | === NotifyInfo |
| 8157 | The `NotifyInfo` entity contains detailed information about who should |
| 8158 | be notified about an update. These notifications are sent out even if a |
| 8159 | `notify` option in the request input disables normal notifications. |
| 8160 | `NotifyInfo` entities are normally contained in a `notify_details` map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8161 | in the request input where the key is the |
| 8162 | link:user-notify.html#recipient-types[recipient type]. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8163 | |
| 8164 | [options="header",cols="1,^1,5"] |
| 8165 | |======================= |
| 8166 | |Field Name||Description |
| 8167 | |`accounts`|optional| |
| 8168 | A list of link:rest-api-accounts.html#account-id[account IDs] that |
| 8169 | identify the accounts that should be should be notified. |
| 8170 | |======================= |
| 8171 | |
Youssef Elghareeb | a112144 | 2023-06-14 14:53:59 +0200 | [diff] [blame] | 8172 | [[parent-info]] |
| 8173 | === ParentInfo |
| 8174 | The `ParentInfo` entity contains information about the parent commit of a |
| 8175 | patch-set. |
| 8176 | |
| 8177 | [options="header",cols="1,^1,5"] |
| 8178 | |======================= |
| 8179 | |Field Name||Description |
| 8180 | |`branch_name` |optional|Name of the target branch into which the parent commit |
| 8181 | is merged. |
| 8182 | |`commit_id` |optional|The commit SHA-1 of the parent commit, or null if the |
| 8183 | current commit is root. |
| 8184 | |`is_merged_in_target_branch` |optional, default to false| Set to true if the |
| 8185 | parent commit is merged into the target branch. |
| 8186 | |`change_id` |optional| If the parent commit is a patch-set of another gerrit |
| 8187 | change, this field will hold the change ID of the parent change. Otherwise, |
| 8188 | will be null. |
| 8189 | |`change_number` |optional|If the parent commit is a patch-set of another gerrit |
| 8190 | change, this field will hold the change number of the parent change. Otherwise, |
| 8191 | will be null. |
| 8192 | |`patch_set_number` |optional|If the parent commit is a patch-set of another gerrit |
| 8193 | change, this field will hold the patch-set number of the parent change. Otherwise, |
| 8194 | will be null. |
| 8195 | |`change_status` |optional|If the parent commit is a patch-set of another gerrit |
| 8196 | change, this field will hold the change status of the parent change. Otherwise, |
| 8197 | will be null. |
| 8198 | |======================= |
| 8199 | |
Edwin Kempin | 364a86b | 2017-04-27 12:34:00 +0200 | [diff] [blame] | 8200 | [[private-input]] |
| 8201 | === PrivateInput |
| 8202 | The `PrivateInput` entity contains information for changing the private |
| 8203 | flag on a change. |
| 8204 | |
| 8205 | [options="header",cols="1,^1,5"] |
| 8206 | |======================= |
| 8207 | |Field Name||Description |
| 8208 | |`message` |optional|Message describing why the private flag was changed. |
| 8209 | |======================= |
| 8210 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8211 | [[problem-info]] |
| 8212 | === ProblemInfo |
| 8213 | The `ProblemInfo` entity contains a description of a potential consistency problem |
| 8214 | with a change. These are not related to the code review process, but rather |
| 8215 | indicate some inconsistency in Gerrit's database or repository metadata related |
| 8216 | to the enclosing change. |
| 8217 | |
| 8218 | [options="header",cols="1,^1,5"] |
| 8219 | |=========================== |
| 8220 | |Field Name||Description |
| 8221 | |`message` ||Plaintext message describing the problem with the change. |
| 8222 | |`status` |optional| |
| 8223 | The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a |
| 8224 | fix was attempted. |
| 8225 | |`outcome` |optional| |
| 8226 | If `status` is set, an additional plaintext message describing the |
| 8227 | outcome of the fix. |
| 8228 | |=========================== |
| 8229 | |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 8230 | [[publish-change-edit-input]] |
| 8231 | === PublishChangeEditInput |
| 8232 | The `PublishChangeEditInput` entity contains options for the publishing of |
| 8233 | change edit. |
| 8234 | |
| 8235 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8236 | |============================= |
| 8237 | |Field Name ||Description |
| 8238 | |`notify` |optional| |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 8239 | Notify handling that defines to whom email notifications should be sent |
| 8240 | after the change edit is published. + |
| 8241 | Allowed values are `NONE` and `ALL`. + |
| 8242 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8243 | |`notify_details`|optional| |
| 8244 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8245 | of link:user-notify.html#recipient-types[recipient type] to |
| 8246 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8247 | |============================= |
Andrii Shyshkalov | 2fa8a06 | 2016-09-08 15:42:07 +0200 | [diff] [blame] | 8248 | |
Patrick Hiesel | bb84fd7 | 2017-08-23 11:11:22 +0200 | [diff] [blame] | 8249 | [[pure-revert-info]] |
| 8250 | === PureRevertInfo |
| 8251 | The `PureRevertInfo` entity describes the result of a pure revert check. |
| 8252 | |
| 8253 | [options="header",cols="1,6"] |
| 8254 | |====================== |
| 8255 | |Field Name |Description |
| 8256 | |`is_pure_revert` |Outcome of the check as boolean. |
| 8257 | |====================== |
| 8258 | |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 8259 | [[push-certificate-info]] |
| 8260 | === PushCertificateInfo |
| 8261 | The `PushCertificateInfo` entity contains information about a push |
| 8262 | certificate provided when the user pushed for review with `git push |
| 8263 | --signed HEAD:refs/for/<branch>`. Only used when signed push is |
| 8264 | link:config-gerrit.html#receive.enableSignedPush[enabled] on the server. |
| 8265 | |
| 8266 | [options="header",cols="1,6"] |
| 8267 | |=========================== |
| 8268 | |Field Name|Description |
| 8269 | |`certificate`|Signed certificate payload and GPG signature block. |
| 8270 | |`key` | |
| 8271 | Information about the key that signed the push, along with any problems |
| 8272 | found while checking the signature or the key itself, as a |
| 8273 | link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity. |
| 8274 | |=========================== |
| 8275 | |
Gabor Somossy | b72d4c6 | 2015-10-20 23:40:07 +0100 | [diff] [blame] | 8276 | [[range-info]] |
| 8277 | === RangeInfo |
| 8278 | The `RangeInfo` entity stores the coordinates of a range. |
| 8279 | |
| 8280 | [options="header",cols="1,6"] |
| 8281 | |=========================== |
| 8282 | |Field Name | Description |
| 8283 | |`start` | First index. |
| 8284 | |`end` | Last index. |
| 8285 | |=========================== |
| 8286 | |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 8287 | [[rebase-input]] |
| 8288 | === RebaseInput |
| 8289 | The `RebaseInput` entity contains information for changing parent when rebasing. |
| 8290 | |
Edwin Kempin | 2f47eb4 | 2022-02-10 12:48:45 +0100 | [diff] [blame] | 8291 | [options="header",cols="1,^1,5"] |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8292 | |==================================== |
| 8293 | |Field Name ||Description |
| 8294 | |`base` |optional| |
Han-Wen Nienhuys | 37a1cab | 2021-04-01 12:46:00 +0200 | [diff] [blame] | 8295 | 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] | 8296 | Alternatively, a change number can be specified, in which case the current |
| 8297 | patch set is inferred. + |
| 8298 | Empty string is used for rebasing directly on top of the target branch, |
| 8299 | which effectively breaks dependency towards a parent change. |
Michael Kelly | 6d5c9f6 | 2023-04-20 23:09:19 -0700 | [diff] [blame] | 8300 | |`strategy` |optional| |
| 8301 | The strategy of the merge, can be `recursive`, `resolve`, |
| 8302 | `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] | 8303 | |`allow_conflicts` |optional, defaults to false| |
Edwin Kempin | 9a6f054 | 2021-01-13 13:51:42 +0100 | [diff] [blame] | 8304 | If `true`, the rebase also succeeds if there are conflicts. + |
| 8305 | If there are conflicts the file contents of the rebased patch set contain |
| 8306 | git conflict markers to indicate the conflicts. + |
| 8307 | Callers can find out whether there were conflicts by checking the |
| 8308 | `contains_git_conflicts` field in the returned link:#change-info[ChangeInfo]. + |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8309 | If there are conflicts the change is marked as work-in-progress. + |
| 8310 | Cannot be combined with the `on_behalf_of_uploader` option. |
| 8311 | |`on_behalf_of_uploader`|optional, defaults to false| |
| 8312 | If `true`, the rebase is done on behalf of the uploader. + |
| 8313 | This means the uploader of the current patch set will also be the uploader of |
| 8314 | the rebased patch set. The calling user will be recorded as the real user. + |
| 8315 | Rebasing on behalf of the uploader is only supported for trivial rebases. |
| 8316 | This means this option cannot be combined with the `allow_conflicts` option. + |
| 8317 | 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] | 8318 | current patch set of a change. + |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8319 | If the caller is the uploader this flag is ignored and a normal rebase is done. |
| 8320 | |`validation_options` |optional| |
Edwin Kempin | e5ec921 | 2022-02-11 13:37:35 +0100 | [diff] [blame] | 8321 | Map with key-value pairs that are forwarded as options to the commit validation |
| 8322 | listeners (e.g. can be used to skip certain validations). Which validation |
| 8323 | options are supported depends on the installed commit validation listeners. |
| 8324 | Gerrit core doesn't support any validation options, but commit validation |
| 8325 | listeners that are implemented in plugins may. Please refer to the |
| 8326 | documentation of the installed plugins to learn whether they support validation |
| 8327 | options. Unknown validation options are silently ignored. |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8328 | |==================================== |
Zalan Blenessy | 874aed7 | 2015-01-12 13:26:18 +0100 | [diff] [blame] | 8329 | |
Nitzan Gur-Furman | 4655d8b | 2022-12-16 08:46:18 +0100 | [diff] [blame] | 8330 | [[rebase-chain-info]] |
| 8331 | === RebaseChainInfo |
| 8332 | |
| 8333 | The `RebaseChainInfo` entity contains information about a chain of changes |
| 8334 | that were rebased. |
| 8335 | |
| 8336 | [options="header",cols="1,^1,5"] |
| 8337 | |=========================== |
| 8338 | |Field Name ||Description |
| 8339 | |`rebased_changes` ||List of the unsubmitted ancestors, as link:#change-info[ChangeInfo] |
| 8340 | entities. Includes both rebased changes, and previously up-to-date ancestors. The list is ordered by |
| 8341 | ancestry, where the oldest ancestor is the first. |
| 8342 | |`contains_git_conflicts` ||Whether any of the rebased changes has conflicts |
| 8343 | due to rebasing. |
Nitzan Gur-Furman | ca0c55c | 2023-01-11 09:33:38 +0100 | [diff] [blame] | 8344 | |=========================== |
Nitzan Gur-Furman | 4655d8b | 2022-12-16 08:46:18 +0100 | [diff] [blame] | 8345 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8346 | [[related-change-and-commit-info]] |
| 8347 | === RelatedChangeAndCommitInfo |
| 8348 | |
| 8349 | The `RelatedChangeAndCommitInfo` entity contains information about |
| 8350 | a related change and commit. |
| 8351 | |
| 8352 | [options="header",cols="1,^1,5"] |
| 8353 | |=========================== |
| 8354 | |Field Name ||Description |
Patrick Hiesel | cab6351 | 2017-07-28 10:25:42 +0200 | [diff] [blame] | 8355 | |`project` ||The project of the change or commit. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8356 | |`change_id` |optional|The Change-Id of the change. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8357 | |`commit` ||The commit as a |
| 8358 | link:#commit-info[CommitInfo] entity. |
| 8359 | |`_change_number` |optional|The change number. |
| 8360 | |`_revision_number` |optional|The revision number. |
| 8361 | |`_current_revision_number`|optional|The current revision number. |
Stefan Beller | 3e8bd6e | 2015-06-17 09:46:36 -0700 | [diff] [blame] | 8362 | |`status` |optional|The status of the change. The status of |
David Ostrovsky | 6ffb7d9 | 2017-02-13 21:16:58 +0100 | [diff] [blame] | 8363 | the change is one of (`NEW`, `MERGED`, `ABANDONED`). |
Joerg Zieren | 75e9538 | 2022-07-08 11:30:35 +0200 | [diff] [blame] | 8364 | |`submittable` |optional|Boolean indicating whether the change is |
| 8365 | submittable. + |
| 8366 | Only populated if link:#get-related-changes-submittable[requested]. |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 8367 | |=========================== |
| 8368 | |
| 8369 | [[related-changes-info]] |
| 8370 | === RelatedChangesInfo |
| 8371 | The `RelatedChangesInfo` entity contains information about related |
| 8372 | changes. |
| 8373 | |
| 8374 | [options="header",cols="1,6"] |
| 8375 | |=========================== |
| 8376 | |Field Name |Description |
| 8377 | |`changes` |A list of |
| 8378 | link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities |
| 8379 | describing the related changes. Sorted by git commit order, newest to |
| 8380 | oldest. Empty if there are no related changes. |
| 8381 | |=========================== |
| 8382 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 8383 | |
| 8384 | [[requirement]] |
| 8385 | === Requirement |
| 8386 | The `Requirement` entity contains information about a requirement relative to a change. |
| 8387 | |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 8388 | [options="header",cols="1,^1,5"] |
| 8389 | |=========================== |
| 8390 | |Field Name | |Description |
| 8391 | |`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] | 8392 | |`fallback_text` | | A human readable reason |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 8393 | |`type` | | |
| 8394 | Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it |
| 8395 | was triggered. Can be seen as a class: requirements sharing the same type were created for a similar |
| 8396 | reason, and the data structure will follow one set of rules. |
Maxime Guerreiro | d32aedb | 2018-03-22 15:29:10 +0100 | [diff] [blame] | 8397 | |=========================== |
| 8398 | |
| 8399 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 8400 | [[restore-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8401 | === RestoreInput |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 8402 | The `RestoreInput` entity contains information for restoring a change. |
| 8403 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8404 | [options="header",cols="1,^1,5"] |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 8405 | |=========================== |
| 8406 | |Field Name ||Description |
| 8407 | |`message` |optional| |
| 8408 | Message to be added as review comment to the change when restoring the |
| 8409 | change. |
| 8410 | |=========================== |
| 8411 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 8412 | [[revert-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8413 | === RevertInput |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 8414 | The `RevertInput` entity contains information for reverting a change. |
| 8415 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8416 | [options="header",cols="1,^1,5"] |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8417 | |================================= |
| 8418 | |Field Name ||Description |
| 8419 | |`message` |optional| |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 8420 | Message to be added as review comment to the change when reverting the |
| 8421 | change. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8422 | |`notify` |optional| |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 8423 | Notify handling that defines to whom email notifications should be sent |
| 8424 | for reverting the change. + |
| 8425 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 8426 | If not set, the default is `ALL`. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8427 | |`notify_details` |optional| |
Edwin Kempin | 0d5be4f5 | 2018-03-14 16:54:24 +0100 | [diff] [blame] | 8428 | Additional information about whom to notify about the revert as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8429 | of link:user-notify.html#recipient-types[recipient type] to |
| 8430 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8431 | |`topic` |optional| |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 8432 | Name of the topic for the revert change. If not set, the default for Revert |
| 8433 | endpoint is the topic of the change being reverted, and the default for the |
| 8434 | RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`. |
Gal Paikin | 44dbd7e | 2020-04-15 15:23:44 +0200 | [diff] [blame] | 8435 | Topic can't contain quotation marks. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8436 | |`work_in_progress` |optional| |
Youssef Elghareeb | 8609544 | 2021-08-02 18:18:22 +0200 | [diff] [blame] | 8437 | 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] | 8438 | used if it's present, otherwise it will be overridden to `NONE`. + |
| 8439 | Notifications for the reverted change will only sent once the result change is |
| 8440 | no longer WIP. + |
Youssef Elghareeb | fd02dae | 2020-09-03 21:56:30 +0200 | [diff] [blame] | 8441 | If not set, the default is false. |
Edwin Kempin | c6dc7a0 | 2022-04-22 12:02:30 +0200 | [diff] [blame] | 8442 | |`validation_options`|optional| |
| 8443 | Map with key-value pairs that are forwarded as options to the commit validation |
| 8444 | listeners (e.g. can be used to skip certain validations). Which validation |
| 8445 | options are supported depends on the installed commit validation listeners. |
| 8446 | Gerrit core doesn't support any validation options, but commit validation |
| 8447 | listeners that are implemented in plugins may. Please refer to the |
| 8448 | documentation of the installed plugins to learn whether they support validation |
| 8449 | options. Unknown validation options are silently ignored. |
| 8450 | |================================= |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 8451 | |
| 8452 | [[revert-submission-info]] |
| 8453 | === RevertSubmissionInfo |
Gal Paikin | 64777c7 | 2019-12-18 14:11:13 +0100 | [diff] [blame] | 8454 | The `RevertSubmissionInfo` entity describes the revert changes. |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 8455 | |
| 8456 | [options="header",cols="1,6"] |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 8457 | |============================== |
Gal Paikin | b81f56c | 2019-10-16 14:39:24 +0200 | [diff] [blame] | 8458 | |Field Name | Description |
| 8459 | |`revert_changes` | |
Edwin Kempin | 6e7fb4e | 2019-10-24 17:20:51 +0200 | [diff] [blame] | 8460 | A list of link:#change-info[ChangeInfo] that describes the revert changes. Each |
| 8461 | entity in that list is a revert change that was created in that revert |
| 8462 | submission. |
Edwin Kempin | 45ec1bb | 2019-10-24 17:19:30 +0200 | [diff] [blame] | 8463 | |============================== |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 8464 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8465 | [[review-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8466 | === ReviewInfo |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8467 | The `ReviewInfo` entity contains information about a review. |
| 8468 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8469 | [options="header",cols="1,6"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8470 | |=========================== |
| 8471 | |Field Name |Description |
| 8472 | |`labels` | |
| 8473 | The labels of the review as a map that maps the label names to the |
| 8474 | voting values. |
| 8475 | |=========================== |
| 8476 | |
Viktar Donich | 316bf7a | 2016-07-06 11:29:01 -0700 | [diff] [blame] | 8477 | [[review-update-info]] |
| 8478 | === ReviewerUpdateInfo |
| 8479 | The `ReviewerUpdateInfo` entity contains information about updates to |
| 8480 | change's reviewers set. |
| 8481 | |
| 8482 | [options="header",cols="1,6"] |
| 8483 | |=========================== |
| 8484 | |Field Name |Description |
| 8485 | |`updated`| |
| 8486 | Timestamp of the update. |
| 8487 | |`updated_by`| |
| 8488 | The account which modified state of the reviewer in question as |
| 8489 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 8490 | |`reviewer`| |
| 8491 | The reviewer account added or removed from the change as an |
| 8492 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 8493 | |`state`| |
| 8494 | The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`. |
| 8495 | |=========================== |
| 8496 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8497 | [[review-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8498 | === ReviewInput |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8499 | The `ReviewInput` entity contains information for adding a review to a |
| 8500 | revision. |
| 8501 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8502 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8503 | |============================ |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8504 | |Field Name ||Description |
| 8505 | |`message` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8506 | The message to be added as review comment. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8507 | |`tag` |optional| |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 8508 | Apply this tag to the review comment message, votes, and inline |
Ben Rohlfs | d9be63f | 2021-02-04 09:01:46 +0100 | [diff] [blame] | 8509 | comments. Tags with an 'autogenerated:' prefix may be used by CI or other |
| 8510 | automated systems to distinguish them from human reviews. If another |
| 8511 | message was posted on a newer patchset, but with the same tag, then the older |
| 8512 | message will be hidden in the UI. Suffixes starting with `~` are not considered, |
| 8513 | so `autogenerated:my-ci-system~trigger` and `autogenerated:my-ci-system~result` |
| 8514 | 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] | 8515 | |`labels` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8516 | The votes that should be added to the revision as a map that maps the |
| 8517 | label names to the voting values. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8518 | |`comments` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8519 | The comments that should be added as a map that maps a file path to a |
| 8520 | list of link:#comment-input[CommentInput] entities. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8521 | |`robot_comments` |optional| |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8522 | The robot comments that should be added as a map that maps a file path |
| 8523 | to a list of link:#robot-comment-input[RobotCommentInput] entities. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8524 | |`drafts` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8525 | Draft handling that defines how draft comments are handled that are |
| 8526 | already in the database but that were not also described in this |
| 8527 | input. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 8528 | Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values |
| 8529 | except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. + |
Dave Borowitz | c064054 | 2016-10-05 16:19:21 -0400 | [diff] [blame] | 8530 | Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. + |
Dave Borowitz | 3b5fb81 | 2018-01-09 15:21:06 -0500 | [diff] [blame] | 8531 | If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value |
| 8532 | besides `KEEP` is allowed. |
Youssef Elghareeb | 3e4bf51 | 2021-05-12 18:40:27 +0200 | [diff] [blame] | 8533 | |`draft_ids_to_publish` |optional| |
| 8534 | List of draft IDs to be published. The draft IDs should belong to the current |
| 8535 | user and be valid. If `drafts` is set to `PUBLISH`, then draft IDs should |
| 8536 | contain drafts for the same revision that is requested for review. If `drafts` |
| 8537 | is set to `KEEP`, then `draft_ids_to_publish` will be ignored and no draft |
| 8538 | comments will be published. + |
| 8539 | 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] | 8540 | |`notify` |optional| |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8541 | Notify handling that defines to whom email notifications should be sent |
| 8542 | after the review is stored. + |
| 8543 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 8544 | If not set, the default is `ALL`. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8545 | |`notify_details` |optional| |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8546 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8547 | of link:user-notify.html#recipient-types[recipient type] to |
| 8548 | link:#notify-info[NotifyInfo] entity. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8549 | |`omit_duplicate_comments` |optional| |
Bill Wendling | 692b4ec | 2015-10-19 15:40:57 -0700 | [diff] [blame] | 8550 | 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] | 8551 | |`on_behalf_of` |optional| |
Shawn Pearce | 9d78312 | 2013-06-11 18:18:03 -0700 | [diff] [blame] | 8552 | link:rest-api-accounts.html#account-id[\{account-id\}] the review |
| 8553 | should be posted on behalf of. To use this option the caller must |
| 8554 | have been granted `labelAs-NAME` permission for all keys of labels. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8555 | |`reviewers` |optional| |
Patrick Hiesel | cf6d935 | 2017-04-13 10:15:42 +0200 | [diff] [blame] | 8556 | A list of link:rest-api-changes.html#reviewer-input[ReviewerInput] |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8557 | representing reviewers that should be added/removed to/from the change. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8558 | |`ready` |optional| |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 8559 | If true, and if the change is work in progress, then start review. |
| 8560 | 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] | 8561 | |`work_in_progress` |optional| |
Logan Hanks | 53c3601 | 2017-06-30 13:47:54 -0700 | [diff] [blame] | 8562 | If true, mark the change as work in progress. It is an error for both |
| 8563 | `ready` and `work_in_progress` to be true. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8564 | |`add_to_attention_set` |optional| |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 8565 | list of link:#attention-set-input[AttentionSetInput] entities to add |
Gal Paikin | e631de2 | 2020-10-29 12:19:11 +0100 | [diff] [blame] | 8566 | to the link:#attention-set[attention set]. Users that are not reviewers, |
| 8567 | ccs, owner, or uploader are silently ignored. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8568 | |`remove_from_attention_set` |optional| |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 8569 | list of link:#attention-set-input[AttentionSetInput] entities to remove |
| 8570 | from the link:#attention-set[attention set]. |
Gal Paikin | 3e984c2 | 2020-07-03 16:44:40 +0300 | [diff] [blame] | 8571 | |`ignore_automatic_attention_set_rules`|optional| |
| 8572 | If set to true, ignore all automatic attention set rules described in the |
Gal Paikin | c326de4 | 2020-06-16 18:49:00 +0300 | [diff] [blame] | 8573 | link:#attention-set[attention set]. Updates in add_to_attention_set |
| 8574 | and remove_from_attention_set are not ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 8575 | |============================ |
| 8576 | |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 8577 | [[review-result]] |
| 8578 | === ReviewResult |
| 8579 | The `ReviewResult` entity contains information regarding the updates |
| 8580 | that were made to a review. |
| 8581 | |
| 8582 | [options="header",cols="1,^1,5"] |
| 8583 | |============================ |
| 8584 | |Field Name ||Description |
| 8585 | |`labels` |optional| |
| 8586 | Map of labels to values after the review was posted. Null if any reviewer |
| 8587 | additions were rejected. |
| 8588 | |`reviewers` |optional| |
| 8589 | Map of account or group identifier to |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8590 | link:rest-api-changes.html#reviewer-result[ReviewerResult] |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8591 | representing the outcome of adding/removing a reviewer. |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 8592 | Absent if no reviewer additions were requested. |
Logan Hanks | e81ad8e | 2017-07-18 09:45:46 -0700 | [diff] [blame] | 8593 | |`ready` |optional| |
| 8594 | If true, the change was moved from WIP to ready for review as a result of this |
| 8595 | action. Not set if false. |
Edwin Kempin | ddcf6f9 | 2022-08-02 11:21:05 +0200 | [diff] [blame] | 8596 | |`error` |optional| |
| 8597 | Error message for non-200 responses. |
Aaron Gable | 843b0c1 | 2017-04-21 08:25:27 -0700 | [diff] [blame] | 8598 | |============================ |
| 8599 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8600 | [[reviewer-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8601 | === ReviewerInfo |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8602 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 8603 | votes on a change. |
| 8604 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 8605 | `ReviewerInfo` has the same fields as |
| 8606 | link:rest-api-accounts.html#account-info[AccountInfo] and includes |
| 8607 | link:#detailed-accounts[detailed account information]. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8608 | In addition `ReviewerInfo` has the following fields: |
| 8609 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8610 | [options="header",cols="1,6"] |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8611 | |========================== |
| 8612 | |Field Name |Description |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8613 | |`approvals` | |
| 8614 | 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] | 8615 | approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`"). |
Patrick Hiesel | 11873ef | 2017-03-17 17:36:05 +0100 | [diff] [blame] | 8616 | |`_account_id` | |
| 8617 | This field is inherited from `AccountInfo` but is optional here if an |
| 8618 | unregistered reviewer was added by email. See |
| 8619 | link:rest-api-changes.html#add-reviewer[add-reviewer] for details. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8620 | |========================== |
| 8621 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8622 | [[reviewer-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8623 | === ReviewerInput |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8624 | The `ReviewerInput` entity contains information for adding or removing |
| 8625 | reviewers to/from the change. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8626 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8627 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8628 | |============================= |
| 8629 | |Field Name ||Description |
| 8630 | |`reviewer` || |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8631 | 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] | 8632 | 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] | 8633 | 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] | 8634 | If an ID identifies both an account and a group, only the account is |
| 8635 | added as reviewer to the change. |
Han-Wen Nienhuys | e622905 | 2020-01-29 12:51:36 +0100 | [diff] [blame] | 8636 | External groups, such as LDAP groups, will be silently omitted from a |
| 8637 | link:#set-review[set-review] or |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8638 | link:rest-api-changes.html#add-reviewer[add-reviewer] call. A group can only be |
| 8639 | specified for adding reviewers, not for removing them. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8640 | |`state` |optional| |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8641 | Add reviewer in this state. Possible reviewer states are `REVIEWER`, |
| 8642 | `CC` and `REMOVED`. If not given, defaults to `REVIEWER`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8643 | |`confirmed` |optional| |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8644 | Whether adding the reviewer is confirmed. + |
| 8645 | The Gerrit server may be configured to |
| 8646 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 8647 | confirmation] when adding a group as reviewer that has many members. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8648 | |`notify` |optional| |
Sven Selberg | 4d64f97 | 2016-09-26 16:15:02 +0200 | [diff] [blame] | 8649 | Notify handling that defines to whom email notifications should be sent |
| 8650 | after the reviewer is added. + |
| 8651 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 8652 | If not set, the default is `ALL`. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8653 | |`notify_details`|optional| |
| 8654 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8655 | of link:user-notify.html#recipient-types[recipient type] to |
| 8656 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8657 | |============================= |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 8658 | |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8659 | [[reviewer-result]] |
| 8660 | === ReviewerResult |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8661 | The `ReviewerResult` entity describes the result of modifying reviewers of |
| 8662 | a change. |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8663 | |
| 8664 | [options="header",cols="1,^1,5"] |
| 8665 | |=========================== |
| 8666 | |Field Name ||Description |
| 8667 | |`input` || |
| 8668 | Value of the `reviewer` field from link:#reviewer-input[ReviewerInput] |
| 8669 | set while adding the reviewer. |
| 8670 | |`reviewers` |optional| |
| 8671 | The newly added reviewers as a list of link:#reviewer-info[ |
| 8672 | ReviewerInfo] entities. |
| 8673 | |`ccs` |optional| |
Gal Paikin | efb4ad5 | 2021-04-15 09:44:40 +0200 | [diff] [blame] | 8674 | The newly CCed accounts as a list of |
| 8675 | link:rest-api-accounts.html#account-info[AccountInfo] entities. This field will |
Gal Paikin | 0184a2b | 2021-04-15 08:58:34 +0200 | [diff] [blame] | 8676 | only appear if the requested `state` for the reviewer was `CC`. |
| 8677 | |`removed` |optional| |
| 8678 | The newly removed accounts as a list of |
| 8679 | link:rest-api-accounts.html#account-info[AccountInfo] entities. |
| 8680 | This field will only appear if the requested `state` for the reviewer was |
| 8681 | `REMOVED`. |
Gal Paikin | 721a40b | 2021-04-15 09:30:00 +0200 | [diff] [blame] | 8682 | |`error` |optional| |
| 8683 | Error message explaining why the reviewer could not be added. + |
| 8684 | If a group was specified in the input and an error is returned, it |
| 8685 | means that none of the members were added as reviewer. |
| 8686 | |`confirm` |`false` if not set| |
| 8687 | Whether adding the reviewer requires confirmation. |
| 8688 | |=========================== |
| 8689 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8690 | [[revision-info]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8691 | === RevisionInfo |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8692 | The `RevisionInfo` entity contains information about a patch set. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 8693 | Not all fields are returned by default. Additional fields can |
| 8694 | be obtained by adding `o` parameters as described in |
| 8695 | link:#list-changes[Query Changes]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8696 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8697 | [options="header",cols="1,^1,5"] |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8698 | |=========================== |
| 8699 | |Field Name ||Description |
David Pursehouse | 4de4111 | 2016-06-28 09:24:08 +0900 | [diff] [blame] | 8700 | |`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`, |
| 8701 | `MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`. |
Kasper Nilsson | be3616d | 2018-01-23 14:10:36 -0800 | [diff] [blame] | 8702 | |`_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] | 8703 | |`created` || |
| 8704 | The link:rest-api.html#timestamp[timestamp] of when the patch set was |
| 8705 | created. |
| 8706 | |`uploader` || |
| 8707 | The uploader of the patch set as an |
| 8708 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
Edwin Kempin | ccc9da0 | 2023-01-23 17:57:15 +0100 | [diff] [blame] | 8709 | |`real_uploader`|optional| |
| 8710 | The real uploader of the patch set as an |
| 8711 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 8712 | Only set if the upload was done on behalf of another user. |
Edwin Kempin | 4569ced | 2014-11-25 16:45:05 +0100 | [diff] [blame] | 8713 | |`ref` ||The Git reference for the patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8714 | |`fetch` || |
| 8715 | Information about how to fetch this patch set. The fetch information is |
| 8716 | provided as a map that maps the protocol name ("`git`", "`http`", |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 8717 | "`ssh`") to link:#fetch-info[FetchInfo] entities. This information is |
| 8718 | only included if a plugin implementing the |
| 8719 | link:intro-project-owner.html#download-commands[download commands] |
| 8720 | interface is installed. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 8721 | |`commit` |optional|The commit of the patch set as |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8722 | link:#commit-info[CommitInfo] entity. |
Youssef Elghareeb | a112144 | 2023-06-14 14:53:59 +0200 | [diff] [blame] | 8723 | |`parents_data` |optional| |
| 8724 | The parent commits of this patch-set commit as a list of |
| 8725 | link:#parent-info[ParentInfo] entities. In each parent, we include the target |
| 8726 | branch name if the parent is a merged commit in the target branch. Otherwise, |
| 8727 | we include the change and patch-set numbers of the parent change. + |
| 8728 | Only set if the `PARENTS` option is set. |
Youssef Elghareeb | 4c11544 | 2023-06-15 18:16:42 +0200 | [diff] [blame] | 8729 | |`branch` | optional|The name of the target branch that this revision is |
| 8730 | set to be merged into. + |
| 8731 | Note that if the change is moved with the link:#move-change[Move Change] |
| 8732 | endpoint, this field can be different for different patchsets. For example, |
| 8733 | if the change is moved and a new patchset is uploaded afterwards, the |
| 8734 | link:#revision-info[RevisionInfo] of the previous patchset will contain the old |
| 8735 | `branch`, but the newer patchset will contain the new `branch`. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 8736 | |`files` |optional| |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8737 | 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] | 8738 | link:#file-info[FileInfo] entities. Only set if |
| 8739 | link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES] |
| 8740 | option is requested. |
Shawn Pearce | 12e5159 | 2013-07-13 22:08:40 -0700 | [diff] [blame] | 8741 | |`actions` |optional| |
Shawn Pearce | dc4a9b2 | 2013-07-12 10:54:38 -0700 | [diff] [blame] | 8742 | Actions the caller might be able to perform on this revision. The |
| 8743 | information is a map of view name to link:#action-info[ActionInfo] |
| 8744 | entities. |
Khai Do | b3139b753 | 2014-09-19 15:13:04 -0700 | [diff] [blame] | 8745 | |`reviewed` |optional| |
| 8746 | Indicates whether the caller is authenticated and has commented on the |
| 8747 | current revision. Only set if link:#reviewed[REVIEWED] option is requested. |
Quinten Yearsley | 28cd212 | 2019-06-10 14:41:13 -0700 | [diff] [blame] | 8748 | |`commit_with_footers` |optional| |
Dave Borowitz | d5ebd9b | 2015-04-23 17:19:34 -0700 | [diff] [blame] | 8749 | If the link:#commit-footers[COMMIT_FOOTERS] option is requested and |
| 8750 | this is the current patch set, contains the full commit message with |
| 8751 | Gerrit-specific commit footers, as if this revision were submitted |
| 8752 | using the link:project-configuration.html#cherry_pick[Cherry Pick] |
| 8753 | submit type. |
Dave Borowitz | 6f58dbe | 2015-09-14 12:34:31 -0400 | [diff] [blame] | 8754 | |`push_certificate` |optional| |
| 8755 | If the link:#push-certificates[PUSH_CERTIFICATES] option is requested, |
| 8756 | contains the push certificate provided by the user when uploading this |
| 8757 | patch set as a link:#push-certificate-info[PushCertificateInfo] entity. |
| 8758 | This field is always set if the option is requested; if no push |
| 8759 | certificate was provided, it is set to an empty object. |
Aaron Gable | 621c9b6 | 2017-04-21 09:24:20 -0700 | [diff] [blame] | 8760 | |`description` |optional| |
| 8761 | The description of this patchset, as displayed in the patchset |
| 8762 | selector menu. May be null if no description is set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 8763 | |=========================== |
| 8764 | |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8765 | [[robot-comment-info]] |
| 8766 | === RobotCommentInfo |
| 8767 | The `RobotCommentInfo` entity contains information about a robot inline |
| 8768 | comment. |
| 8769 | |
Alice Kober-Sotzek | 7d890be | 2020-10-01 17:41:56 +0200 | [diff] [blame] | 8770 | `RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>> |
| 8771 | except for the `unresolved` field which doesn't exist for robot comments. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8772 | In addition `RobotCommentInfo` has the following fields: |
| 8773 | |
| 8774 | [options="header",cols="1,^1,5"] |
| 8775 | |=========================== |
Alice Kober-Sotzek | bcd275e | 2016-12-05 16:22:07 +0100 | [diff] [blame] | 8776 | |Field Name ||Description |
| 8777 | |`robot_id` ||The ID of the robot that generated this comment. |
| 8778 | |`robot_run_id` ||An ID of the run of the robot. |
| 8779 | |`url` |optional|URL to more information. |
| 8780 | |`properties` |optional|Robot specific properties as map that maps arbitrary |
| 8781 | keys to values. |
| 8782 | |`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of |
| 8783 | <<fix-suggestion-info,FixSuggestionInfo>> entities. |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8784 | |=========================== |
| 8785 | |
| 8786 | [[robot-comment-input]] |
| 8787 | === RobotCommentInput |
| 8788 | The `RobotCommentInput` entity contains information for creating an inline |
| 8789 | robot comment. |
| 8790 | |
Alice Kober-Sotzek | 7d890be | 2020-10-01 17:41:56 +0200 | [diff] [blame] | 8791 | [options="header",cols="1,^1,5"] |
| 8792 | |=========================== |
| 8793 | |Field Name ||Description |
| 8794 | |`path` || |
| 8795 | link:#file-id[The file path] for which the inline comment should be added. |
| 8796 | |`side` |optional| |
| 8797 | The side on which the comment should be added. + |
| 8798 | Allowed values are `REVISION` and `PARENT`. + |
| 8799 | If not set, the default is `REVISION`. |
| 8800 | |`line` |optional| |
| 8801 | The number of the line for which the comment should be added. + |
| 8802 | `0` if it is a file comment. + |
| 8803 | If neither line nor range is set, a file comment is added. + |
| 8804 | If range is set, this value is ignored in favor of the `end_line` of the range. |
| 8805 | |`range` |optional| |
| 8806 | The range of the comment as a link:#comment-range[CommentRange] |
| 8807 | entity. |
| 8808 | |`in_reply_to` |optional| |
| 8809 | The URL encoded UUID of the comment to which this comment is a reply. |
| 8810 | |`message` |optional| |
| 8811 | The comment message. |
| 8812 | |`robot_id` ||The ID of the robot that generated this comment. |
| 8813 | |`robot_run_id` ||An ID of the run of the robot. |
| 8814 | |`url` |optional|URL to more information. |
| 8815 | |`properties` |optional|Robot specific properties as map that maps arbitrary |
| 8816 | keys to values. |
| 8817 | |`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of |
| 8818 | <<fix-suggestion-info,FixSuggestionInfo>> entities. |
| 8819 | |=========================== |
Edwin Kempin | 3fde7e4 | 2016-09-19 15:35:10 +0200 | [diff] [blame] | 8820 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8821 | [[rule-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8822 | === RuleInput |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8823 | The `RuleInput` entity contains information to test a Prolog rule. |
| 8824 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8825 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8826 | |=========================== |
| 8827 | |Field Name ||Description |
| 8828 | |`rule`|| |
| 8829 | Prolog code to execute instead of the code in `refs/meta/config`. |
| 8830 | |`filters`|`RUN` if not set| |
| 8831 | When `RUN` filter rules in the parent projects are called to |
| 8832 | post-process the results of the project specific rule. This |
| 8833 | behavior matches how the rule will execute if installed. + |
| 8834 | If `SKIP` the parent filters are not called, allowing the test |
| 8835 | to return results from the input rule. |
| 8836 | |=========================== |
| 8837 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8838 | [[submit-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8839 | === SubmitInput |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8840 | The `SubmitInput` entity contains information for submitting a change. |
| 8841 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8842 | [options="header",cols="1,^1,5"] |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8843 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8844 | |Field Name ||Description |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8845 | |`on_behalf_of` |optional| |
Dave Borowitz | c6d143d | 2016-02-24 12:32:23 -0500 | [diff] [blame] | 8846 | If set, submit the change on behalf of the given user. The value may take any |
| 8847 | format link:rest-api-accounts.html#account-id[accepted by the accounts REST |
| 8848 | API]. Using this option requires |
| 8849 | link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)] |
| 8850 | permission on the branch. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8851 | |`notify` |optional| |
Stephen Li | a5a5ef0 | 2016-03-31 16:55:53 -0700 | [diff] [blame] | 8852 | Notify handling that defines to whom email notifications should be sent after |
| 8853 | the change is submitted. + |
| 8854 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
Nitzan Gur-Furman | 9da317c | 2022-10-07 11:19:53 +0200 | [diff] [blame] | 8855 | If not set, the default is `ALL`.+ |
| 8856 | Ignored if a post approval diff is present (i.e. if the change is submitted |
| 8857 | with copied approvals), because in this case everyone should be informed |
| 8858 | about the non-reviewed diff which has been applied after the change has been |
| 8859 | approved so that they can take action if the post approval diff looks |
| 8860 | unexpected. In other words if a post approval diff is present `ALL` is |
| 8861 | enforced. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8862 | |`notify_details`|optional| |
| 8863 | Additional information about whom to notify about the update as a map |
Gal Paikin | 1ae8b46 | 2020-07-27 15:50:59 +0300 | [diff] [blame] | 8864 | of link:user-notify.html#recipient-types[recipient type] to |
| 8865 | link:#notify-info[NotifyInfo] entity. |
Edwin Kempin | cd07df4 | 2016-12-01 09:10:09 +0100 | [diff] [blame] | 8866 | |============================= |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 8867 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8868 | [[submit-record]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 8869 | === SubmitRecord |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8870 | The `SubmitRecord` entity describes results from a submit_rule. |
Dave Borowitz | 6453fce | 2016-09-22 16:11:56 +0200 | [diff] [blame] | 8871 | Fields in this entity roughly correspond to the fields set by `LABELS` |
| 8872 | in link:#label-info[LabelInfo]. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8873 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 8874 | [options="header",cols="1,^1,5"] |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8875 | |=========================== |
| 8876 | |Field Name ||Description |
| 8877 | |`status`|| |
| 8878 | `OK`, the change can be submitted. + |
| 8879 | `NOT_READY`, additional labels are required before submit. + |
| 8880 | `CLOSED`, closed changes cannot be submitted. + |
| 8881 | `RULE_ERROR`, rule code failed with an error. |
| 8882 | |`ok`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 8883 | Map of labels that are approved; an |
| 8884 | link:rest-api-accounts.html#account-info[AccountInfo] identifies the |
| 8885 | voter chosen by the rule. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8886 | |`reject`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 8887 | Map of labels that are preventing submit; |
| 8888 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8889 | |`need`|optional| |
| 8890 | Map of labels that need to be given to submit. The value is |
| 8891 | currently an empty object. |
| 8892 | |`may`|optional| |
| 8893 | Map of labels that can be used, but do not affect submit. |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 8894 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter, |
| 8895 | if the label has been applied. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 8896 | |`impossible`|optional| |
| 8897 | Map of labels that should have been in `need` but cannot be |
| 8898 | used by any user because of access restrictions. The value |
| 8899 | is currently an empty object. |
| 8900 | |`error_message`|optional| |
| 8901 | When status is RULE_ERROR this message provides some text describing |
| 8902 | the failure of the rule predicate. |
| 8903 | |=========================== |
| 8904 | |
Youssef Elghareeb | 02d33aa | 2021-10-04 13:24:52 +0200 | [diff] [blame] | 8905 | [[submit-record-info]] |
| 8906 | === SubmitRecordInfo |
| 8907 | The `SubmitRecordInfo` entity describes results from a submit_rule. |
| 8908 | |
| 8909 | [options="header",cols="1,^1,5"] |
| 8910 | |=========================== |
| 8911 | |Field Name ||Description |
| 8912 | |`rule_name`|| |
| 8913 | The name of the submit rule that created this submit record. The submit rule is |
| 8914 | specified in the form of "$plugin~$rule" where `$plugin` is the plugin name |
| 8915 | and `$rule` is the name of the class that implemented the submit rule. |
| 8916 | |`status`|| |
| 8917 | `OK`, the change can be submitted. + |
| 8918 | `NOT_READY`, additional labels are required before submit. + |
| 8919 | `CLOSED`, closed changes cannot be submitted. + |
| 8920 | `FORCED`, the change was submitted bypassing the submit rule. + |
| 8921 | `RULE_ERROR`, rule code failed with an error. |
| 8922 | |`labels`|optional| |
| 8923 | A list of labels, each containing the following fields. + |
| 8924 | * `label`: the label name. + |
| 8925 | * `status`: the label status: {`OK`, `REJECT`, `MAY`, `NEED`, `IMPOSSIBLE`}. + |
| 8926 | * `appliedBy`: the link:rest-api-accounts.html#account-info[AccountInfo] |
| 8927 | that applied the vote to the label. |
| 8928 | |`requirements`|optional| |
| 8929 | List of the link:rest-api-changes.html#requirement[requirements] to be met |
| 8930 | before this change can be submitted. |
| 8931 | |`error_message`|optional| |
| 8932 | When status is RULE_ERROR this message provides some text describing |
| 8933 | the failure of the rule predicate. |
| 8934 | |=========================== |
| 8935 | |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8936 | [[submit-requirement-expression-info]] |
| 8937 | === SubmitRequirementExpressionInfo |
| 8938 | The `SubmitRequirementExpressionInfo` describes the result of evaluating a |
| 8939 | single submit requirement expression, for example `label:code-review=+2`. |
| 8940 | |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8941 | [options="header",cols="1,^1,5"] |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8942 | |=========================== |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8943 | |Field Name ||Description |
| 8944 | |`expression`|optional| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8945 | The submit requirement expression as a string, for example |
| 8946 | `branch:refs/heads/foo and label:verified=+1`. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8947 | |`fulfilled`|| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8948 | True if the submit requirement is fulfilled for the change. |
Youssef Elghareeb | df62c5a | 2022-04-08 12:23:23 +0200 | [diff] [blame] | 8949 | |`status`|| |
| 8950 | A string containing the status of evaluating the expression which can be one |
| 8951 | of the following: + |
| 8952 | * `PASS` - expression was evaluated and result is true. + |
| 8953 | * `FAIL` - expression was evaluated and result is false. + |
| 8954 | * `ERROR` - an error occurred while evaluating the expression. + |
| 8955 | * `NOT_EVALUATED` - expression was not evaluated. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8956 | |`passing_atoms`|optional| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8957 | A list of passing atoms as strings. For the above expression, |
| 8958 | `passing_atoms` can contain ["branch:refs/heads/foo"] if the branch predicate is |
| 8959 | fulfilled for the change. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 8960 | |`failing_atoms`|optional| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8961 | A list of failing atoms. This is similar to `passing_atoms` except that it |
| 8962 | contains the list of predicates that are not fulfilled for the change. |
Youssef Elghareeb | 393be61 | 2021-11-16 13:39:33 +0100 | [diff] [blame] | 8963 | |`error_message`|optional| |
| 8964 | If the submit requirement fails during evaluation, this string will contain |
| 8965 | an error message describing why it failed. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8966 | |=========================== |
| 8967 | |
Youssef Elghareeb | d598693 | 2021-10-15 11:45:23 +0200 | [diff] [blame] | 8968 | [[submit-requirement-input]] |
| 8969 | === SubmitRequirementInput |
| 8970 | The `SubmitRequirementInput` entity describes a submit requirement. |
| 8971 | |
| 8972 | [options="header",cols="1,^1,5"] |
| 8973 | |=========================== |
| 8974 | |Field Name ||Description |
| 8975 | |`name`|| |
| 8976 | The submit requirement name. |
| 8977 | |`description`|optional| |
| 8978 | Description of the submit requirement. |
| 8979 | |`applicability_expression`|optional| |
| 8980 | Query expression that can be evaluated on any change. If evaluated to true on a |
| 8981 | change, the submit requirement is then applicable for this change. |
| 8982 | If not specified, the submit requirement is applicable for all changes. |
| 8983 | |`submittability_expression`|| |
| 8984 | Query expression that can be evaluated on any change. If evaluated to true on a |
| 8985 | change, the submit requirement is fulfilled and not blocking change submission. |
| 8986 | |`override_expression`|optional| |
| 8987 | Query expression that can be evaluated on any change. If evaluated to true on a |
| 8988 | change, the submit requirement is overridden and not blocking change submission. |
| 8989 | |`allow_override_in_child_projects`|optional| |
| 8990 | Whether this submit requirement can be overridden in child projects. Default is |
| 8991 | `true`. |
| 8992 | |=========================== |
| 8993 | |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 8994 | [[submit-requirement-result-info]] |
| 8995 | === SubmitRequirementResultInfo |
| 8996 | The `SubmitRequirementResultInfo` describes the result of evaluating a |
| 8997 | submit requirement on a change. |
| 8998 | |
| 8999 | [options="header",cols="1,^1,5"] |
| 9000 | |=========================== |
| 9001 | |Field Name ||Description |
| 9002 | |`name`|| |
| 9003 | The submit requirement name. |
| 9004 | |`description`|optional| |
| 9005 | Description of the submit requirement. |
| 9006 | |`status`|| |
| 9007 | Status describing the result of evaluating the submit requirement. The status |
Youssef Elghareeb | f592ed1 | 2021-11-26 15:52:06 +0100 | [diff] [blame] | 9008 | is one of (`SATISFIED`, `UNSATISFIED`, `OVERRIDDEN`, `NOT_APPLICABLE`, `ERROR`, |
| 9009 | `FORCED`). |
Youssef Elghareeb | 024103e | 2021-09-06 14:41:04 +0200 | [diff] [blame] | 9010 | |`is_legacy`|| |
| 9011 | If true, this submit requirement result was created from a legacy |
| 9012 | link:#submit-record[SubmitRecord]. Otherwise, it was created by evaluating a |
| 9013 | submit requirement. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9014 | |`applicability_expression_result`|optional| |
| 9015 | A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo] |
| 9016 | containing the result of evaluating the applicability expression. Not set if the |
| 9017 | submit requirement did not define an applicability expression. |
Youssef Elghareeb | 08d4cae | 2021-10-27 15:43:05 +0200 | [diff] [blame] | 9018 | Note that fields `expression`, `passing_atoms` and `failing_atoms` are always |
| 9019 | omitted for the `applicability_expression_result`. |
Youssef Elghareeb | df62c5a | 2022-04-08 12:23:23 +0200 | [diff] [blame] | 9020 | |`submittability_expression_result`|| |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9021 | A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo] |
Marija Savtchouk | 6d87bae | 2022-01-20 17:06:22 +0000 | [diff] [blame] | 9022 | containing the result of evaluating the submittability expression. + |
Youssef Elghareeb | df62c5a | 2022-04-08 12:23:23 +0200 | [diff] [blame] | 9023 | If the submit requirement does not apply, the `status` field of the result |
| 9024 | will be set to `NOT_EVALUATED`. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9025 | |`override_expression_result`|optional| |
| 9026 | A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo] |
Marija Savtchouk | 6d87bae | 2022-01-20 17:06:22 +0000 | [diff] [blame] | 9027 | containing the result of evaluating the override expression. + |
Youssef Elghareeb | df62c5a | 2022-04-08 12:23:23 +0200 | [diff] [blame] | 9028 | Not set if the submit requirement did not define an override expression. If the |
| 9029 | submit requirement does not apply, the `status` field of the result will be set |
| 9030 | to `NOT_EVALUATED`. |
Youssef Elghareeb | 79f47362 | 2021-05-26 18:58:40 +0200 | [diff] [blame] | 9031 | |=========================== |
| 9032 | |
Jonathan Nieder | 2a629b0 | 2016-06-16 15:15:25 -0700 | [diff] [blame] | 9033 | [[submitted-together-info]] |
| 9034 | === SubmittedTogetherInfo |
| 9035 | The `SubmittedTogetherInfo` entity contains information about a |
| 9036 | collection of changes that would be submitted together. |
| 9037 | |
| 9038 | [options="header",cols="1,6"] |
| 9039 | |=========================== |
| 9040 | |Field Name |Description |
| 9041 | |`changes` | |
| 9042 | A list of ChangeInfo entities representing the changes to be submitted together. |
| 9043 | |`non_visible_changes`| |
| 9044 | The number of changes to be submitted together that the current user |
| 9045 | cannot see. (This count includes changes that are visible to the |
| 9046 | current user when their reason for being submitted together involves |
| 9047 | changes the user cannot see.) |
| 9048 | |=========================== |
| 9049 | |
Edwin Kempin | 521c124 | 2015-01-23 12:44:44 +0100 | [diff] [blame] | 9050 | [[suggested-reviewer-info]] |
| 9051 | === SuggestedReviewerInfo |
| 9052 | The `SuggestedReviewerInfo` entity contains information about a reviewer |
| 9053 | that can be added to a change (an account or a group). |
| 9054 | |
| 9055 | `SuggestedReviewerInfo` has either the `account` field that contains |
| 9056 | the link:rest-api-accounts.html#account-info[AccountInfo] entity, or |
| 9057 | the `group` field that contains the |
| 9058 | link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity. |
| 9059 | |
Logan Hanks | ab3c81e | 2016-07-20 15:42:52 -0700 | [diff] [blame] | 9060 | [options="header",cols="1,^1,5"] |
| 9061 | |=========================== |
| 9062 | |Field Name ||Description |
| 9063 | |`account` |optional| |
| 9064 | An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the |
| 9065 | suggestion is an account. |
| 9066 | |`group` |optional| |
| 9067 | A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the |
| 9068 | suggestion is a group. |
| 9069 | |`count` || |
| 9070 | The total number of accounts in the suggestion. This is `1` if `account` is |
| 9071 | present. If `group` is present, the total number of accounts that are |
| 9072 | members of the group is returned (this count includes members of nested |
| 9073 | groups). |
| 9074 | |`confirm` |optional| |
| 9075 | True if `group` is present and `count` is above the threshold where the |
| 9076 | `confirmed` flag must be passed to add the group as a reviewer. |
| 9077 | |=========================== |
| 9078 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 9079 | [[topic-input]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 9080 | === TopicInput |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 9081 | The `TopicInput` entity contains information for setting a topic. |
| 9082 | |
David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 9083 | [options="header",cols="1,^1,5"] |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 9084 | |=========================== |
| 9085 | |Field Name ||Description |
| 9086 | |`topic` |optional|The topic. + |
| 9087 | The topic will be deleted if not set. |
Gal Paikin | 44dbd7e | 2020-04-15 15:23:44 +0200 | [diff] [blame] | 9088 | Topic can't contain quotation marks. |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 9089 | |=========================== |
| 9090 | |
Makson Lee | 3568a93 | 2017-08-28 17:12:03 +0800 | [diff] [blame] | 9091 | [[tracking-id-info]] |
| 9092 | === TrackingIdInfo |
| 9093 | The `TrackingIdInfo` entity describes a reference to an external tracking system. |
| 9094 | |
| 9095 | [options="header",cols="1,6"] |
| 9096 | |====================== |
| 9097 | |Field Name|Description |
| 9098 | |`system` |The name of the external tracking system. |
| 9099 | |`id` |The tracking id. |
| 9100 | |====================== |
| 9101 | |
Oleg Aravin | bf313bb | 2016-10-24 12:28:56 -0700 | [diff] [blame] | 9102 | [[voting-range-info]] |
| 9103 | === VotingRangeInfo |
| 9104 | The `VotingRangeInfo` entity describes the continuous voting range from min |
| 9105 | to max values. |
| 9106 | |
| 9107 | [options="header",cols="1,6"] |
| 9108 | |====================== |
| 9109 | |Field Name|Description |
| 9110 | |`min` |The minimum voting value. |
| 9111 | |`max` |The maximum voting value. |
| 9112 | |====================== |
| 9113 | |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 9114 | [[web-link-info]] |
| 9115 | === WebLinkInfo |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 9116 | The `WebLinkInfo` entity describes a link to an external site. Depending on the |
| 9117 | context and the provided data the UI may decide to show the link as a text link, |
| 9118 | a linkified icon, or both. |
| 9119 | |
| 9120 | If the `tooltip` is not provided, then the UI may fall back to showing something |
| 9121 | like "Open in External Tool". |
| 9122 | |
| 9123 | Weblinks will always be opened in a new tab. |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 9124 | |
Edwin Kempin | af35ce4 | 2021-01-29 13:50:04 +0100 | [diff] [blame] | 9125 | [options="header",cols="1,^1,5"] |
| 9126 | |======================== |
| 9127 | |Field Name ||Description |
Ben Rohlfs | 25c47811 | 2023-03-16 16:06:40 +0100 | [diff] [blame] | 9128 | |`name` ||The text to be linkified. |
| 9129 | |`tooltip` |optional|Tooltip to show when hovering over the link. Using "Open |
| 9130 | in $NAME_OF_EXTERNAL_TOOL" is a good option here. |
Edwin Kempin | af35ce4 | 2021-01-29 13:50:04 +0100 | [diff] [blame] | 9131 | |`url` ||The link URL. |
| 9132 | |`image_url`|optional|URL to the icon of the link. |
Edwin Kempin | af35ce4 | 2021-01-29 13:50:04 +0100 | [diff] [blame] | 9133 | |======================== |
Edwin Kempin | bd885ff | 2014-04-11 16:11:56 +0200 | [diff] [blame] | 9134 | |
Alan Tokaev | 392cfca | 2017-04-28 11:11:31 +0200 | [diff] [blame] | 9135 | [[work-in-progress-input]] |
| 9136 | === WorkInProgressInput |
| 9137 | The `WorkInProgressInput` entity contains additional information for a change |
| 9138 | set to WorkInProgress/ReadyForReview. |
| 9139 | |
| 9140 | [options="header",cols="1,^1,5"] |
| 9141 | |============================= |
| 9142 | |Field Name ||Description |
| 9143 | |`message` |optional| |
| 9144 | Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview. |
| 9145 | |============================= |
| 9146 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 9147 | GERRIT |
| 9148 | ------ |
| 9149 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 9150 | |
| 9151 | SEARCHBOX |
| 9152 | --------- |