blob: 714efd73fcb488945012680f7916870d0a6878db [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - /changes/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01002
3This page describes the change related REST endpoints.
4Please also take note of the general information on the
5link:rest-api.html[REST API].
6
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007[[change-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008== Change Endpoints
Edwin Kempind0a63922013-01-23 16:32:59 +01009
David Ostrovsky837c0ee2014-04-27 12:54:20 +020010[[create-change]]
11=== Create Change
12--
David Pursehousea92d2e92017-08-03 06:03:47 +000013'POST /changes/'
David Ostrovsky837c0ee2014-04-27 12:54:20 +020014--
15
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -080016The change input link:#change-input[ChangeInput] entity must be provided in the
17request body.
David Ostrovsky837c0ee2014-04-27 12:54:20 +020018
19.Request
20----
Paladox none4bac1952017-08-03 00:09:25 +000021 POST /changes/ HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +090022 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020023
24 {
25 "project" : "myProject",
26 "subject" : "Let's support 100% Gerrit workflow direct in browser",
27 "branch" : "master",
28 "topic" : "create-change-in-browser",
29 "status" : "DRAFT"
30 }
31----
32
33As response a link:#change-info[ChangeInfo] entity is returned that describes
34the resulting change.
35
36.Response
37----
Paladox none4bac1952017-08-03 00:09:25 +000038 HTTP/1.1 201 OK
David Ostrovsky837c0ee2014-04-27 12:54:20 +020039 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090040 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020041
42 )]}'
43 {
David Ostrovsky837c0ee2014-04-27 12:54:20 +020044 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
45 "project": "myProject",
46 "branch": "master",
47 "topic": "create-change-in-browser",
48 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
49 "subject": "Let's support 100% Gerrit workflow direct in browser",
50 "status": "DRAFT",
51 "created": "2014-05-05 07:15:44.639000000",
52 "updated": "2014-05-05 07:15:44.639000000",
53 "mergeable": true,
54 "insertions": 0,
55 "deletions": 0,
David Ostrovsky837c0ee2014-04-27 12:54:20 +020056 "_number": 4711,
57 "owner": {
58 "name": "John Doe"
59 }
60 }
61----
62
Edwin Kempin76202742013-02-15 13:51:50 +010063[[list-changes]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080064=== Query Changes
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080065--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010066'GET /changes/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080067--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010068
Saša Živkovdd804022014-06-23 16:44:03 +020069Queries changes visible to the caller. The
70link:user-search.html#_search_operators[query string] must be provided
71by the `q` parameter. The `n` parameter can be used to limit the
72returned results.
Edwin Kempind0a63922013-01-23 16:32:59 +010073
Edwin Kempine3446292013-02-19 16:40:14 +010074As result a list of link:#change-info[ChangeInfo] entries is returned.
75The change output is sorted by the last update time, most recently
76updated to oldest updated.
77
Edwin Kempind0a63922013-01-23 16:32:59 +010078Query for open changes of watched projects:
Edwin Kempin37440832013-02-06 11:36:00 +010079
80.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010081----
Edwin Kempin2091edb2013-01-23 19:07:38 +010082 GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010083----
Edwin Kempind0a63922013-01-23 16:32:59 +010084
Edwin Kempin37440832013-02-06 11:36:00 +010085.Response
86----
Edwin Kempind0a63922013-01-23 16:32:59 +010087 HTTP/1.1 200 OK
88 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090089 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010090
91 )]}'
John Spurlockd25fad12013-03-09 11:48:49 -050092 [
93 {
John Spurlockd25fad12013-03-09 11:48:49 -050094 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
95 "project": "demo",
96 "branch": "master",
97 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
98 "subject": "One change",
99 "status": "NEW",
100 "created": "2012-07-17 07:18:30.854000000",
101 "updated": "2012-07-17 07:19:27.766000000",
John Spurlockd25fad12013-03-09 11:48:49 -0500102 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100103 "insertions": 26,
104 "deletions": 10,
John Spurlockd25fad12013-03-09 11:48:49 -0500105 "_number": 1756,
106 "owner": {
107 "name": "John Doe"
108 },
Edwin Kempind0a63922013-01-23 16:32:59 +0100109 },
John Spurlockd25fad12013-03-09 11:48:49 -0500110 {
John Spurlockd25fad12013-03-09 11:48:49 -0500111 "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501",
112 "project": "demo",
113 "branch": "master",
114 "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501",
115 "subject": "Another change",
116 "status": "NEW",
117 "created": "2012-07-17 07:18:30.884000000",
118 "updated": "2012-07-17 07:18:30.885000000",
119 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100120 "insertions": 12,
121 "deletions": 18,
John Spurlockd25fad12013-03-09 11:48:49 -0500122 "_number": 1757,
123 "owner": {
124 "name": "John Doe"
125 },
126 "_more_changes": true
127 }
128 ]
Edwin Kempind0a63922013-01-23 16:32:59 +0100129----
130
Sebastian Schuberth02bafe02016-01-20 21:38:11 +0100131If the number of changes matching the query exceeds either the internal
132limit or a supplied `n` query parameter, the last change object has a
David Pursehouse025ea3e2014-09-03 10:47:34 +0900133`_more_changes: true` JSON field set.
134
135The `S` or `start` query parameter can be supplied to skip a number
136of changes from the list.
Edwin Kempind0a63922013-01-23 16:32:59 +0100137
138Clients are allowed to specify more than one query by setting the `q`
139parameter multiple times. In this case the result is an array of
140arrays, one per query in the same order the queries were given in.
141
Edwin Kempina64c4b92013-01-23 11:30:40 +0100142.Query for the 25 most recent open changes of the projects that you watch
143****
144get::/changes/?q=status:open+is:watched&n=25
145****
146
Edwin Kempind0a63922013-01-23 16:32:59 +0100147Query that retrieves changes for a user's dashboard:
Edwin Kempin37440832013-02-06 11:36:00 +0100148
149.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100150----
151 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 Kempin37440832013-02-06 11:36:00 +0100152----
Edwin Kempind0a63922013-01-23 16:32:59 +0100153
Edwin Kempin37440832013-02-06 11:36:00 +0100154.Response
155----
Edwin Kempind0a63922013-01-23 16:32:59 +0100156 HTTP/1.1 200 OK
157 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900158 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100159
160 )]}'
161 [
162 [
163 {
Edwin Kempind0a63922013-01-23 16:32:59 +0100164 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
165 "project": "demo",
166 "branch": "master",
167 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
168 "subject": "One change",
169 "status": "NEW",
170 "created": "2012-07-17 07:18:30.854000000",
171 "updated": "2012-07-17 07:19:27.766000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100172 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100173 "insertions": 4,
174 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100175 "_number": 1756,
176 "owner": {
177 "name": "John Doe"
178 },
179 "labels": {
180 "Verified": {},
181 "Code-Review": {}
182 }
183 }
184 ],
185 [],
186 []
187 ]
188----
189
Edwin Kempina64c4b92013-01-23 11:30:40 +0100190.Query the changes for your user dashboard
191****
192get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS
193****
194
David Pursehouse2cf28432016-08-21 23:20:08 +0900195[[query-options]]
Edwin Kempind0a63922013-01-23 16:32:59 +0100196Additional fields can be obtained by adding `o` parameters, each
197option requires more database lookups and slows down the query
198response time to the client so they are generally disabled by
199default. Optional fields are:
200
Edwin Kempine3446292013-02-19 16:40:14 +0100201[[labels]]
202--
Edwin Kempind0a63922013-01-23 16:32:59 +0100203* `LABELS`: a summary of each label required for submit, and
204 approvers that have granted (or rejected) with that label.
Edwin Kempine3446292013-02-19 16:40:14 +0100205--
Edwin Kempind0a63922013-01-23 16:32:59 +0100206
Edwin Kempine3446292013-02-19 16:40:14 +0100207[[detailed-labels]]
208--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800209* `DETAILED_LABELS`: detailed label information, including numeric
Dave Borowitz992ddd72013-02-13 11:53:17 -0800210 values of all existing approvals, recognized label values, values
Edwin Kempin66af3d82015-11-10 17:38:40 -0800211 permitted to be set by the current user, all reviewers by state, and
212 reviewers that may be removed by the current user.
Edwin Kempine3446292013-02-19 16:40:14 +0100213--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800214
Edwin Kempine3446292013-02-19 16:40:14 +0100215[[current-revision]]
216--
Edwin Kempind0a63922013-01-23 16:32:59 +0100217* `CURRENT_REVISION`: describe the current revision (patch set)
218 of the change, including the commit SHA-1 and URLs to fetch from.
Edwin Kempine3446292013-02-19 16:40:14 +0100219--
Edwin Kempind0a63922013-01-23 16:32:59 +0100220
Edwin Kempine3446292013-02-19 16:40:14 +0100221[[all-revisions]]
222--
Edwin Kempind0a63922013-01-23 16:32:59 +0100223* `ALL_REVISIONS`: describe all revisions, not just current.
Edwin Kempine3446292013-02-19 16:40:14 +0100224--
Edwin Kempind0a63922013-01-23 16:32:59 +0100225
David Pursehouse025c1af2015-11-20 17:02:50 +0900226[[download-commands]]
Edwin Kempinea621482013-10-16 12:58:24 +0200227--
228* `DOWNLOAD_COMMANDS`: include the `commands` field in the
229 link:#fetch-info[FetchInfo] for revisions. Only valid when the
230 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
231--
232
Edwin Kempine3446292013-02-19 16:40:14 +0100233[[current-commit]]
234--
Edwin Kempind0a63922013-01-23 16:32:59 +0100235* `CURRENT_COMMIT`: parse and output all header fields from the
David Pursehouse98006e82013-10-02 10:15:52 +0900236 commit object, including message. Only valid when the
237 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100238--
Edwin Kempind0a63922013-01-23 16:32:59 +0100239
Edwin Kempine3446292013-02-19 16:40:14 +0100240[[all-commits]]
241--
Edwin Kempind0a63922013-01-23 16:32:59 +0100242* `ALL_COMMITS`: parse and output all header fields from the
243 output revisions. If only `CURRENT_REVISION` was requested
244 then only the current revision's commit data will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100245--
Edwin Kempind0a63922013-01-23 16:32:59 +0100246
Edwin Kempine3446292013-02-19 16:40:14 +0100247[[current-files]]
248--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100249* `CURRENT_FILES`: list files modified by the commit and magic files,
250 including basic line counts inserted/deleted per file. Only valid
251 when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100252--
Edwin Kempind0a63922013-01-23 16:32:59 +0100253
Edwin Kempine3446292013-02-19 16:40:14 +0100254[[all-files]]
255--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100256* `ALL_FILES`: list files modified by the commit and magic files,
257 including basic line counts inserted/deleted per file. If only the
258 `CURRENT_REVISION` was requested then only that commit's modified
259 files will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100260--
Edwin Kempind0a63922013-01-23 16:32:59 +0100261
Edwin Kempine3446292013-02-19 16:40:14 +0100262[[detailed-accounts]]
263--
Edwin Kempin4a00e222013-10-16 14:34:24 +0200264* `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username`
265 fields when referencing accounts.
Edwin Kempine3446292013-02-19 16:40:14 +0100266--
Dave Borowitz8926a882013-02-01 14:32:48 -0800267
Viktar Donich316bf7a2016-07-06 11:29:01 -0700268[[reviewer-updates]]
269--
270* `REVIEWER_UPDATES`: include updates to reviewers set as
271 link:#review-update-info[ReviewerUpdateInfo] entities.
272--
273
John Spurlock74a70cc2013-03-23 16:41:50 -0400274[[messages]]
275--
276* `MESSAGES`: include messages associated with the change.
277--
278
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700279[[actions]]
280--
281* `CURRENT_ACTIONS`: include information on available actions
Stefan Beller09cd95d2015-02-12 13:40:23 -0800282 for the change and its current revision. Ignored if the caller
283 is not authenticated.
284--
285
286[[change-actions]]
287--
288* `CHANGE_ACTIONS`: include information on available
289 change actions for the change. Ignored if the caller
290 is not authenticated.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700291--
292
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700293[[reviewed]]
294--
Dave Borowitz86669b32015-05-27 14:56:10 -0700295* `REVIEWED`: include the `reviewed` field if all of the following are
296 true:
Ardo Septama505f9ad2016-12-06 16:28:00 +0100297 - the change is open
298 - the caller is authenticated
299 - the caller has commented on the change more recently than the last update
Dave Borowitz86669b32015-05-27 14:56:10 -0700300 from the change owner, i.e. this change would show up in the results of
301 link:user-search.html#reviewedby[reviewedby:self].
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700302--
303
Jonathan Niedercb51d742016-09-23 11:37:57 -0700304[[submittable]]
305--
Jonathan Niederad5240f2016-10-04 11:03:23 -0700306* `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo],
Jonathan Niedercb51d742016-09-23 11:37:57 -0700307 which can be used to tell if the change is reviewed and ready for submit.
308--
309
Khai Do2a23ec82014-09-19 16:33:02 -0700310[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100311--
Sven Selbergd26bd542014-11-21 16:28:10 +0100312* `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo],
313 therefore only valid in combination with `CURRENT_COMMIT` or
314 `ALL_COMMITS`.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100315--
316
Dave Borowitz4c46c242014-12-03 16:46:45 -0800317[[check]]
318--
319* `CHECK`: include potential problems with the change.
320--
321
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700322[[commit-footers]]
323--
324* `COMMIT_FOOTERS`: include the full commit message with
325 Gerrit-specific commit footers in the
326 link:#revision-info[RevisionInfo].
Yuxuan 'fishy' Wang16baf212015-05-05 16:49:55 -0700327--
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700328
Dave Borowitz6f58dbe2015-09-14 12:34:31 -0400329[[push-certificates]]
330--
331* `PUSH_CERTIFICATES`: include push certificate information in the
332 link:#revision-info[RevisionInfo]. Ignored if signed push is not
333 link:config-gerrit.html#receive.enableSignedPush[enabled] on the
334 server.
335--
336
Edwin Kempin37440832013-02-06 11:36:00 +0100337.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100338----
Edwin Kempinea621482013-10-16 12:58:24 +0200339 GET /changes/?q=97&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES&o=DOWNLOAD_COMMANDS HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100340----
Edwin Kempind0a63922013-01-23 16:32:59 +0100341
Edwin Kempin37440832013-02-06 11:36:00 +0100342.Response
343----
Edwin Kempind0a63922013-01-23 16:32:59 +0100344 HTTP/1.1 200 OK
345 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900346 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100347
348 )]}'
349 [
350 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900351 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100352 "project": "gerrit",
353 "branch": "master",
354 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
355 "subject": "Use an EventBus to manage star icons",
356 "status": "NEW",
357 "created": "2012-04-25 00:52:25.580000000",
358 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100359 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100360 "insertions": 16,
361 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100362 "_number": 97,
363 "owner": {
364 "name": "Shawn Pearce"
365 },
366 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
367 "revisions": {
368 "184ebe53805e102605d11f6b143486d15c23a09c": {
David Pursehouse4de41112016-06-28 09:24:08 +0900369 "kind": "REWORK",
Edwin Kempind0a63922013-01-23 16:32:59 +0100370 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100371 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100372 "fetch": {
373 "git": {
374 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200375 "ref": "refs/changes/97/97/1",
376 "commands": {
377 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
378 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
379 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
380 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
381 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100382 },
383 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200384 "url": "http://myuser@127.0.0.1:8080/gerrit",
385 "ref": "refs/changes/97/97/1",
386 "commands": {
387 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
388 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
389 "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",
390 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
391 }
392 },
393 "ssh": {
394 "url": "ssh://myuser@*:29418/gerrit",
395 "ref": "refs/changes/97/97/1",
396 "commands": {
397 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
398 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
399 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
400 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
401 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100402 }
403 },
404 "commit": {
405 "parents": [
406 {
407 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
408 "subject": "Migrate contributor agreements to All-Projects."
409 }
410 ],
411 "author": {
412 "name": "Shawn O. Pearce",
413 "email": "sop@google.com",
414 "date": "2012-04-24 18:08:08.000000000",
415 "tz": -420
416 },
417 "committer": {
418 "name": "Shawn O. Pearce",
419 "email": "sop@google.com",
420 "date": "2012-04-24 18:08:08.000000000",
421 "tz": -420
422 },
423 "subject": "Use an EventBus to manage star icons",
424 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
425 },
426 "files": {
427 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200428 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100429 "size_delta": -412,
430 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100431 },
432 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200433 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100434 "size_delta": 23,
435 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100436 },
437 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
438 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200439 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100440 "size_delta": -298,
441 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100442 },
443 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
444 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200445 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100446 "size_delta": 132,
447 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100448 },
449 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
450 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200451 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100452 "size_delta": -5512,
453 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100454 },
455 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
456 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200457 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100458 "size_delta": 8345,
459 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100460 },
461 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200462 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100463 "size_delta": -343,
464 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100465 }
466 }
467 }
468 }
469 }
470 ]
471----
472
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100473[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800474=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800475--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100476'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800477--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100478
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100479Retrieves a change.
480
Dave Borowitz0314f732013-10-03 09:34:30 -0700481Additional fields can be obtained by adding `o` parameters, each
482option requires more database lookups and slows down the query
483response time to the client so they are generally disabled by
484default. Fields are described in link:#list-changes[Query Changes].
485
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100486.Request
487----
488 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
489----
490
491As response a link:#change-info[ChangeInfo] entity is returned that
492describes the change.
493
494.Response
495----
496 HTTP/1.1 200 OK
497 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900498 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100499
500 )]}'
501 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100502 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
503 "project": "myProject",
504 "branch": "master",
505 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
506 "subject": "Implementing Feature X",
507 "status": "NEW",
508 "created": "2013-02-01 09:59:32.126000000",
509 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100510 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100511 "insertions": 34,
512 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100513 "_number": 3965,
514 "owner": {
515 "name": "John Doe"
516 }
517 }
518----
519
Edwin Kempin8e492202013-02-21 15:38:25 +0100520[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800521=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800522--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100523'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800524--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100525
Edwin Kempin8e492202013-02-21 15:38:25 +0100526Retrieves a change with link:#labels[labels], link:#detailed-labels[
Viktar Donich316bf7a2016-07-06 11:29:01 -0700527detailed labels], link:#detailed-accounts[detailed accounts],
528link:#reviewer-updates[reviewer updates], and link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100529
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700530Additional fields can be obtained by adding `o` parameters, each
531option requires more database lookups and slows down the query
532response time to the client so they are generally disabled by
533default. Fields are described in link:#list-changes[Query Changes].
534
Edwin Kempin8e492202013-02-21 15:38:25 +0100535.Request
536----
537 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
538----
539
540As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700541describes the change. This response will contain all votes for each
542label and include one combined vote. The combined label vote is
543calculated in the following order (from highest to lowest):
544REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100545
546.Response
547----
548 HTTP/1.1 200 OK
549 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900550 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100551
552 )]}'
553 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100554 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
555 "project": "myProject",
556 "branch": "master",
557 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
558 "subject": "Implementing Feature X",
559 "status": "NEW",
560 "created": "2013-02-01 09:59:32.126000000",
561 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100562 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100563 "insertions": 126,
564 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100565 "_number": 3965,
566 "owner": {
567 "_account_id": 1000096,
568 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200569 "email": "john.doe@example.com",
570 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100571 },
572 "labels": {
573 "Verified": {
574 "all": [
575 {
576 "value": 0,
577 "_account_id": 1000096,
578 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200579 "email": "john.doe@example.com",
580 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100581 },
582 {
583 "value": 0,
584 "_account_id": 1000097,
585 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200586 "email": "jane.roe@example.com",
587 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100588 }
589 ],
590 "values": {
591 "-1": "Fails",
592 " 0": "No score",
593 "+1": "Verified"
594 }
595 },
596 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100597 "disliked": {
598 "_account_id": 1000096,
599 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200600 "email": "john.doe@example.com",
601 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100602 },
603 "all": [
604 {
605 "value": -1,
606 "_account_id": 1000096,
607 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200608 "email": "john.doe@example.com",
609 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100610 },
611 {
612 "value": 1,
613 "_account_id": 1000097,
614 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200615 "email": "jane.roe@example.com",
616 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100617 }
618 ]
619 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +0400620 "-2": "This shall not be merged",
621 "-1": "I would prefer this is not merged as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100622 " 0": "No score",
623 "+1": "Looks good to me, but someone else must approve",
624 "+2": "Looks good to me, approved"
625 }
626 }
627 },
628 "permitted_labels": {
629 "Verified": [
630 "-1",
631 " 0",
632 "+1"
633 ],
634 "Code-Review": [
635 "-2",
636 "-1",
637 " 0",
638 "+1",
639 "+2"
640 ]
641 },
642 "removable_reviewers": [
643 {
644 "_account_id": 1000096,
645 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200646 "email": "john.doe@example.com",
647 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100648 },
649 {
650 "_account_id": 1000097,
651 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200652 "email": "jane.roe@example.com",
653 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100654 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400655 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800656 "reviewers": {
657 "REVIEWER": [
658 {
659 "_account_id": 1000096,
660 "name": "John Doe",
661 "email": "john.doe@example.com",
662 "username": "jdoe"
663 },
664 {
665 "_account_id": 1000097,
666 "name": "Jane Roe",
667 "email": "jane.roe@example.com",
668 "username": "jroe"
669 }
670 ]
671 },
Viktar Donich316bf7a2016-07-06 11:29:01 -0700672 "reviewer_updates": [
673 {
674 "state": "REVIEWER",
675 "reviewer": {
676 "_account_id": 1000096,
677 "name": "John Doe",
678 "email": "john.doe@example.com",
679 "username": "jdoe"
680 },
681 "updated_by": {
682 "_account_id": 1000096,
683 "name": "John Doe",
684 "email": "john.doe@example.com",
685 "username": "jdoe"
686 },
687 "updated": "2016-07-21 20:12:39.000000000"
688 },
689 {
690 "state": "REMOVED",
691 "reviewer": {
692 "_account_id": 1000096,
693 "name": "John Doe",
694 "email": "john.doe@example.com",
695 "username": "jdoe"
696 },
697 "updated_by": {
698 "_account_id": 1000096,
699 "name": "John Doe",
700 "email": "john.doe@example.com",
701 "username": "jdoe"
702 },
703 "updated": "2016-07-21 20:12:33.000000000"
704 },
705 {
706 "state": "CC",
707 "reviewer": {
708 "_account_id": 1000096,
709 "name": "John Doe",
710 "email": "john.doe@example.com",
711 "username": "jdoe"
712 },
713 "updated_by": {
714 "_account_id": 1000096,
715 "name": "John Doe",
716 "email": "john.doe@example.com",
717 "username": "jdoe"
718 },
719 "updated": "2016-03-23 21:34:02.419000000",
720 },
721 ],
John Spurlock74a70cc2013-03-23 16:41:50 -0400722 "messages": [
723 {
724 "id": "YH-egE",
725 "author": {
726 "_account_id": 1000096,
727 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200728 "email": "john.doe@example.com",
729 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400730 },
731 "updated": "2013-03-23 21:34:02.419000000",
732 "message": "Patch Set 1:\n\nThis is the first message.",
733 "revision_number": 1
734 },
735 {
736 "id": "WEEdhU",
737 "author": {
738 "_account_id": 1000097,
739 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200740 "email": "jane.roe@example.com",
741 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400742 },
743 "updated": "2013-03-23 21:36:52.332000000",
744 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
745 "revision_number": 1
746 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100747 ]
748 }
749----
750
Aaron Gable9b413072017-08-24 13:15:21 -0700751[[create-merge-patch-set-for-change]]
752=== Create Merge Patch Set For Change
753--
754'POST /changes/link:#change-id[\{change-id\}]/merge'
755--
756
757Update an existing change by using a
758link:#merge-patch-set-input[MergePatchSetInput] entity.
759
760Gerrit will create a merge commit based on the information of
761MergePatchSetInput and add a new patch set to the change corresponding
762to the new merge commit.
763
764.Request
765----
766 POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0
767 Content-Type: application/json; charset=UTF-8
768
769 {
770 "subject": "Merge dev_branch into master",
771 "merge": {
772 "source": "refs/12/1234/1"
773 }
774 }
775----
776
777As response a link:#change-info[ChangeInfo] entity with current revision is
778returned that describes the resulting change.
779
780.Response
781----
782 HTTP/1.1 200 OK
783 Content-Disposition: attachment
784 Content-Type: application/json; charset=UTF-8
785
786 )]}'
787 {
788 "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc",
789 "project": "test",
790 "branch": "master",
791 "hashtags": [],
792 "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc",
793 "subject": "Merge dev_branch into master",
794 "status": "NEW",
795 "created": "2016-09-23 18:08:53.238000000",
796 "updated": "2016-09-23 18:09:25.934000000",
797 "submit_type": "MERGE_IF_NECESSARY",
798 "mergeable": true,
799 "insertions": 5,
800 "deletions": 0,
801 "_number": 72,
802 "owner": {
803 "_account_id": 1000000
804 },
805 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822"
806 }
807----
808
809[[set-message]]
810=== Set Commit Message
811--
812'PUT /changes/link:#change-id[\{change-id\}]/message'
813--
814
815Creates a new patch set with a new commit message.
816
817The new commit message must be provided in the request body inside a
818link:#commit-message-input[CommitMessageInput] entity and contain the change ID footer if
819link:project-configuration.html#require-change-id[Require Change-Id] was specified.
820
821.Request
822----
823 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0
824 Content-Type: application/json; charset=UTF-8
825
826 {
827 "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n"
828 }
829----
830
831.Notifications
832
833An email will be sent using the "newpatchset" template.
834
835[options="header",cols="1,1"]
836|=============================
837|WIP State |Default
838|Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers
839|Work in progress|owner
840|=============================
841
Edwin Kempin64006bb2013-02-22 08:17:04 +0100842[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800843=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800844--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100845'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800846--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100847
Edwin Kempin64006bb2013-02-22 08:17:04 +0100848Retrieves the topic of a change.
849
850.Request
851----
852 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
853----
854
855.Response
856----
857 HTTP/1.1 200 OK
858 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900859 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100860
861 )]}'
862 "Documentation"
863----
864
865If the change does not have a topic an empty string is returned.
866
867[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800868=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800869--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100870'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800871--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100872
Edwin Kempin64006bb2013-02-22 08:17:04 +0100873Sets the topic of a change.
874
875The new topic must be provided in the request body inside a
876link:#topic-input[TopicInput] entity.
877
878.Request
879----
880 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900881 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100882
883 {
884 "topic": "Documentation"
885 }
886----
887
888As response the new topic is returned.
889
890.Response
891----
892 HTTP/1.1 200 OK
893 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900894 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100895
896 )]}'
897 "Documentation"
898----
899
900If the topic was deleted the response is "`204 No Content`".
901
902[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800903=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800904--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100905'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800906--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100907
Edwin Kempin64006bb2013-02-22 08:17:04 +0100908Deletes the topic of a change.
909
Edwin Kempin64006bb2013-02-22 08:17:04 +0100910Please note that some proxies prohibit request bodies for DELETE
911requests. In this case, if you want to specify a commit message, use
912link:#set-topic[PUT] to delete the topic.
913
914.Request
915----
916 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
917----
918
919.Response
920----
921 HTTP/1.1 204 No Content
922----
923
Sven Selberg273a4aa2016-09-21 16:28:10 +0200924[[get-assignee]]
925=== Get Assignee
926--
927'GET /changes/link:#change-id[\{change-id\}]/assignee'
928--
929
930Retrieves the account of the user assigned to a change.
931
932.Request
933----
934 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
935----
936
937As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
938describing the assigned account is returned.
939
940.Response
941----
942 HTTP/1.1 200 OK
943 Content-Disposition: attachment
944 Content-Type: application/json; charset=UTF-8
945
946 )]}'
947 {
948 "_account_id": 1000096,
949 "name": "John Doe",
950 "email": "john.doe@example.com",
951 "username": "jdoe"
952 }
953----
954
955If the change has no assignee the response is "`204 No Content`".
956
957[[get-past-assignees]]
958=== Get Past Assignees
959--
960'GET /changes/link:#change-id[\{change-id\}]/past_assignees'
961--
962
963Returns a list of every user ever assigned to a change, in the order in which
964they were first assigned.
965
966.Request
967----
968 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/past_assignees HTTP/1.0
969----
970
971As a response a list of link:rest-api-accounts.html#account-info[AccountInfo]
972entities is returned.
973
974.Response
975----
976 HTTP/1.1 200 OK
977 Content-Disposition: attachment
978 Content-Type: application/json; charset=UTF-8
979
980 )]}'
981 [
982 {
983 "_account_id": 1000051,
984 "name": "Jane Doe",
985 "email": "jane.doe@example.com",
986 "username": "janed"
987 },
988 {
989 "_account_id": 1000096,
990 "name": "John Doe",
991 "email": "john.doe@example.com",
992 "username": "jdoe"
993 }
994 ]
995
996----
997
998
999[[set-assignee]]
1000=== Set Assignee
1001--
1002'PUT /changes/link:#change-id[\{change-id\}]/assignee'
1003--
1004
1005Sets the assignee of a change.
1006
1007The new assignee must be provided in the request body inside a
1008link:#assignee-input[AssigneeInput] entity.
1009
1010.Request
1011----
1012 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1013 Content-Type: application/json; charset=UTF-8
1014
1015 {
1016 "assignee": "jdoe"
1017 }
1018----
1019
1020As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1021describing the assigned account is returned.
1022
1023.Response
1024----
1025 HTTP/1.1 200 OK
1026 Content-Disposition: attachment
1027 Content-Type: application/json; charset=UTF-8
1028
1029 )]}'
1030 {
1031 "_account_id": 1000096,
1032 "name": "John Doe",
1033 "email": "john.doe@example.com",
1034 "username": "jdoe"
1035 }
1036----
1037
1038[[delete-assignee]]
1039=== Delete Assignee
1040--
1041'DELETE /changes/link:#change-id[\{change-id\}]/assignee'
1042--
1043
1044Deletes the assignee of a change.
1045
1046
1047.Request
1048----
1049 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1050----
1051
1052As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1053describing the account of the deleted assignee is returned.
1054
1055.Response
1056----
1057 HTTP/1.1 200 OK
1058 Content-Disposition: attachment
1059 Content-Type: application/json; charset=UTF-8
1060
1061 )]}'
1062 {
1063 "_account_id": 1000096,
1064 "name": "John Doe",
1065 "email": "john.doe@example.com",
1066 "username": "jdoe"
1067 }
1068----
1069
1070If the change had no assignee the response is "`204 No Content`".
1071
Edwin Kempined5364b2013-02-22 10:39:33 +01001072[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001073=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001074--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001075'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001076--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001077
Edwin Kempined5364b2013-02-22 10:39:33 +01001078Abandons a change.
1079
1080The request body does not need to include a link:#abandon-input[
1081AbandonInput] entity if no review comment is added.
1082
1083.Request
1084----
1085 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
1086----
1087
1088As response a link:#change-info[ChangeInfo] entity is returned that
1089describes the abandoned change.
1090
1091.Response
1092----
1093 HTTP/1.1 200 OK
1094 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001095 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001096
1097 )]}'
1098 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001099 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1100 "project": "myProject",
1101 "branch": "master",
1102 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1103 "subject": "Implementing Feature X",
1104 "status": "ABANDONED",
1105 "created": "2013-02-01 09:59:32.126000000",
1106 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001107 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001108 "insertions": 3,
1109 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +01001110 "_number": 3965,
1111 "owner": {
1112 "name": "John Doe"
1113 }
1114 }
1115----
1116
1117If the change cannot be abandoned because the change state doesn't
1118allow abandoning of the change, the response is "`409 Conflict`" and
1119the error message is contained in the response body.
1120
1121.Response
1122----
1123 HTTP/1.1 409 Conflict
1124 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001125 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001126
1127 change is merged
1128----
1129
Logan Hankse43b68e2017-05-23 13:16:22 -07001130.Notifications
1131
1132An email will be sent using the "abandon" template. The notify handling is ALL.
1133Notifications are suppressed on WIP changes that have never started review.
1134
Logan Hanks87607412017-05-30 13:49:04 -07001135[options="header",cols="1,2"]
Logan Hankse43b68e2017-05-23 13:16:22 -07001136|=============================
Logan Hanks87607412017-05-30 13:49:04 -07001137|WIP State |notify=ALL
Logan Hankse43b68e2017-05-23 13:16:22 -07001138|Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1139|Work in progress|not sent
1140|Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1141|=============================
1142
Edwin Kempined5364b2013-02-22 10:39:33 +01001143[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001144=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001145--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001146'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001147--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001148
Edwin Kempined5364b2013-02-22 10:39:33 +01001149Restores a change.
1150
1151The request body does not need to include a link:#restore-input[
1152RestoreInput] entity if no review comment is added.
1153
1154.Request
1155----
1156 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1157----
1158
1159As response a link:#change-info[ChangeInfo] entity is returned that
1160describes the restored change.
1161
1162.Response
1163----
1164 HTTP/1.1 200 OK
1165 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001166 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001167
1168 )]}'
1169 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001170 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1171 "project": "myProject",
1172 "branch": "master",
1173 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1174 "subject": "Implementing Feature X",
1175 "status": "NEW",
1176 "created": "2013-02-01 09:59:32.126000000",
1177 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001178 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001179 "insertions": 2,
1180 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001181 "_number": 3965,
1182 "owner": {
1183 "name": "John Doe"
1184 }
1185 }
1186----
1187
1188If the change cannot be restored because the change state doesn't
1189allow restoring the change, the response is "`409 Conflict`" and
1190the error message is contained in the response body.
1191
1192.Response
1193----
1194 HTTP/1.1 409 Conflict
1195 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001196 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001197
1198 change is new
1199----
1200
Edwin Kempincdae63b2013-03-15 15:06:59 +01001201[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001202=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001203--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001204'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001205--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001206
1207Rebases a change.
1208
Zalan Blenessy874aed72015-01-12 13:26:18 +01001209Optionally, the parent revision can be changed to another patch set through the
1210link:#rebase-input[RebaseInput] entity.
1211
Edwin Kempincdae63b2013-03-15 15:06:59 +01001212.Request
1213----
1214 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001215 Content-Type: application/json;charset=UTF-8
1216
1217 {
1218 "base" : "1234",
1219 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001220----
1221
1222As response a link:#change-info[ChangeInfo] entity is returned that
1223describes the rebased change. Information about the current patch set
1224is included.
1225
1226.Response
1227----
1228 HTTP/1.1 200 OK
1229 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001230 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001231
1232 )]}'
1233 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001234 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1235 "project": "myProject",
1236 "branch": "master",
1237 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1238 "subject": "Implement Feature X",
1239 "status": "NEW",
1240 "created": "2013-02-01 09:59:32.126000000",
1241 "updated": "2013-02-21 11:16:36.775000000",
1242 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001243 "insertions": 33,
1244 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001245 "_number": 4799,
1246 "owner": {
1247 "name": "John Doe"
1248 },
1249 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1250 "revisions": {
1251 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001252 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001253 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001254 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001255 "fetch": {
1256 "http": {
1257 "url": "http://gerrit:8080/myProject",
1258 "ref": "refs/changes/99/4799/2"
1259 }
1260 },
1261 "commit": {
1262 "parents": [
1263 {
1264 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1265 "subject": "Implement Feature A"
1266 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001267 ],
1268 "author": {
1269 "name": "John Doe",
1270 "email": "john.doe@example.com",
1271 "date": "2013-05-07 15:21:27.000000000",
1272 "tz": 120
1273 },
1274 "committer": {
1275 "name": "Gerrit Code Review",
1276 "email": "gerrit-server@example.com",
1277 "date": "2013-05-07 15:35:43.000000000",
1278 "tz": 120
1279 },
1280 "subject": "Implement Feature X",
1281 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001282 }
1283 }
1284 }
1285----
1286
1287If the change cannot be rebased, e.g. due to conflicts, the response is
1288"`409 Conflict`" and the error message is contained in the response
1289body.
1290
1291.Response
1292----
1293 HTTP/1.1 409 Conflict
1294 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001295 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001296
1297 The change could not be rebased due to a path conflict during merge.
1298----
1299
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301300[[move-change]]
1301=== Move Change
1302--
1303'POST /changes/link:#change-id[\{change-id\}]/move'
1304--
1305
1306Move a change.
1307
1308The destination branch must be provided in the request body inside a
1309link:#move-input[MoveInput] entity.
1310
1311.Request
1312----
1313 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1314 Content-Type: application/json; charset=UTF-8
1315
1316 {
1317 "destination_branch" : "release-branch"
1318 }
1319
1320----
1321
1322As response a link:#change-info[ChangeInfo] entity is returned that
1323describes the moved change.
1324
1325.Response
1326----
1327 HTTP/1.1 200 OK
1328 Content-Disposition: attachment
1329 Content-Type: application/json; charset=UTF-8
1330
1331 )]}'
1332 {
1333 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1334 "project": "myProject",
1335 "branch": "release-branch",
1336 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1337 "subject": "Implementing Feature X",
1338 "status": "NEW",
1339 "created": "2013-02-01 09:59:32.126000000",
1340 "updated": "2013-02-21 11:16:36.775000000",
1341 "mergeable": true,
1342 "insertions": 2,
1343 "deletions": 13,
1344 "_number": 3965,
1345 "owner": {
1346 "name": "John Doe"
1347 }
1348 }
1349----
1350
Changcheng Xiao6dc90422017-08-09 10:21:58 +02001351Note that this endpoint will not update the change's parents, which is
1352different from the link:#cherry-pick[cherry-pick] endpoint.
1353
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301354If the change cannot be moved because the change state doesn't
1355allow moving the change, the response is "`409 Conflict`" and
1356the error message is contained in the response body.
1357
1358.Response
1359----
1360 HTTP/1.1 409 Conflict
1361 Content-Disposition: attachment
1362 Content-Type: text/plain; charset=UTF-8
1363
1364 change is merged
1365----
1366
1367If the change cannot be moved because the user doesn't have
1368abandon permission on the change or upload permission on the destination,
1369the response is "`409 Conflict`" and the error message is contained in the
1370response body.
1371
1372.Response
1373----
1374 HTTP/1.1 409 Conflict
1375 Content-Disposition: attachment
1376 Content-Type: text/plain; charset=UTF-8
1377
1378 move not permitted
1379----
1380
Edwin Kempind2ec4152013-02-22 12:17:19 +01001381[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001382=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001383--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001384'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001385--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001386
Edwin Kempind2ec4152013-02-22 12:17:19 +01001387Reverts a change.
1388
1389The request body does not need to include a link:#revert-input[
1390RevertInput] entity if no review comment is added.
1391
1392.Request
1393----
Michael Zhou10270492016-03-24 22:35:40 -04001394 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001395----
1396
1397As response a link:#change-info[ChangeInfo] entity is returned that
1398describes the reverting change.
1399
1400.Response
1401----
1402 HTTP/1.1 200 OK
1403 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001404 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001405
1406 )]}'
1407 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001408 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1409 "project": "myProject",
1410 "branch": "master",
1411 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1412 "subject": "Revert \"Implementing Feature X\"",
1413 "status": "NEW",
1414 "created": "2013-02-01 09:59:32.126000000",
1415 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001416 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001417 "insertions": 6,
1418 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001419 "_number": 3965,
1420 "owner": {
1421 "name": "John Doe"
1422 }
1423 }
1424----
1425
1426If the change cannot be reverted because the change state doesn't
1427allow reverting the change, the response is "`409 Conflict`" and
1428the error message is contained in the response body.
1429
1430.Response
1431----
1432 HTTP/1.1 409 Conflict
1433 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001434 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001435
1436 change is new
1437----
1438
Edwin Kempin0eddba02013-02-22 15:30:12 +01001439[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001440=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001441--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001442'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001443--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001444
Edwin Kempin0eddba02013-02-22 15:30:12 +01001445Submits a change.
1446
1447The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001448SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001449
1450.Request
1451----
1452 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001453 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001454
1455 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001456 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001457 }
1458----
1459
1460As response a link:#change-info[ChangeInfo] entity is returned that
1461describes the submitted/merged change.
1462
1463.Response
1464----
1465 HTTP/1.1 200 OK
1466 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001467 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001468
1469 )]}'
1470 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001471 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1472 "project": "myProject",
1473 "branch": "master",
1474 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1475 "subject": "Implementing Feature X",
1476 "status": "MERGED",
1477 "created": "2013-02-01 09:59:32.126000000",
1478 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001479 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001480 "_number": 3965,
1481 "owner": {
1482 "name": "John Doe"
1483 }
1484 }
1485----
1486
1487If the change cannot be submitted because the submit rule doesn't allow
1488submitting the change, the response is "`409 Conflict`" and the error
1489message is contained in the response body.
1490
1491.Response
1492----
1493 HTTP/1.1 409 Conflict
1494 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001495 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001496
1497 blocked by Verified
1498----
1499
David Pursehouse025c1af2015-11-20 17:02:50 +09001500[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001501=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07001502--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001503'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001504--
1505
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001506Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001507link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07001508including the current change itself.
1509
Stefan Bellera7ad6612015-06-26 10:05:43 -07001510The list consists of:
1511
1512* The given change.
1513* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1514 is enabled, include all open changes with the same topic.
1515* For each change whose submit type is not CHERRY_PICK, include unmerged
1516 ancestors targeting the same branch.
1517
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001518As a special case, the list is empty if this change would be
1519submitted by itself (without other changes).
1520
1521.Request
1522----
1523 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
1524 Content-Type: application/json; charset=UTF-8
1525----
1526
1527As a response a link:#submitted-together-info[SubmittedTogetherInfo]
1528entity is returned that describes what would happen if the change were
1529submitted. This response contains a list of changes and a count of
1530changes that are not visible to the caller that are part of the set of
1531changes to be merged.
1532
1533The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001534link:#list-changes[Query Changes] with the
1535link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Jonathan Niedercb51d742016-09-23 11:37:57 -07001536link:#current-revision[`CURRENT_REVISION`],
1537link:#current-commit[`CURRENT_COMMIT`], and
1538link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001539
Shawn Pearce8080c3d2016-09-19 19:15:04 -07001540Standard link:#query-options[formatting options] can be specified
1541with the `o` parameter, as well as the `submitted_together` specific
1542option `NON_VISIBLE_CHANGES`.
1543
Stefan Bellera7ad6612015-06-26 10:05:43 -07001544.Response
1545----
1546 HTTP/1.1 200 OK
1547 Content-Disposition: attachment
1548 Content-Type: application/json; charset=UTF-8
1549
1550)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001551{
1552 "changes": [
1553 {
1554 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1555 "project": "gerrit",
1556 "branch": "master",
1557 "hashtags": [],
1558 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1559 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1560 "status": "NEW",
1561 "created": "2015-05-01 15:39:57.979000000",
1562 "updated": "2015-05-20 19:25:21.592000000",
1563 "mergeable": true,
1564 "insertions": 303,
1565 "deletions": 210,
1566 "_number": 1779,
1567 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001568 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001569 },
1570 "labels": {
1571 "Code-Review": {
1572 "approved": {
1573 "_account_id": 1000000
1574 },
1575 "all": [
1576 {
1577 "value": 2,
1578 "date": "2015-05-20 19:25:21.592000000",
1579 "_account_id": 1000000
1580 }
1581 ],
1582 "values": {
1583 "-2": "This shall not be merged",
1584 "-1": "I would prefer this is not merged as is",
1585 " 0": "No score",
1586 "+1": "Looks good to me, but someone else must approve",
1587 "+2": "Looks good to me, approved"
1588 },
1589 "default_value": 0
1590 },
1591 "Verified": {
1592 "approved": {
1593 "_account_id": 1000000
1594 },
1595 "all": [
1596 {
1597 "value": 1,
1598 "date": "2015-05-20 19:25:21.592000000",
1599 "_account_id": 1000000
1600 }
1601 ],
1602 "values": {
1603 "-1": "Fails",
1604 " 0": "No score",
1605 "+1": "Verified"
1606 },
1607 "default_value": 0
1608 }
1609 },
1610 "permitted_labels": {
1611 "Code-Review": [
1612 "-2",
1613 "-1",
1614 " 0",
1615 "+1",
1616 "+2"
1617 ],
1618 "Verified": [
1619 "-1",
1620 " 0",
1621 "+1"
1622 ]
1623 },
1624 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001625 {
1626 "_account_id": 1000000
1627 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001628 ],
1629 "reviewers": {
1630 "REVIEWER": [
1631 {
1632 "_account_id": 1000000
1633 }
1634 ]
1635 },
1636 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1637 "revisions": {
1638 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09001639 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001640 "_number": 1,
1641 "created": "2015-05-01 15:39:57.979000000",
1642 "uploader": {
1643 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001644 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001645 "ref": "refs/changes/79/1779/1",
1646 "fetch": {},
1647 "commit": {
1648 "parents": [
1649 {
1650 "commit": "2d3176497a2747faed075f163707e57d9f961a1c",
1651 "subject": "Merge changes from topic \u0027submodule-subscription-tests-and-fixes-3\u0027"
1652 }
1653 ],
1654 "author": {
1655 "name": "Stefan Beller",
1656 "email": "sbeller@google.com",
1657 "date": "2015-04-29 21:36:52.000000000",
1658 "tz": -420
1659 },
1660 "committer": {
1661 "name": "Stefan Beller",
1662 "email": "sbeller@google.com",
1663 "date": "2015-05-01 00:11:16.000000000",
1664 "tz": -420
1665 },
1666 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1667 "message": "ChangeMergeQueue: Rewrite such that it works on set of changes\n\nChangeMergeQueue used to work on branches rather than sets of changes.\nThis change is a first step to merge sets of changes (e.g. grouped by a\ntopic and `changes.submitWholeTopic` enabled) in an atomic fashion.\nThis change doesn\u0027t aim to implement these changes, but only as a step\ntowards it.\n\nMergeOp keeps its functionality and behavior as is. A new class\nMergeOpMapper is introduced which will map the set of changes to\nthe set of branches. Additionally the MergeOpMapper is also\nresponsible for the threading done right now, which was part of\nthe ChangeMergeQueue before.\n\nChange-Id: I1ffe09a505e25f15ce1521bcfb222e51e62c2a14\n"
1668 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001669 }
1670 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001671 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001672 {
1673 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
1674 "project": "gerrit",
1675 "branch": "master",
1676 "hashtags": [],
1677 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
1678 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1679 "status": "NEW",
1680 "created": "2015-05-01 15:39:57.979000000",
1681 "updated": "2015-05-20 19:25:21.546000000",
1682 "mergeable": true,
1683 "insertions": 15,
1684 "deletions": 6,
1685 "_number": 1780,
1686 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001687 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001688 },
1689 "labels": {
1690 "Code-Review": {
1691 "approved": {
1692 "_account_id": 1000000
1693 },
1694 "all": [
1695 {
1696 "value": 2,
1697 "date": "2015-05-20 19:25:21.546000000",
1698 "_account_id": 1000000
1699 }
1700 ],
1701 "values": {
1702 "-2": "This shall not be merged",
1703 "-1": "I would prefer this is not merged as is",
1704 " 0": "No score",
1705 "+1": "Looks good to me, but someone else must approve",
1706 "+2": "Looks good to me, approved"
1707 },
1708 "default_value": 0
1709 },
1710 "Verified": {
1711 "approved": {
1712 "_account_id": 1000000
1713 },
1714 "all": [
1715 {
1716 "value": 1,
1717 "date": "2015-05-20 19:25:21.546000000",
1718 "_account_id": 1000000
1719 }
1720 ],
1721 "values": {
1722 "-1": "Fails",
1723 " 0": "No score",
1724 "+1": "Verified"
1725 },
1726 "default_value": 0
1727 }
1728 },
1729 "permitted_labels": {
1730 "Code-Review": [
1731 "-2",
1732 "-1",
1733 " 0",
1734 "+1",
1735 "+2"
1736 ],
1737 "Verified": [
1738 "-1",
1739 " 0",
1740 "+1"
1741 ]
1742 },
1743 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001744 {
1745 "_account_id": 1000000
1746 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001747 ],
1748 "reviewers": {
1749 "REVIEWER": [
1750 {
1751 "_account_id": 1000000
1752 }
1753 ]
1754 },
1755 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
1756 "revisions": {
1757 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09001758 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001759 "_number": 1,
1760 "created": "2015-05-01 15:39:57.979000000",
1761 "uploader": {
1762 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001763 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001764 "ref": "refs/changes/80/1780/1",
1765 "fetch": {},
1766 "commit": {
1767 "parents": [
1768 {
1769 "commit": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1770 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes"
1771 }
1772 ],
1773 "author": {
1774 "name": "Stefan Beller",
1775 "email": "sbeller@google.com",
1776 "date": "2015-04-25 00:11:59.000000000",
1777 "tz": -420
1778 },
1779 "committer": {
1780 "name": "Stefan Beller",
1781 "email": "sbeller@google.com",
1782 "date": "2015-05-01 00:11:16.000000000",
1783 "tz": -420
1784 },
1785 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1786 "message": "AbstractSubmoduleSubscription: Split up createSubscription\n\nLater we want to have subscriptions to more submodules, so we need to\nfind a way to add more submodule entries into the file. By splitting up\nthe createSubscription() method, that is very easy by using the\naddSubmoduleSubscription method multiple times.\n\nChange-Id: I7fe807e63792b3d26776fd1422e5e790a5697e22\n"
1787 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001788 }
1789 }
1790 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001791 ],
1792 "non_visible_changes": 0
1793}
Stefan Bellera7ad6612015-06-26 10:05:43 -07001794----
1795
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001796If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
1797instead of a link:#submitted-together-info[SubmittedTogetherInfo]
1798entity, the response is a list of changes, or a 403 response with a
1799message if the set of changes to be submitted with this change
1800includes changes the caller cannot read.
1801
Stefan Bellera7ad6612015-06-26 10:05:43 -07001802
David Ostrovsky0d69c232013-09-10 23:10:23 +02001803[[publish-draft-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001804=== Publish Draft Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001805--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001806'POST /changes/link:#change-id[\{change-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001807--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001808
1809Publishes a draft change.
1810
1811.Request
1812----
1813 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001814 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001815----
1816
1817.Response
1818----
1819 HTTP/1.1 204 No Content
1820----
1821
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001822[[delete-change]]
1823=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001824--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001825'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001826--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001827
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001828Deletes a change.
1829
Paladox none580ae0e2017-02-12 18:15:48 +00001830New or abandoned changes can be deleted by their owner if the user is granted
1831the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
1832otherwise only by administrators.
1833
1834Draft changes can only be deleted by their owner or other users who have the
1835permissions to view and delete drafts. If the draft workflow is disabled, only
1836administrators with those permissions may delete draft changes.
David Ostrovsky0d69c232013-09-10 23:10:23 +02001837
1838.Request
1839----
1840 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001841 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001842----
1843
1844.Response
1845----
1846 HTTP/1.1 204 No Content
1847----
1848
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001849[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001850=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001851--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001852'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001853--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001854
1855Retrieves the branches and tags in which a change is included. As result
1856an link:#included-in-info[IncludedInInfo] entity is returned.
1857
1858.Request
1859----
1860 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
1861----
1862
1863.Response
1864----
1865 HTTP/1.1 200 OK
1866 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001867 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001868
1869 )]}'
1870 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001871 "branches": [
1872 "master"
1873 ],
1874 "tags": []
1875 }
1876----
1877
David Pursehouse4e38b972014-05-30 10:36:40 +09001878[[index-change]]
1879=== Index Change
1880--
1881'POST /changes/link:#change-id[\{change-id\}]/index'
1882--
1883
1884Adds or updates the change in the secondary index.
1885
1886.Request
1887----
1888 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
1889----
1890
1891.Response
1892----
1893 HTTP/1.1 204 No Content
1894----
1895
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001896[[list-change-comments]]
1897=== List Change Comments
1898--
1899'GET /changes/link:#change-id[\{change-id\}]/comments'
1900--
1901
1902Lists the published comments of all revisions of the change.
1903
1904Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1905entries. The entries in the map are sorted by file path, and the
1906comments for each path are sorted by patch set number. Each comment has
1907the `patch_set` and `author` fields set.
1908
1909.Request
1910----
1911 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
1912----
1913
1914.Response
1915----
1916 HTTP/1.1 200 OK
1917 Content-Disposition: attachment
1918 Content-Type: application/json; charset=UTF-8
1919
1920 )]}'
1921 {
1922 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1923 {
1924 "patch_set": 1,
1925 "id": "TvcXrmjM",
1926 "line": 23,
1927 "message": "[nit] trailing whitespace",
1928 "updated": "2013-02-26 15:40:43.986000000"
1929 "author": {
1930 "_account_id": 1000096,
1931 "name": "John Doe",
1932 "email": "john.doe@example.com"
1933 }
1934 },
1935 {
1936 "patch_set": 2,
1937 "id": "TveXwFiA",
1938 "line": 49,
1939 "in_reply_to": "TfYX-Iuo",
1940 "message": "Done",
1941 "updated": "2013-02-26 15:40:45.328000000"
1942 "author": {
1943 "_account_id": 1000097,
1944 "name": "Jane Roe",
1945 "email": "jane.roe@example.com"
1946 }
1947 }
1948 ]
1949 }
1950----
1951
Changcheng Xiao9b04c042016-12-28 12:45:29 +01001952[[list-change-robot-comments]]
1953=== List Change Robot Comments
1954--
1955'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
1956--
1957
1958Lists the robot comments of all revisions of the change.
1959
1960Return a map that maps the file path to a list of
1961link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
1962map are sorted by file path.
1963
1964.Request
1965----
1966 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
1967----
1968
1969.Response
1970----
1971 HTTP/1.1 200 OK
1972 Content-Disposition: attachment
1973 Content-Type: application/json; charset=UTF-8
1974
1975 )]}'
1976 {
1977 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1978 {
1979 "id": "TvcXrmjM",
1980 "line": 23,
1981 "message": "unused import",
1982 "updated": "2016-02-26 15:40:43.986000000",
1983 "author": {
1984 "_account_id": 1000110,
1985 "name": "Code Analyzer",
1986 "email": "code.analyzer@example.com"
1987 },
1988 "robotId": "importChecker",
1989 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
1990 },
1991 {
1992 "id": "TveXwFiA",
1993 "line": 49,
1994 "message": "wrong indention",
1995 "updated": "2016-02-26 15:40:45.328000000",
1996 "author": {
1997 "_account_id": 1000110,
1998 "name": "Code Analyzer",
1999 "email": "code.analyzer@example.com"
2000 },
2001 "robotId": "styleChecker",
2002 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
2003 }
2004 ]
2005 }
2006----
2007
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002008[[list-change-drafts]]
2009=== List Change Drafts
2010--
2011'GET /changes/link:#change-id[\{change-id\}]/drafts'
2012--
2013
2014Lists the draft comments of all revisions of the change that belong to
2015the calling user.
2016
2017Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2018entries. The entries in the map are sorted by file path, and the
2019comments for each path are sorted by patch set number. Each comment has
2020the `patch_set` field set, and no `author`.
2021
2022.Request
2023----
2024 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
2025----
2026
2027.Response
2028----
2029 HTTP/1.1 200 OK
2030 Content-Disposition: attachment
2031 Content-Type: application/json; charset=UTF-8
2032
2033 )]}'
2034 {
2035 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2036 {
2037 "patch_set": 1,
2038 "id": "TvcXrmjM",
2039 "line": 23,
2040 "message": "[nit] trailing whitespace",
2041 "updated": "2013-02-26 15:40:43.986000000"
2042 },
2043 {
2044 "patch_set": 2,
2045 "id": "TveXwFiA",
2046 "line": 49,
2047 "in_reply_to": "TfYX-Iuo",
2048 "message": "Done",
2049 "updated": "2013-02-26 15:40:45.328000000"
2050 }
2051 ]
2052 }
2053----
2054
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002055[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002056=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002057--
2058'GET /changes/link:#change-id[\{change-id\}]/check'
2059--
2060
2061Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002062link:#change-info[ChangeInfo] entity with the `problems` field set to a
2063list of link:#problem-info[ProblemInfo] entities.
2064
2065Depending on the type of problem, some fields not marked optional may be
2066missing from the result. At least `id`, `project`, `branch`, and
2067`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002068
2069.Request
2070----
2071 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2072----
2073
2074.Response
2075----
2076 HTTP/1.1 200 OK
2077 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002078 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002079
2080 )]}'
2081 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002082 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2083 "project": "myProject",
2084 "branch": "master",
2085 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2086 "subject": "Implementing Feature X",
2087 "status": "NEW",
2088 "created": "2013-02-01 09:59:32.126000000",
2089 "updated": "2013-02-21 11:16:36.775000000",
2090 "mergeable": true,
2091 "insertions": 34,
2092 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002093 "_number": 3965,
2094 "owner": {
2095 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002096 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002097 "problems": [
2098 {
2099 "message": "Current patch set 1 not found"
2100 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002101 ]
2102 }
2103----
2104
Dave Borowitz3be39d02014-12-03 17:57:38 -08002105[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002106=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002107--
2108'POST /changes/link:#change-id[\{change-id\}]/check'
2109--
2110
2111Performs consistency checks on the change as with link:#check-change[GET
2112/check], and additionally fixes any problems that can be fixed
2113automatically. The returned field values reflect any fixes.
2114
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002115Some fixes have options controlling their behavior, which can be set in the
2116link:#fix-input[FixInput] entity body.
2117
Dave Borowitz3be39d02014-12-03 17:57:38 -08002118Only the change owner, a project owner, or an administrator may fix changes.
2119
2120.Request
2121----
2122 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2123----
2124
2125.Response
2126----
2127 HTTP/1.1 200 OK
2128 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002129 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002130
2131 )]}'
2132 {
2133 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2134 "project": "myProject",
2135 "branch": "master",
2136 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2137 "subject": "Implementing Feature X",
2138 "status": "MERGED",
2139 "created": "2013-02-01 09:59:32.126000000",
2140 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002141 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002142 "mergeable": true,
2143 "insertions": 34,
2144 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002145 "_number": 3965,
2146 "owner": {
2147 "name": "John Doe"
2148 },
2149 "problems": [
2150 {
2151 "message": "Current patch set 2 not found"
2152 },
2153 {
2154 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2155 "status": FIXED,
2156 "outcome": "Marked change as merged"
2157 }
2158 ]
2159 }
2160----
2161
Alan Tokaev392cfca2017-04-28 11:11:31 +02002162[[set-work-in-pogress]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002163=== Set Work-In-Progress
Alan Tokaev392cfca2017-04-28 11:11:31 +02002164--
2165'POST /changes/link:#change-id[\{change-id\}]/wip'
2166--
2167
2168Marks the change as not ready for review yet.
2169
2170The request body does not need to include a
2171link:#work-in-progress-input[WorkInProgressInput] entity if no review comment
2172is added. Actions that create a new patch set in a WIP change default to
2173notifying *OWNER* instead of *ALL*.
2174
2175.Request
2176----
2177 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0
2178 Content-Type: application/json; charset=UTF-8
2179
2180 {
2181 "message": "Refactoring needs to be done before we can proceed here."
2182 }
2183----
2184
2185.Response
2186----
2187 HTTP/1.1 200 OK
2188----
2189
2190[[set-ready-for-review]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002191=== Set Ready-For-Review
Alan Tokaev392cfca2017-04-28 11:11:31 +02002192--
2193'POST /changes/link:#change-id[\{change-id\}]/ready'
2194--
2195
2196Marks the change as ready for review (set WIP property to false).
2197
2198Activates notifications of reviewer. The request body does not need
2199to include a link:#work-in-progress-input[WorkInProgressInput] entity
2200if no review comment is added.
2201
2202.Request
2203----
2204 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0
2205 Content-Type: application/json;charset=UTF-8
2206
2207 {
2208 "message": "Refactoring is done."
2209 }
2210
2211----
2212
2213.Response
2214----
2215 HTTP/1.1 200 OK
2216----
2217
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002218[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002219=== Mark Private
2220--
Edwin Kempin364a86b2017-04-27 12:34:00 +02002221'POST /changes/link:#change-id[\{change-id\}]/private'
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002222--
2223
David Pursehouse540c8422017-05-10 16:41:59 +09002224Marks the change to be private. Changes may only be marked private by the
2225owner or site administrators.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002226
Edwin Kempin364a86b2017-04-27 12:34:00 +02002227A message can be specified in the request body inside a
2228link:#private-input[PrivateInput] entity.
2229
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002230.Request
2231----
Edwin Kempin364a86b2017-04-27 12:34:00 +02002232 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2233 Content-Type: application/json; charset=UTF-8
2234
2235 {
2236 "message": "After this security fix has been released we can make it public now."
2237 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002238----
2239
2240.Response
2241----
2242 HTTP/1.1 201 Created
2243----
2244
2245If the change was already private the response is "`200 OK`".
2246
2247[[unmark-private]]
2248=== Unmark Private
2249--
2250'DELETE /changes/link:#change-id[\{change-id\}]/private'
2251--
2252
2253Marks the change to be non-private. Note users can only unmark own private
2254changes.
2255
Edwin Kempin364a86b2017-04-27 12:34:00 +02002256A message can be specified in the request body inside a
2257link:#private-input[PrivateInput] entity.
2258
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002259.Request
2260----
2261 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
Edwin Kempin364a86b2017-04-27 12:34:00 +02002262 Content-Type: application/json; charset=UTF-8
2263
2264 {
2265 "message": "This is a security fix that must not be public."
2266 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002267----
2268
2269.Response
2270----
2271 HTTP/1.1 204 No Content
2272----
2273
2274If the change was already not private, the response is "`409 Conflict`".
2275
Edwin Kempin364a86b2017-04-27 12:34:00 +02002276Please note that some proxies prohibit request bodies for DELETE
2277requests. In this case, if you want to set a message options, use a
2278POST request:
2279
2280.Request
2281----
2282 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0
2283 Content-Type: application/json; charset=UTF-8
2284
2285 {
2286 "message": "This is a security fix that must not be public."
2287 }
2288----
2289
David Pursehoused656fa82017-04-28 06:51:26 +02002290[[ignore]]
2291=== Ignore
2292--
2293'PUT /changes/link:#change-id[\{change-id\}]/ignore'
2294--
2295
2296Marks a change as ignored. The change will not be shown in the incoming
2297reviews dashboard, and email notifications will be suppressed.
2298
2299.Request
2300----
2301 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ignore HTTP/1.0
2302----
2303
2304[[unignore]]
2305=== Unignore
2306--
2307'PUT /changes/link:#change-id[\{change-id\}]/unignore'
2308--
2309
2310Un-marks a change as ignored.
2311
2312.Request
2313----
2314 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unignore HTTP/1.0
2315----
2316
Gustaf Lundhe8647c62017-04-28 06:51:26 +02002317[[mute]]
2318=== Mute
2319--
2320'PUT /changes/link:#change-id[\{change-id\}]/mute'
2321--
2322
2323Marks a change as muted.
2324
2325This allows users to "de-highlight" changes in their dashboard until a new
2326patch set is uploaded.
2327
2328This differs from the link:#ignore[ignore] endpoint, which will mute
2329emails and hide the change from dashboard completely until it is
2330link:#unignore[unignored] again.
2331
2332
2333.Request
2334----
2335 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/mute HTTP/1.0
2336----
2337
2338[[unmute]]
2339=== Unmute
2340--
2341'PUT /changes/link:#change-id[\{change-id\}]/unmute'
2342--
2343
2344Unmutes a change.
2345
2346.Request
2347----
2348 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unmute HTTP/1.0
2349----
2350
David Ostrovsky1a49f622014-07-29 00:40:02 +02002351[[edit-endpoints]]
2352== Change Edit Endpoints
2353
David Ostrovsky1a49f622014-07-29 00:40:02 +02002354[[get-edit-detail]]
2355=== Get Change Edit Details
2356--
2357'GET /changes/link:#change-id[\{change-id\}]/edit
2358--
2359
2360Retrieves a change edit details.
2361
2362.Request
2363----
2364 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2365----
2366
2367As response an link:#edit-info[EditInfo] entity is returned that
2368describes the change edit, or "`204 No Content`" when change edit doesn't
2369exist for this change. Change edits are stored on special branches and there
2370can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02002371When request parameter `list` is provided the response also includes the file
2372list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02002373against this base revision. When request parameter `download-commands` is
2374provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02002375
2376.Response
2377----
2378 HTTP/1.1 200 OK
2379 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002380 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02002381
2382 )]}'
2383 {
2384 "commit":{
2385 "parents":[
2386 {
2387 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
2388 }
2389 ],
2390 "author":{
2391 "name":"Shawn O. Pearce",
2392 "email":"sop@google.com",
2393 "date":"2012-04-24 18:08:08.000000000",
2394 "tz":-420
2395 },
2396 "committer":{
2397 "name":"Shawn O. Pearce",
2398 "email":"sop@google.com",
2399 "date":"2012-04-24 18:08:08.000000000",
2400 "tz":-420
2401 },
2402 "subject":"Use an EventBus to manage star icons",
2403 "message":"Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2404 },
Michael Zhoud03fe282016-04-25 17:13:17 -04002405 "base_revision":"c35558e0925e6985c91f3a16921537d5e572b7a3"
David Ostrovsky1a49f622014-07-29 00:40:02 +02002406 }
2407----
David Pursehouse4e38b972014-05-30 10:36:40 +09002408
David Ostrovskya5ab8292014-08-01 02:11:39 +02002409[[put-edit-file]]
2410=== Change file content in Change Edit
2411--
2412'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2413--
2414
2415Put content of a file to a change edit.
2416
2417.Request
2418----
2419 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2420----
2421
2422When change edit doesn't exist for this change yet it is created. When file
2423content isn't provided, it is wiped out for that file. As response
2424"`204 No Content`" is returned.
2425
2426.Response
2427----
2428 HTTP/1.1 204 No Content
2429----
2430
David Ostrovsky138edb42014-08-15 21:31:43 +02002431[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01002432=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02002433--
2434'POST /changes/link:#change-id[\{change-id\}]/edit
2435--
2436
David Ostrovskya00c9532015-01-21 00:17:49 +01002437Creates empty change edit, restores file content or renames files in change
2438edit. The request body needs to include a
2439link:#change-edit-input[ChangeEditInput] entity when a file within change
2440edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02002441
2442.Request
2443----
2444 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002445 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02002446
2447 {
David Ostrovskybd12e172014-08-21 23:08:15 +02002448 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02002449 }
2450----
2451
David Ostrovskya00c9532015-01-21 00:17:49 +01002452or for rename:
2453
2454.Request
2455----
2456 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2457 Content-Type: application/json; charset=UTF-8
2458
2459 {
2460 "old_path": "foo",
2461 "new_path": "bar"
2462 }
2463----
2464
David Ostrovsky138edb42014-08-15 21:31:43 +02002465When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01002466and restore flag are provided in request body, this file is restored. When
2467old and new file names are provided, the file is renamed. As response
2468"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02002469
2470.Response
2471----
2472 HTTP/1.1 204 No Content
2473----
2474
David Ostrovskyc967e152014-10-24 17:36:16 +02002475[[put-change-edit-message]]
2476=== Change commit message in Change Edit
2477--
2478'PUT /changes/link:#change-id[\{change-id\}]/edit:message
2479--
2480
2481Modify commit message. The request body needs to include a
2482link:#change-edit-message-input[ChangeEditMessageInput]
2483entity.
2484
2485.Request
2486----
2487 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002488 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02002489
2490 {
2491 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
2492 }
2493----
2494
2495If a change edit doesn't exist for this change yet, it is created. As
2496response "`204 No Content`" is returned.
2497
2498.Response
2499----
2500 HTTP/1.1 204 No Content
2501----
2502
David Ostrovsky2830c292014-08-01 02:24:31 +02002503[[delete-edit-file]]
2504=== Delete file in Change Edit
2505--
2506'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
2507--
2508
2509Deletes a file from a change edit. This deletes the file from the repository
2510completely. This is not the same as reverting or restoring a file to its
2511previous contents.
2512
2513.Request
2514----
2515 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2516----
2517
2518When change edit doesn't exist for this change yet it is created.
2519
2520.Response
2521----
2522 HTTP/1.1 204 No Content
2523----
2524
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002525[[get-edit-file]]
2526=== Retrieve file content from Change Edit
2527--
2528'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2529--
2530
2531Retrieves content of a file from a change edit.
2532
2533.Request
2534----
2535 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2536----
2537
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002538The content of the file is returned as text encoded inside base64.
2539The Content-Type header will always be `text/plain` reflecting the
2540outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
2541can be examined to find the server detected content type of the file.
2542
2543When the specified file was deleted in the change edit
2544"`204 No Content`" is returned.
2545
2546If only the content type is required, callers should use HEAD to
2547avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002548
Michael Zhou551ad0c2016-04-26 01:21:42 -04002549If the `base` parameter is set to true, the returned content is from the
2550revision that the edit is based on.
2551
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002552.Response
2553----
2554 HTTP/1.1 200 OK
2555 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002556 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002557 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002558 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002559
2560 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
2561----
2562
David Ostrovskyd0078672015-02-06 21:51:04 +01002563Alternatively, if the only value of the Accept request header is
2564`application/json` the content is returned as JSON string and
2565`X-FYI-Content-Encoding` is set to `json`.
2566
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002567[[get-edit-meta-data]]
2568=== Retrieve meta data of a file from Change Edit
2569--
2570'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
2571--
2572
2573Retrieves meta data of a file from a change edit. Currently only
2574web links are returned.
2575
2576.Request
2577----
2578 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
2579----
2580
2581This REST endpoint retrieves additional information for a file in a
2582change edit. As result an link:#edit-file-info[EditFileInfo] entity is
2583returned.
2584
2585.Response
2586----
2587 HTTP/1.1 200 OK
2588 Content-Disposition: attachment
2589 Content-Type: application/json; charset=UTF-8
2590
2591 )]}'
2592 {
2593 "web_links":[
2594 {
2595 "show_on_side_by_side_diff_view": true,
2596 "name": "side-by-side preview diff",
2597 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
2598 "url": "#/x/xdocs/c/42/1..0/README.md",
2599 "target": "_self"
2600 },
2601 {
2602 "show_on_unified_diff_view": true,
2603 "name": "unified preview diff",
2604 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
2605 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
2606 "target": "_self"
2607 }
2608 ]}
2609----
2610
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002611[[get-edit-message]]
2612=== Retrieve commit message from Change Edit or current patch set of the change
2613--
2614'GET /changes/link:#change-id[\{change-id\}]/edit:message
2615--
2616
David Ostrovsky25ad15e2014-12-15 21:18:59 +01002617Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002618
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02002619If the `base` parameter is set to true, the returned message is from the
2620revision that the edit is based on.
2621
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002622.Request
2623----
2624 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
2625----
2626
2627The commit message is returned as base64 encoded string.
2628
2629.Response
2630----
2631 HTTP/1.1 200 OK
2632
2633 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
2634M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
2635----
2636
David Ostrovskyd0078672015-02-06 21:51:04 +01002637Alternatively, if the only value of the Accept request header is
2638`application/json` the commit message is returned as JSON string:
2639
2640.Response
2641----
2642 HTTP/1.1 200 OK
2643
2644)]}'
2645"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
2646----
2647
2648
David Ostrovskye9988f92014-08-01 09:56:34 +02002649[[publish-edit]]
2650=== Publish Change Edit
2651--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002652'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02002653--
2654
2655Promotes change edit to a regular patch set.
2656
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002657Options can be provided in the request body as a
2658link:#publish-change-edit-input[PublishChangeEditInput] entity.
2659
David Ostrovskye9988f92014-08-01 09:56:34 +02002660.Request
2661----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002662 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002663 Content-Type: application/json; charset=UTF-8
2664
2665 {
2666 "notify": "NONE"
2667 }
David Ostrovskye9988f92014-08-01 09:56:34 +02002668----
2669
2670As response "`204 No Content`" is returned.
2671
2672.Response
2673----
2674 HTTP/1.1 204 No Content
2675----
2676
David Ostrovsky46999d22014-08-16 02:19:13 +02002677[[rebase-edit]]
2678=== Rebase Change Edit
2679--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002680'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02002681--
2682
2683Rebases change edit on top of latest patch set.
2684
2685.Request
2686----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002687 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02002688----
2689
2690When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09002691"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02002692based on top of the latest patch set, the response
2693"`409 Conflict`" is returned.
2694
2695.Response
2696----
2697 HTTP/1.1 204 No Content
2698----
2699
David Ostrovsky8e75f502014-08-10 00:36:31 +02002700[[delete-edit]]
2701=== Delete Change Edit
2702--
2703'DELETE /changes/link:#change-id[\{change-id\}]/edit'
2704--
2705
2706Deletes change edit.
2707
2708.Request
2709----
2710 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2711----
2712
2713As response "`204 No Content`" is returned.
2714
2715.Response
2716----
2717 HTTP/1.1 204 No Content
2718----
2719
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01002720[[get-hashtags]]
2721=== Get Hashtags
2722--
2723'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2724--
2725
2726Gets the hashtags associated with a change.
2727
2728[NOTE] Hashtags are only available when NoteDb is enabled.
2729
2730.Request
2731----
2732 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2733----
2734
2735As response the change's hashtags are returned as a list of strings.
2736
2737.Response
2738----
2739 HTTP/1.1 200 OK
2740 Content-Disposition: attachment
2741 Content-Type: application/json; charset=UTF-8
2742
2743 )]}'
2744 [
2745 "hashtag1",
2746 "hashtag2"
2747 ]
2748----
2749
2750[[set-hashtags]]
2751=== Set Hashtags
2752--
2753'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2754--
2755
2756Adds and/or removes hashtags from a change.
2757
2758[NOTE] Hashtags are only available when NoteDb is enabled.
2759
2760The hashtags to add or remove must be provided in the request body inside a
2761link:#hashtags-input[HashtagsInput] entity.
2762
2763.Request
2764----
2765 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2766 Content-Type: application/json; charset=UTF-8
2767
2768 {
2769 "add" : [
2770 "hashtag3"
2771 ],
2772 "remove" : [
2773 "hashtag2"
2774 ]
2775 }
2776----
2777
2778As response the change's hashtags are returned as a list of strings.
2779
2780.Response
2781----
2782 HTTP/1.1 200 OK
2783 Content-Disposition: attachment
2784 Content-Type: application/json; charset=UTF-8
2785
2786 )]}'
2787 [
2788 "hashtag1",
2789 "hashtag3"
2790 ]
2791----
2792
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002793[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002794== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002795
2796[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002797=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002798--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002799'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002800--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002801
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002802Lists the reviewers of a change.
2803
2804As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
2805
2806.Request
2807----
2808 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
2809----
2810
2811.Response
2812----
2813 HTTP/1.1 200 OK
2814 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002815 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002816
2817 )]}'
2818 [
2819 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002820 "approvals": {
2821 "Verified": "+1",
2822 "Code-Review": "+2"
2823 },
2824 "_account_id": 1000096,
2825 "name": "John Doe",
2826 "email": "john.doe@example.com"
2827 },
2828 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002829 "approvals": {
2830 "Verified": " 0",
2831 "Code-Review": "-1"
2832 },
2833 "_account_id": 1000097,
2834 "name": "Jane Roe",
2835 "email": "jane.roe@example.com"
2836 }
2837 ]
2838----
2839
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002840[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002841=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002842--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002843'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002844--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002845
2846Suggest the reviewers for a given query `q` and result limit `n`. If result
2847limit is not passed, then the default 10 is used.
2848
Patrick Hieselc79ae0e2017-06-28 14:50:53 +02002849Groups can be excluded from the results by specifying 'e=f'.
2850
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002851As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
2852
2853.Request
2854----
2855 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
2856----
2857
2858.Response
2859----
2860 HTTP/1.1 200 OK
2861 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002862 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002863
2864 )]}'
2865 [
2866 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002867 "account": {
2868 "_account_id": 1000097,
2869 "name": "Jane Roe",
2870 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002871 },
2872 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002873 },
2874 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002875 "group": {
2876 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
2877 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002878 },
2879 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002880 }
2881 ]
2882----
2883
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002884[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002885=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002886--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002887'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002888--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002889
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002890Retrieves a reviewer of a change.
2891
2892As response a link:#reviewer-info[ReviewerInfo] entity is returned that
2893describes the reviewer.
2894
2895.Request
2896----
2897 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
2898----
2899
2900.Response
2901----
2902 HTTP/1.1 200 OK
2903 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002904 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002905
2906 )]}'
2907 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002908 "approvals": {
2909 "Verified": "+1",
2910 "Code-Review": "+2"
2911 },
2912 "_account_id": 1000096,
2913 "name": "John Doe",
2914 "email": "john.doe@example.com"
2915 }
2916----
2917
Edwin Kempin392328e2013-02-25 12:50:03 +01002918[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002919=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002920--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002921'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002922--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002923
Edwin Kempin392328e2013-02-25 12:50:03 +01002924Adds one user or all members of one group as reviewer to the change.
2925
2926The reviewer to be added to the change must be provided in the request
2927body as a link:#reviewer-input[ReviewerInput] entity.
2928
2929.Request
2930----
2931 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002932 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002933
2934 {
2935 "reviewer": "john.doe@example.com"
2936 }
2937----
2938
2939As response an link:#add-reviewer-result[AddReviewerResult] entity is
2940returned that describes the newly added reviewers.
2941
2942.Response
2943----
2944 HTTP/1.1 200 OK
2945 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002946 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002947
2948 )]}'
2949 {
Aaron Gable8c650212017-04-25 12:03:37 -07002950 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01002951 "reviewers": [
2952 {
Aaron Gable8c650212017-04-25 12:03:37 -07002953 "_account_id": 1000096,
2954 "name": "John Doe",
2955 "email": "john.doe@example.com"
Edwin Kempin392328e2013-02-25 12:50:03 +01002956 "approvals": {
2957 "Verified": " 0",
2958 "Code-Review": " 0"
2959 },
Edwin Kempin392328e2013-02-25 12:50:03 +01002960 }
2961 ]
2962 }
2963----
2964
2965If a group is specified, adding the group members as reviewers is an
2966atomic operation. This means if an error is returned, none of the
2967members are added as reviewer.
2968
2969If a group with many members is added as reviewer a confirmation may be
2970required.
2971
2972.Request
2973----
2974 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002975 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002976
2977 {
2978 "reviewer": "MyProjectVerifiers"
2979 }
2980----
2981
2982.Response
2983----
2984 HTTP/1.1 200 OK
2985 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002986 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002987
2988 )]}'
2989 {
Logan Hanks23e70282016-07-06 14:31:56 -07002990 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01002991 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
2992 "confirm": true
2993 }
2994----
2995
2996To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01002997`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01002998
2999.Request
3000----
3001 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003002 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003003
3004 {
Logan Hanks23e70282016-07-06 14:31:56 -07003005 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01003006 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01003007 }
3008----
3009
Patrick Hiesel11873ef2017-03-17 17:36:05 +01003010If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
3011for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
3012an email address of a reviewer or CC then, they will be added to the change even if they
3013don't have a Gerrit account.
3014
3015If this option is disabled, the request would fail with `400 Bad Request` if the email
3016address can't be resolved to an active Gerrit account.
3017
3018Note that the name is optional so both "un.registered@reviewer.com" and
3019"John Doe <un.registered@reviewer.com>" are valid inputs.
3020
3021Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
3022
3023.Request
3024----
3025 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
3026 Content-Type: application/json; charset=UTF-8
3027
3028 {
3029 "reviewer": "John Doe <un.registered@reviewer.com>"
3030 }
3031----
3032
3033.Response
3034----
3035 HTTP/1.1 200 OK
3036 Content-Disposition: attachment
3037 Content-Type: application/json; charset=UTF-8
3038
3039 )]}'
3040 {
3041 "input": "John Doe <un.registered@reviewer.com>"
3042 }
3043----
3044
Logan Hanksf03040e2017-05-03 09:40:56 -07003045.Notifications
3046
3047An email will be sent using the "newchange" template.
3048
3049[options="header",cols="1,1,1"]
3050|=============================
3051|WIP State |Default|notify=ALL
3052|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3053|Work in progress|not sent|owner, reviewers, CCs
3054|=============================
3055
Edwin Kempin53301072013-02-25 12:57:07 +01003056[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003057=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003058--
Edwin Kempin407fca32016-08-29 12:01:00 +02003059'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
3060'POST /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/delete'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003061--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003062
Edwin Kempin53301072013-02-25 12:57:07 +01003063Deletes a reviewer from a change.
3064
Edwin Kempin407fca32016-08-29 12:01:00 +02003065Options can be provided in the request body as a
3066link:#delete-reviewer-input[DeleteReviewerInput] entity.
3067
Edwin Kempin53301072013-02-25 12:57:07 +01003068.Request
3069----
3070 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02003071 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3072----
3073
3074Please note that some proxies prohibit request bodies for DELETE
3075requests. In this case, if you want to specify options, use a POST
3076request:
3077
3078.Request
3079----
3080 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3081 Content-Type: application/json; charset=UTF-8
3082
3083 {
3084 "notify": "NONE"
3085 }
Edwin Kempin53301072013-02-25 12:57:07 +01003086----
3087
3088.Response
3089----
3090 HTTP/1.1 204 No Content
3091----
3092
Logan Hanks87607412017-05-30 13:49:04 -07003093.Notifications
3094
3095An email will be sent using the "deleteReviewer" template. If deleting the
3096reviewer resulted in one or more approvals being removed, then the deleted
3097reviewer will also receive a notification (unless notify=NONE).
3098
3099[options="header",cols="1,5"]
3100|=============================
3101|WIP State |Default Recipients
3102|Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers
3103|Work in progress|notify=NONE: deleted reviewer (if voted)
3104|=============================
3105
David Ostrovskybeb0b842014-12-13 00:24:29 +01003106[[list-votes]]
3107=== List Votes
3108--
3109'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
3110--
3111
3112Lists the votes for a specific reviewer of the change.
3113
3114.Request
3115----
Edwin Kempin314f10a2016-07-11 11:39:05 +02003116 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01003117----
3118
3119As result a map is returned that maps the label name to the label value.
3120The entries in the map are sorted by label name.
3121
3122.Response
3123----
3124 HTTP/1.1 200 OK
3125 Content-Disposition: attachment
3126 Content-Type: application/json;charset=UTF-8
3127
3128 )]}'
3129 {
3130 "Code-Review": -1,
3131 "Verified": 1
3132 "Work-In-Progress": 1,
3133 }
3134----
3135
3136[[delete-vote]]
3137=== Delete Vote
3138--
Edwin Kempin5488dc12016-08-29 11:13:31 +02003139'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
Edwin Kempin32a7c532016-06-22 07:58:32 +02003140'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 Ostrovskybeb0b842014-12-13 00:24:29 +01003141--
3142
3143Deletes a single vote from a change. Note, that even when the last vote of
3144a reviewer is removed the reviewer itself is still listed on the change.
3145
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003146Options can be provided in the request body as a
3147link:#delete-vote-input[DeleteVoteInput] entity.
3148
David Ostrovskybeb0b842014-12-13 00:24:29 +01003149.Request
3150----
3151 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003152 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3153----
3154
3155Please note that some proxies prohibit request bodies for DELETE
3156requests. In this case, if you want to specify options, use a POST
3157request:
3158
3159.Request
3160----
3161 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3162 Content-Type: application/json; charset=UTF-8
3163
3164 {
3165 "notify": "NONE"
3166 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01003167----
3168
3169.Response
3170----
3171 HTTP/1.1 204 No Content
3172----
3173
Logan Hanksa1e68dc2017-06-29 15:13:27 -07003174
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003175[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003176== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003177
Shawn Pearce728ba882013-07-08 23:13:08 -07003178[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003179=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003180--
Shawn Pearce728ba882013-07-08 23:13:08 -07003181'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003182--
Shawn Pearce728ba882013-07-08 23:13:08 -07003183
3184Retrieves a parsed commit of a revision.
3185
3186.Request
3187----
3188 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
3189----
3190
3191As response a link:#commit-info[CommitInfo] entity is returned that
3192describes the revision.
3193
3194.Response
3195----
3196 HTTP/1.1 200 OK
3197 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003198 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07003199
3200 )]}'
3201 {
Edwin Kempinc8237402015-07-15 18:27:55 +02003202 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07003203 "parents": [
3204 {
3205 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3206 "subject": "Migrate contributor agreements to All-Projects."
3207 }
3208 ],
3209 "author": {
3210 "name": "Shawn O. Pearce",
3211 "email": "sop@google.com",
3212 "date": "2012-04-24 18:08:08.000000000",
3213 "tz": -420
3214 },
3215 "committer": {
3216 "name": "Shawn O. Pearce",
3217 "email": "sop@google.com",
3218 "date": "2012-04-24 18:08:08.000000000",
3219 "tz": -420
3220 },
3221 "subject": "Use an EventBus to manage star icons",
3222 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3223 }
3224----
3225
Sven Selbergd26bd542014-11-21 16:28:10 +01003226Adding query parameter `links` (for example `/changes/.../commit?links`)
3227returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07003228
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08003229[[get-description]]
3230=== Get Description
3231--
3232'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3233--
3234
3235Retrieves the description of a patch set.
3236
3237.Request
3238----
3239 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3240----
3241
3242.Response
3243----
3244 HTTP/1.1 200 OK
3245 Content-Disposition: attachment
3246 Content-Type: application/json; charset=UTF-8
3247
3248 )]}'
3249 "Added Documentation"
3250----
3251
3252If the patch set does not have a description an empty string is returned.
3253
3254[[set-description]]
3255=== Set Description
3256--
3257'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3258--
3259
3260Sets the description of a patch set.
3261
3262The new description must be provided in the request body inside a
3263link:#description-input[DescriptionInput] entity.
3264
3265.Request
3266----
3267 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3268 Content-Type: application/json; charset=UTF-8
3269
3270 {
3271 "description": "Added Documentation"
3272 }
3273----
3274
3275As response the new description is returned.
3276
3277.Response
3278----
3279 HTTP/1.1 200 OK
3280 Content-Disposition: attachment
3281 Content-Type: application/json; charset=UTF-8
3282
3283 )]}'
3284 "Added Documentation"
3285----
3286
Edwin Kempin0f229442016-09-09 13:06:12 +02003287[[get-merge-list]]
3288=== Get Merge List
3289--
3290'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
3291--
3292
3293Returns the list of commits that are being integrated into a target
3294branch by a merge commit. By default the first parent is assumed to be
3295uninteresting. By using the `parent` option another parent can be set
3296as uninteresting (parents are 1-based).
3297
3298The list of commits is returned as a list of
3299link:#commit-info[CommitInfo] entities. Web links are only included if
3300the `links` option was set.
3301
3302.Request
3303----
3304 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
3305----
3306
3307.Response
3308----
3309HTTP/1.1 200 OK
3310 Content-Disposition: attachment
3311 Content-Type: application/json; charset=UTF-8
3312
3313 )]}'
3314 [
3315 {
3316 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
3317 "parents": [
3318 {
3319 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3320 "subject": "Migrate contributor agreements to All-Projects."
3321 }
3322 ],
3323 "author": {
3324 "name": "Shawn O. Pearce",
3325 "email": "sop@google.com",
3326 "date": "2012-04-24 18:08:08.000000000",
3327 "tz": -420
3328 },
3329 "committer": {
3330 "name": "Shawn O. Pearce",
3331 "email": "sop@google.com",
3332 "date": "2012-04-24 18:08:08.000000000",
3333 "tz": -420
3334 },
3335 "subject": "Use an EventBus to manage star icons",
3336 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3337 }
3338 ]
3339----
3340
Stefan Bellerc7259662015-02-12 17:23:05 -08003341[[get-revision-actions]]
3342=== Get Revision Actions
3343--
3344'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
3345--
3346
3347Retrieves revision link:#action-info[actions] of the revision of a change.
3348
3349.Request
3350----
3351 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
3352----
3353
3354.Response
3355----
3356 HTTP/1.1 200 OK
3357 Content-Disposition: attachment
3358 Content-Type: application/json; charset=UTF-8
3359
3360 )]}'
3361
3362{
3363 "submit": {
3364 "method": "POST",
3365 "label": "Submit",
3366 "title": "Submit patch set 1 into master",
3367 "enabled": true
3368 },
3369 "cherrypick": {
3370 "method": "POST",
3371 "label": "Cherry Pick",
3372 "title": "Cherry pick change to a different branch",
3373 "enabled": true
3374 }
3375}
3376----
3377
3378The response is a flat map of possible revision actions mapped to their
3379link:#action-info[ActionInfo].
3380
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003381[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003382=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003383--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003384'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003385--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003386
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003387Retrieves a review of a revision.
3388
3389.Request
3390----
3391 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3392----
3393
3394As response a link:#change-info[ChangeInfo] entity with
3395link:#detailed-labels[detailed labels] and link:#detailed-accounts[
3396detailed accounts] is returned that describes the review of the
3397revision. The revision for which the review is retrieved is contained
3398in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05003399set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003400revision of the change. Please note that the returned labels are always
3401for the current patch set.
3402
3403.Response
3404----
3405 HTTP/1.1 200 OK
3406 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003407 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003408
3409 )]}'
3410 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003411 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
3412 "project": "myProject",
3413 "branch": "master",
3414 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
3415 "subject": "Implementing Feature X",
3416 "status": "NEW",
3417 "created": "2013-02-01 09:59:32.126000000",
3418 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003419 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003420 "insertions": 34,
3421 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003422 "_number": 3965,
3423 "owner": {
3424 "_account_id": 1000096,
3425 "name": "John Doe",
3426 "email": "john.doe@example.com"
3427 },
3428 "labels": {
3429 "Verified": {
3430 "all": [
3431 {
3432 "value": 0,
3433 "_account_id": 1000096,
3434 "name": "John Doe",
3435 "email": "john.doe@example.com"
3436 },
3437 {
3438 "value": 0,
3439 "_account_id": 1000097,
3440 "name": "Jane Roe",
3441 "email": "jane.roe@example.com"
3442 }
3443 ],
3444 "values": {
3445 "-1": "Fails",
3446 " 0": "No score",
3447 "+1": "Verified"
3448 }
3449 },
3450 "Code-Review": {
3451 "all": [
3452 {
3453 "value": -1,
3454 "_account_id": 1000096,
3455 "name": "John Doe",
3456 "email": "john.doe@example.com"
3457 },
3458 {
3459 "value": 1,
3460 "_account_id": 1000097,
3461 "name": "Jane Roe",
3462 "email": "jane.roe@example.com"
3463 }
3464 ]
3465 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04003466 "-2": "This shall not be merged",
3467 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003468 " 0": "No score",
3469 "+1": "Looks good to me, but someone else must approve",
3470 "+2": "Looks good to me, approved"
3471 }
3472 }
3473 },
3474 "permitted_labels": {
3475 "Verified": [
3476 "-1",
3477 " 0",
3478 "+1"
3479 ],
3480 "Code-Review": [
3481 "-2",
3482 "-1",
3483 " 0",
3484 "+1",
3485 "+2"
3486 ]
3487 },
3488 "removable_reviewers": [
3489 {
3490 "_account_id": 1000096,
3491 "name": "John Doe",
3492 "email": "john.doe@example.com"
3493 },
3494 {
3495 "_account_id": 1000097,
3496 "name": "Jane Roe",
3497 "email": "jane.roe@example.com"
3498 }
3499 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08003500 "reviewers": {
3501 "REVIEWER": [
3502 {
3503 "_account_id": 1000096,
3504 "name": "John Doe",
3505 "email": "john.doe@example.com"
3506 },
3507 {
3508 "_account_id": 1000097,
3509 "name": "Jane Roe",
3510 "email": "jane.roe@example.com"
3511 }
3512 ]
3513 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003514 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
3515 "revisions": {
3516 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09003517 "kind": "REWORK",
3518 "_number": 2,
3519 "ref": "refs/changes/65/3965/2",
3520 "fetch": {
3521 "http": {
3522 "url": "http://gerrit/myProject",
3523 "ref": "refs/changes/65/3965/2"
3524 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003525 }
3526 }
3527 }
3528 }
3529----
3530
David Pursehouse669f2512014-07-18 11:41:42 +09003531[[get-related-changes]]
3532=== Get Related Changes
3533--
3534'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
3535--
3536
3537Retrieves related changes of a revision. Related changes are changes that either
3538depend on, or are dependencies of the revision.
3539
3540.Request
3541----
3542 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
3543----
3544
3545As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
3546describing the related changes.
3547
3548.Response
3549----
3550 HTTP/1.1 200 OK
3551 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003552 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09003553
3554 )]}'
3555 {
3556 "changes": [
3557 {
Patrick Hieselcab63512017-07-28 10:25:42 +02003558 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09003559 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
3560 "commit": {
3561 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
3562 "parents": [
3563 {
3564 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
3565 }
3566 ],
3567 "author": {
3568 "name": "David Ostrovsky",
3569 "email": "david@ostrovsky.org",
3570 "date": "2014-07-12 15:04:24.000000000",
3571 "tz": 120
3572 },
3573 "subject": "Remove Solr"
3574 },
3575 "_change_number": 58478,
3576 "_revision_number": 2,
3577 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003578 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003579 },
3580 {
Patrick Hieselcab63512017-07-28 10:25:42 +02003581 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09003582 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
3583 "commit": {
3584 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
3585 "parents": [
3586 {
3587 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
3588 }
3589 ],
3590 "author": {
3591 "name": "David Pursehouse",
3592 "email": "david.pursehouse@sonymobile.com",
3593 "date": "2014-06-24 02:01:28.000000000",
3594 "tz": 540
3595 },
3596 "subject": "Add support for secondary index with Elasticsearch"
3597 },
3598 "_change_number": 58081,
3599 "_revision_number": 10,
3600 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003601 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003602 }
3603 ]
3604 }
3605----
3606
3607
Edwin Kempin67498de2013-02-25 16:15:34 +01003608[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003609=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003610--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003611'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003612--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003613
Logan Hanksf03040e2017-05-03 09:40:56 -07003614Sets a review on a revision, optionally also publishing draft comments, setting
Logan Hanks53c36012017-06-30 13:47:54 -07003615labels, adding reviewers or CCs, and modifying the work in progress property.
Edwin Kempin67498de2013-02-25 16:15:34 +01003616
3617The review must be provided in the request body as a
3618link:#review-input[ReviewInput] entity.
3619
Aaron Gable8c650212017-04-25 12:03:37 -07003620A review cannot be set on a change edit. Trying to post a review for a
3621change edit fails with `409 Conflict`.
3622
Logan Hanksf03040e2017-05-03 09:40:56 -07003623Here is an example of using this method to set labels:
Aaron Gable8c650212017-04-25 12:03:37 -07003624
Edwin Kempin67498de2013-02-25 16:15:34 +01003625.Request
3626----
3627 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003628 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003629
3630 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01003631 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01003632 "message": "Some nits need to be fixed.",
3633 "labels": {
3634 "Code-Review": -1
3635 },
3636 "comments": {
3637 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3638 {
3639 "line": 23,
3640 "message": "[nit] trailing whitespace"
3641 },
3642 {
3643 "line": 49,
3644 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09003645 },
3646 {
3647 "range": {
3648 "start_line": 50,
3649 "start_character": 0,
3650 "end_line": 55,
3651 "end_character": 20
3652 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09003653 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01003654 }
3655 ]
3656 }
3657 }
3658----
3659
Aaron Gable843b0c12017-04-21 08:25:27 -07003660As response a link:#review-result[ReviewResult] entity is returned that
Aaron Gable8c650212017-04-25 12:03:37 -07003661describes the applied labels and any added reviewers (e.g. yourself,
3662if you set a label but weren't previously a reviewer on this CL).
Edwin Kempin67498de2013-02-25 16:15:34 +01003663
3664.Response
3665----
3666 HTTP/1.1 200 OK
3667 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003668 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003669
3670 )]}'
3671 {
3672 "labels": {
3673 "Code-Review": -1
3674 }
3675 }
3676----
3677
Aaron Gable8c650212017-04-25 12:03:37 -07003678It is also possible to add one or more reviewers or CCs
Logan Hanksf03040e2017-05-03 09:40:56 -07003679to a change simultaneously with a review:
Logan Hanks5f1c7592016-07-06 14:39:33 -07003680
3681.Request
3682----
3683 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3684 Content-Type: application/json; charset=UTF-8
3685
3686 {
Aaron Gable8c650212017-04-25 12:03:37 -07003687 "message": "I don't have context here. Jane and maybe John and the project leads should take a look.",
Logan Hanks5f1c7592016-07-06 14:39:33 -07003688 "reviewers": [
3689 {
3690 "reviewer": "jane.roe@example.com"
3691 },
3692 {
Aaron Gable8c650212017-04-25 12:03:37 -07003693 "reviewer": "john.doe@example.com",
3694 "state": "CC"
3695 }
3696 {
3697 "reviewer": "MyProjectVerifiers",
Logan Hanks5f1c7592016-07-06 14:39:33 -07003698 }
3699 ]
3700 }
3701----
3702
3703Each element of the `reviewers` list is an instance of
3704link:#reviewer-input[ReviewerInput]. The corresponding result of
Aaron Gable8c650212017-04-25 12:03:37 -07003705adding each reviewer will be returned in a map of inputs to
3706link:#add-reviewer-result[AddReviewerResult]s.
Logan Hanks5f1c7592016-07-06 14:39:33 -07003707
3708.Response
3709----
3710 HTTP/1.1 200 OK
3711 Content-Disposition: attachment
3712 Content-Type: application/json; charset=UTF-8
3713
3714 )]}'
3715 {
Aaron Gable8c650212017-04-25 12:03:37 -07003716 "reviewers": {
3717 "jane.roe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07003718 "input": "jane.roe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07003719 "reviewers": [
3720 {
3721 "_account_id": 1000097,
3722 "name": "Jane Roe",
3723 "email": "jane.roe@example.com"
3724 "approvals": {
3725 "Verified": " 0",
3726 "Code-Review": " 0"
3727 },
3728 },
3729 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07003730 },
Aaron Gable8c650212017-04-25 12:03:37 -07003731 "john.doe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07003732 "input": "john.doe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07003733 "ccs": [
3734 {
3735 "_account_id": 1000096,
3736 "name": "John Doe",
3737 "email": "john.doe@example.com"
3738 "approvals": {
3739 "Verified": " 0",
3740 "Code-Review": " 0"
3741 },
3742 }
3743 ]
3744 },
3745 "MyProjectVerifiers": {
3746 "input": "MyProjectVerifiers",
3747 "reviewers": [
3748 {
3749 "_account_id": 1000098,
3750 "name": "Alice Ansel",
3751 "email": "alice.ansel@example.com"
3752 "approvals": {
3753 "Verified": " 0",
3754 "Code-Review": " 0"
3755 },
3756 },
3757 {
3758 "_account_id": 1000099,
3759 "name": "Bob Bollard",
3760 "email": "bob.bollard@example.com"
3761 "approvals": {
3762 "Verified": " 0",
3763 "Code-Review": " 0"
3764 },
3765 },
3766 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07003767 }
Aaron Gable8c650212017-04-25 12:03:37 -07003768 }
Logan Hanks5f1c7592016-07-06 14:39:33 -07003769 }
3770----
3771
Logan Hankse2aacef2016-07-22 15:54:52 -07003772If there are any errors returned for reviewers, the entire review request will
Aaron Gable8c650212017-04-25 12:03:37 -07003773be rejected with `400 Bad Request`. None of the entries will have the
3774`reviewers` or `ccs` field set, and those which specifically failed will have
3775the `errors` field set containing details of why they failed.
Logan Hankse2aacef2016-07-22 15:54:52 -07003776
3777.Error Response
3778----
3779 HTTP/1.1 400 Bad Request
3780 Content-Disposition: attachment
3781 Content-Type: application/json; charset=UTF-8
3782
3783 )]}'
3784 {
3785 "reviewers": {
Aaron Gable8c650212017-04-25 12:03:37 -07003786 "jane.roe@example.com": {
3787 "input": "jane.roe@example.com",
3788 "error": "Account of jane.roe@example.com is inactive."
3789 },
3790 "john.doe@example.com": {
3791 "input": "john.doe@example.com"
3792 },
Logan Hankse2aacef2016-07-22 15:54:52 -07003793 "MyProjectVerifiers": {
3794 "input": "MyProjectVerifiers",
3795 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3796 "confirm": true
3797 }
3798 }
3799 }
3800----
3801
Logan Hanksfc055962017-06-12 14:20:53 -07003802.Notifications
3803
3804An email will be sent using the "comment" template.
3805
3806If the top-level notify property is null or not set, then notification behavior
3807depends on whether the change is WIP, whether it has started review, and whether
3808the tag property is null.
3809
3810NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*.
3811Use the notify property of the top-level link:#review-input[ReviewInput] instead.
3812
3813For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS
3814watchers*.
3815
Logan Hanksea3e3b72017-06-12 14:21:47 -07003816[options="header",cols="2,1,1,2,2"]
Logan Hanksfc055962017-06-12 14:20:53 -07003817|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07003818|WIP State |Review Started|Tag Given|Default |notify=ALL
3819|Ready for review|N/A |N/A |everyone|everyone
3820|Work in progress|no |no |not sent|everyone
3821|Work in progress|no |yes |owner |everyone
3822|Work in progress|yes |no |everyone|everyone
3823|Work in progress|yes |yes |owner |everyone
3824
Logan Hanksfc055962017-06-12 14:20:53 -07003825|=============================
3826
3827If reviewers are added, then a second email will be sent using the "newchange"
3828template. The notification logic for this email is the same as for
3829link:#add-reviewer[Add Reviewer].
3830
Logan Hanksea3e3b72017-06-12 14:21:47 -07003831[options="header",cols="1,1,1"]
Logan Hanksfc055962017-06-12 14:20:53 -07003832|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07003833|WIP State |Default |notify=ALL
3834|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3835|Work in progress|not sent |owner, reviewers, CCs
Logan Hanksfc055962017-06-12 14:20:53 -07003836|=============================
3837
3838
Edwin Kempincdae63b2013-03-15 15:06:59 +01003839[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003840=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003841--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003842'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003843--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003844
3845Rebases a revision.
3846
Zalan Blenessy874aed72015-01-12 13:26:18 +01003847Optionally, the parent revision can be changed to another patch set through the
3848link:#rebase-input[RebaseInput] entity.
3849
Edwin Kempincdae63b2013-03-15 15:06:59 +01003850.Request
3851----
3852 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01003853 Content-Type: application/json;charset=UTF-8
3854
3855 {
3856 "base" : "1234",
3857 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01003858----
3859
3860As response a link:#change-info[ChangeInfo] entity is returned that
3861describes the rebased change. Information about the current patch set
3862is included.
3863
3864.Response
3865----
3866 HTTP/1.1 200 OK
3867 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003868 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003869
3870 )]}'
3871 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01003872 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3873 "project": "myProject",
3874 "branch": "master",
3875 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3876 "subject": "Implement Feature X",
3877 "status": "NEW",
3878 "created": "2013-02-01 09:59:32.126000000",
3879 "updated": "2013-02-21 11:16:36.775000000",
3880 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003881 "insertions": 21,
3882 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01003883 "_number": 4799,
3884 "owner": {
3885 "name": "John Doe"
3886 },
3887 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
3888 "revisions": {
3889 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09003890 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003891 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01003892 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003893 "fetch": {
3894 "http": {
3895 "url": "http://gerrit:8080/myProject",
3896 "ref": "refs/changes/99/4799/2"
3897 }
3898 },
3899 "commit": {
3900 "parents": [
3901 {
3902 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
3903 "subject": "Implement Feature A"
3904 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00003905 ],
3906 "author": {
3907 "name": "John Doe",
3908 "email": "john.doe@example.com",
3909 "date": "2013-05-07 15:21:27.000000000",
3910 "tz": 120
3911 },
3912 "committer": {
3913 "name": "Gerrit Code Review",
3914 "email": "gerrit-server@example.com",
3915 "date": "2013-05-07 15:35:43.000000000",
3916 "tz": 120
3917 },
3918 "subject": "Implement Feature X",
3919 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01003920 }
3921 }
3922 }
3923----
3924
3925If the revision cannot be rebased, e.g. due to conflicts, the response is
3926"`409 Conflict`" and the error message is contained in the response
3927body.
3928
3929.Response
3930----
3931 HTTP/1.1 409 Conflict
3932 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003933 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003934
3935 The change could not be rebased due to a path conflict during merge.
3936----
3937
Edwin Kempin14b58112013-02-26 16:30:19 +01003938[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003939=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003940--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003941'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003942--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003943
Edwin Kempin14b58112013-02-26 16:30:19 +01003944Submits a revision.
3945
Edwin Kempin14b58112013-02-26 16:30:19 +01003946.Request
3947----
3948 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003949 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003950----
3951
3952As response a link:#submit-info[SubmitInfo] entity is returned that
3953describes the status of the submitted change.
3954
3955.Response
3956----
3957 HTTP/1.1 200 OK
3958 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003959 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003960
3961 )]}'
3962 {
3963 "status": "MERGED"
3964 }
3965----
3966
3967If the revision cannot be submitted, e.g. because the submit rule
3968doesn't allow submitting the revision or the revision is not the
3969current revision, the response is "`409 Conflict`" and the error
3970message is contained in the response body.
3971
3972.Response
3973----
3974 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003975 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003976
3977 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
3978----
3979
David Ostrovsky0d69c232013-09-10 23:10:23 +02003980[[publish-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003981=== Publish Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003982--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003983'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003984--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003985
3986Publishes a draft revision.
3987
3988.Request
3989----
3990 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003991 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02003992----
3993
3994.Response
3995----
3996 HTTP/1.1 204 No Content
3997----
3998
3999[[delete-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004000=== Delete Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004001--
David Ostrovsky0d69c232013-09-10 23:10:23 +02004002'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004003--
David Ostrovsky0d69c232013-09-10 23:10:23 +02004004
4005Deletes a draft revision.
4006
4007.Request
4008----
4009 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004010 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02004011----
4012
4013.Response
4014----
4015 HTTP/1.1 204 No Content
4016----
4017
Edwin Kempin257d70f2013-03-28 14:31:14 +01004018[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004019=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004020--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004021'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004022--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004023
4024Gets the formatted patch for one revision.
4025
4026.Request
4027----
4028 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
4029----
4030
Shawn Pearce98361f72013-05-10 16:27:36 -07004031The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01004032
4033.Response
4034----
4035 HTTP/1.1 200 OK
4036 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004037 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07004038 X-FYI-Content-Encoding: base64
4039 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01004040
Shawn Pearce98361f72013-05-10 16:27:36 -07004041 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01004042----
4043
David Ostrovsky973f38b2013-08-22 00:24:51 -07004044Adding query parameter `zip` (for example `/changes/.../patch?zip`)
4045returns the patch as a single file inside of a ZIP archive. Clients
4046can expand the ZIP to obtain the plain text patch, avoiding the
4047need for a base64 decoding step. This option implies `download`.
4048
4049Query parameter `download` (e.g. `/changes/.../patch?download`)
4050will suggest the browser save the patch as `commitsha1.diff.base64`,
4051for later processing by command line tools.
4052
Kasper Nilsson81448072016-10-17 15:04:33 -07004053If the `path` parameter is set, the returned content is a diff of the single
4054file that the path refers to.
4055
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004056[[submit-preview]]
Edwin Kempin807eb4b2016-10-18 15:49:41 +02004057=== Submit Preview
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004058--
4059'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit'
4060--
4061Gets a file containing thin bundles of all modified projects if this
4062change was submitted. The bundles are named `${ProjectName}.git`.
4063Each thin bundle contains enough to construct the state in which a project would
4064be in if this change were submitted. The base of the thin bundles are the
4065current target branches, so to make use of this call in a non-racy way, first
4066get the bundles and then fetch all projects contained in the bundle.
4067(This assumes no non-fastforward pushes).
4068
4069You need to give a parameter '?format=zip' or '?format=tar' to specify the
Stefan Beller3e586742016-10-05 15:23:22 -07004070format for the outer container. It is always possible to use tgz, even if
4071tgz is not in the list of allowed archive formats.
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004072
4073To make good use of this call, you would roughly need code as found at:
4074----
4075 $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh
4076----
4077.Request
4078----
4079 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0
4080----
4081
4082.Response
4083----
4084 HTTP/1.1 200 OK
4085 Date: Tue, 13 Sep 2016 19:13:46 GMT
4086 Content-Disposition: attachment; filename="submit-preview-147.zip"
4087 X-Content-Type-Options: nosniff
4088 Cache-Control: no-cache, no-store, max-age=0, must-revalidate
4089 Pragma: no-cache
4090 Expires: Mon, 01 Jan 1990 00:00:00 GMT
4091 Content-Type: application/x-zip
4092 Transfer-Encoding: chunked
4093
4094 [binary stuff]
4095----
4096
4097In case of an error, the response is not a zip file but a regular json response,
4098containing only the error message:
4099
4100.Response
4101----
4102 HTTP/1.1 200 OK
4103 Content-Disposition: attachment
4104 Content-Type: application/json; charset=UTF-8
4105
4106 )]}'
4107 "Anonymous users cannot submit"
4108----
4109
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004110[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004111=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004112--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004113'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004114--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004115
4116Gets the method the server will use to submit (merge) the change and
4117an indicator if the change is currently mergeable.
4118
4119.Request
4120----
4121 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
4122----
4123
Saša Živkov499873f2014-05-05 13:34:18 +02004124As response a link:#mergeable-info[MergeableInfo] entity is returned.
4125
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004126.Response
4127----
4128 HTTP/1.1 200 OK
4129 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004130 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004131
4132 )]}'
4133 {
4134 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004135 strategy: "recursive",
4136 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004137 }
4138----
4139
Saša Živkov697cab22014-04-29 16:46:50 +02004140If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08004141checked for all other branches which are listed in the
4142link:config-project-config.html#branchOrder-section[branchOrder] section in the
4143project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02004144
4145.Request
4146----
4147 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
4148----
4149
4150The response will then contain a list of all other branches where this changes
4151could merge cleanly.
4152
4153.Response
4154----
4155 HTTP/1.1 200 OK
4156 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004157 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02004158
4159 )]}'
4160 {
4161 submit_type: "MERGE_IF_NECESSARY",
4162 mergeable: true,
4163 mergeable_into: [
4164 "refs/heads/stable-2.7",
4165 "refs/heads/stable-2.8",
4166 ]
4167 }
4168----
4169
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004170[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004171=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004172--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004173'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004174--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004175
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004176Gets the method the server will use to submit (merge) the change.
4177
4178.Request
4179----
4180 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
4181----
4182
4183.Response
4184----
4185 HTTP/1.1 200 OK
4186 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004187 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004188
4189 )]}'
4190 "MERGE_IF_NECESSARY"
4191----
4192
4193[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004194=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004195--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004196'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004197--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004198
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004199Tests the submit_type Prolog rule in the project, or the one given.
4200
4201Request body may be either the Prolog code as `text/plain` or a
4202link:#rule-input[RuleInput] object. The query parameter `filters`
4203may be set to `SKIP` to bypass parent project filters while testing
4204a project-specific rule.
4205
4206.Request
4207----
4208 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004209 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004210
4211 submit_type(cherry_pick).
4212----
4213
4214.Response
4215----
4216 HTTP/1.1 200 OK
4217 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004218 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004219
4220 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07004221 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004222----
4223
4224[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004225=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004226--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004227'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004228--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004229
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004230Tests the submit_rule Prolog rule in the project, or the one given.
4231
4232Request body may be either the Prolog code as `text/plain` or a
4233link:#rule-input[RuleInput] object. The query parameter `filters`
4234may be set to `SKIP` to bypass parent project filters while testing
4235a project-specific rule.
4236
4237.Request
4238----
Shawn Pearcea3cce712014-03-21 08:16:11 -07004239 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004240 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004241
4242 submit_rule(submit(R)) :-
4243 R = label('Any-Label-Name', reject(_)).
4244----
4245
4246The response is a list of link:#submit-record[SubmitRecord] entries
4247describing the permutations that satisfy the tested submit rule.
4248
4249.Response
4250----
4251 HTTP/1.1 200 OK
4252 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004253 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004254
4255 )]}'
4256 [
4257 {
4258 "status": "NOT_READY",
4259 "reject": {
4260 "Any-Label-Name": {}
4261 }
4262 }
4263 ]
4264----
4265
Shawn Pearceb42e3032015-04-02 10:28:10 -07004266When testing with the `curl` command line client the
4267`--data-binary @rules.pl` flag should be used to ensure
4268all LFs are included in the Prolog code:
4269
4270----
4271 curl -X POST \
4272 -H 'Content-Type: text/plain; charset=UTF-8' \
4273 --data-binary @rules.pl \
4274 http://.../test.submit_rule
4275----
4276
Edwin Kempincb6724a2013-02-26 16:58:51 +01004277[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004278=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004279--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004280'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004281--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004282
Edwin Kempin3ca57192013-02-27 07:44:01 +01004283Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01004284user.
4285
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004286Returns a map of file paths to lists of link:#comment-info[CommentInfo]
4287entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004288
4289.Request
4290----
4291 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
4292----
4293
4294.Response
4295----
4296 HTTP/1.1 200 OK
4297 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004298 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01004299
4300 )]}'
4301 {
4302 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4303 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004304 "id": "TvcXrmjM",
4305 "line": 23,
4306 "message": "[nit] trailing whitespace",
4307 "updated": "2013-02-26 15:40:43.986000000"
4308 },
4309 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004310 "id": "TveXwFiA",
4311 "line": 49,
4312 "in_reply_to": "TfYX-Iuo",
4313 "message": "Done",
4314 "updated": "2013-02-26 15:40:45.328000000"
4315 }
4316 ]
4317 }
4318----
4319
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004320[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004321=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004322--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004323'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004324--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004325
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004326Creates a draft comment on a revision.
4327
4328The new draft comment must be provided in the request body inside a
4329link:#comment-input[CommentInput] entity.
4330
4331.Request
4332----
4333 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004334 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004335
4336 {
4337 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4338 "line": 23,
4339 "message": "[nit] trailing whitespace"
4340 }
4341----
4342
4343As response a link:#comment-info[CommentInfo] entity is returned that
4344describes the draft comment.
4345
4346.Response
4347----
4348 HTTP/1.1 200 OK
4349 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004350 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004351
4352 )]}'
4353 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004354 "id": "TvcXrmjM",
4355 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4356 "line": 23,
4357 "message": "[nit] trailing whitespace",
4358 "updated": "2013-02-26 15:40:43.986000000"
4359 }
4360----
4361
Edwin Kempin3ca57192013-02-27 07:44:01 +01004362[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004363=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004364--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004365'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004366--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004367
Edwin Kempin3ca57192013-02-27 07:44:01 +01004368Retrieves a draft comment of a revision that belongs to the calling
4369user.
4370
4371.Request
4372----
4373 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4374----
4375
4376As response a link:#comment-info[CommentInfo] entity is returned that
4377describes the draft comment.
4378
4379.Response
4380----
4381 HTTP/1.1 200 OK
4382 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004383 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01004384
4385 )]}'
4386 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01004387 "id": "TvcXrmjM",
4388 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4389 "line": 23,
4390 "message": "[nit] trailing whitespace",
4391 "updated": "2013-02-26 15:40:43.986000000"
4392 }
4393----
4394
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004395[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004396=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004397--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004398'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004399--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004400
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004401Updates a draft comment on a revision.
4402
4403The new draft comment must be provided in the request body inside a
4404link:#comment-input[CommentInput] entity.
4405
4406.Request
4407----
4408 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004409 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004410
4411 {
4412 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4413 "line": 23,
4414 "message": "[nit] trailing whitespace"
4415 }
4416----
4417
4418As response a link:#comment-info[CommentInfo] entity is returned that
4419describes the draft comment.
4420
4421.Response
4422----
4423 HTTP/1.1 200 OK
4424 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004425 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004426
4427 )]}'
4428 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004429 "id": "TvcXrmjM",
4430 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4431 "line": 23,
4432 "message": "[nit] trailing whitespace",
4433 "updated": "2013-02-26 15:40:43.986000000"
4434 }
4435----
4436
4437[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004438=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004439--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004440'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004441--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004442
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004443Deletes a draft comment from a revision.
4444
4445.Request
4446----
4447 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4448----
4449
4450.Response
4451----
4452 HTTP/1.1 204 No Content
4453----
4454
John Spurlock5e402f02013-03-24 11:35:04 -04004455[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004456=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004457--
John Spurlock5e402f02013-03-24 11:35:04 -04004458'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004459--
John Spurlock5e402f02013-03-24 11:35:04 -04004460
4461Lists the published comments of a revision.
4462
4463As result a map is returned that maps the file path to a list of
4464link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07004465sorted by file path and only include file (or inline) comments. Use
4466the link:#get-change-detail[Get Change Detail] endpoint to retrieve
4467the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04004468
4469.Request
4470----
4471 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
4472----
4473
4474.Response
4475----
4476 HTTP/1.1 200 OK
4477 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004478 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004479
4480 )]}'
4481 {
4482 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4483 {
John Spurlock5e402f02013-03-24 11:35:04 -04004484 "id": "TvcXrmjM",
4485 "line": 23,
4486 "message": "[nit] trailing whitespace",
4487 "updated": "2013-02-26 15:40:43.986000000",
4488 "author": {
4489 "_account_id": 1000096,
4490 "name": "John Doe",
4491 "email": "john.doe@example.com"
4492 }
4493 },
4494 {
John Spurlock5e402f02013-03-24 11:35:04 -04004495 "id": "TveXwFiA",
4496 "line": 49,
4497 "in_reply_to": "TfYX-Iuo",
4498 "message": "Done",
4499 "updated": "2013-02-26 15:40:45.328000000",
4500 "author": {
4501 "_account_id": 1000097,
4502 "name": "Jane Roe",
4503 "email": "jane.roe@example.com"
4504 }
4505 }
4506 ]
4507 }
4508----
4509
4510[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004511=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004512--
John Spurlock5e402f02013-03-24 11:35:04 -04004513'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004514--
John Spurlock5e402f02013-03-24 11:35:04 -04004515
4516Retrieves a published comment of a revision.
4517
4518.Request
4519----
4520 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
4521----
4522
4523As response a link:#comment-info[CommentInfo] entity is returned that
4524describes the published comment.
4525
4526.Response
4527----
4528 HTTP/1.1 200 OK
4529 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004530 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004531
4532 )]}'
4533 {
John Spurlock5e402f02013-03-24 11:35:04 -04004534 "id": "TvcXrmjM",
4535 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4536 "line": 23,
4537 "message": "[nit] trailing whitespace",
4538 "updated": "2013-02-26 15:40:43.986000000",
4539 "author": {
4540 "_account_id": 1000096,
4541 "name": "John Doe",
4542 "email": "john.doe@example.com"
4543 }
4544 }
4545----
4546
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01004547[[delete-comment]]
4548=== Delete Comment
4549--
4550'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' +
4551'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete'
4552--
4553
4554Deletes a published comment of a revision. Instead of deleting the
4555whole comment, this endpoint just replaces the comment's message
4556with a new message, which contains the name of the user who deletes
4557the comment and the reason why it's deleted. The reason can be
4558provided in the request body as a
4559link:#delete-comment-input[DeleteCommentInput] entity.
4560
4561Note that only users with the
4562link:access-control.html#capability_administrateServer[Administrate Server]
4563global capability are permitted to delete a comment.
4564
4565Please note that some proxies prohibit request bodies for DELETE
4566requests. In this case, if you want to specify options, use a
4567POST request:
4568
4569.Request
4570----
4571 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0
4572 Content-Type: application/json; charset=UTF-8
4573
4574 {
4575 "reason": "contains confidential information"
4576 }
4577----
4578
4579As response a link:#comment-info[CommentInfo] entity is returned that
4580describes the updated comment.
4581
4582.Response
4583----
4584 HTTP/1.1 200 OK
4585 Content-Disposition: attachment
4586 Content-Type: application/json; charset=UTF-8
4587
4588 )]}'
4589 {
4590 "id": "TvcXrmjM",
4591 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4592 "line": 23,
4593 "message": "Comment removed by: Administrator; Reason: contains confidential information",
4594 "updated": "2013-02-26 15:40:43.986000000",
4595 "author": {
4596 "_account_id": 1000096,
4597 "name": "John Doe",
4598 "email": "john.doe@example.com"
4599 }
4600 }
4601----
4602
Edwin Kempinb050a482016-12-01 09:11:19 +01004603[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02004604=== List Robot Comments
4605--
4606'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
4607--
4608
4609Lists the link:config-robot-comments.html[robot comments] of a
4610revision.
4611
4612As result a map is returned that maps the file path to a list of
4613link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
4614map are sorted by file path.
4615
4616.Request
4617----
4618 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
4619----
4620
4621.Response
4622----
4623 HTTP/1.1 200 OK
4624 Content-Disposition: attachment
4625 Content-Type: application/json; charset=UTF-8
4626
4627 )]}'
4628 {
4629 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4630 {
4631 "id": "TvcXrmjM",
4632 "line": 23,
4633 "message": "unused import",
4634 "updated": "2016-02-26 15:40:43.986000000",
4635 "author": {
4636 "_account_id": 1000110,
4637 "name": "Code Analyzer",
4638 "email": "code.analyzer@example.com"
4639 },
4640 "robotId": "importChecker",
4641 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4642 },
4643 {
4644 "id": "TveXwFiA",
4645 "line": 49,
4646 "message": "wrong indention",
4647 "updated": "2016-02-26 15:40:45.328000000",
4648 "author": {
4649 "_account_id": 1000110,
4650 "name": "Code Analyzer",
4651 "email": "code.analyzer@example.com"
4652 },
4653 "robotId": "styleChecker",
4654 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
4655 }
4656 ]
4657 }
4658----
4659
4660[[get-robot-comment]]
4661=== Get Robot Comment
4662--
4663'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
4664--
4665
4666Retrieves a link:config-robot-comments.html[robot comment] of a
4667revision.
4668
4669.Request
4670----
4671 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
4672----
4673
4674As response a link:#robot-comment-info[RobotCommentInfo] entity is
4675returned that describes the robot comment.
4676
4677.Response
4678----
4679 HTTP/1.1 200 OK
4680 Content-Disposition: attachment
4681 Content-Type: application/json; charset=UTF-8
4682
4683 )]}'
4684 {
4685 "id": "TvcXrmjM",
4686 "line": 23,
4687 "message": "unused import",
4688 "updated": "2016-02-26 15:40:43.986000000",
4689 "author": {
4690 "_account_id": 1000110,
4691 "name": "Code Analyzer",
4692 "email": "code.analyzer@example.com"
4693 },
4694 "robotId": "importChecker",
4695 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4696 }
4697----
4698
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004699[[apply-fix]]
4700=== Apply Fix
4701--
4702'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
4703--
4704
4705Applies a suggested fix by creating a change edit which includes the
4706modifications indicated by the fix suggestion. If a change edit already exists,
4707it will be updated accordingly. A fix can only be applied if no change edit
4708exists and the fix refers to the current patch set, or the fix refers to the
4709patch set on which the change edit is based.
4710
4711.Request
4712----
4713 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
4714----
4715
4716If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
4717resulting change edit is returned.
4718
4719.Response
4720----
4721 HTTP/1.1 200 OK
4722 Content-Disposition: attachment
4723 Content-Type: application/json; charset=UTF-8
4724
4725 )]}'
4726 {
4727 "commit":{
4728 "parents":[
4729 {
4730 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
4731 }
4732 ],
4733 "author":{
4734 "name":"John Doe",
4735 "email":"john.doe@example.com",
4736 "date":"2013-05-07 15:21:27.000000000",
4737 "tz":120
4738 },
4739 "committer":{
4740 "name":"Jane Doe",
4741 "email":"jane.doe@example.com",
4742 "date":"2013-05-07 15:35:43.000000000",
4743 "tz":120
4744 },
4745 "subject":"Implement feature X",
4746 "message":"Implement feature X\n\nWith this feature ..."
4747 },
4748 "base_revision":"674ac754f91e64a0efb8087e59a176484bd534d1"
4749 }
4750----
4751
4752If the application failed e.g. due to conflicts with an existing change edit,
4753the response "`409 Conflict`" including an error message in the response body
4754is returned.
4755
4756.Response
4757----
4758 HTTP/1.1 409 Conflict
4759 Content-Disposition: attachment
4760 Content-Type: text/plain; charset=UTF-8
4761
4762 The existing change edit could not be merged with another tree.
4763----
4764
Edwin Kempin682ac712013-05-14 13:40:46 +02004765[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004766=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004767--
Edwin Kempin682ac712013-05-14 13:40:46 +02004768'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004769--
Edwin Kempin682ac712013-05-14 13:40:46 +02004770
4771Lists the files that were modified, added or deleted in a revision.
4772
4773.Request
4774----
4775 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
4776----
4777
David Pursehouse11badbb2017-03-27 10:58:05 +09004778As result a map is returned that maps the link:#file-id[file path] to a list of
Edwin Kempin682ac712013-05-14 13:40:46 +02004779link:#file-info[FileInfo] entries. The entries in the map are
4780sorted by file path.
4781
4782.Response
4783----
4784 HTTP/1.1 200 OK
4785 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004786 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02004787
4788 )]}'
4789 {
4790 "/COMMIT_MSG": {
4791 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02004792 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004793 "size_delta": 551,
4794 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02004795 },
4796 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
4797 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02004798 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004799 "size_delta": 98,
4800 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02004801 }
4802 }
4803----
4804
Shawn Pearce984747d2013-07-18 00:42:16 -07004805The request parameter `reviewed` changes the response to return a list
4806of the paths the caller has marked as reviewed. Clients that also
4807need the FileInfo should make two requests.
4808
Shawn Pearce8ca03a62015-01-02 22:03:20 -08004809The request parameter `q` changes the response to return a list
4810of all files (modified or unmodified) that contain that substring
4811in the path name. This is useful to implement suggestion services
4812finding a file by partial name.
4813
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01004814The integer-valued request parameter `parent` changes the response to return a
4815list of the files which are different in this commit compared to the given
4816parent commit. This is useful for supporting review of merge commits. The value
4817is the 1-based index of the parent's position in the commit object.
4818
Shawn Pearce984747d2013-07-18 00:42:16 -07004819.Request
4820----
4821 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
4822----
4823
4824.Response
4825----
4826 HTTP/1.1 200 OK
4827 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004828 Content-Type: application/json; charset=UTF-8
Shawn Pearce984747d2013-07-18 00:42:16 -07004829
4830 )]}'
4831 [
4832 "/COMMIT_MSG",
4833 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4834 ]
4835----
4836
Edwin Kempinaef44b02013-05-07 16:15:55 +02004837[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004838=== Get Content
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004839--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004840'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004841--
Edwin Kempinaef44b02013-05-07 16:15:55 +02004842
4843Gets the content of a file from a certain revision.
4844
Patrick Hiesel38667d42017-05-02 13:12:48 +02004845The optional, integer-valued `parent` parameter can be specified to request
4846the named file from a parent commit of the specified revision. The value is
4847the 1-based index of the parent's position in the commit object. If the
4848parameter is omitted or the value is non-positive, the patch set is referenced.
4849
Edwin Kempinaef44b02013-05-07 16:15:55 +02004850.Request
4851----
4852 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
4853----
4854
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004855The content is returned as base64 encoded string. The HTTP response
4856Content-Type is always `text/plain`, reflecting the base64 wrapping.
4857A Gerrit-specific `X-FYI-Content-Type` header is returned describing
4858the server detected content type of the file.
4859
4860If only the content type is required, callers should use HEAD to
4861avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02004862
4863.Response
4864----
4865 HTTP/1.1 200 OK
4866 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004867 Content-Type: text/plain; charset=ISO-8859-1
4868 X-FYI-Content-Encoding: base64
4869 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02004870
4871 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
4872----
4873
David Ostrovskyd0078672015-02-06 21:51:04 +01004874Alternatively, if the only value of the Accept request header is
4875`application/json` the content is returned as JSON string and
4876`X-FYI-Content-Encoding` is set to `json`.
4877
David Pletcherd1efb452015-09-01 17:45:55 -07004878[[get-safe-content]]
4879=== Download Content
4880--
4881'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
4882--
4883
4884Downloads the content of a file from a certain revision, in a safe format
4885that poses no risk for inadvertent execution of untrusted code.
4886
4887If the content type is defined as safe, the binary file content is returned
4888verbatim. If the content type is not safe, the file is stored inside a ZIP
4889file, containing a single entry with a random, unpredictable name having the
4890same base and suffix as the true filename. The ZIP file is returned in
4891verbatim binary form.
4892
4893See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
4894for information about safe file type configuration.
4895
4896The HTTP resource Content-Type is dependent on the file type: the
4897applicable type for safe files, or "application/zip" for unsafe files.
4898
David Pletcherec622bf2015-09-18 14:30:05 -07004899The optional, integer-valued `parent` parameter can be specified to request
4900the named file from a parent commit of the specified revision. The value is
4901the 1-based index of the parent's position in the commit object. If the
4902parameter is omitted or the value non-positive, the patch set is referenced.
4903
4904Filenames are decorated with a suffix of `_new` for the current patch,
4905`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07004906
4907.Request
4908----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004909 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07004910----
4911
4912.Response
4913----
4914 HTTP/1.1 200 OK
4915 Content-Disposition: attachment; filename="logo.png"
4916 Content-Type: image/png
4917
4918 `[binary data for logo.png]`
4919----
4920
4921.Request
4922----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004923 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 Pletcherd1efb452015-09-01 17:45:55 -07004924----
4925
4926.Response
4927----
4928 HTTP/1.1 200 OK
4929 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
4930 Content-Type:application/zip
4931
4932 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
4933----
4934
David Pursehouse882aef22013-06-05 10:56:37 +09004935[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004936=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004937--
David Pursehouse882aef22013-06-05 10:56:37 +09004938'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/diff'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004939--
David Pursehouse882aef22013-06-05 10:56:37 +09004940
4941Gets the diff of a file from a certain revision.
4942
4943.Request
4944----
4945 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
4946----
4947
4948As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
4949
4950.Response
4951----
4952 HTTP/1.1 200 OK
4953 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004954 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004955
4956 )]
4957 {
4958 "meta_a": {
4959 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004960 "content_type": "text/x-java-source",
4961 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09004962 },
4963 "meta_b": {
4964 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004965 "content_type": "text/x-java-source",
4966 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004967 },
4968 "change_type": "MODIFIED",
4969 "diff_header": [
4970 "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",
4971 "index 59b7670..9faf81c 100644",
4972 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4973 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
4974 ],
4975 "content": [
4976 {
4977 "ab": [
4978 "// Copyright (C) 2010 The Android Open Source Project",
4979 "//",
4980 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
4981 "// you may not use this file except in compliance with the License.",
4982 "// You may obtain a copy of the License at",
4983 "//",
4984 "// http://www.apache.org/licenses/LICENSE-2.0",
4985 "//",
4986 "// Unless required by applicable law or agreed to in writing, software",
4987 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
4988 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
4989 "// See the License for the specific language governing permissions and",
4990 "// limitations under the License."
4991 ]
4992 },
4993 {
4994 "b": [
4995 "//",
4996 "// Add some more lines in the header."
4997 ]
4998 },
4999 {
5000 "ab": [
5001 "",
5002 "package com.google.gerrit.server.project;",
5003 "",
5004 "import com.google.common.collect.Maps;",
5005 ...
5006 ]
5007 }
5008 ...
5009 ]
5010 }
5011----
5012
5013If the `intraline` parameter is specified, intraline differences are included in the diff.
5014
5015.Request
5016----
5017 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
5018----
5019
5020.Response
5021----
5022 HTTP/1.1 200 OK
5023 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005024 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005025
5026 )]
5027 {
5028 "meta_a": {
5029 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005030 "content_type": "text/x-java-source",
5031 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005032 },
5033 "meta_b": {
5034 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005035 "content_type": "text/x-java-source",
5036 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005037 },
5038 "change_type": "MODIFIED",
5039 "diff_header": [
5040 "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",
5041 "index 59b7670..9faf81c 100644",
5042 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5043 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5044 ],
5045 "content": [
5046 ...
5047 {
5048 "a": [
5049 "/** Manages access control for Git references (aka branches, tags). */"
5050 ],
5051 "b": [
5052 "/** Manages access control for the Git references (aka branches, tags). */"
5053 ],
5054 "edit_a": [],
5055 "edit_b": [
5056 [
5057 31,
5058 4
5059 ]
5060 ]
5061 }
5062 ]
5063 }
5064----
5065
5066The `base` parameter can be specified to control the base patch set from which the diff should
5067be generated.
5068
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005069The integer-valued request parameter `parent` can be specified to control the
5070parent commit number against which the diff should be generated. This is useful
5071for supporting review of merge commits. The value is the 1-based index of the
5072parent's position in the commit object.
5073
Edwin Kempin8cdce502014-12-06 10:55:38 +01005074[[weblinks-only]]
5075If the `weblinks-only` parameter is specified, only the diff web links are returned.
5076
David Pursehouse882aef22013-06-05 10:56:37 +09005077.Request
5078----
5079 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
5080----
5081
5082.Response
5083----
5084 HTTP/1.1 200 OK
5085 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005086 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005087
5088 )]
5089 {
5090 "meta_a": {
5091 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005092 "content_type": "text/x-java-source",
5093 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005094 },
5095 "meta_b": {
5096 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005097 "content_type": "text/x-java-source",
5098 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005099 },
5100 "change_type": "MODIFIED",
5101 "content": [
5102 {
5103 "skip": 578
5104 }
5105 ]
5106 }
5107----
5108
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01005109The `whitespace` parameter can be specified to control how whitespace
5110differences are reported in the result. Valid values are `IGNORE_NONE`,
5111`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09005112
5113The `context` parameter can be specified to control the number of lines of surrounding context
5114in the diff. Valid values are `ALL` or number of lines.
5115
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005116[[get-blame]]
5117=== Get Blame
5118--
5119'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
5120--
5121
5122Gets the blame of a file from a certain revision.
5123
5124.Request
5125----
5126 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
5127----
5128
5129As response a link:#blame-info[BlameInfo] entity is returned that describes the
5130blame.
5131
5132.Response
5133----
5134 HTTP/1.1 200 OK
5135 Content-Disposition: attachment
5136 Content-Type: application/json; charset=UTF-8
5137
5138 )]
5139 {
5140 [
5141 {
5142 "author": "Joe Daw",
5143 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
5144 "time": 1421441349,
5145 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
5146 "ranges": [
5147 {
5148 "start": 1,
5149 "end": 10
5150 },
5151 {
5152 "start": 16,
5153 "end": 296
5154 }
5155 ]
5156 },
5157 {
5158 "author": "Jane Daw",
5159 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
5160 "time": 1421825421,
5161 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
5162 "ranges": [
5163 {
5164 "start": 13,
5165 "end": 13
5166 }
5167 ]
5168 }
5169 ]
5170 }
5171----
5172
5173The `base` parameter can be specified to control the base patch set from which
5174the blame should be generated.
5175
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005176[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005177=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005178--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005179'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005180--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005181
Edwin Kempinbea55a52013-05-14 13:53:39 +02005182Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005183
5184.Request
5185----
5186 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5187----
5188
5189.Response
5190----
5191 HTTP/1.1 201 Created
5192----
5193
Edwin Kempinbea55a52013-05-14 13:53:39 +02005194If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005195response is "`200 OK`".
5196
5197[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005198=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005199--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005200'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005201--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005202
Edwin Kempinbea55a52013-05-14 13:53:39 +02005203Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005204
5205.Request
5206----
5207 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5208----
5209
5210.Response
5211----
5212 HTTP/1.1 204 No Content
5213----
5214
Gustaf Lundh019fb262012-11-28 14:20:22 +01005215[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005216=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005217--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005218'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005219--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005220
5221Cherry picks a revision to a destination branch.
5222
5223The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02005224link:#cherrypick-input[CherryPickInput] entity. If the commit message
5225does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005226
5227.Request
5228----
5229 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005230 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005231
5232 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01005233 "message" : "Implementing Feature X",
5234 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01005235 }
5236----
5237
5238As response a link:#change-info[ChangeInfo] entity is returned that
5239describes the resulting cherry picked change.
5240
5241.Response
5242----
5243 HTTP/1.1 200 OK
5244 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005245 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005246
5247 )]}'
5248 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01005249 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
5250 "project": "myProject",
5251 "branch": "release-branch",
5252 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
5253 "subject": "Implementing Feature X",
5254 "status": "NEW",
5255 "created": "2013-02-01 09:59:32.126000000",
5256 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01005257 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005258 "insertions": 12,
5259 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01005260 "_number": 3965,
5261 "owner": {
5262 "name": "John Doe"
5263 }
5264 }
5265----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005266
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005267[[revision-reviewer-endpoints]]
5268== Revision Reviewer Endpoints
5269
5270[[list-revision-reviewers]]
5271=== List Revision Reviewers
5272--
5273'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
5274--
5275
5276Lists the reviewers of a revision.
5277
5278Please note that only the current revision is supported.
5279
5280As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
5281
5282.Request
5283----
5284 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
5285----
5286
5287.Response
5288----
5289 HTTP/1.1 200 OK
5290 Content-Disposition: attachment
5291 Content-Type: application/json; charset=UTF-8
5292
5293 )]}'
5294 [
5295 {
5296 "approvals": {
5297 "Verified": "+1",
5298 "Code-Review": "+2"
5299 },
5300 "_account_id": 1000096,
5301 "name": "John Doe",
5302 "email": "john.doe@example.com"
5303 },
5304 {
5305 "approvals": {
5306 "Verified": " 0",
5307 "Code-Review": "-1"
5308 },
5309 "_account_id": 1000097,
5310 "name": "Jane Roe",
5311 "email": "jane.roe@example.com"
5312 }
5313 ]
5314----
5315
5316[[list-revision-votes]]
5317=== List Revision Votes
5318--
5319'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
5320--
5321
5322Lists the votes for a specific reviewer of the revision.
5323
5324Please note that only the current revision is supported.
5325
5326.Request
5327----
5328 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
5329----
5330
5331As result a map is returned that maps the label name to the label value.
5332The entries in the map are sorted by label name.
5333
5334.Response
5335----
5336 HTTP/1.1 200 OK
5337 Content-Disposition: attachment
5338 Content-Type: application/json;charset=UTF-8
5339
5340 )]}'
5341 {
5342 "Code-Review": -1,
5343 "Verified": 1,
5344 "Work-In-Progress": 1
5345 }
5346----
5347
5348[[delete-revision-vote]]
5349=== Delete Revision Vote
5350--
5351'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5352/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
5353'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5354/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
5355--
5356
5357Deletes a single vote from a revision. The deletion will be possible only
5358if the revision is the current revision. By using this endpoint you can prevent
5359deleting the vote (with same label) from a newer patch set by mistake.
5360
5361Note, that even when the last vote of a reviewer is removed the reviewer itself
5362is still listed on the change.
5363
5364Options can be provided in the request body as a
5365link:#delete-vote-input[DeleteVoteInput] entity.
5366
5367.Request
5368----
5369 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
5370 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5371----
5372
5373Please note that some proxies prohibit request bodies for DELETE
5374requests. In this case, if you want to specify options, use a POST
5375request:
5376
5377.Request
5378----
5379 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5380 Content-Type: application/json; charset=UTF-8
5381
5382 {
5383 "notify": "NONE"
5384 }
5385----
5386
5387.Response
5388----
5389 HTTP/1.1 204 No Content
5390----
5391
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005392[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005393== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005394
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005395[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005396=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005397--
5398--
5399
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005400[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005401=== \{change-id\}
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005402Identifier that uniquely identifies one change.
5403
5404This can be:
5405
Patrick Hiesel4d2dd182017-05-09 17:35:18 +02005406* an ID of the change in the format "'$$<project>~<numericId>$$'"
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005407* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
5408 where for the branch the `refs/heads/` prefix can be omitted
5409 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
5410* a Change-Id if it uniquely identifies one change
5411 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
Patrick Hiesel4d2dd182017-05-09 17:35:18 +02005412* a numeric change ID ("4247")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005413
John Spurlock5e402f02013-03-24 11:35:04 -04005414[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005415=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04005416UUID of a published comment.
5417
Edwin Kempin3ca57192013-02-27 07:44:01 +01005418[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005419=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01005420UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005421
David Ostrovskybeb0b842014-12-13 00:24:29 +01005422[[label-id]]
5423=== \{label-id\}
5424The name of the label.
5425
Edwin Kempinbea55a52013-05-14 13:53:39 +02005426[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09005427=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02005428The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005429
David Pursehouse11badbb2017-03-27 10:58:05 +09005430The following magic paths are supported:
5431
5432* `/COMMIT_MSG`:
5433+
5434The commit message and headers with the parent commit(s), the author
5435information and the committer information.
5436
5437* `/MERGE_LIST` (for merge commits only):
5438+
5439The list of commits that are being integrated into the destination
5440branch by submitting the merge commit.
5441
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005442[[fix-id]]
5443=== \{fix-id\}
5444UUID of a suggested fix.
5445
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005446[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005447=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005448Identifier that uniquely identifies one revision of a change.
5449
5450This can be:
5451
Shawn Pearce9c0722a2013-03-02 15:30:31 -08005452* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005453* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
5454* an abbreviated commit ID that uniquely identifies one revision of the
5455 change ("674ac754"), at least 4 digits are required
5456* a legacy numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02005457* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005458
Edwin Kempine3446292013-02-19 16:40:14 +01005459[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005460== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01005461
Edwin Kempined5364b2013-02-22 10:39:33 +01005462[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005463=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01005464The `AbandonInput` entity contains information for abandoning a change.
5465
David Pursehouseae367192014-11-25 17:24:47 +09005466[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005467|=============================
5468|Field Name ||Description
5469|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01005470Message to be added as review comment to the change when abandoning the
5471change.
Edwin Kempincd07df42016-12-01 09:10:09 +01005472|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07005473Notify handling that defines to whom email notifications should be sent after
5474the change is abandoned. +
5475Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5476If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01005477|`notify_details`|optional|
5478Additional information about whom to notify about the update as a map
5479of recipient type to link:#notify-info[NotifyInfo] entity.
5480|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01005481
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005482[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005483=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005484The `ActionInfo` entity describes a REST API call the client can
5485make to manipulate a resource. These are frequently implemented by
5486plugins and may be discovered at runtime.
5487
David Pursehouseae367192014-11-25 17:24:47 +09005488[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005489|====================================
5490|Field Name ||Description
5491|`method` |optional|
5492HTTP method to use with the action. Most actions use `POST`, `PUT`
5493or `DELETE` to cause state changes.
5494|`label` |optional|
5495Short title to display to a user describing the action. In the
5496Gerrit web interface the label is used as the text on the button
5497presented in the UI.
5498|`title` |optional|
5499Longer text to display describing the action. In a web UI this
5500should be the title attribute of the element, displaying when
5501the user hovers the mouse.
5502|`enabled` |optional|
5503If true the action is permitted at this time and the caller is
5504likely allowed to execute it. This may change if state is updated
5505at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005506|====================================
5507
Edwin Kempin392328e2013-02-25 12:50:03 +01005508[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005509=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01005510The `AddReviewerResult` entity describes the result of adding a
5511reviewer to a change.
5512
David Pursehouseae367192014-11-25 17:24:47 +09005513[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01005514|===========================
5515|Field Name ||Description
Logan Hanks23e70282016-07-06 14:31:56 -07005516|`input` ||
5517Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
5518set while adding the reviewer.
Edwin Kempin392328e2013-02-25 12:50:03 +01005519|`reviewers` |optional|
5520The newly added reviewers as a list of link:#reviewer-info[
5521ReviewerInfo] entities.
Logan Hanksee0a4182016-07-06 14:39:26 -07005522|`ccs` |optional|
5523The newly CCed accounts as a list of link:#reviewer-info[
5524ReviewerInfo] entities. This field will only appear if the requested
5525`state` for the reviewer was `CC` *and* NoteDb is enabled on the
5526server.
Edwin Kempin392328e2013-02-25 12:50:03 +01005527|`error` |optional|
5528Error message explaining why the reviewer could not be added. +
5529If a group was specified in the input and an error is returned, it
5530means that none of the members were added as reviewer.
5531|`confirm` |`false` if not set|
5532Whether adding the reviewer requires confirmation.
5533|===========================
5534
Edwin Kempine3446292013-02-19 16:40:14 +01005535[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005536=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005537The `ApprovalInfo` entity contains information about an approval from a
5538user for a label on a change.
5539
Edwin Kempin963dfd02013-02-27 12:39:32 +01005540`ApprovalInfo` has the same fields as
5541link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01005542In addition `ApprovalInfo` has the following fields:
5543
David Pursehouseae367192014-11-25 17:24:47 +09005544[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005545|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005546|Field Name ||Description
5547|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07005548The vote that the user has given for the label. If present and zero, the
5549user is permitted to vote on the label. If absent, the user is not
5550permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005551|`permitted_voting_range` |optional|
5552The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
5553on that label. If present, the user is permitted to vote on the label
5554regarding the range values. If absent, the user is not permitted to vote
5555on that label.
5556|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01005557The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005558|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005559Value of the `tag` field from link:#review-input[ReviewInput] set
5560while posting the review.
5561NOTE: To apply different tags on on different votes/comments multiple
5562invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04005563|`post_submit` |not set if `false`|
5564If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01005565|===========================
5566
Sven Selberg273a4aa2016-09-21 16:28:10 +02005567[[assignee-input]]
5568=== AssigneeInput
5569The `AssigneeInput` entity contains the identity of the user to be set as assignee.
5570
5571[options="header",cols="1,^1,5"]
5572|===========================
5573|Field Name ||Description
5574|`assignee` ||
5575The link:rest-api-accounts.html#account-id[ID] of one account that
5576should be added as assignee.
5577|===========================
5578
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005579[[blame-info]]
5580=== BlameInfo
5581The `BlameInfo` entity stores the commit metadata with the row coordinates where
5582it applies.
5583
5584[options="header",cols="1,6"]
5585|===========================
5586|Field Name | Description
5587|`author` | The author of the commit.
5588|`id` | The id of the commit.
5589|`time` | Commit time.
5590|`commit_msg` | The commit message.
5591|`ranges` |
5592The blame row coordinates as link:#range-info[RangeInfo] entities.
5593|===========================
5594
Edwin Kempin521c1242015-01-23 12:44:44 +01005595[[change-edit-input]]
5596=== ChangeEditInput
5597The `ChangeEditInput` entity contains information for restoring a
5598path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005599
Edwin Kempin521c1242015-01-23 12:44:44 +01005600[options="header",cols="1,^1,5"]
5601|===========================
5602|Field Name ||Description
5603|`restore_path`|optional|Path to file to restore.
5604|`old_path` |optional|Old path to file to rename.
5605|`new_path` |optional|New path to file to rename.
5606|===========================
5607
5608[[change-edit-message-input]]
5609=== ChangeEditMessageInput
5610The `ChangeEditMessageInput` entity contains information for changing
5611the commit message within a change edit.
5612
5613[options="header",cols="1,^1,5"]
5614|===========================
5615|Field Name ||Description
5616|`message` ||New commit message.
5617|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005618
Edwin Kempine3446292013-02-19 16:40:14 +01005619[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005620=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005621The `ChangeInfo` entity contains information about a change.
5622
David Pursehouseae367192014-11-25 17:24:47 +09005623[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005624|==================================
5625|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01005626|`id` ||
5627The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05005628where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01005629`refs/heads/` prefix is omitted.
5630|`project` ||The name of the project.
5631|`branch` ||
5632The name of the target branch. +
5633The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01005634|`topic` |optional|The topic to which this change belongs.
Edwin Kempine3446292013-02-19 16:40:14 +01005635|`change_id` ||The Change-Id of the change.
5636|`subject` ||
5637The subject of the change (header line of the commit message).
5638|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07005639The status of the change (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempine3446292013-02-19 16:40:14 +01005640|`created` ||
5641The link:rest-api.html#timestamp[timestamp] of when the change was
5642created.
5643|`updated` ||
5644The link:rest-api.html#timestamp[timestamp] of when the change was last
5645updated.
Khai Do96a7caf2016-01-07 14:07:54 -08005646|`submitted` |only set for merged changes|
5647The link:rest-api.html#timestamp[timestamp] of when the change was
5648submitted.
Dave Borowitz8ec31f92017-08-23 10:28:34 -04005649|`submitter` |only set for merged changes|
5650The user who submitted the change, as an
5651link:rest-api-accounts.html#account-info[ AccountInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01005652|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02005653Whether the calling user has starred this change with the default label.
5654|`stars` |optional|
5655A list of star labels that are applied by the calling user to this
5656change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01005657|`reviewed` |not set if `false`|
5658Whether the change was reviewed by the calling user.
Gustaf Lundh7626fc42017-04-28 14:37:33 +02005659|`muted` |not set if `false`|
5660Whether the change has been link:#mute[muted] by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005661Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05005662|`submit_type` |optional|
5663The link:project-configuration.html#submit_type[submit type] of the change. +
5664Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01005665|`mergeable` |optional|
5666Whether the change is mergeable. +
Dave Borowitze5fbeeb2014-06-27 09:47:49 -07005667Not set for merged changes, or if the change has not yet been tested.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07005668|`submittable` |optional|
5669Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07005670Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005671|`insertions` ||
5672Number of inserted lines.
5673|`deletions` ||
5674Number of deleted lines.
Changcheng Xiao81c48092017-02-08 13:04:07 +01005675|`unresolved_comment_count` |optional|
5676Number of unresolved comments. Not set if the current change index doesn't have the data.
Edwin Kempine3446292013-02-19 16:40:14 +01005677|`_number` ||The legacy numeric ID of the change.
5678|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01005679The owner of the change as an link:rest-api-accounts.html#account-info[
5680AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07005681|`actions` |optional|
5682Actions the caller might be able to perform on this revision. The
5683information is a map of view name to link:#action-info[ActionInfo]
5684entities.
Edwin Kempine3446292013-02-19 16:40:14 +01005685|`labels` |optional|
5686The labels of the change as a map that maps the label names to
5687link:#label-info[LabelInfo] entries. +
5688Only set if link:#labels[labels] or link:#detailed-labels[detailed
5689labels] are requested.
5690|`permitted_labels` |optional|
5691A map of the permitted labels that maps a label name to the list of
5692values that are allowed for that label. +
5693Only set if link:#detailed-labels[detailed labels] are requested.
5694|`removable_reviewers`|optional|
5695The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01005696link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01005697Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07005698|`reviewers` |optional|
Edwin Kempin66af3d82015-11-10 17:38:40 -08005699The reviewers as a map that maps a reviewer state to a list of
5700link:rest-api-accounts.html#account-info[AccountInfo] entities.
5701Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
5702`REVIEWER`: Users with at least one non-zero vote on the change. +
5703`CC`: Users that were added to the change, but have not voted. +
5704`REMOVED`: Users that were previously reviewers on the change, but have
5705been removed. +
5706Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07005707|`pending_reviewers` |optional|
5708Updates to `reviewers` that have been made while the change was in the
5709WIP state. Only present on WIP changes and only if there are pending
5710reviewer updates to report. These are reviewers who have not yet been
5711notified about being added to or removed from the change. +
5712Only set if link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07005713|`reviewer_updates`|optional|
5714Updates to reviewers set for the change as
5715link:#review-update-info[ReviewerUpdateInfo] entities.
5716Only set if link:#reviewer-updates[reviewer updates] are requested and
5717if NoteDb is enabled.
John Spurlock74a70cc2013-03-23 16:41:50 -04005718|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005719Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04005720link:#change-message-info[ChangeMessageInfo] entities. +
5721Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005722|`current_revision` |optional|
5723The commit ID of the current patch set of this change. +
5724Only set if link:#current-revision[the current revision] is requested
5725or if link:#all-revisions[all revisions] are requested.
5726|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05005727All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01005728patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08005729Only set if link:#current-revision[the current revision] is requested
5730(in which case it will only contain a key for the current revision) or
5731if link:#all-revisions[all revisions] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005732|`_more_changes` |optional, not set if `false`|
5733Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08005734Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05005735|`problems` |optional|
5736A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08005737problems with this change. Only set if link:#check[CHECK] is set.
David Ostrovskycb19cec2017-04-28 11:55:45 +02005738|`is_private` |optional, not set if `false`|
5739When present, change is marked as private.
David Ostrovsky258849b2017-03-09 23:21:03 +01005740|`work_in_progress` |optional, not set if `false`|
5741When present, change is marked as Work In Progress.
Logan Hanks724b24c2017-07-14 10:01:05 -07005742|`has_review_started` |optional, not set if `false`|
Logan Hanks296cd892017-05-03 15:14:41 -07005743When present, change has been marked Ready at some point in time.
Patrick Hiesel828f3222017-07-13 14:18:38 +02005744|`revert_of` |optional|
5745The numeric Change-Id of the change that this change reverts.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005746|==================================
5747
5748[[change-input]]
5749=== ChangeInput
5750The `ChangeInput` entity contains information about creating a new change.
5751
5752[options="header",cols="1,^1,5"]
5753|==================================
5754|Field Name ||Description
5755|`project` ||The name of the project.
5756|`branch` ||
5757The name of the target branch. +
5758The `refs/heads/` prefix is omitted.
5759|`subject` ||
5760The subject of the change (header line of the commit message).
5761|`topic` |optional|The topic to which this change belongs.
5762|`status` |optional, default to `NEW`|
5763The status of the change (only `NEW` and `DRAFT` accepted here).
Edwin Kempin14d50ed2017-05-03 13:26:30 +02005764|`is_private` |optional, default to `false`|
5765Whether the new change should be marked as private.
5766|`work_in_progress` |optional, default to `false`|
5767Whether the new change should be set to work in progress.
David Ostrovsky9d8ec422014-12-24 00:52:09 +01005768|`base_change` |optional|
5769A link:#change-id[\{change-id\}] that identifies the base change for a create
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005770change operation.
5771|`new_branch` |optional, default to `false`|
5772Allow creating a new branch when set to `true`.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005773|`merge` |optional|
5774The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01005775|`notify` |optional|
5776Notify handling that defines to whom email notifications should be sent
5777after the change is created. +
5778Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5779If not set, the default is `ALL`.
5780|`notify_details` |optional|
5781Additional information about whom to notify about the change creation
5782as a map of recipient type to link:#notify-info[NotifyInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01005783|==================================
5784
John Spurlock74a70cc2013-03-23 16:41:50 -04005785[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005786=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04005787The `ChangeMessageInfo` entity contains information about a message
5788attached to a change.
5789
David Pursehouseae367192014-11-25 17:24:47 +09005790[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04005791|==================================
5792|Field Name ||Description
5793|`id` ||The ID of the message.
5794|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07005795Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04005796link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5797Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01005798|`real_author` |optional|
5799Real author of the message as an
5800link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5801Set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04005802|`date` ||
5803The link:rest-api.html#timestamp[timestamp] this message was posted.
5804|`message` ||The text left by the user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005805|`tag` |optional|
5806Value of the `tag` field from link:#review-input[ReviewInput] set
5807while posting the review.
5808NOTE: To apply different tags on on different votes/comments multiple
5809invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04005810|`_revision_number` |optional|
5811Which patchset (if any) generated this message.
5812|==================================
5813
Gustaf Lundh019fb262012-11-28 14:20:22 +01005814[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005815=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01005816The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
5817
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005818[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01005819|===========================
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005820|Field Name ||Description
5821|`message` ||Commit message for the cherry-picked change
5822|`destination` ||Destination branch
Changcheng Xiaoe3332582017-05-26 15:29:41 +02005823|`base` |optional|
582440-hex digit SHA-1 of the commit which will be the parent commit of the newly created change.
5825If set, it must be a merged commit or a change revision on the destination branch.
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005826|`parent` |optional, defaults to 1|
5827Number of the parent relative to which the cherry-pick should be considered.
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02005828|`notify` |optional|
5829Notify handling that defines to whom email notifications should be sent
5830after the cherry-pick. +
5831Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5832If not set, the default is `NONE`.
5833|`notify_details` |optional|
5834Additional information about whom to notify about the update as a map
5835of recipient type to link:#notify-info[NotifyInfo] entity.
Aaron Gable54bc9832017-07-05 14:44:36 -07005836|`keep_reviewers` |optional, defaults to false|
5837If true, carries reviewers and ccs over from original change to newly created one.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005838|===========================
5839
Edwin Kempincb6724a2013-02-26 16:58:51 +01005840[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005841=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05005842The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005843
David Pursehouseae367192014-11-25 17:24:47 +09005844[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01005845|===========================
5846|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005847|`patch_set` |optional|
5848The patch set number for the comment; only set in contexts where +
5849comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04005850|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005851|`path` |optional|
5852The path of the file for which the inline comment was done. +
5853Not set if returned in a map where the key is the file path.
5854|`side` |optional|
5855The side on which the comment was added. +
5856Allowed values are `REVISION` and `PARENT`. +
5857If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005858|`parent` |optional|
5859The 1-based parent number. Used only for merge commits when `side == PARENT`.
5860When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005861|`line` |optional|
5862The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04005863If range is set, this equals the end line of the range. +
5864If neither line nor range is set, it's a file comment.
5865|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005866The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005867entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005868|`in_reply_to` |optional|
5869The URL encoded UUID of the comment to which this comment is a reply.
5870|`message` |optional|The comment message.
5871|`updated` ||
5872The link:rest-api.html#timestamp[timestamp] of when this comment was
5873written.
John Spurlock5e402f02013-03-24 11:35:04 -04005874|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09005875The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04005876link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5877Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005878|`tag` |optional|
5879Value of the `tag` field from link:#review-input[ReviewInput] set
5880while posting the review.
5881NOTE: To apply different tags on on different votes/comments multiple
5882invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08005883|`unresolved` |optional|
5884Whether or not the comment must be addressed by the user. The state of
5885resolution of a comment thread is stored in the last comment in that thread
5886chronologically.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005887|===========================
5888
Edwin Kempin67498de2013-02-25 16:15:34 +01005889[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005890=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03005891The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01005892comment.
5893
David Pursehouseae367192014-11-25 17:24:47 +09005894[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01005895|===========================
5896|Field Name ||Description
5897|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01005898The URL encoded UUID of the comment if an existing draft comment should
5899be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005900|`path` |optional|
5901The path of the file for which the inline comment should be added. +
5902Doesn't need to be set if contained in a map where the key is the file
5903path.
Edwin Kempin67498de2013-02-25 16:15:34 +01005904|`side` |optional|
5905The side on which the comment should be added. +
5906Allowed values are `REVISION` and `PARENT`. +
5907If not set, the default is `REVISION`.
5908|`line` |optional|
5909The number of the line for which the comment should be added. +
5910`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04005911If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09005912If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04005913|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005914The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005915entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01005916|`in_reply_to` |optional|
5917The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005918|`updated` |optional|
5919The link:rest-api.html#timestamp[timestamp] of this comment. +
5920Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01005921|`message` |optional|
5922The comment message. +
5923If not set and an existing draft comment is updated, the existing draft
5924comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04005925|`tag` |optional, drafts only|
5926Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
5927inputs; for published comments, use the `tag` field in +
5928link#review-input[ReviewInput]
Kasper Nilsson7ec30362016-12-20 14:13:21 -08005929|`unresolved` |optional|
5930Whether or not the comment must be addressed by the user. This value will
5931default to false if the comment is an orphan, or the value of the `in_reply_to`
5932comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01005933|===========================
5934
Michael Zhou596c7682013-08-25 05:43:34 -04005935[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005936=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04005937The `CommentRange` entity describes the range of an inline comment.
5938
David Pursehouseae367192014-11-25 17:24:47 +09005939[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04005940|===========================
5941|Field Name ||Description
Alice Kober-Sotzekcd06fb62017-03-21 15:19:45 +01005942|`start_line` ||The start line number of the range. (1-based, inclusive)
5943|`start_character` ||The character position in the start line. (0-based, inclusive)
5944|`end_line` ||The end line number of the range. (1-based, exclusive)
5945|`end_character` ||The character position in the end line. (0-based, exclusive)
Michael Zhou596c7682013-08-25 05:43:34 -04005946|===========================
5947
Edwin Kempine3446292013-02-19 16:40:14 +01005948[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005949=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005950The `CommitInfo` entity contains information about a commit.
5951
Edwin Kempinf0c57152015-07-15 18:18:24 +02005952[options="header",cols="1,^1,5"]
5953|===========================
5954|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02005955|`commit` |Optional|
5956The commit ID. Not set if included in a link:#revision-info[
5957RevisionInfo] entity that is contained in a map which has the commit ID
5958as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005959|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005960The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02005961link:#commit-info[CommitInfo] entities. In each parent
5962only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005963|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005964link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005965|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005966link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005967|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005968The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02005969|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01005970|`web_links` |optional|
5971Links to the commit in external sites as a list of
5972link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005973|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01005974
Patrick Hieselfda96452017-06-14 16:44:54 +02005975[[commit-message-input]]
5976=== CommitMessageInput
5977The `CommitMessageInput` entity contains information for changing
5978the commit message of a change.
5979
5980[options="header",cols="1,^1,5"]
5981|=============================
5982|Field Name ||Description
5983|`message` ||New commit message.
5984|`notify` |optional|
5985Notify handling that defines to whom email notifications should be sent
5986after the commit message was updated. +
5987Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Logan Hanksa1e68dc2017-06-29 15:13:27 -07005988If not set, the default is `OWNER` for WIP changes and `ALL` otherwise.
Patrick Hieselfda96452017-06-14 16:44:54 +02005989|`notify_details`|optional|
5990Additional information about whom to notify about the update as a map
5991of recipient type to link:#notify-info[NotifyInfo] entity.
5992|=============================
5993
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005994[[delete-comment-input]]
5995=== DeleteCommentInput
5996The `DeleteCommentInput` entity contains the option for deleting a comment.
5997
5998[options="header",cols="1,^1,5"]
5999|=============================
6000|Field Name ||Description
6001|`reason` |optional|
6002The reason why the comment should be deleted. +
6003If set, the comment's message will be replaced with
6004"Comment removed by: `name`; Reason: `reason`",
6005or just "Comment removed by: `name`." if not set.
6006|=============================
6007
Edwin Kempin407fca32016-08-29 12:01:00 +02006008[[delete-reviewer-input]]
6009=== DeleteReviewerInput
6010The `DeleteReviewerInput` entity contains options for the deletion of a
6011reviewer.
6012
6013[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006014|=============================
6015|Field Name ||Description
6016|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02006017Notify handling that defines to whom email notifications should be sent
6018after the reviewer is deleted. +
6019Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6020If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006021|`notify_details`|optional|
6022Additional information about whom to notify about the update as a map
6023of recipient type to link:#notify-info[NotifyInfo] entity.
6024|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02006025
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006026[[delete-vote-input]]
6027=== DeleteVoteInput
6028The `DeleteVoteInput` entity contains options for the deletion of a
6029vote.
6030
6031[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006032|=============================
6033|Field Name ||Description
6034|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006035The label for which the vote should be deleted. +
6036If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01006037|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006038Notify handling that defines to whom email notifications should be sent
6039after the vote is deleted. +
6040Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6041If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006042|`notify_details`|optional|
6043Additional information about whom to notify about the update as a map
6044of recipient type to link:#notify-info[NotifyInfo] entity.
6045|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006046
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08006047[[description-input]]
6048=== DescriptionInput
6049The `DescriptionInput` entity contains information for setting a description.
6050
6051[options="header",cols="1,6"]
6052|===========================
6053|Field Name |Description
6054|`description` |The description text.
6055|===========================
6056
David Pursehouse882aef22013-06-05 10:56:37 +09006057[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006058=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09006059The `DiffContent` entity contains information about the content differences
6060in a file.
6061
David Pursehouseae367192014-11-25 17:24:47 +09006062[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006063|==========================
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006064|Field Name ||Description
6065|`a` |optional|Content only in the file on side A (deleted in B).
6066|`b` |optional|Content only in the file on side B (added in B).
6067|`ab` |optional|Content in the file on both sides (unchanged).
6068|`edit_a` |only present during a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09006069Text sections deleted from side A as a
6070link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006071|`edit_b` |only present during a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09006072Text sections inserted in side B as a
6073link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006074|`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a
6075rebase.
6076|`skip` |optional|count of lines skipped on both sides when the file is
David Pursehouse882aef22013-06-05 10:56:37 +09006077too large to include all common lines.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006078|`common` |optional|Set to `true` if the region is common according
Shawn Pearce425a2be2014-01-02 16:00:58 -08006079to the requested ignore-whitespace parameter, but a and b contain
6080differing amounts of whitespace. When present and true a and b are
6081used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09006082|==========================
6083
6084[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006085=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006086The `DiffFileMetaInfo` entity contains meta information about a file diff.
6087
David Pursehouseae367192014-11-25 17:24:47 +09006088[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006089|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006090|Field Name ||Description
6091|`name` ||The name of the file.
6092|`content_type`||The content type of the file.
6093|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01006094|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006095Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07006096link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09006097|==========================
6098
6099[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006100=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006101The `DiffInfo` entity contains information about the diff of a file
6102in a revision.
6103
Edwin Kempin8cdce502014-12-06 10:55:38 +01006104If the link:#weblinks-only[weblinks-only] parameter is specified, only
6105the `web_links` field is set.
6106
David Pursehouseae367192014-11-25 17:24:47 +09006107[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006108|==========================
6109|Field Name ||Description
6110|`meta_a` |not present when the file is added|
6111Meta information about the file on side A as a
6112link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6113|`meta_b` |not present when the file is deleted|
6114Meta information about the file on side B as a
6115link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6116|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
6117`COPIED`, `REWRITE`).
6118|`intraline_status`|only set when the `intraline` parameter was specified in the request|
6119Intraline status (`OK`, `ERROR`, `TIMEOUT`).
6120|`diff_header` ||A list of strings representing the patch set diff header.
6121|`content` ||The content differences in the file as a list of
6122link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01006123|`web_links` |optional|
6124Links to the file diff in external sites as a list of
6125link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01006126|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09006127|==========================
6128
6129[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006130=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006131The `DiffIntralineInfo` entity contains information about intraline edits in a
6132file.
6133
David Pursehouse31203f52013-06-08 17:05:45 +09006134The information consists of a list of `<skip length, mark length>` pairs, where
6135the skip length is the number of characters between the end of the previous edit
6136and the start of this edit, and the mark length is the number of edited characters
6137following the skip. The start of the edits is from the beginning of the related
6138diff content lines.
David Pursehouse882aef22013-06-05 10:56:37 +09006139
David Pursehouse31203f52013-06-08 17:05:45 +09006140Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07006141the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09006142
Edwin Kempin8cdce502014-12-06 10:55:38 +01006143[[diff-web-link-info]]
6144=== DiffWebLinkInfo
6145The `DiffWebLinkInfo` entity describes a link on a diff screen to an
6146external site.
6147
6148[options="header",cols="1,6"]
6149|=======================
6150|Field Name|Description
6151|`name` |The link name.
6152|`url` |The link URL.
6153|`image_url`|URL to the icon of the link.
6154|show_on_side_by_side_diff_view|
6155Whether the web link should be shown on the side-by-side diff screen.
6156|show_on_unified_diff_view|
6157Whether the web link should be shown on the unified diff screen.
6158|=======================
6159
David Ostrovsky9ea9c112015-01-25 00:12:38 +01006160[[edit-file-info]]
6161=== EditFileInfo
6162The `EditFileInfo` entity contains additional information
6163of a file within a change edit.
6164
6165[options="header",cols="1,^1,5"]
6166|===========================
6167|Field Name ||Description
6168|`web_links` |optional|
6169Links to the diff info in external sites as a list of
6170link:#web-link-info[WebLinkInfo] entities.
6171|===========================
6172
Edwin Kempin521c1242015-01-23 12:44:44 +01006173[[edit-info]]
6174=== EditInfo
6175The `EditInfo` entity contains information about a change edit.
6176
6177[options="header",cols="1,^1,5"]
6178|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04006179|Field Name ||Description
6180|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01006181link:#commit-info[CommitInfo] entity.
Michael Zhoud03fe282016-04-25 17:13:17 -04006182|`base_revision`||The revision of the patch set the change edit is based on.
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01006183|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006184Information about how to fetch this patch set. The fetch information is
6185provided as a map that maps the protocol name ("`git`", "`http`",
6186"`ssh`") to link:#fetch-info[FetchInfo] entities.
Michael Zhoud03fe282016-04-25 17:13:17 -04006187|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006188The files of the change edit as a map that maps the file names to
6189link:#file-info[FileInfo] entities.
6190|===========================
6191
Edwin Kempine3446292013-02-19 16:40:14 +01006192[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006193=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006194The `FetchInfo` entity contains information about how to fetch a patch
6195set via a certain protocol.
6196
David Pursehouseae367192014-11-25 17:24:47 +09006197[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006198|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02006199|Field Name ||Description
6200|`url` ||The URL of the project.
6201|`ref` ||The ref of the patch set.
6202|`commands` |optional|
6203The download commands for this patch set as a map that maps the command
6204names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09006205Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006206|==========================
6207
6208[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006209=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006210The `FileInfo` entity contains information about a file in a patch set.
6211
David Pursehouseae367192014-11-25 17:24:47 +09006212[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006213|=============================
6214|Field Name ||Description
6215|`status` |optional|
6216The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
6217"`C`"=Copied, "`W`"=Rewritten). +
6218Not set if the file was Modified ("`M`").
6219|`binary` |not set if `false`|Whether the file is binary.
6220|`old_path` |optional|
6221The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05006222Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01006223|`lines_inserted`|optional|
6224Number of inserted lines. +
6225Not set for binary files or if no lines were inserted.
6226|`lines_deleted` |optional|
6227Number of deleted lines. +
6228Not set for binary files or if no lines were deleted.
Edwin Kempin640f9842015-10-08 15:53:20 +02006229|`size_delta` ||
6230Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01006231|`size` ||
6232File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01006233|=============================
6234
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006235[[fix-input]]
6236=== FixInput
6237The `FixInput` entity contains options for fixing commits using the
6238link:#fix-change[fix change] endpoint.
6239
6240[options="header",cols="1,6"]
6241|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006242|Field Name |Description
6243|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006244database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006245|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07006246merged into the destination branch as this exact SHA-1. If not, insert
6247a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006248|==========================
6249
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006250[[fix-suggestion-info]]
6251=== FixSuggestionInfo
6252The `FixSuggestionInfo` entity represents a suggested fix.
6253
6254[options="header",cols="1,^1,5"]
6255|==========================
6256|Field Name ||Description
6257|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
6258fix. It will be generated automatically and hence will be ignored if it's set
6259for input objects.
6260|`description` ||A description of the suggested fix.
6261|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006262entities indicating how the content of one or several files should be modified.
6263Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006264|==========================
6265
6266[[fix-replacement-info]]
6267=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01006268The `FixReplacementInfo` entity describes how the content of a file should be
6269replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006270
6271[options="header",cols="1,6"]
6272|==========================
6273|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006274|`path` |The path of the file which should be modified. Any file in
6275the repository may be modified.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006276|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01006277of the file should be replaced. Lines in the file are assumed to be separated
6278by the line feed character, the carriage return character, the carriage return
6279followed by the line feed character, or one of the other Unicode linebreak
6280sequences supported by Java.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006281|`replacement` |The content which should be used instead of the current one.
6282|==========================
6283
Edwin Kempine3446292013-02-19 16:40:14 +01006284[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006285=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006286The `GitPersonInfo` entity contains information about the
6287author/committer of a commit.
6288
David Pursehouseae367192014-11-25 17:24:47 +09006289[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01006290|==========================
6291|Field Name |Description
6292|`name` |The name of the author/committer.
6293|`email` |The email address of the author/committer.
6294|`date` |The link:rest-api.html#timestamp[timestamp] of when
6295this identity was constructed.
6296|`tz` |The timezone offset from UTC of when this identity was
6297constructed.
6298|==========================
6299
Edwin Kempin521c1242015-01-23 12:44:44 +01006300[[group-base-info]]
6301=== GroupBaseInfo
6302The `GroupBaseInfo` entity contains base information about the group.
6303
6304[options="header",cols="1,6"]
6305|==========================
6306|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01006307|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01006308|`name` |The name of the group.
6309|==========================
6310
David Pursehoused9dac372016-11-24 19:41:10 +09006311[[hashtags-input]]
6312=== HashtagsInput
6313
6314The `HashtagsInput` entity contains information about hashtags to add to,
6315and/or remove from, a change.
6316
6317[options="header",cols="1,^1,5"]
6318|=======================
6319|Field Name||Description
6320|`add` |optional|The list of hashtags to be added to the change.
6321|`remove |optional|The list of hashtags to be removed from the change.
6322|=======================
6323
Edwin Kempin521c1242015-01-23 12:44:44 +01006324[[included-in-info]]
6325=== IncludedInInfo
6326The `IncludedInInfo` entity contains information about the branches a
6327change was merged into and tags it was tagged with.
6328
Edwin Kempin78279ba2015-05-22 15:22:41 +02006329[options="header",cols="1,^1,5"]
6330|=======================
6331|Field Name||Description
6332|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01006333Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02006334|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01006335Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02006336|`external`|optional|A map that maps a name to a list of external
6337systems that include this change, e.g. a list of servers on which this
6338change is deployed.
6339|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01006340
Edwin Kempine3446292013-02-19 16:40:14 +01006341[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006342=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07006343The `LabelInfo` entity contains information about a label on a change, always
6344corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01006345
Dave Borowitz88159512013-06-14 14:21:50 -07006346There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07006347link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07006348
6349* For a quick summary of the state of labels, use `LABELS`.
6350* For detailed information about labels, including exact numeric votes for all
6351 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
6352
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006353==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09006354[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006355|===========================
6356|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006357|`optional` |not set if `false`|
6358Whether the label is optional. Optional means the label may be set, but
6359it's neither necessary for submission nor does it block submission if
6360set.
Dave Borowitz88159512013-06-14 14:21:50 -07006361|===========================
6362
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006363==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09006364[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07006365|===========================
6366|Field Name ||Description
6367|`approved` |optional|One user who approved this label on the change
6368(voted the maximum value) as an
6369link:rest-api-accounts.html#account-info[AccountInfo] entity.
6370|`rejected` |optional|One user who rejected this label on the change
6371(voted the minimum value) as an
6372link:rest-api-accounts.html#account-info[AccountInfo] entity.
6373|`recommended` |optional|One user who recommended this label on the
6374change (voted positively, but not the maximum value) as an
6375link:rest-api-accounts.html#account-info[AccountInfo] entity.
6376|`disliked` |optional|One user who disliked this label on the change
6377(voted negatively, but not the minimum value) as an
6378link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01006379|`blocking` |optional|If `true`, the label blocks submit operation.
6380If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07006381|`value` |optional|The voting value of the user who
6382recommended/disliked this label on the change if it is not
6383"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07006384|`default_value`|optional|The default voting value for the label.
6385This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07006386|===========================
6387
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006388==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09006389[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07006390|===========================
6391|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006392|`all` |optional|List of all approvals for this label as a list
Aaron Gableea8a2112017-04-25 14:18:16 -07006393of link:#approval-info[ApprovalInfo] entities. Items in this list may
6394not represent actual votes cast by users; if a user votes on any label,
6395a corresponding ApprovalInfo will appear in this list for all labels.
Edwin Kempine3446292013-02-19 16:40:14 +01006396|`values` |optional|A map of all values that are allowed for this
6397label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07006398to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01006399|===========================
6400
Saša Živkov499873f2014-05-05 13:34:18 +02006401[[mergeable-info]]
6402=== MergeableInfo
6403The `MergeableInfo` entity contains information about the mergeability of a
6404change.
6405
David Pursehouseae367192014-11-25 17:24:47 +09006406[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02006407|============================
Saša Živkov697cab22014-04-29 16:46:50 +02006408|Field Name ||Description
6409|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02006410Submit type used for this change, can be `MERGE_IF_NECESSARY`,
6411`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
6412`CHERRY_PICK`.
Zhen Chenec13e452016-08-03 23:29:43 -07006413|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006414The strategy of the merge, can be `recursive`, `resolve`,
6415`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02006416|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02006417`true` if this change is cleanly mergeable, `false` otherwise
Zhen Chen8f00d552016-07-26 16:54:59 -07006418|`commit_merged` |optional|
6419`true` if this change is already merged, `false` otherwise
6420|`content_merged` |optional|
6421`true` if the content of this change is already merged, `false` otherwise
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006422|`conflicts`|optional|
6423A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02006424|`mergeable_into`|optional|
6425A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02006426|============================
Dave Borowitz88159512013-06-14 14:21:50 -07006427
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006428[[merge-input]]
6429=== MergeInput
6430The `MergeInput` entity contains information about the merge
6431
6432[options="header",cols="1,^1,5"]
6433|============================
6434|Field Name ||Description
6435|`source` ||
6436The source to merge from, e.g. a complete or abbreviated commit SHA-1,
6437a complete reference name, a short reference name under refs/heads, refs/tags,
6438or refs/remotes namespace, etc.
6439|`strategy` |optional|
6440The strategy of the merge, can be `recursive`, `resolve`,
6441`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
6442|============================
6443
Zhen Chenb1e07e52016-09-23 12:59:48 -07006444[[merge-patch-set-input]]
6445=== MergePatchSetInput
6446The `MergePatchSetInput` entity contains information about updating a new
6447change by creating a new merge commit.
6448
6449[options="header",cols="1,^1,5"]
6450|==================================
6451|Field Name ||Description
6452|`subject` |optional|
6453The new subject for the change, if not specified, will reuse the current patch
6454set's subject
6455|`inheritParent` |optional, default to `false`|
6456Use the current patch set's first parent as the merge tip when set to `true`.
6457Otherwise, use the current branch tip of the destination branch.
6458|`merge` ||
6459The detail of the source commit for merge as a link:#merge-input[MergeInput]
6460entity.
6461|==================================
6462
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306463[[move-input]]
6464=== MoveInput
6465The `MoveInput` entity contains information for moving a change to a new branch.
6466
6467[options="header",cols="1,^1,5"]
6468|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04006469|Field Name ||Description
6470|`destination_branch`||Destination branch
6471|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306472A message to be posted in this change's comments
6473|===========================
6474
Edwin Kempincd07df42016-12-01 09:10:09 +01006475[[notify-info]]
6476=== NotifyInfo
6477The `NotifyInfo` entity contains detailed information about who should
6478be notified about an update. These notifications are sent out even if a
6479`notify` option in the request input disables normal notifications.
6480`NotifyInfo` entities are normally contained in a `notify_details` map
6481in the request input where the key is the recipient type. The recipient
6482type can be `TO`, `CC` and `BCC`.
6483
6484[options="header",cols="1,^1,5"]
6485|=======================
6486|Field Name||Description
6487|`accounts`|optional|
6488A list of link:rest-api-accounts.html#account-id[account IDs] that
6489identify the accounts that should be should be notified.
6490|=======================
6491
Edwin Kempin364a86b2017-04-27 12:34:00 +02006492[[private-input]]
6493=== PrivateInput
6494The `PrivateInput` entity contains information for changing the private
6495flag on a change.
6496
6497[options="header",cols="1,^1,5"]
6498|=======================
6499|Field Name||Description
6500|`message` |optional|Message describing why the private flag was changed.
6501|=======================
6502
Edwin Kempin521c1242015-01-23 12:44:44 +01006503[[problem-info]]
6504=== ProblemInfo
6505The `ProblemInfo` entity contains a description of a potential consistency problem
6506with a change. These are not related to the code review process, but rather
6507indicate some inconsistency in Gerrit's database or repository metadata related
6508to the enclosing change.
6509
6510[options="header",cols="1,^1,5"]
6511|===========================
6512|Field Name||Description
6513|`message` ||Plaintext message describing the problem with the change.
6514|`status` |optional|
6515The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
6516fix was attempted.
6517|`outcome` |optional|
6518If `status` is set, an additional plaintext message describing the
6519outcome of the fix.
6520|===========================
6521
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006522[[publish-change-edit-input]]
6523=== PublishChangeEditInput
6524The `PublishChangeEditInput` entity contains options for the publishing of
6525change edit.
6526
6527[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006528|=============================
6529|Field Name ||Description
6530|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006531Notify handling that defines to whom email notifications should be sent
6532after the change edit is published. +
6533Allowed values are `NONE` and `ALL`. +
6534If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006535|`notify_details`|optional|
6536Additional information about whom to notify about the update as a map
6537of recipient type to link:#notify-info[NotifyInfo] entity.
6538|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006539
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04006540[[push-certificate-info]]
6541=== PushCertificateInfo
6542The `PushCertificateInfo` entity contains information about a push
6543certificate provided when the user pushed for review with `git push
6544--signed HEAD:refs/for/<branch>`. Only used when signed push is
6545link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
6546
6547[options="header",cols="1,6"]
6548|===========================
6549|Field Name|Description
6550|`certificate`|Signed certificate payload and GPG signature block.
6551|`key` |
6552Information about the key that signed the push, along with any problems
6553found while checking the signature or the key itself, as a
6554link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
6555|===========================
6556
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006557[[range-info]]
6558=== RangeInfo
6559The `RangeInfo` entity stores the coordinates of a range.
6560
6561[options="header",cols="1,6"]
6562|===========================
6563|Field Name | Description
6564|`start` | First index.
6565|`end` | Last index.
6566|===========================
6567
Zalan Blenessy874aed72015-01-12 13:26:18 +01006568[[rebase-input]]
6569=== RebaseInput
6570The `RebaseInput` entity contains information for changing parent when rebasing.
6571
6572[options="header",width="50%",cols="1,^1,5"]
6573|===========================
6574|Field Name ||Description
6575|`base` |optional|
6576The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
6577Alternatively, a change number can be specified, in which case the current
6578patch set is inferred. +
6579Empty string is used for rebasing directly on top of the target branch,
6580which effectively breaks dependency towards a parent change.
6581|===========================
6582
Edwin Kempin521c1242015-01-23 12:44:44 +01006583[[related-change-and-commit-info]]
6584=== RelatedChangeAndCommitInfo
6585
6586The `RelatedChangeAndCommitInfo` entity contains information about
6587a related change and commit.
6588
6589[options="header",cols="1,^1,5"]
6590|===========================
6591|Field Name ||Description
Patrick Hieselcab63512017-07-28 10:25:42 +02006592|`project` ||The project of the change or commit.
Edwin Kempin521c1242015-01-23 12:44:44 +01006593|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01006594|`commit` ||The commit as a
6595link:#commit-info[CommitInfo] entity.
6596|`_change_number` |optional|The change number.
6597|`_revision_number` |optional|The revision number.
6598|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07006599|`status` |optional|The status of the change. The status of
Stefan Beller0d3cab02015-07-10 13:32:57 -07006600the change is one of (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempin521c1242015-01-23 12:44:44 +01006601|===========================
6602
6603[[related-changes-info]]
6604=== RelatedChangesInfo
6605The `RelatedChangesInfo` entity contains information about related
6606changes.
6607
6608[options="header",cols="1,6"]
6609|===========================
6610|Field Name |Description
6611|`changes` |A list of
6612link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
6613describing the related changes. Sorted by git commit order, newest to
6614oldest. Empty if there are no related changes.
6615|===========================
6616
Edwin Kempined5364b2013-02-22 10:39:33 +01006617[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006618=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01006619The `RestoreInput` entity contains information for restoring a change.
6620
David Pursehouseae367192014-11-25 17:24:47 +09006621[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01006622|===========================
6623|Field Name ||Description
6624|`message` |optional|
6625Message to be added as review comment to the change when restoring the
6626change.
6627|===========================
6628
Edwin Kempind2ec4152013-02-22 12:17:19 +01006629[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006630=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01006631The `RevertInput` entity contains information for reverting a change.
6632
David Pursehouseae367192014-11-25 17:24:47 +09006633[options="header",cols="1,^1,5"]
Edwin Kempind2ec4152013-02-22 12:17:19 +01006634|===========================
6635|Field Name ||Description
6636|`message` |optional|
6637Message to be added as review comment to the change when reverting the
6638change.
6639|===========================
6640
Edwin Kempin67498de2013-02-25 16:15:34 +01006641[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006642=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01006643The `ReviewInfo` entity contains information about a review.
6644
David Pursehouseae367192014-11-25 17:24:47 +09006645[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006646|===========================
6647|Field Name |Description
6648|`labels` |
6649The labels of the review as a map that maps the label names to the
6650voting values.
6651|===========================
6652
Viktar Donich316bf7a2016-07-06 11:29:01 -07006653[[review-update-info]]
6654=== ReviewerUpdateInfo
6655The `ReviewerUpdateInfo` entity contains information about updates to
6656change's reviewers set.
6657
6658[options="header",cols="1,6"]
6659|===========================
6660|Field Name |Description
6661|`updated`|
6662Timestamp of the update.
6663|`updated_by`|
6664The account which modified state of the reviewer in question as
6665link:rest-api-accounts.html#account-info[AccountInfo] entity.
6666|`reviewer`|
6667The reviewer account added or removed from the change as an
6668link:rest-api-accounts.html#account-info[AccountInfo] entity.
6669|`state`|
6670The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
6671|===========================
6672
Edwin Kempin67498de2013-02-25 16:15:34 +01006673[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006674=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01006675The `ReviewInput` entity contains information for adding a review to a
6676revision.
6677
David Pursehouseae367192014-11-25 17:24:47 +09006678[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006679|============================
Bill Wendling692b4ec2015-10-19 15:40:57 -07006680|Field Name ||Description
6681|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006682The message to be added as review comment.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006683|`tag` |optional|
6684Apply this tag to the review comment message, votes, and inline
6685comments. Tags may be used by CI or other automated systems to
6686distinguish them from human reviews. Comments with specific tag
6687values can be filtered out in the web UI.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006688|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006689The votes that should be added to the revision as a map that maps the
6690label names to the voting values.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006691|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006692The comments that should be added as a map that maps a file path to a
6693list of link:#comment-input[CommentInput] entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006694|`robot_comments` |optional|
6695The robot comments that should be added as a map that maps a file path
6696to a list of link:#robot-comment-input[RobotCommentInput] entities.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006697|`strict_labels` |`true` if not set|
John Spurlockd25fad12013-03-09 11:48:49 -05006698Whether all labels are required to be within the user's permitted ranges
Edwin Kempin67498de2013-02-25 16:15:34 +01006699based on access controls. +
6700If `true`, attempting to use a label not granted to the user will fail
6701the entire modify operation early. +
6702If `false`, the operation will execute anyway, but the proposed labels
6703will be modified to be the "best" value allowed by the access controls.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006704|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006705Draft handling that defines how draft comments are handled that are
6706already in the database but that were not also described in this
6707input. +
David Ostrovsky8a1da032014-07-25 10:57:35 +02006708Allowed values are `DELETE`, `PUBLISH`, `PUBLISH_ALL_REVISIONS` and
6709`KEEP`. All values except `PUBLISH_ALL_REVISIONS` operate only on drafts
6710for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04006711Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
6712If not set, the default is `DELETE`, unless `on_behalf_of` is set, in
6713which case the default is `KEEP` and any other value is disallowed.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006714|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006715Notify handling that defines to whom email notifications should be sent
6716after the review is stored. +
6717Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6718If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006719|`notify_details` |optional|
6720Additional information about whom to notify about the update as a map
6721of recipient type to link:#notify-info[NotifyInfo] entity.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006722|`omit_duplicate_comments`|optional|
6723If `true`, comments with the same content at the same place will be omitted.
6724|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07006725link:rest-api-accounts.html#account-id[\{account-id\}] the review
6726should be posted on behalf of. To use this option the caller must
6727have been granted `labelAs-NAME` permission for all keys of labels.
Patrick Hieselcf6d9352017-04-13 10:15:42 +02006728|`reviewers` |optional|
6729A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
6730representing reviewers that should be added to the change.
Logan Hanks53c36012017-06-30 13:47:54 -07006731|`ready` |optional|
6732If true, and if the change is work in progress, then start review.
6733It is an error for both `ready` and `work_in_progress` to be true.
6734|`work_in_progress` |optional|
6735If true, mark the change as work in progress. It is an error for both
6736`ready` and `work_in_progress` to be true.
Edwin Kempin67498de2013-02-25 16:15:34 +01006737|============================
6738
Aaron Gable843b0c12017-04-21 08:25:27 -07006739[[review-result]]
6740=== ReviewResult
6741The `ReviewResult` entity contains information regarding the updates
6742that were made to a review.
6743
6744[options="header",cols="1,^1,5"]
6745|============================
6746|Field Name ||Description
6747|`labels` |optional|
6748Map of labels to values after the review was posted. Null if any reviewer
6749additions were rejected.
6750|`reviewers` |optional|
6751Map of account or group identifier to
6752link:rest-api-changes.html#add-reviewer-result[AddReviewerResult]
6753representing the outcome of adding as a reviewer.
6754Absent if no reviewer additions were requested.
Logan Hankse81ad8e2017-07-18 09:45:46 -07006755|`ready` |optional|
6756If true, the change was moved from WIP to ready for review as a result of this
6757action. Not set if false.
Aaron Gable843b0c12017-04-21 08:25:27 -07006758|============================
6759
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006760[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006761=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006762The `ReviewerInfo` entity contains information about a reviewer and its
6763votes on a change.
6764
Edwin Kempin963dfd02013-02-27 12:39:32 +01006765`ReviewerInfo` has the same fields as
6766link:rest-api-accounts.html#account-info[AccountInfo] and includes
6767link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006768In addition `ReviewerInfo` has the following fields:
6769
David Pursehouseae367192014-11-25 17:24:47 +09006770[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006771|==========================
6772|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006773|`approvals` |
6774The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09006775approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01006776|`_account_id` |
6777This field is inherited from `AccountInfo` but is optional here if an
6778unregistered reviewer was added by email. See
6779link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006780|==========================
6781
Edwin Kempin392328e2013-02-25 12:50:03 +01006782[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006783=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01006784The `ReviewerInput` entity contains information for adding a reviewer
6785to a change.
6786
David Pursehouseae367192014-11-25 17:24:47 +09006787[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006788|=============================
6789|Field Name ||Description
6790|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01006791The link:rest-api-accounts.html#account-id[ID] of one account that
6792should be added as reviewer or the link:rest-api-groups.html#group-id[
6793ID] of one group for which all members should be added as reviewers. +
6794If an ID identifies both an account and a group, only the account is
6795added as reviewer to the change.
Edwin Kempincd07df42016-12-01 09:10:09 +01006796|`state` |optional|
Logan Hanksee0a4182016-07-06 14:39:26 -07006797Add reviewer in this state. Possible reviewer states are `REVIEWER`
6798and `CC`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006799|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01006800Whether adding the reviewer is confirmed. +
6801The Gerrit server may be configured to
6802link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
6803confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01006804|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02006805Notify handling that defines to whom email notifications should be sent
6806after the reviewer is added. +
6807Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6808If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006809|`notify_details`|optional|
6810Additional information about whom to notify about the update as a map
6811of recipient type to link:#notify-info[NotifyInfo] entity.
6812|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01006813
Edwin Kempine3446292013-02-19 16:40:14 +01006814[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006815=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006816The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07006817Not all fields are returned by default. Additional fields can
6818be obtained by adding `o` parameters as described in
6819link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01006820
David Pursehouseae367192014-11-25 17:24:47 +09006821[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006822|===========================
6823|Field Name ||Description
6824|`draft` |not set if `false`|Whether the patch set is a draft.
David Pursehouse4de41112016-06-28 09:24:08 +09006825|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
6826`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Edwin Kempine3446292013-02-19 16:40:14 +01006827|`_number` ||The patch set number.
Edwin Kempin04cbd342015-02-19 16:31:22 +01006828|`created` ||
6829The link:rest-api.html#timestamp[timestamp] of when the patch set was
6830created.
6831|`uploader` ||
6832The uploader of the patch set as an
6833link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01006834|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01006835|`fetch` ||
6836Information about how to fetch this patch set. The fetch information is
6837provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07006838"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
6839only included if a plugin implementing the
6840link:intro-project-owner.html#download-commands[download commands]
6841interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07006842|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01006843link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07006844|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01006845The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07006846link:#file-info[FileInfo] entities. Only set if
6847link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
6848option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07006849|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006850Actions the caller might be able to perform on this revision. The
6851information is a map of view name to link:#action-info[ActionInfo]
6852entities.
Khai Dob3139b7532014-09-19 15:13:04 -07006853|`reviewed` |optional|
6854Indicates whether the caller is authenticated and has commented on the
6855current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07006856|`messageWithFooter` |optional|
6857If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
6858this is the current patch set, contains the full commit message with
6859Gerrit-specific commit footers, as if this revision were submitted
6860using the link:project-configuration.html#cherry_pick[Cherry Pick]
6861submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04006862|`push_certificate` |optional|
6863If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
6864contains the push certificate provided by the user when uploading this
6865patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
6866This field is always set if the option is requested; if no push
6867certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07006868|`description` |optional|
6869The description of this patchset, as displayed in the patchset
6870selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01006871|===========================
6872
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006873[[robot-comment-info]]
6874=== RobotCommentInfo
6875The `RobotCommentInfo` entity contains information about a robot inline
6876comment.
6877
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01006878`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006879In addition `RobotCommentInfo` has the following fields:
6880
6881[options="header",cols="1,^1,5"]
6882|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006883|Field Name ||Description
6884|`robot_id` ||The ID of the robot that generated this comment.
6885|`robot_run_id` ||An ID of the run of the robot.
6886|`url` |optional|URL to more information.
6887|`properties` |optional|Robot specific properties as map that maps arbitrary
6888keys to values.
6889|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
6890<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006891|===========================
6892
6893[[robot-comment-input]]
6894=== RobotCommentInput
6895The `RobotCommentInput` entity contains information for creating an inline
6896robot comment.
6897
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01006898`RobotCommentInput` has the same fields as
6899<<robot-comment-info,RobotCommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006900
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006901[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006902=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006903The `RuleInput` entity contains information to test a Prolog rule.
6904
David Pursehouseae367192014-11-25 17:24:47 +09006905[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006906|===========================
6907|Field Name ||Description
6908|`rule`||
6909Prolog code to execute instead of the code in `refs/meta/config`.
6910|`filters`|`RUN` if not set|
6911When `RUN` filter rules in the parent projects are called to
6912post-process the results of the project specific rule. This
6913behavior matches how the rule will execute if installed. +
6914If `SKIP` the parent filters are not called, allowing the test
6915to return results from the input rule.
6916|===========================
6917
Edwin Kempin14b58112013-02-26 16:30:19 +01006918[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006919=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01006920The `SubmitInfo` entity contains information about the change status
6921after submitting.
6922
Stefan Bellere4785b42015-06-18 12:31:03 -07006923[options="header",cols="1,^1,5"]
Edwin Kempin14b58112013-02-26 16:30:19 +01006924|==========================
Stefan Bellere4785b42015-06-18 12:31:03 -07006925|Field Name ||Description
6926|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07006927The status of the change after submitting is `MERGED`.
David Ostrovsky868e3412014-01-30 19:50:57 +01006928|`on_behalf_of`|optional|
6929The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
6930whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09006931have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
6932The user named by `on_behalf_of` does not need to be granted the `Submit`
6933permission. This feature is aimed for CI solutions: the CI account can be
David Pursehousea61ee502016-09-06 16:27:09 +09006934granted both permissions, so individual users don't need `Submit` permission
6935themselves. Still the changes can be submitted on behalf of real users and
David Pursehouse22bd6f92014-02-20 21:11:01 +09006936not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01006937|==========================
6938
Edwin Kempin0eddba02013-02-22 15:30:12 +01006939[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006940=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01006941The `SubmitInput` entity contains information for submitting a change.
6942
David Pursehouseae367192014-11-25 17:24:47 +09006943[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006944|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01006945|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01006946|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05006947If set, submit the change on behalf of the given user. The value may take any
6948format link:rest-api-accounts.html#account-id[accepted by the accounts REST
6949API]. Using this option requires
6950link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
6951permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01006952|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07006953Notify handling that defines to whom email notifications should be sent after
6954the change is submitted. +
6955Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6956If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006957|`notify_details`|optional|
6958Additional information about whom to notify about the update as a map
6959of recipient type to link:#notify-info[NotifyInfo] entity.
6960|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01006961
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006962[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006963=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006964The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02006965Fields in this entity roughly correspond to the fields set by `LABELS`
6966in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006967
David Pursehouseae367192014-11-25 17:24:47 +09006968[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006969|===========================
6970|Field Name ||Description
6971|`status`||
6972`OK`, the change can be submitted. +
6973`NOT_READY`, additional labels are required before submit. +
6974`CLOSED`, closed changes cannot be submitted. +
6975`RULE_ERROR`, rule code failed with an error.
6976|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006977Map of labels that are approved; an
6978link:rest-api-accounts.html#account-info[AccountInfo] identifies the
6979voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006980|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006981Map of labels that are preventing submit;
6982link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006983|`need`|optional|
6984Map of labels that need to be given to submit. The value is
6985currently an empty object.
6986|`may`|optional|
6987Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01006988link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
6989if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006990|`impossible`|optional|
6991Map of labels that should have been in `need` but cannot be
6992used by any user because of access restrictions. The value
6993is currently an empty object.
6994|`error_message`|optional|
6995When status is RULE_ERROR this message provides some text describing
6996the failure of the rule predicate.
6997|===========================
6998
Jonathan Nieder2a629b02016-06-16 15:15:25 -07006999[[submitted-together-info]]
7000=== SubmittedTogetherInfo
7001The `SubmittedTogetherInfo` entity contains information about a
7002collection of changes that would be submitted together.
7003
7004[options="header",cols="1,6"]
7005|===========================
7006|Field Name |Description
7007|`changes` |
7008A list of ChangeInfo entities representing the changes to be submitted together.
7009|`non_visible_changes`|
7010The number of changes to be submitted together that the current user
7011cannot see. (This count includes changes that are visible to the
7012current user when their reason for being submitted together involves
7013changes the user cannot see.)
7014|===========================
7015
Edwin Kempin521c1242015-01-23 12:44:44 +01007016[[suggested-reviewer-info]]
7017=== SuggestedReviewerInfo
7018The `SuggestedReviewerInfo` entity contains information about a reviewer
7019that can be added to a change (an account or a group).
7020
7021`SuggestedReviewerInfo` has either the `account` field that contains
7022the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
7023the `group` field that contains the
7024link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
7025
Logan Hanksab3c81e2016-07-20 15:42:52 -07007026[options="header",cols="1,^1,5"]
7027|===========================
7028|Field Name ||Description
7029|`account` |optional|
7030An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
7031suggestion is an account.
7032|`group` |optional|
7033A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
7034suggestion is a group.
7035|`count` ||
7036The total number of accounts in the suggestion. This is `1` if `account` is
7037present. If `group` is present, the total number of accounts that are
7038members of the group is returned (this count includes members of nested
7039groups).
7040|`confirm` |optional|
7041True if `group` is present and `count` is above the threshold where the
7042`confirmed` flag must be passed to add the group as a reviewer.
7043|===========================
7044
Edwin Kempin64006bb2013-02-22 08:17:04 +01007045[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007046=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01007047The `TopicInput` entity contains information for setting a topic.
7048
David Pursehouseae367192014-11-25 17:24:47 +09007049[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01007050|===========================
7051|Field Name ||Description
7052|`topic` |optional|The topic. +
7053The topic will be deleted if not set.
Edwin Kempin64006bb2013-02-22 08:17:04 +01007054|===========================
7055
Oleg Aravinbf313bb2016-10-24 12:28:56 -07007056[[voting-range-info]]
7057=== VotingRangeInfo
7058The `VotingRangeInfo` entity describes the continuous voting range from min
7059to max values.
7060
7061[options="header",cols="1,6"]
7062|======================
7063|Field Name|Description
7064|`min` |The minimum voting value.
7065|`max` |The maximum voting value.
7066|======================
7067
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007068[[web-link-info]]
7069=== WebLinkInfo
7070The `WebLinkInfo` entity describes a link to an external site.
7071
David Pursehouseae367192014-11-25 17:24:47 +09007072[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007073|======================
7074|Field Name|Description
7075|`name` |The link name.
7076|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02007077|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007078|======================
7079
Alan Tokaev392cfca2017-04-28 11:11:31 +02007080[[work-in-progress-input]]
7081=== WorkInProgressInput
7082The `WorkInProgressInput` entity contains additional information for a change
7083set to WorkInProgress/ReadyForReview.
7084
7085[options="header",cols="1,^1,5"]
7086|=============================
7087|Field Name ||Description
7088|`message` |optional|
7089Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview.
7090|=============================
7091
Edwin Kempind0a63922013-01-23 16:32:59 +01007092GERRIT
7093------
7094Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07007095
7096SEARCHBOX
7097---------