blob: 0c30a4bd2dddba3439af7e4f3c02f009c8f64f58 [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",
David Ostrovsky6ffb7d92017-02-13 21:16:58 +010029 "status" : "NEW"
David Ostrovsky837c0ee2014-04-27 12:54:20 +020030 }
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",
David Ostrovsky6ffb7d92017-02-13 21:16:58 +010050 "status": "NEW",
David Ostrovsky837c0ee2014-04-27 12:54:20 +020051 "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
Han-Wen Nienhuys19de6cd2018-01-16 13:15:38 +0100304[[skip_mergeable]]
305--
306* `SKIP_MERGEABLE`: skip the `mergeable` field in
307link:#change-info[ChangeInfo]. For fast moving projects, this field must
308be recomputed often, which is slow for projects with big trees.
309
Jonathan Niedercb51d742016-09-23 11:37:57 -0700310[[submittable]]
311--
Jonathan Niederad5240f2016-10-04 11:03:23 -0700312* `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo],
Jonathan Niedercb51d742016-09-23 11:37:57 -0700313 which can be used to tell if the change is reviewed and ready for submit.
314--
315
Khai Do2a23ec82014-09-19 16:33:02 -0700316[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100317--
Sven Selbergd26bd542014-11-21 16:28:10 +0100318* `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo],
319 therefore only valid in combination with `CURRENT_COMMIT` or
320 `ALL_COMMITS`.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100321--
322
Dave Borowitz4c46c242014-12-03 16:46:45 -0800323[[check]]
324--
325* `CHECK`: include potential problems with the change.
326--
327
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700328[[commit-footers]]
329--
330* `COMMIT_FOOTERS`: include the full commit message with
331 Gerrit-specific commit footers in the
332 link:#revision-info[RevisionInfo].
Yuxuan 'fishy' Wang16baf212015-05-05 16:49:55 -0700333--
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700334
Dave Borowitz6f58dbe2015-09-14 12:34:31 -0400335[[push-certificates]]
336--
337* `PUSH_CERTIFICATES`: include push certificate information in the
338 link:#revision-info[RevisionInfo]. Ignored if signed push is not
339 link:config-gerrit.html#receive.enableSignedPush[enabled] on the
340 server.
341--
342
Makson Lee3568a932017-08-28 17:12:03 +0800343[[tracking-ids]]
344--
345* `TRACKING_IDS`: include references to external tracking systems
346 as link:#tracking-id-info[TrackingIdInfo].
347--
348
Edwin Kempin37440832013-02-06 11:36:00 +0100349.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100350----
Edwin Kempinea621482013-10-16 12:58:24 +0200351 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 +0100352----
Edwin Kempind0a63922013-01-23 16:32:59 +0100353
Edwin Kempin37440832013-02-06 11:36:00 +0100354.Response
355----
Edwin Kempind0a63922013-01-23 16:32:59 +0100356 HTTP/1.1 200 OK
357 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900358 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100359
360 )]}'
361 [
362 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900363 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100364 "project": "gerrit",
365 "branch": "master",
366 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
367 "subject": "Use an EventBus to manage star icons",
368 "status": "NEW",
369 "created": "2012-04-25 00:52:25.580000000",
370 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100371 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100372 "insertions": 16,
373 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100374 "_number": 97,
375 "owner": {
376 "name": "Shawn Pearce"
377 },
378 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
379 "revisions": {
380 "184ebe53805e102605d11f6b143486d15c23a09c": {
David Pursehouse4de41112016-06-28 09:24:08 +0900381 "kind": "REWORK",
Edwin Kempind0a63922013-01-23 16:32:59 +0100382 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100383 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100384 "fetch": {
385 "git": {
386 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200387 "ref": "refs/changes/97/97/1",
388 "commands": {
389 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
390 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
391 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
392 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
393 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100394 },
395 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200396 "url": "http://myuser@127.0.0.1:8080/gerrit",
397 "ref": "refs/changes/97/97/1",
398 "commands": {
399 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
400 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
401 "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",
402 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
403 }
404 },
405 "ssh": {
406 "url": "ssh://myuser@*:29418/gerrit",
407 "ref": "refs/changes/97/97/1",
408 "commands": {
409 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
410 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
411 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
412 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
413 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100414 }
415 },
416 "commit": {
417 "parents": [
418 {
419 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
420 "subject": "Migrate contributor agreements to All-Projects."
421 }
422 ],
423 "author": {
424 "name": "Shawn O. Pearce",
425 "email": "sop@google.com",
426 "date": "2012-04-24 18:08:08.000000000",
427 "tz": -420
428 },
429 "committer": {
430 "name": "Shawn O. Pearce",
431 "email": "sop@google.com",
432 "date": "2012-04-24 18:08:08.000000000",
433 "tz": -420
434 },
435 "subject": "Use an EventBus to manage star icons",
436 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
437 },
438 "files": {
439 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200440 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100441 "size_delta": -412,
442 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100443 },
444 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200445 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100446 "size_delta": 23,
447 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100448 },
449 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
450 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200451 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100452 "size_delta": -298,
453 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100454 },
455 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
456 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200457 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100458 "size_delta": 132,
459 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100460 },
461 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
462 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200463 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100464 "size_delta": -5512,
465 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100466 },
467 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
468 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200469 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100470 "size_delta": 8345,
471 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100472 },
473 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200474 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100475 "size_delta": -343,
476 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100477 }
478 }
479 }
480 }
481 }
482 ]
483----
484
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100485[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800486=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800487--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100488'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800489--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100490
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100491Retrieves a change.
492
Dave Borowitz0314f732013-10-03 09:34:30 -0700493Additional fields can be obtained by adding `o` parameters, each
494option requires more database lookups and slows down the query
495response time to the client so they are generally disabled by
496default. Fields are described in link:#list-changes[Query Changes].
497
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100498.Request
499----
500 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
501----
502
503As response a link:#change-info[ChangeInfo] entity is returned that
504describes the change.
505
506.Response
507----
508 HTTP/1.1 200 OK
509 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900510 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100511
512 )]}'
513 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100514 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
515 "project": "myProject",
516 "branch": "master",
517 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
518 "subject": "Implementing Feature X",
519 "status": "NEW",
520 "created": "2013-02-01 09:59:32.126000000",
521 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100522 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100523 "insertions": 34,
524 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100525 "_number": 3965,
526 "owner": {
527 "name": "John Doe"
528 }
529 }
530----
531
Edwin Kempin8e492202013-02-21 15:38:25 +0100532[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800533=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800534--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100535'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800536--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100537
Edwin Kempin8e492202013-02-21 15:38:25 +0100538Retrieves a change with link:#labels[labels], link:#detailed-labels[
Viktar Donich316bf7a2016-07-06 11:29:01 -0700539detailed labels], link:#detailed-accounts[detailed accounts],
540link:#reviewer-updates[reviewer updates], and link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100541
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700542Additional fields can be obtained by adding `o` parameters, each
543option requires more database lookups and slows down the query
544response time to the client so they are generally disabled by
545default. Fields are described in link:#list-changes[Query Changes].
546
Edwin Kempin8e492202013-02-21 15:38:25 +0100547.Request
548----
549 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
550----
551
552As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700553describes the change. This response will contain all votes for each
554label and include one combined vote. The combined label vote is
555calculated in the following order (from highest to lowest):
556REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100557
558.Response
559----
560 HTTP/1.1 200 OK
561 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900562 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100563
564 )]}'
565 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100566 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
567 "project": "myProject",
568 "branch": "master",
569 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
570 "subject": "Implementing Feature X",
571 "status": "NEW",
572 "created": "2013-02-01 09:59:32.126000000",
573 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100574 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100575 "insertions": 126,
576 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100577 "_number": 3965,
578 "owner": {
579 "_account_id": 1000096,
580 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200581 "email": "john.doe@example.com",
582 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100583 },
584 "labels": {
585 "Verified": {
586 "all": [
587 {
588 "value": 0,
589 "_account_id": 1000096,
590 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200591 "email": "john.doe@example.com",
592 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100593 },
594 {
595 "value": 0,
596 "_account_id": 1000097,
597 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200598 "email": "jane.roe@example.com",
599 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100600 }
601 ],
602 "values": {
603 "-1": "Fails",
604 " 0": "No score",
605 "+1": "Verified"
606 }
607 },
608 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100609 "disliked": {
610 "_account_id": 1000096,
611 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200612 "email": "john.doe@example.com",
613 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100614 },
615 "all": [
616 {
617 "value": -1,
618 "_account_id": 1000096,
619 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200620 "email": "john.doe@example.com",
621 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100622 },
623 {
624 "value": 1,
625 "_account_id": 1000097,
626 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200627 "email": "jane.roe@example.com",
628 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100629 }
630 ]
631 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +0400632 "-2": "This shall not be merged",
633 "-1": "I would prefer this is not merged as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100634 " 0": "No score",
635 "+1": "Looks good to me, but someone else must approve",
636 "+2": "Looks good to me, approved"
637 }
638 }
639 },
640 "permitted_labels": {
641 "Verified": [
642 "-1",
643 " 0",
644 "+1"
645 ],
646 "Code-Review": [
647 "-2",
648 "-1",
649 " 0",
650 "+1",
651 "+2"
652 ]
653 },
654 "removable_reviewers": [
655 {
656 "_account_id": 1000096,
657 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200658 "email": "john.doe@example.com",
659 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100660 },
661 {
662 "_account_id": 1000097,
663 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200664 "email": "jane.roe@example.com",
665 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100666 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400667 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800668 "reviewers": {
669 "REVIEWER": [
670 {
671 "_account_id": 1000096,
672 "name": "John Doe",
673 "email": "john.doe@example.com",
674 "username": "jdoe"
675 },
676 {
677 "_account_id": 1000097,
678 "name": "Jane Roe",
679 "email": "jane.roe@example.com",
680 "username": "jroe"
681 }
682 ]
683 },
Viktar Donich316bf7a2016-07-06 11:29:01 -0700684 "reviewer_updates": [
685 {
686 "state": "REVIEWER",
687 "reviewer": {
688 "_account_id": 1000096,
689 "name": "John Doe",
690 "email": "john.doe@example.com",
691 "username": "jdoe"
692 },
693 "updated_by": {
694 "_account_id": 1000096,
695 "name": "John Doe",
696 "email": "john.doe@example.com",
697 "username": "jdoe"
698 },
699 "updated": "2016-07-21 20:12:39.000000000"
700 },
701 {
702 "state": "REMOVED",
703 "reviewer": {
704 "_account_id": 1000096,
705 "name": "John Doe",
706 "email": "john.doe@example.com",
707 "username": "jdoe"
708 },
709 "updated_by": {
710 "_account_id": 1000096,
711 "name": "John Doe",
712 "email": "john.doe@example.com",
713 "username": "jdoe"
714 },
715 "updated": "2016-07-21 20:12:33.000000000"
716 },
717 {
718 "state": "CC",
719 "reviewer": {
720 "_account_id": 1000096,
721 "name": "John Doe",
722 "email": "john.doe@example.com",
723 "username": "jdoe"
724 },
725 "updated_by": {
726 "_account_id": 1000096,
727 "name": "John Doe",
728 "email": "john.doe@example.com",
729 "username": "jdoe"
730 },
731 "updated": "2016-03-23 21:34:02.419000000",
732 },
733 ],
John Spurlock74a70cc2013-03-23 16:41:50 -0400734 "messages": [
735 {
736 "id": "YH-egE",
737 "author": {
738 "_account_id": 1000096,
739 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200740 "email": "john.doe@example.com",
741 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400742 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100743 "date": "2013-03-23 21:34:02.419000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400744 "message": "Patch Set 1:\n\nThis is the first message.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100745 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400746 },
747 {
748 "id": "WEEdhU",
749 "author": {
750 "_account_id": 1000097,
751 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200752 "email": "jane.roe@example.com",
753 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400754 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100755 "date": "2013-03-23 21:36:52.332000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400756 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100757 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400758 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100759 ]
760 }
761----
762
Aaron Gable9b413072017-08-24 13:15:21 -0700763[[create-merge-patch-set-for-change]]
764=== Create Merge Patch Set For Change
765--
766'POST /changes/link:#change-id[\{change-id\}]/merge'
767--
768
769Update an existing change by using a
770link:#merge-patch-set-input[MergePatchSetInput] entity.
771
772Gerrit will create a merge commit based on the information of
773MergePatchSetInput and add a new patch set to the change corresponding
774to the new merge commit.
775
776.Request
777----
778 POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0
779 Content-Type: application/json; charset=UTF-8
780
781 {
782 "subject": "Merge dev_branch into master",
783 "merge": {
784 "source": "refs/12/1234/1"
785 }
786 }
787----
788
789As response a link:#change-info[ChangeInfo] entity with current revision is
790returned that describes the resulting change.
791
792.Response
793----
794 HTTP/1.1 200 OK
795 Content-Disposition: attachment
796 Content-Type: application/json; charset=UTF-8
797
798 )]}'
799 {
800 "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc",
801 "project": "test",
802 "branch": "master",
803 "hashtags": [],
804 "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc",
805 "subject": "Merge dev_branch into master",
806 "status": "NEW",
807 "created": "2016-09-23 18:08:53.238000000",
808 "updated": "2016-09-23 18:09:25.934000000",
809 "submit_type": "MERGE_IF_NECESSARY",
810 "mergeable": true,
811 "insertions": 5,
812 "deletions": 0,
813 "_number": 72,
814 "owner": {
815 "_account_id": 1000000
816 },
817 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822"
818 }
819----
820
821[[set-message]]
822=== Set Commit Message
823--
824'PUT /changes/link:#change-id[\{change-id\}]/message'
825--
826
827Creates a new patch set with a new commit message.
828
829The new commit message must be provided in the request body inside a
830link:#commit-message-input[CommitMessageInput] entity and contain the change ID footer if
831link:project-configuration.html#require-change-id[Require Change-Id] was specified.
832
833.Request
834----
835 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0
836 Content-Type: application/json; charset=UTF-8
837
838 {
839 "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n"
840 }
841----
842
843.Notifications
844
845An email will be sent using the "newpatchset" template.
846
847[options="header",cols="1,1"]
848|=============================
849|WIP State |Default
850|Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers
851|Work in progress|owner
852|=============================
853
Edwin Kempin64006bb2013-02-22 08:17:04 +0100854[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800855=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800856--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100857'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800858--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100859
Edwin Kempin64006bb2013-02-22 08:17:04 +0100860Retrieves the topic of a change.
861
862.Request
863----
864 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
865----
866
867.Response
868----
869 HTTP/1.1 200 OK
870 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900871 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100872
873 )]}'
874 "Documentation"
875----
876
877If the change does not have a topic an empty string is returned.
878
879[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800880=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800881--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100882'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800883--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100884
Edwin Kempin64006bb2013-02-22 08:17:04 +0100885Sets the topic of a change.
886
887The new topic must be provided in the request body inside a
888link:#topic-input[TopicInput] entity.
889
890.Request
891----
892 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900893 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100894
895 {
896 "topic": "Documentation"
897 }
898----
899
900As response the new topic is returned.
901
902.Response
903----
904 HTTP/1.1 200 OK
905 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900906 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100907
908 )]}'
909 "Documentation"
910----
911
912If the topic was deleted the response is "`204 No Content`".
913
914[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800915=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800916--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100917'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800918--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100919
Edwin Kempin64006bb2013-02-22 08:17:04 +0100920Deletes the topic of a change.
921
Edwin Kempin64006bb2013-02-22 08:17:04 +0100922Please note that some proxies prohibit request bodies for DELETE
923requests. In this case, if you want to specify a commit message, use
924link:#set-topic[PUT] to delete the topic.
925
926.Request
927----
928 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
929----
930
931.Response
932----
933 HTTP/1.1 204 No Content
934----
935
Sven Selberg273a4aa2016-09-21 16:28:10 +0200936[[get-assignee]]
937=== Get Assignee
938--
939'GET /changes/link:#change-id[\{change-id\}]/assignee'
940--
941
942Retrieves the account of the user assigned to a change.
943
944.Request
945----
946 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
947----
948
949As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
950describing the assigned account is returned.
951
952.Response
953----
954 HTTP/1.1 200 OK
955 Content-Disposition: attachment
956 Content-Type: application/json; charset=UTF-8
957
958 )]}'
959 {
960 "_account_id": 1000096,
961 "name": "John Doe",
962 "email": "john.doe@example.com",
963 "username": "jdoe"
964 }
965----
966
967If the change has no assignee the response is "`204 No Content`".
968
969[[get-past-assignees]]
970=== Get Past Assignees
971--
972'GET /changes/link:#change-id[\{change-id\}]/past_assignees'
973--
974
975Returns a list of every user ever assigned to a change, in the order in which
976they were first assigned.
977
David Pursehouse90e452c2017-08-25 13:20:20 +0900978[NOTE] Past assignees are only available when NoteDb is enabled.
979
Sven Selberg273a4aa2016-09-21 16:28:10 +0200980.Request
981----
982 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/past_assignees HTTP/1.0
983----
984
985As a response a list of link:rest-api-accounts.html#account-info[AccountInfo]
986entities is returned.
987
988.Response
989----
990 HTTP/1.1 200 OK
991 Content-Disposition: attachment
992 Content-Type: application/json; charset=UTF-8
993
994 )]}'
995 [
996 {
997 "_account_id": 1000051,
998 "name": "Jane Doe",
999 "email": "jane.doe@example.com",
1000 "username": "janed"
1001 },
1002 {
1003 "_account_id": 1000096,
1004 "name": "John Doe",
1005 "email": "john.doe@example.com",
1006 "username": "jdoe"
1007 }
1008 ]
1009
1010----
1011
1012
1013[[set-assignee]]
1014=== Set Assignee
1015--
1016'PUT /changes/link:#change-id[\{change-id\}]/assignee'
1017--
1018
1019Sets the assignee of a change.
1020
1021The new assignee must be provided in the request body inside a
1022link:#assignee-input[AssigneeInput] entity.
1023
1024.Request
1025----
1026 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1027 Content-Type: application/json; charset=UTF-8
1028
1029 {
1030 "assignee": "jdoe"
1031 }
1032----
1033
1034As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1035describing the assigned account is returned.
1036
1037.Response
1038----
1039 HTTP/1.1 200 OK
1040 Content-Disposition: attachment
1041 Content-Type: application/json; charset=UTF-8
1042
1043 )]}'
1044 {
1045 "_account_id": 1000096,
1046 "name": "John Doe",
1047 "email": "john.doe@example.com",
1048 "username": "jdoe"
1049 }
1050----
1051
1052[[delete-assignee]]
1053=== Delete Assignee
1054--
1055'DELETE /changes/link:#change-id[\{change-id\}]/assignee'
1056--
1057
1058Deletes the assignee of a change.
1059
1060
1061.Request
1062----
1063 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1064----
1065
1066As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1067describing the account of the deleted assignee is returned.
1068
1069.Response
1070----
1071 HTTP/1.1 200 OK
1072 Content-Disposition: attachment
1073 Content-Type: application/json; charset=UTF-8
1074
1075 )]}'
1076 {
1077 "_account_id": 1000096,
1078 "name": "John Doe",
1079 "email": "john.doe@example.com",
1080 "username": "jdoe"
1081 }
1082----
1083
1084If the change had no assignee the response is "`204 No Content`".
1085
Patrick Hieselbb84fd72017-08-23 11:11:22 +02001086[[get-pure-revert]]
1087=== Get Pure Revert
1088--
1089'GET /changes/link:#change-id[\{change-id\}]/pure_revert'
1090--
1091
1092Check if the given change is a pure revert of the change it references in `revertOf`.
1093Optionally, the query parameter `o` can be passed in to specify a commit (SHA1 in
109440 digit hex representation) to check against. It takes precedence over `revertOf`.
1095If the change has no reference in `revertOf`, the parameter is mandatory.
1096
1097As response a link:#pure-revert-info[PureRevertInfo] entity is returned.
1098
1099.Request
1100----
1101 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0
1102----
1103
1104.Response
1105----
1106 HTTP/1.1 200 OK
1107 Content-Disposition: attachment
1108 Content-Type: application/json; charset=UTF-8
1109
1110 )]}'
1111 {
1112 "is_pure_revert" : false
1113 }
1114----
1115
Edwin Kempined5364b2013-02-22 10:39:33 +01001116[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001117=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001118--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001119'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001120--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001121
Edwin Kempined5364b2013-02-22 10:39:33 +01001122Abandons a change.
1123
1124The request body does not need to include a link:#abandon-input[
1125AbandonInput] entity if no review comment is added.
1126
1127.Request
1128----
1129 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
1130----
1131
1132As response a link:#change-info[ChangeInfo] entity is returned that
1133describes the abandoned change.
1134
1135.Response
1136----
1137 HTTP/1.1 200 OK
1138 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001139 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001140
1141 )]}'
1142 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001143 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1144 "project": "myProject",
1145 "branch": "master",
1146 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1147 "subject": "Implementing Feature X",
1148 "status": "ABANDONED",
1149 "created": "2013-02-01 09:59:32.126000000",
1150 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001151 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001152 "insertions": 3,
1153 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +01001154 "_number": 3965,
1155 "owner": {
1156 "name": "John Doe"
1157 }
1158 }
1159----
1160
1161If the change cannot be abandoned because the change state doesn't
1162allow abandoning of the change, the response is "`409 Conflict`" and
1163the error message is contained in the response body.
1164
1165.Response
1166----
1167 HTTP/1.1 409 Conflict
1168 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001169 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001170
1171 change is merged
1172----
1173
Logan Hankse43b68e2017-05-23 13:16:22 -07001174.Notifications
1175
1176An email will be sent using the "abandon" template. The notify handling is ALL.
1177Notifications are suppressed on WIP changes that have never started review.
1178
Logan Hanks87607412017-05-30 13:49:04 -07001179[options="header",cols="1,2"]
Logan Hankse43b68e2017-05-23 13:16:22 -07001180|=============================
Logan Hanks87607412017-05-30 13:49:04 -07001181|WIP State |notify=ALL
Logan Hankse43b68e2017-05-23 13:16:22 -07001182|Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1183|Work in progress|not sent
1184|Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1185|=============================
1186
Edwin Kempined5364b2013-02-22 10:39:33 +01001187[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001188=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001189--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001190'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001191--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001192
Edwin Kempined5364b2013-02-22 10:39:33 +01001193Restores a change.
1194
1195The request body does not need to include a link:#restore-input[
1196RestoreInput] entity if no review comment is added.
1197
1198.Request
1199----
1200 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1201----
1202
1203As response a link:#change-info[ChangeInfo] entity is returned that
1204describes the restored change.
1205
1206.Response
1207----
1208 HTTP/1.1 200 OK
1209 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001210 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001211
1212 )]}'
1213 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001214 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1215 "project": "myProject",
1216 "branch": "master",
1217 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1218 "subject": "Implementing Feature X",
1219 "status": "NEW",
1220 "created": "2013-02-01 09:59:32.126000000",
1221 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001222 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001223 "insertions": 2,
1224 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001225 "_number": 3965,
1226 "owner": {
1227 "name": "John Doe"
1228 }
1229 }
1230----
1231
1232If the change cannot be restored because the change state doesn't
1233allow restoring the change, the response is "`409 Conflict`" and
1234the error message is contained in the response body.
1235
1236.Response
1237----
1238 HTTP/1.1 409 Conflict
1239 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001240 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001241
1242 change is new
1243----
1244
Edwin Kempincdae63b2013-03-15 15:06:59 +01001245[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001246=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001247--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001248'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001249--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001250
1251Rebases a change.
1252
Zalan Blenessy874aed72015-01-12 13:26:18 +01001253Optionally, the parent revision can be changed to another patch set through the
1254link:#rebase-input[RebaseInput] entity.
1255
Edwin Kempincdae63b2013-03-15 15:06:59 +01001256.Request
1257----
1258 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001259 Content-Type: application/json;charset=UTF-8
1260
1261 {
1262 "base" : "1234",
1263 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001264----
1265
1266As response a link:#change-info[ChangeInfo] entity is returned that
1267describes the rebased change. Information about the current patch set
1268is included.
1269
1270.Response
1271----
1272 HTTP/1.1 200 OK
1273 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001274 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001275
1276 )]}'
1277 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001278 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1279 "project": "myProject",
1280 "branch": "master",
1281 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1282 "subject": "Implement Feature X",
1283 "status": "NEW",
1284 "created": "2013-02-01 09:59:32.126000000",
1285 "updated": "2013-02-21 11:16:36.775000000",
1286 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001287 "insertions": 33,
1288 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001289 "_number": 4799,
1290 "owner": {
1291 "name": "John Doe"
1292 },
1293 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1294 "revisions": {
1295 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001296 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001297 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001298 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001299 "fetch": {
1300 "http": {
1301 "url": "http://gerrit:8080/myProject",
1302 "ref": "refs/changes/99/4799/2"
1303 }
1304 },
1305 "commit": {
1306 "parents": [
1307 {
1308 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1309 "subject": "Implement Feature A"
1310 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001311 ],
1312 "author": {
1313 "name": "John Doe",
1314 "email": "john.doe@example.com",
1315 "date": "2013-05-07 15:21:27.000000000",
1316 "tz": 120
1317 },
1318 "committer": {
1319 "name": "Gerrit Code Review",
1320 "email": "gerrit-server@example.com",
1321 "date": "2013-05-07 15:35:43.000000000",
1322 "tz": 120
1323 },
1324 "subject": "Implement Feature X",
1325 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001326 }
1327 }
1328 }
1329----
1330
1331If the change cannot be rebased, e.g. due to conflicts, the response is
1332"`409 Conflict`" and the error message is contained in the response
1333body.
1334
1335.Response
1336----
1337 HTTP/1.1 409 Conflict
1338 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001339 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001340
1341 The change could not be rebased due to a path conflict during merge.
1342----
1343
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301344[[move-change]]
1345=== Move Change
1346--
1347'POST /changes/link:#change-id[\{change-id\}]/move'
1348--
1349
1350Move a change.
1351
1352The destination branch must be provided in the request body inside a
1353link:#move-input[MoveInput] entity.
1354
1355.Request
1356----
1357 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1358 Content-Type: application/json; charset=UTF-8
1359
1360 {
1361 "destination_branch" : "release-branch"
1362 }
1363
1364----
1365
1366As response a link:#change-info[ChangeInfo] entity is returned that
1367describes the moved change.
1368
1369.Response
1370----
1371 HTTP/1.1 200 OK
1372 Content-Disposition: attachment
1373 Content-Type: application/json; charset=UTF-8
1374
1375 )]}'
1376 {
1377 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1378 "project": "myProject",
1379 "branch": "release-branch",
1380 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1381 "subject": "Implementing Feature X",
1382 "status": "NEW",
1383 "created": "2013-02-01 09:59:32.126000000",
1384 "updated": "2013-02-21 11:16:36.775000000",
1385 "mergeable": true,
1386 "insertions": 2,
1387 "deletions": 13,
1388 "_number": 3965,
1389 "owner": {
1390 "name": "John Doe"
1391 }
1392 }
1393----
1394
Changcheng Xiao6dc90422017-08-09 10:21:58 +02001395Note that this endpoint will not update the change's parents, which is
1396different from the link:#cherry-pick[cherry-pick] endpoint.
1397
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301398If the change cannot be moved because the change state doesn't
1399allow moving the change, the response is "`409 Conflict`" and
1400the error message is contained in the response body.
1401
1402.Response
1403----
1404 HTTP/1.1 409 Conflict
1405 Content-Disposition: attachment
1406 Content-Type: text/plain; charset=UTF-8
1407
1408 change is merged
1409----
1410
1411If the change cannot be moved because the user doesn't have
1412abandon permission on the change or upload permission on the destination,
1413the response is "`409 Conflict`" and the error message is contained in the
1414response body.
1415
1416.Response
1417----
1418 HTTP/1.1 409 Conflict
1419 Content-Disposition: attachment
1420 Content-Type: text/plain; charset=UTF-8
1421
1422 move not permitted
1423----
1424
Edwin Kempind2ec4152013-02-22 12:17:19 +01001425[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001426=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001427--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001428'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001429--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001430
Edwin Kempind2ec4152013-02-22 12:17:19 +01001431Reverts a change.
1432
1433The request body does not need to include a link:#revert-input[
1434RevertInput] entity if no review comment is added.
1435
1436.Request
1437----
Michael Zhou10270492016-03-24 22:35:40 -04001438 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001439----
1440
1441As response a link:#change-info[ChangeInfo] entity is returned that
1442describes the reverting change.
1443
1444.Response
1445----
1446 HTTP/1.1 200 OK
1447 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001448 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001449
1450 )]}'
1451 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001452 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1453 "project": "myProject",
1454 "branch": "master",
1455 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1456 "subject": "Revert \"Implementing Feature X\"",
1457 "status": "NEW",
1458 "created": "2013-02-01 09:59:32.126000000",
1459 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001460 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001461 "insertions": 6,
1462 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001463 "_number": 3965,
1464 "owner": {
1465 "name": "John Doe"
1466 }
1467 }
1468----
1469
1470If the change cannot be reverted because the change state doesn't
1471allow reverting the change, the response is "`409 Conflict`" and
1472the error message is contained in the response body.
1473
1474.Response
1475----
1476 HTTP/1.1 409 Conflict
1477 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001478 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001479
1480 change is new
1481----
1482
Edwin Kempin0eddba02013-02-22 15:30:12 +01001483[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001484=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001485--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001486'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001487--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001488
Edwin Kempin0eddba02013-02-22 15:30:12 +01001489Submits a change.
1490
1491The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001492SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001493
1494.Request
1495----
1496 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001497 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001498
1499 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001500 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001501 }
1502----
1503
1504As response a link:#change-info[ChangeInfo] entity is returned that
1505describes the submitted/merged change.
1506
1507.Response
1508----
1509 HTTP/1.1 200 OK
1510 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001511 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001512
1513 )]}'
1514 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001515 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1516 "project": "myProject",
1517 "branch": "master",
1518 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1519 "subject": "Implementing Feature X",
1520 "status": "MERGED",
1521 "created": "2013-02-01 09:59:32.126000000",
1522 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001523 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001524 "_number": 3965,
1525 "owner": {
1526 "name": "John Doe"
1527 }
1528 }
1529----
1530
1531If the change cannot be submitted because the submit rule doesn't allow
1532submitting the change, the response is "`409 Conflict`" and the error
1533message is contained in the response body.
1534
1535.Response
1536----
1537 HTTP/1.1 409 Conflict
1538 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001539 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001540
1541 blocked by Verified
1542----
1543
David Pursehouse025c1af2015-11-20 17:02:50 +09001544[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001545=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07001546--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001547'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001548--
1549
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001550Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001551link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07001552including the current change itself.
1553
Stefan Bellera7ad6612015-06-26 10:05:43 -07001554The list consists of:
1555
1556* The given change.
1557* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1558 is enabled, include all open changes with the same topic.
1559* For each change whose submit type is not CHERRY_PICK, include unmerged
1560 ancestors targeting the same branch.
1561
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001562As a special case, the list is empty if this change would be
1563submitted by itself (without other changes).
1564
1565.Request
1566----
1567 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
1568 Content-Type: application/json; charset=UTF-8
1569----
1570
1571As a response a link:#submitted-together-info[SubmittedTogetherInfo]
1572entity is returned that describes what would happen if the change were
1573submitted. This response contains a list of changes and a count of
1574changes that are not visible to the caller that are part of the set of
1575changes to be merged.
1576
1577The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001578link:#list-changes[Query Changes] with the
1579link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Jonathan Niedercb51d742016-09-23 11:37:57 -07001580link:#current-revision[`CURRENT_REVISION`],
1581link:#current-commit[`CURRENT_COMMIT`], and
1582link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001583
Shawn Pearce8080c3d2016-09-19 19:15:04 -07001584Standard link:#query-options[formatting options] can be specified
1585with the `o` parameter, as well as the `submitted_together` specific
1586option `NON_VISIBLE_CHANGES`.
1587
Stefan Bellera7ad6612015-06-26 10:05:43 -07001588.Response
1589----
1590 HTTP/1.1 200 OK
1591 Content-Disposition: attachment
1592 Content-Type: application/json; charset=UTF-8
1593
1594)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001595{
1596 "changes": [
1597 {
1598 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1599 "project": "gerrit",
1600 "branch": "master",
1601 "hashtags": [],
1602 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1603 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1604 "status": "NEW",
1605 "created": "2015-05-01 15:39:57.979000000",
1606 "updated": "2015-05-20 19:25:21.592000000",
1607 "mergeable": true,
1608 "insertions": 303,
1609 "deletions": 210,
1610 "_number": 1779,
1611 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001612 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001613 },
1614 "labels": {
1615 "Code-Review": {
1616 "approved": {
1617 "_account_id": 1000000
1618 },
1619 "all": [
1620 {
1621 "value": 2,
1622 "date": "2015-05-20 19:25:21.592000000",
1623 "_account_id": 1000000
1624 }
1625 ],
1626 "values": {
1627 "-2": "This shall not be merged",
1628 "-1": "I would prefer this is not merged as is",
1629 " 0": "No score",
1630 "+1": "Looks good to me, but someone else must approve",
1631 "+2": "Looks good to me, approved"
1632 },
1633 "default_value": 0
1634 },
1635 "Verified": {
1636 "approved": {
1637 "_account_id": 1000000
1638 },
1639 "all": [
1640 {
1641 "value": 1,
1642 "date": "2015-05-20 19:25:21.592000000",
1643 "_account_id": 1000000
1644 }
1645 ],
1646 "values": {
1647 "-1": "Fails",
1648 " 0": "No score",
1649 "+1": "Verified"
1650 },
1651 "default_value": 0
1652 }
1653 },
1654 "permitted_labels": {
1655 "Code-Review": [
1656 "-2",
1657 "-1",
1658 " 0",
1659 "+1",
1660 "+2"
1661 ],
1662 "Verified": [
1663 "-1",
1664 " 0",
1665 "+1"
1666 ]
1667 },
1668 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001669 {
1670 "_account_id": 1000000
1671 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001672 ],
1673 "reviewers": {
1674 "REVIEWER": [
1675 {
1676 "_account_id": 1000000
1677 }
1678 ]
1679 },
1680 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1681 "revisions": {
1682 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09001683 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001684 "_number": 1,
1685 "created": "2015-05-01 15:39:57.979000000",
1686 "uploader": {
1687 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001688 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001689 "ref": "refs/changes/79/1779/1",
1690 "fetch": {},
1691 "commit": {
1692 "parents": [
1693 {
1694 "commit": "2d3176497a2747faed075f163707e57d9f961a1c",
1695 "subject": "Merge changes from topic \u0027submodule-subscription-tests-and-fixes-3\u0027"
1696 }
1697 ],
1698 "author": {
1699 "name": "Stefan Beller",
1700 "email": "sbeller@google.com",
1701 "date": "2015-04-29 21:36:52.000000000",
1702 "tz": -420
1703 },
1704 "committer": {
1705 "name": "Stefan Beller",
1706 "email": "sbeller@google.com",
1707 "date": "2015-05-01 00:11:16.000000000",
1708 "tz": -420
1709 },
1710 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1711 "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"
1712 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001713 }
1714 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001715 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001716 {
1717 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
1718 "project": "gerrit",
1719 "branch": "master",
1720 "hashtags": [],
1721 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
1722 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1723 "status": "NEW",
1724 "created": "2015-05-01 15:39:57.979000000",
1725 "updated": "2015-05-20 19:25:21.546000000",
1726 "mergeable": true,
1727 "insertions": 15,
1728 "deletions": 6,
1729 "_number": 1780,
1730 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001731 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001732 },
1733 "labels": {
1734 "Code-Review": {
1735 "approved": {
1736 "_account_id": 1000000
1737 },
1738 "all": [
1739 {
1740 "value": 2,
1741 "date": "2015-05-20 19:25:21.546000000",
1742 "_account_id": 1000000
1743 }
1744 ],
1745 "values": {
1746 "-2": "This shall not be merged",
1747 "-1": "I would prefer this is not merged as is",
1748 " 0": "No score",
1749 "+1": "Looks good to me, but someone else must approve",
1750 "+2": "Looks good to me, approved"
1751 },
1752 "default_value": 0
1753 },
1754 "Verified": {
1755 "approved": {
1756 "_account_id": 1000000
1757 },
1758 "all": [
1759 {
1760 "value": 1,
1761 "date": "2015-05-20 19:25:21.546000000",
1762 "_account_id": 1000000
1763 }
1764 ],
1765 "values": {
1766 "-1": "Fails",
1767 " 0": "No score",
1768 "+1": "Verified"
1769 },
1770 "default_value": 0
1771 }
1772 },
1773 "permitted_labels": {
1774 "Code-Review": [
1775 "-2",
1776 "-1",
1777 " 0",
1778 "+1",
1779 "+2"
1780 ],
1781 "Verified": [
1782 "-1",
1783 " 0",
1784 "+1"
1785 ]
1786 },
1787 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001788 {
1789 "_account_id": 1000000
1790 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001791 ],
1792 "reviewers": {
1793 "REVIEWER": [
1794 {
1795 "_account_id": 1000000
1796 }
1797 ]
1798 },
1799 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
1800 "revisions": {
1801 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09001802 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001803 "_number": 1,
1804 "created": "2015-05-01 15:39:57.979000000",
1805 "uploader": {
1806 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001807 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001808 "ref": "refs/changes/80/1780/1",
1809 "fetch": {},
1810 "commit": {
1811 "parents": [
1812 {
1813 "commit": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1814 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes"
1815 }
1816 ],
1817 "author": {
1818 "name": "Stefan Beller",
1819 "email": "sbeller@google.com",
1820 "date": "2015-04-25 00:11:59.000000000",
1821 "tz": -420
1822 },
1823 "committer": {
1824 "name": "Stefan Beller",
1825 "email": "sbeller@google.com",
1826 "date": "2015-05-01 00:11:16.000000000",
1827 "tz": -420
1828 },
1829 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1830 "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"
1831 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001832 }
1833 }
1834 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001835 ],
1836 "non_visible_changes": 0
1837}
Stefan Bellera7ad6612015-06-26 10:05:43 -07001838----
1839
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001840If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
1841instead of a link:#submitted-together-info[SubmittedTogetherInfo]
1842entity, the response is a list of changes, or a 403 response with a
1843message if the set of changes to be submitted with this change
1844includes changes the caller cannot read.
1845
Stefan Bellera7ad6612015-06-26 10:05:43 -07001846
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001847[[delete-change]]
1848=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001849--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001850'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001851--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001852
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001853Deletes a change.
1854
Paladox none580ae0e2017-02-12 18:15:48 +00001855New or abandoned changes can be deleted by their owner if the user is granted
1856the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
1857otherwise only by administrators.
1858
David Ostrovsky0d69c232013-09-10 23:10:23 +02001859.Request
1860----
1861 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001862 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001863----
1864
1865.Response
1866----
1867 HTTP/1.1 204 No Content
1868----
1869
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001870[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001871=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001872--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001873'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001874--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001875
1876Retrieves the branches and tags in which a change is included. As result
1877an link:#included-in-info[IncludedInInfo] entity is returned.
1878
1879.Request
1880----
1881 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
1882----
1883
1884.Response
1885----
1886 HTTP/1.1 200 OK
1887 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001888 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001889
1890 )]}'
1891 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001892 "branches": [
1893 "master"
1894 ],
1895 "tags": []
1896 }
1897----
1898
David Pursehouse4e38b972014-05-30 10:36:40 +09001899[[index-change]]
1900=== Index Change
1901--
1902'POST /changes/link:#change-id[\{change-id\}]/index'
1903--
1904
1905Adds or updates the change in the secondary index.
1906
1907.Request
1908----
1909 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
1910----
1911
1912.Response
1913----
1914 HTTP/1.1 204 No Content
1915----
1916
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001917[[list-change-comments]]
1918=== List Change Comments
1919--
1920'GET /changes/link:#change-id[\{change-id\}]/comments'
1921--
1922
1923Lists the published comments of all revisions of the change.
1924
1925Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1926entries. The entries in the map are sorted by file path, and the
1927comments for each path are sorted by patch set number. Each comment has
1928the `patch_set` and `author` fields set.
1929
1930.Request
1931----
1932 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
1933----
1934
1935.Response
1936----
1937 HTTP/1.1 200 OK
1938 Content-Disposition: attachment
1939 Content-Type: application/json; charset=UTF-8
1940
1941 )]}'
1942 {
1943 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1944 {
1945 "patch_set": 1,
1946 "id": "TvcXrmjM",
1947 "line": 23,
1948 "message": "[nit] trailing whitespace",
1949 "updated": "2013-02-26 15:40:43.986000000"
1950 "author": {
1951 "_account_id": 1000096,
1952 "name": "John Doe",
1953 "email": "john.doe@example.com"
1954 }
1955 },
1956 {
1957 "patch_set": 2,
1958 "id": "TveXwFiA",
1959 "line": 49,
1960 "in_reply_to": "TfYX-Iuo",
1961 "message": "Done",
1962 "updated": "2013-02-26 15:40:45.328000000"
1963 "author": {
1964 "_account_id": 1000097,
1965 "name": "Jane Roe",
1966 "email": "jane.roe@example.com"
1967 }
1968 }
1969 ]
1970 }
1971----
1972
Changcheng Xiao9b04c042016-12-28 12:45:29 +01001973[[list-change-robot-comments]]
1974=== List Change Robot Comments
1975--
1976'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
1977--
1978
1979Lists the robot comments of all revisions of the change.
1980
1981Return a map that maps the file path to a list of
1982link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
1983map are sorted by file path.
1984
1985.Request
1986----
1987 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
1988----
1989
1990.Response
1991----
1992 HTTP/1.1 200 OK
1993 Content-Disposition: attachment
1994 Content-Type: application/json; charset=UTF-8
1995
1996 )]}'
1997 {
1998 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1999 {
2000 "id": "TvcXrmjM",
2001 "line": 23,
2002 "message": "unused import",
2003 "updated": "2016-02-26 15:40:43.986000000",
2004 "author": {
2005 "_account_id": 1000110,
2006 "name": "Code Analyzer",
2007 "email": "code.analyzer@example.com"
2008 },
2009 "robotId": "importChecker",
2010 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
2011 },
2012 {
2013 "id": "TveXwFiA",
2014 "line": 49,
2015 "message": "wrong indention",
2016 "updated": "2016-02-26 15:40:45.328000000",
2017 "author": {
2018 "_account_id": 1000110,
2019 "name": "Code Analyzer",
2020 "email": "code.analyzer@example.com"
2021 },
2022 "robotId": "styleChecker",
2023 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
2024 }
2025 ]
2026 }
2027----
2028
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002029[[list-change-drafts]]
2030=== List Change Drafts
2031--
2032'GET /changes/link:#change-id[\{change-id\}]/drafts'
2033--
2034
2035Lists the draft comments of all revisions of the change that belong to
2036the calling user.
2037
2038Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2039entries. The entries in the map are sorted by file path, and the
2040comments for each path are sorted by patch set number. Each comment has
2041the `patch_set` field set, and no `author`.
2042
2043.Request
2044----
2045 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
2046----
2047
2048.Response
2049----
2050 HTTP/1.1 200 OK
2051 Content-Disposition: attachment
2052 Content-Type: application/json; charset=UTF-8
2053
2054 )]}'
2055 {
2056 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2057 {
2058 "patch_set": 1,
2059 "id": "TvcXrmjM",
2060 "line": 23,
2061 "message": "[nit] trailing whitespace",
2062 "updated": "2013-02-26 15:40:43.986000000"
2063 },
2064 {
2065 "patch_set": 2,
2066 "id": "TveXwFiA",
2067 "line": 49,
2068 "in_reply_to": "TfYX-Iuo",
2069 "message": "Done",
2070 "updated": "2013-02-26 15:40:45.328000000"
2071 }
2072 ]
2073 }
2074----
2075
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002076[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002077=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002078--
2079'GET /changes/link:#change-id[\{change-id\}]/check'
2080--
2081
2082Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002083link:#change-info[ChangeInfo] entity with the `problems` field set to a
2084list of link:#problem-info[ProblemInfo] entities.
2085
2086Depending on the type of problem, some fields not marked optional may be
2087missing from the result. At least `id`, `project`, `branch`, and
2088`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002089
2090.Request
2091----
2092 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2093----
2094
2095.Response
2096----
2097 HTTP/1.1 200 OK
2098 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002099 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002100
2101 )]}'
2102 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002103 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2104 "project": "myProject",
2105 "branch": "master",
2106 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2107 "subject": "Implementing Feature X",
2108 "status": "NEW",
2109 "created": "2013-02-01 09:59:32.126000000",
2110 "updated": "2013-02-21 11:16:36.775000000",
2111 "mergeable": true,
2112 "insertions": 34,
2113 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002114 "_number": 3965,
2115 "owner": {
2116 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002117 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002118 "problems": [
2119 {
2120 "message": "Current patch set 1 not found"
2121 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002122 ]
2123 }
2124----
2125
Dave Borowitz3be39d02014-12-03 17:57:38 -08002126[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002127=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002128--
2129'POST /changes/link:#change-id[\{change-id\}]/check'
2130--
2131
2132Performs consistency checks on the change as with link:#check-change[GET
2133/check], and additionally fixes any problems that can be fixed
2134automatically. The returned field values reflect any fixes.
2135
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002136Some fixes have options controlling their behavior, which can be set in the
2137link:#fix-input[FixInput] entity body.
2138
Dave Borowitz3be39d02014-12-03 17:57:38 -08002139Only the change owner, a project owner, or an administrator may fix changes.
2140
2141.Request
2142----
2143 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2144----
2145
2146.Response
2147----
2148 HTTP/1.1 200 OK
2149 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002150 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002151
2152 )]}'
2153 {
2154 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2155 "project": "myProject",
2156 "branch": "master",
2157 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2158 "subject": "Implementing Feature X",
2159 "status": "MERGED",
2160 "created": "2013-02-01 09:59:32.126000000",
2161 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002162 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002163 "mergeable": true,
2164 "insertions": 34,
2165 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002166 "_number": 3965,
2167 "owner": {
2168 "name": "John Doe"
2169 },
2170 "problems": [
2171 {
2172 "message": "Current patch set 2 not found"
2173 },
2174 {
2175 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2176 "status": FIXED,
2177 "outcome": "Marked change as merged"
2178 }
2179 ]
2180 }
2181----
2182
Alan Tokaev392cfca2017-04-28 11:11:31 +02002183[[set-work-in-pogress]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002184=== Set Work-In-Progress
Alan Tokaev392cfca2017-04-28 11:11:31 +02002185--
2186'POST /changes/link:#change-id[\{change-id\}]/wip'
2187--
2188
2189Marks the change as not ready for review yet.
2190
2191The request body does not need to include a
2192link:#work-in-progress-input[WorkInProgressInput] entity if no review comment
2193is added. Actions that create a new patch set in a WIP change default to
2194notifying *OWNER* instead of *ALL*.
2195
2196.Request
2197----
2198 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0
2199 Content-Type: application/json; charset=UTF-8
2200
2201 {
2202 "message": "Refactoring needs to be done before we can proceed here."
2203 }
2204----
2205
2206.Response
2207----
2208 HTTP/1.1 200 OK
2209----
2210
2211[[set-ready-for-review]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002212=== Set Ready-For-Review
Alan Tokaev392cfca2017-04-28 11:11:31 +02002213--
2214'POST /changes/link:#change-id[\{change-id\}]/ready'
2215--
2216
2217Marks the change as ready for review (set WIP property to false).
2218
2219Activates notifications of reviewer. The request body does not need
2220to include a link:#work-in-progress-input[WorkInProgressInput] entity
2221if no review comment is added.
2222
2223.Request
2224----
2225 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0
2226 Content-Type: application/json;charset=UTF-8
2227
2228 {
2229 "message": "Refactoring is done."
2230 }
2231
2232----
2233
2234.Response
2235----
2236 HTTP/1.1 200 OK
2237----
2238
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002239[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002240=== Mark Private
2241--
Edwin Kempin364a86b2017-04-27 12:34:00 +02002242'POST /changes/link:#change-id[\{change-id\}]/private'
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002243--
2244
David Pursehouse540c8422017-05-10 16:41:59 +09002245Marks the change to be private. Changes may only be marked private by the
2246owner or site administrators.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002247
Edwin Kempin364a86b2017-04-27 12:34:00 +02002248A message can be specified in the request body inside a
2249link:#private-input[PrivateInput] entity.
2250
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002251.Request
2252----
Edwin Kempin364a86b2017-04-27 12:34:00 +02002253 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2254 Content-Type: application/json; charset=UTF-8
2255
2256 {
2257 "message": "After this security fix has been released we can make it public now."
2258 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002259----
2260
2261.Response
2262----
2263 HTTP/1.1 201 Created
2264----
2265
2266If the change was already private the response is "`200 OK`".
2267
2268[[unmark-private]]
2269=== Unmark Private
2270--
2271'DELETE /changes/link:#change-id[\{change-id\}]/private'
2272--
2273
2274Marks the change to be non-private. Note users can only unmark own private
2275changes.
2276
Edwin Kempin364a86b2017-04-27 12:34:00 +02002277A message can be specified in the request body inside a
2278link:#private-input[PrivateInput] entity.
2279
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002280.Request
2281----
2282 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
Edwin Kempin364a86b2017-04-27 12:34:00 +02002283 Content-Type: application/json; charset=UTF-8
2284
2285 {
2286 "message": "This is a security fix that must not be public."
2287 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002288----
2289
2290.Response
2291----
2292 HTTP/1.1 204 No Content
2293----
2294
2295If the change was already not private, the response is "`409 Conflict`".
2296
Edwin Kempin364a86b2017-04-27 12:34:00 +02002297Please note that some proxies prohibit request bodies for DELETE
2298requests. In this case, if you want to set a message options, use a
2299POST request:
2300
2301.Request
2302----
2303 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0
2304 Content-Type: application/json; charset=UTF-8
2305
2306 {
2307 "message": "This is a security fix that must not be public."
2308 }
2309----
2310
David Pursehoused656fa82017-04-28 06:51:26 +02002311[[ignore]]
2312=== Ignore
2313--
2314'PUT /changes/link:#change-id[\{change-id\}]/ignore'
2315--
2316
2317Marks a change as ignored. The change will not be shown in the incoming
2318reviews dashboard, and email notifications will be suppressed.
2319
2320.Request
2321----
2322 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ignore HTTP/1.0
2323----
2324
2325[[unignore]]
2326=== Unignore
2327--
2328'PUT /changes/link:#change-id[\{change-id\}]/unignore'
2329--
2330
2331Un-marks a change as ignored.
2332
2333.Request
2334----
2335 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unignore HTTP/1.0
2336----
2337
Edwin Kempinceb673e2017-10-01 12:29:05 +02002338[[mark-as-reviewed]]
2339=== Mark as Reviewed
2340--
2341'PUT /changes/link:#change-id[\{change-id\}]/reviewed'
2342--
2343
2344Marks a change as reviewed.
2345
2346This allows users to "de-highlight" changes in their dashboard until a new
2347patch set is uploaded.
2348
2349This differs from the link:#ignore[ignore] endpoint, which will mute
2350emails and hide the change from dashboard completely until it is
2351link:#unignore[unignored] again.
2352
2353
2354.Request
2355----
2356 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewed HTTP/1.0
2357----
2358
2359[[mark-as-unreviewed]]
2360=== Mark as Unreviewed
2361--
2362'PUT /changes/link:#change-id[\{change-id\}]/unreviewed'
2363--
2364
2365Marks a change as unreviewed.
2366
2367This allows users to "highlight" changes in their dashboard
2368
2369.Request
2370----
2371 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unreviewed HTTP/1.0
2372----
2373
David Pursehouse7c79b682017-08-25 13:18:32 +09002374[[get-hashtags]]
2375=== Get Hashtags
2376--
2377'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2378--
2379
2380Gets the hashtags associated with a change.
2381
2382[NOTE] Hashtags are only available when NoteDb is enabled.
2383
2384.Request
2385----
2386 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2387----
2388
2389As response the change's hashtags are returned as a list of strings.
2390
2391.Response
2392----
2393 HTTP/1.1 200 OK
2394 Content-Disposition: attachment
2395 Content-Type: application/json; charset=UTF-8
2396
2397 )]}'
2398 [
2399 "hashtag1",
2400 "hashtag2"
2401 ]
2402----
2403
2404[[set-hashtags]]
2405=== Set Hashtags
2406--
2407'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2408--
2409
2410Adds and/or removes hashtags from a change.
2411
2412[NOTE] Hashtags are only available when NoteDb is enabled.
2413
2414The hashtags to add or remove must be provided in the request body inside a
2415link:#hashtags-input[HashtagsInput] entity.
2416
2417.Request
2418----
2419 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2420 Content-Type: application/json; charset=UTF-8
2421
2422 {
2423 "add" : [
2424 "hashtag3"
2425 ],
2426 "remove" : [
2427 "hashtag2"
2428 ]
2429 }
2430----
2431
2432As response the change's hashtags are returned as a list of strings.
2433
2434.Response
2435----
2436 HTTP/1.1 200 OK
2437 Content-Disposition: attachment
2438 Content-Type: application/json; charset=UTF-8
2439
2440 )]}'
2441 [
2442 "hashtag1",
2443 "hashtag3"
2444 ]
2445----
2446
David Pursehousec32050d2017-08-25 16:27:47 +09002447
David Ostrovsky1a49f622014-07-29 00:40:02 +02002448[[edit-endpoints]]
2449== Change Edit Endpoints
2450
David Ostrovsky1a49f622014-07-29 00:40:02 +02002451[[get-edit-detail]]
2452=== Get Change Edit Details
2453--
2454'GET /changes/link:#change-id[\{change-id\}]/edit
2455--
2456
2457Retrieves a change edit details.
2458
2459.Request
2460----
2461 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2462----
2463
2464As response an link:#edit-info[EditInfo] entity is returned that
2465describes the change edit, or "`204 No Content`" when change edit doesn't
2466exist for this change. Change edits are stored on special branches and there
2467can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02002468When request parameter `list` is provided the response also includes the file
2469list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02002470against this base revision. When request parameter `download-commands` is
2471provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02002472
2473.Response
2474----
2475 HTTP/1.1 200 OK
2476 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002477 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02002478
2479 )]}'
2480 {
2481 "commit":{
2482 "parents":[
2483 {
2484 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
2485 }
2486 ],
2487 "author":{
2488 "name":"Shawn O. Pearce",
2489 "email":"sop@google.com",
2490 "date":"2012-04-24 18:08:08.000000000",
2491 "tz":-420
2492 },
2493 "committer":{
2494 "name":"Shawn O. Pearce",
2495 "email":"sop@google.com",
2496 "date":"2012-04-24 18:08:08.000000000",
2497 "tz":-420
2498 },
2499 "subject":"Use an EventBus to manage star icons",
2500 "message":"Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2501 },
Michael Zhoud03fe282016-04-25 17:13:17 -04002502 "base_revision":"c35558e0925e6985c91f3a16921537d5e572b7a3"
David Ostrovsky1a49f622014-07-29 00:40:02 +02002503 }
2504----
David Pursehouse4e38b972014-05-30 10:36:40 +09002505
David Ostrovskya5ab8292014-08-01 02:11:39 +02002506[[put-edit-file]]
2507=== Change file content in Change Edit
2508--
2509'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2510--
2511
2512Put content of a file to a change edit.
2513
2514.Request
2515----
2516 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2517----
2518
2519When change edit doesn't exist for this change yet it is created. When file
2520content isn't provided, it is wiped out for that file. As response
2521"`204 No Content`" is returned.
2522
2523.Response
2524----
2525 HTTP/1.1 204 No Content
2526----
2527
David Ostrovsky138edb42014-08-15 21:31:43 +02002528[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01002529=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02002530--
2531'POST /changes/link:#change-id[\{change-id\}]/edit
2532--
2533
David Ostrovskya00c9532015-01-21 00:17:49 +01002534Creates empty change edit, restores file content or renames files in change
2535edit. The request body needs to include a
2536link:#change-edit-input[ChangeEditInput] entity when a file within change
2537edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02002538
2539.Request
2540----
2541 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002542 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02002543
2544 {
David Ostrovskybd12e172014-08-21 23:08:15 +02002545 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02002546 }
2547----
2548
David Ostrovskya00c9532015-01-21 00:17:49 +01002549or for rename:
2550
2551.Request
2552----
2553 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2554 Content-Type: application/json; charset=UTF-8
2555
2556 {
2557 "old_path": "foo",
2558 "new_path": "bar"
2559 }
2560----
2561
David Ostrovsky138edb42014-08-15 21:31:43 +02002562When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01002563and restore flag are provided in request body, this file is restored. When
2564old and new file names are provided, the file is renamed. As response
2565"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02002566
2567.Response
2568----
2569 HTTP/1.1 204 No Content
2570----
2571
David Ostrovskyc967e152014-10-24 17:36:16 +02002572[[put-change-edit-message]]
2573=== Change commit message in Change Edit
2574--
2575'PUT /changes/link:#change-id[\{change-id\}]/edit:message
2576--
2577
2578Modify commit message. The request body needs to include a
2579link:#change-edit-message-input[ChangeEditMessageInput]
2580entity.
2581
2582.Request
2583----
2584 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002585 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02002586
2587 {
2588 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
2589 }
2590----
2591
2592If a change edit doesn't exist for this change yet, it is created. As
2593response "`204 No Content`" is returned.
2594
2595.Response
2596----
2597 HTTP/1.1 204 No Content
2598----
2599
David Ostrovsky2830c292014-08-01 02:24:31 +02002600[[delete-edit-file]]
2601=== Delete file in Change Edit
2602--
2603'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
2604--
2605
2606Deletes a file from a change edit. This deletes the file from the repository
2607completely. This is not the same as reverting or restoring a file to its
2608previous contents.
2609
2610.Request
2611----
2612 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2613----
2614
2615When change edit doesn't exist for this change yet it is created.
2616
2617.Response
2618----
2619 HTTP/1.1 204 No Content
2620----
2621
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002622[[get-edit-file]]
2623=== Retrieve file content from Change Edit
2624--
2625'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2626--
2627
2628Retrieves content of a file from a change edit.
2629
2630.Request
2631----
2632 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2633----
2634
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002635The content of the file is returned as text encoded inside base64.
2636The Content-Type header will always be `text/plain` reflecting the
2637outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
2638can be examined to find the server detected content type of the file.
2639
2640When the specified file was deleted in the change edit
2641"`204 No Content`" is returned.
2642
2643If only the content type is required, callers should use HEAD to
2644avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002645
Michael Zhou551ad0c2016-04-26 01:21:42 -04002646If the `base` parameter is set to true, the returned content is from the
2647revision that the edit is based on.
2648
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002649.Response
2650----
2651 HTTP/1.1 200 OK
2652 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002653 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002654 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002655 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002656
2657 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
2658----
2659
David Ostrovskyd0078672015-02-06 21:51:04 +01002660Alternatively, if the only value of the Accept request header is
2661`application/json` the content is returned as JSON string and
2662`X-FYI-Content-Encoding` is set to `json`.
2663
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002664[[get-edit-meta-data]]
2665=== Retrieve meta data of a file from Change Edit
2666--
2667'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
2668--
2669
2670Retrieves meta data of a file from a change edit. Currently only
2671web links are returned.
2672
2673.Request
2674----
2675 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
2676----
2677
2678This REST endpoint retrieves additional information for a file in a
2679change edit. As result an link:#edit-file-info[EditFileInfo] entity is
2680returned.
2681
2682.Response
2683----
2684 HTTP/1.1 200 OK
2685 Content-Disposition: attachment
2686 Content-Type: application/json; charset=UTF-8
2687
2688 )]}'
2689 {
2690 "web_links":[
2691 {
2692 "show_on_side_by_side_diff_view": true,
2693 "name": "side-by-side preview diff",
2694 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
2695 "url": "#/x/xdocs/c/42/1..0/README.md",
2696 "target": "_self"
2697 },
2698 {
2699 "show_on_unified_diff_view": true,
2700 "name": "unified preview diff",
2701 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
2702 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
2703 "target": "_self"
2704 }
2705 ]}
2706----
2707
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002708[[get-edit-message]]
2709=== Retrieve commit message from Change Edit or current patch set of the change
2710--
2711'GET /changes/link:#change-id[\{change-id\}]/edit:message
2712--
2713
David Ostrovsky25ad15e2014-12-15 21:18:59 +01002714Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002715
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02002716If the `base` parameter is set to true, the returned message is from the
2717revision that the edit is based on.
2718
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002719.Request
2720----
2721 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
2722----
2723
2724The commit message is returned as base64 encoded string.
2725
2726.Response
2727----
2728 HTTP/1.1 200 OK
2729
2730 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
2731M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
2732----
2733
David Ostrovskyd0078672015-02-06 21:51:04 +01002734Alternatively, if the only value of the Accept request header is
2735`application/json` the commit message is returned as JSON string:
2736
2737.Response
2738----
2739 HTTP/1.1 200 OK
2740
2741)]}'
2742"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
2743----
2744
2745
David Ostrovskye9988f92014-08-01 09:56:34 +02002746[[publish-edit]]
2747=== Publish Change Edit
2748--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002749'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02002750--
2751
2752Promotes change edit to a regular patch set.
2753
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002754Options can be provided in the request body as a
2755link:#publish-change-edit-input[PublishChangeEditInput] entity.
2756
David Ostrovskye9988f92014-08-01 09:56:34 +02002757.Request
2758----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002759 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002760 Content-Type: application/json; charset=UTF-8
2761
2762 {
2763 "notify": "NONE"
2764 }
David Ostrovskye9988f92014-08-01 09:56:34 +02002765----
2766
2767As response "`204 No Content`" is returned.
2768
2769.Response
2770----
2771 HTTP/1.1 204 No Content
2772----
2773
David Ostrovsky46999d22014-08-16 02:19:13 +02002774[[rebase-edit]]
2775=== Rebase Change Edit
2776--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002777'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02002778--
2779
2780Rebases change edit on top of latest patch set.
2781
2782.Request
2783----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002784 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02002785----
2786
2787When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09002788"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02002789based on top of the latest patch set, the response
2790"`409 Conflict`" is returned.
2791
2792.Response
2793----
2794 HTTP/1.1 204 No Content
2795----
2796
David Ostrovsky8e75f502014-08-10 00:36:31 +02002797[[delete-edit]]
2798=== Delete Change Edit
2799--
2800'DELETE /changes/link:#change-id[\{change-id\}]/edit'
2801--
2802
2803Deletes change edit.
2804
2805.Request
2806----
2807 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2808----
2809
2810As response "`204 No Content`" is returned.
2811
2812.Response
2813----
2814 HTTP/1.1 204 No Content
2815----
2816
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01002817
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002818[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002819== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002820
2821[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002822=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002823--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002824'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002825--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002826
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002827Lists the reviewers of a change.
2828
2829As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
2830
2831.Request
2832----
2833 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
2834----
2835
2836.Response
2837----
2838 HTTP/1.1 200 OK
2839 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002840 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002841
2842 )]}'
2843 [
2844 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002845 "approvals": {
2846 "Verified": "+1",
2847 "Code-Review": "+2"
2848 },
2849 "_account_id": 1000096,
2850 "name": "John Doe",
2851 "email": "john.doe@example.com"
2852 },
2853 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002854 "approvals": {
2855 "Verified": " 0",
2856 "Code-Review": "-1"
2857 },
2858 "_account_id": 1000097,
2859 "name": "Jane Roe",
2860 "email": "jane.roe@example.com"
2861 }
2862 ]
2863----
2864
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002865[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002866=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002867--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002868'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002869--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002870
2871Suggest the reviewers for a given query `q` and result limit `n`. If result
2872limit is not passed, then the default 10 is used.
2873
Patrick Hieselc79ae0e2017-06-28 14:50:53 +02002874Groups can be excluded from the results by specifying 'e=f'.
2875
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002876As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
2877
2878.Request
2879----
2880 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
2881----
2882
2883.Response
2884----
2885 HTTP/1.1 200 OK
2886 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002887 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002888
2889 )]}'
2890 [
2891 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002892 "account": {
2893 "_account_id": 1000097,
2894 "name": "Jane Roe",
2895 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002896 },
2897 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002898 },
2899 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002900 "group": {
2901 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
2902 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002903 },
2904 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002905 }
2906 ]
2907----
2908
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002909[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002910=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002911--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002912'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 -08002913--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002914
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002915Retrieves a reviewer of a change.
2916
2917As response a link:#reviewer-info[ReviewerInfo] entity is returned that
2918describes the reviewer.
2919
2920.Request
2921----
2922 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
2923----
2924
2925.Response
2926----
2927 HTTP/1.1 200 OK
2928 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002929 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002930
2931 )]}'
2932 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002933 "approvals": {
2934 "Verified": "+1",
2935 "Code-Review": "+2"
2936 },
2937 "_account_id": 1000096,
2938 "name": "John Doe",
2939 "email": "john.doe@example.com"
2940 }
2941----
2942
Edwin Kempin392328e2013-02-25 12:50:03 +01002943[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002944=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002945--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002946'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002947--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002948
Edwin Kempin392328e2013-02-25 12:50:03 +01002949Adds one user or all members of one group as reviewer to the change.
2950
2951The reviewer to be added to the change must be provided in the request
2952body as a link:#reviewer-input[ReviewerInput] entity.
2953
2954.Request
2955----
2956 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002957 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002958
2959 {
2960 "reviewer": "john.doe@example.com"
2961 }
2962----
2963
2964As response an link:#add-reviewer-result[AddReviewerResult] entity is
2965returned that describes the newly added reviewers.
2966
2967.Response
2968----
2969 HTTP/1.1 200 OK
2970 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002971 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002972
2973 )]}'
2974 {
Aaron Gable8c650212017-04-25 12:03:37 -07002975 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01002976 "reviewers": [
2977 {
Aaron Gable8c650212017-04-25 12:03:37 -07002978 "_account_id": 1000096,
2979 "name": "John Doe",
2980 "email": "john.doe@example.com"
Edwin Kempin392328e2013-02-25 12:50:03 +01002981 "approvals": {
2982 "Verified": " 0",
2983 "Code-Review": " 0"
2984 },
Edwin Kempin392328e2013-02-25 12:50:03 +01002985 }
2986 ]
2987 }
2988----
2989
2990If a group is specified, adding the group members as reviewers is an
2991atomic operation. This means if an error is returned, none of the
2992members are added as reviewer.
2993
2994If a group with many members is added as reviewer a confirmation may be
2995required.
2996
2997.Request
2998----
2999 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003000 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003001
3002 {
3003 "reviewer": "MyProjectVerifiers"
3004 }
3005----
3006
3007.Response
3008----
3009 HTTP/1.1 200 OK
3010 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003011 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003012
3013 )]}'
3014 {
Logan Hanks23e70282016-07-06 14:31:56 -07003015 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01003016 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3017 "confirm": true
3018 }
3019----
3020
3021To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01003022`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01003023
3024.Request
3025----
3026 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003027 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003028
3029 {
Logan Hanks23e70282016-07-06 14:31:56 -07003030 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01003031 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01003032 }
3033----
3034
Patrick Hiesel11873ef2017-03-17 17:36:05 +01003035If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
3036for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
3037an email address of a reviewer or CC then, they will be added to the change even if they
3038don't have a Gerrit account.
3039
3040If this option is disabled, the request would fail with `400 Bad Request` if the email
3041address can't be resolved to an active Gerrit account.
3042
3043Note that the name is optional so both "un.registered@reviewer.com" and
3044"John Doe <un.registered@reviewer.com>" are valid inputs.
3045
3046Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
3047
3048.Request
3049----
3050 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
3051 Content-Type: application/json; charset=UTF-8
3052
3053 {
3054 "reviewer": "John Doe <un.registered@reviewer.com>"
3055 }
3056----
3057
3058.Response
3059----
3060 HTTP/1.1 200 OK
3061 Content-Disposition: attachment
3062 Content-Type: application/json; charset=UTF-8
3063
3064 )]}'
3065 {
3066 "input": "John Doe <un.registered@reviewer.com>"
3067 }
3068----
3069
Logan Hanksf03040e2017-05-03 09:40:56 -07003070.Notifications
3071
3072An email will be sent using the "newchange" template.
3073
3074[options="header",cols="1,1,1"]
3075|=============================
3076|WIP State |Default|notify=ALL
3077|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3078|Work in progress|not sent|owner, reviewers, CCs
3079|=============================
3080
Edwin Kempin53301072013-02-25 12:57:07 +01003081[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003082=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003083--
Edwin Kempin407fca32016-08-29 12:01:00 +02003084'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
3085'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 -08003086--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003087
Edwin Kempin53301072013-02-25 12:57:07 +01003088Deletes a reviewer from a change.
3089
Edwin Kempin407fca32016-08-29 12:01:00 +02003090Options can be provided in the request body as a
3091link:#delete-reviewer-input[DeleteReviewerInput] entity.
3092
Edwin Kempin53301072013-02-25 12:57:07 +01003093.Request
3094----
3095 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02003096 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3097----
3098
3099Please note that some proxies prohibit request bodies for DELETE
3100requests. In this case, if you want to specify options, use a POST
3101request:
3102
3103.Request
3104----
3105 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3106 Content-Type: application/json; charset=UTF-8
3107
3108 {
3109 "notify": "NONE"
3110 }
Edwin Kempin53301072013-02-25 12:57:07 +01003111----
3112
3113.Response
3114----
3115 HTTP/1.1 204 No Content
3116----
3117
Logan Hanks87607412017-05-30 13:49:04 -07003118.Notifications
3119
3120An email will be sent using the "deleteReviewer" template. If deleting the
3121reviewer resulted in one or more approvals being removed, then the deleted
3122reviewer will also receive a notification (unless notify=NONE).
3123
3124[options="header",cols="1,5"]
3125|=============================
3126|WIP State |Default Recipients
3127|Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers
3128|Work in progress|notify=NONE: deleted reviewer (if voted)
3129|=============================
3130
David Ostrovskybeb0b842014-12-13 00:24:29 +01003131[[list-votes]]
3132=== List Votes
3133--
3134'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
3135--
3136
3137Lists the votes for a specific reviewer of the change.
3138
3139.Request
3140----
Edwin Kempin314f10a2016-07-11 11:39:05 +02003141 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01003142----
3143
3144As result a map is returned that maps the label name to the label value.
3145The entries in the map are sorted by label name.
3146
3147.Response
3148----
3149 HTTP/1.1 200 OK
3150 Content-Disposition: attachment
3151 Content-Type: application/json;charset=UTF-8
3152
3153 )]}'
3154 {
3155 "Code-Review": -1,
3156 "Verified": 1
3157 "Work-In-Progress": 1,
3158 }
3159----
3160
3161[[delete-vote]]
3162=== Delete Vote
3163--
Edwin Kempin5488dc12016-08-29 11:13:31 +02003164'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 +02003165'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 +01003166--
3167
3168Deletes a single vote from a change. Note, that even when the last vote of
3169a reviewer is removed the reviewer itself is still listed on the change.
3170
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003171Options can be provided in the request body as a
3172link:#delete-vote-input[DeleteVoteInput] entity.
3173
David Ostrovskybeb0b842014-12-13 00:24:29 +01003174.Request
3175----
3176 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003177 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3178----
3179
3180Please note that some proxies prohibit request bodies for DELETE
3181requests. In this case, if you want to specify options, use a POST
3182request:
3183
3184.Request
3185----
3186 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3187 Content-Type: application/json; charset=UTF-8
3188
3189 {
3190 "notify": "NONE"
3191 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01003192----
3193
3194.Response
3195----
3196 HTTP/1.1 204 No Content
3197----
3198
Logan Hanksa1e68dc2017-06-29 15:13:27 -07003199
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003200[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003201== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003202
Shawn Pearce728ba882013-07-08 23:13:08 -07003203[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003204=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003205--
Shawn Pearce728ba882013-07-08 23:13:08 -07003206'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003207--
Shawn Pearce728ba882013-07-08 23:13:08 -07003208
3209Retrieves a parsed commit of a revision.
3210
3211.Request
3212----
3213 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
3214----
3215
3216As response a link:#commit-info[CommitInfo] entity is returned that
3217describes the revision.
3218
3219.Response
3220----
3221 HTTP/1.1 200 OK
3222 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003223 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07003224
3225 )]}'
3226 {
Edwin Kempinc8237402015-07-15 18:27:55 +02003227 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07003228 "parents": [
3229 {
3230 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3231 "subject": "Migrate contributor agreements to All-Projects."
3232 }
3233 ],
3234 "author": {
3235 "name": "Shawn O. Pearce",
3236 "email": "sop@google.com",
3237 "date": "2012-04-24 18:08:08.000000000",
3238 "tz": -420
3239 },
3240 "committer": {
3241 "name": "Shawn O. Pearce",
3242 "email": "sop@google.com",
3243 "date": "2012-04-24 18:08:08.000000000",
3244 "tz": -420
3245 },
3246 "subject": "Use an EventBus to manage star icons",
3247 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3248 }
3249----
3250
Sven Selbergd26bd542014-11-21 16:28:10 +01003251Adding query parameter `links` (for example `/changes/.../commit?links`)
3252returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07003253
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08003254[[get-description]]
3255=== Get Description
3256--
3257'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3258--
3259
3260Retrieves the description of a patch set.
3261
3262.Request
3263----
3264 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3265----
3266
3267.Response
3268----
3269 HTTP/1.1 200 OK
3270 Content-Disposition: attachment
3271 Content-Type: application/json; charset=UTF-8
3272
3273 )]}'
3274 "Added Documentation"
3275----
3276
3277If the patch set does not have a description an empty string is returned.
3278
3279[[set-description]]
3280=== Set Description
3281--
3282'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3283--
3284
3285Sets the description of a patch set.
3286
3287The new description must be provided in the request body inside a
3288link:#description-input[DescriptionInput] entity.
3289
3290.Request
3291----
3292 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3293 Content-Type: application/json; charset=UTF-8
3294
3295 {
3296 "description": "Added Documentation"
3297 }
3298----
3299
3300As response the new description is returned.
3301
3302.Response
3303----
3304 HTTP/1.1 200 OK
3305 Content-Disposition: attachment
3306 Content-Type: application/json; charset=UTF-8
3307
3308 )]}'
3309 "Added Documentation"
3310----
3311
Edwin Kempin0f229442016-09-09 13:06:12 +02003312[[get-merge-list]]
3313=== Get Merge List
3314--
3315'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
3316--
3317
3318Returns the list of commits that are being integrated into a target
3319branch by a merge commit. By default the first parent is assumed to be
3320uninteresting. By using the `parent` option another parent can be set
3321as uninteresting (parents are 1-based).
3322
3323The list of commits is returned as a list of
3324link:#commit-info[CommitInfo] entities. Web links are only included if
3325the `links` option was set.
3326
3327.Request
3328----
3329 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
3330----
3331
3332.Response
3333----
3334HTTP/1.1 200 OK
3335 Content-Disposition: attachment
3336 Content-Type: application/json; charset=UTF-8
3337
3338 )]}'
3339 [
3340 {
3341 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
3342 "parents": [
3343 {
3344 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3345 "subject": "Migrate contributor agreements to All-Projects."
3346 }
3347 ],
3348 "author": {
3349 "name": "Shawn O. Pearce",
3350 "email": "sop@google.com",
3351 "date": "2012-04-24 18:08:08.000000000",
3352 "tz": -420
3353 },
3354 "committer": {
3355 "name": "Shawn O. Pearce",
3356 "email": "sop@google.com",
3357 "date": "2012-04-24 18:08:08.000000000",
3358 "tz": -420
3359 },
3360 "subject": "Use an EventBus to manage star icons",
3361 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3362 }
3363 ]
3364----
3365
Stefan Bellerc7259662015-02-12 17:23:05 -08003366[[get-revision-actions]]
3367=== Get Revision Actions
3368--
3369'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
3370--
3371
3372Retrieves revision link:#action-info[actions] of the revision of a change.
3373
3374.Request
3375----
3376 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
3377----
3378
3379.Response
3380----
3381 HTTP/1.1 200 OK
3382 Content-Disposition: attachment
3383 Content-Type: application/json; charset=UTF-8
3384
3385 )]}'
3386
3387{
3388 "submit": {
3389 "method": "POST",
3390 "label": "Submit",
3391 "title": "Submit patch set 1 into master",
3392 "enabled": true
3393 },
3394 "cherrypick": {
3395 "method": "POST",
3396 "label": "Cherry Pick",
3397 "title": "Cherry pick change to a different branch",
3398 "enabled": true
3399 }
3400}
3401----
3402
3403The response is a flat map of possible revision actions mapped to their
3404link:#action-info[ActionInfo].
3405
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003406[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003407=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003408--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003409'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003410--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003411
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003412Retrieves a review of a revision.
3413
3414.Request
3415----
3416 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3417----
3418
3419As response a link:#change-info[ChangeInfo] entity with
3420link:#detailed-labels[detailed labels] and link:#detailed-accounts[
3421detailed accounts] is returned that describes the review of the
3422revision. The revision for which the review is retrieved is contained
3423in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05003424set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003425revision of the change. Please note that the returned labels are always
3426for the current patch set.
3427
3428.Response
3429----
3430 HTTP/1.1 200 OK
3431 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003432 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003433
3434 )]}'
3435 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003436 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
3437 "project": "myProject",
3438 "branch": "master",
3439 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
3440 "subject": "Implementing Feature X",
3441 "status": "NEW",
3442 "created": "2013-02-01 09:59:32.126000000",
3443 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003444 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003445 "insertions": 34,
3446 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003447 "_number": 3965,
3448 "owner": {
3449 "_account_id": 1000096,
3450 "name": "John Doe",
3451 "email": "john.doe@example.com"
3452 },
3453 "labels": {
3454 "Verified": {
3455 "all": [
3456 {
3457 "value": 0,
3458 "_account_id": 1000096,
3459 "name": "John Doe",
3460 "email": "john.doe@example.com"
3461 },
3462 {
3463 "value": 0,
3464 "_account_id": 1000097,
3465 "name": "Jane Roe",
3466 "email": "jane.roe@example.com"
3467 }
3468 ],
3469 "values": {
3470 "-1": "Fails",
3471 " 0": "No score",
3472 "+1": "Verified"
3473 }
3474 },
3475 "Code-Review": {
3476 "all": [
3477 {
3478 "value": -1,
3479 "_account_id": 1000096,
3480 "name": "John Doe",
3481 "email": "john.doe@example.com"
3482 },
3483 {
3484 "value": 1,
3485 "_account_id": 1000097,
3486 "name": "Jane Roe",
3487 "email": "jane.roe@example.com"
3488 }
3489 ]
3490 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04003491 "-2": "This shall not be merged",
3492 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003493 " 0": "No score",
3494 "+1": "Looks good to me, but someone else must approve",
3495 "+2": "Looks good to me, approved"
3496 }
3497 }
3498 },
3499 "permitted_labels": {
3500 "Verified": [
3501 "-1",
3502 " 0",
3503 "+1"
3504 ],
3505 "Code-Review": [
3506 "-2",
3507 "-1",
3508 " 0",
3509 "+1",
3510 "+2"
3511 ]
3512 },
3513 "removable_reviewers": [
3514 {
3515 "_account_id": 1000096,
3516 "name": "John Doe",
3517 "email": "john.doe@example.com"
3518 },
3519 {
3520 "_account_id": 1000097,
3521 "name": "Jane Roe",
3522 "email": "jane.roe@example.com"
3523 }
3524 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08003525 "reviewers": {
3526 "REVIEWER": [
3527 {
3528 "_account_id": 1000096,
3529 "name": "John Doe",
3530 "email": "john.doe@example.com"
3531 },
3532 {
3533 "_account_id": 1000097,
3534 "name": "Jane Roe",
3535 "email": "jane.roe@example.com"
3536 }
3537 ]
3538 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003539 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
3540 "revisions": {
3541 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09003542 "kind": "REWORK",
3543 "_number": 2,
3544 "ref": "refs/changes/65/3965/2",
3545 "fetch": {
3546 "http": {
3547 "url": "http://gerrit/myProject",
3548 "ref": "refs/changes/65/3965/2"
3549 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003550 }
3551 }
3552 }
3553 }
3554----
3555
David Pursehouse669f2512014-07-18 11:41:42 +09003556[[get-related-changes]]
3557=== Get Related Changes
3558--
3559'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
3560--
3561
3562Retrieves related changes of a revision. Related changes are changes that either
3563depend on, or are dependencies of the revision.
3564
3565.Request
3566----
3567 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
3568----
3569
3570As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
3571describing the related changes.
3572
3573.Response
3574----
3575 HTTP/1.1 200 OK
3576 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003577 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09003578
3579 )]}'
3580 {
3581 "changes": [
3582 {
Patrick Hieselcab63512017-07-28 10:25:42 +02003583 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09003584 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
3585 "commit": {
3586 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
3587 "parents": [
3588 {
3589 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
3590 }
3591 ],
3592 "author": {
3593 "name": "David Ostrovsky",
3594 "email": "david@ostrovsky.org",
3595 "date": "2014-07-12 15:04:24.000000000",
3596 "tz": 120
3597 },
3598 "subject": "Remove Solr"
3599 },
3600 "_change_number": 58478,
3601 "_revision_number": 2,
3602 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003603 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003604 },
3605 {
Patrick Hieselcab63512017-07-28 10:25:42 +02003606 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09003607 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
3608 "commit": {
3609 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
3610 "parents": [
3611 {
3612 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
3613 }
3614 ],
3615 "author": {
3616 "name": "David Pursehouse",
3617 "email": "david.pursehouse@sonymobile.com",
3618 "date": "2014-06-24 02:01:28.000000000",
3619 "tz": 540
3620 },
3621 "subject": "Add support for secondary index with Elasticsearch"
3622 },
3623 "_change_number": 58081,
3624 "_revision_number": 10,
3625 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003626 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003627 }
3628 ]
3629 }
3630----
3631
3632
Edwin Kempin67498de2013-02-25 16:15:34 +01003633[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003634=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003635--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003636'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003637--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003638
Logan Hanksf03040e2017-05-03 09:40:56 -07003639Sets a review on a revision, optionally also publishing draft comments, setting
Logan Hanks53c36012017-06-30 13:47:54 -07003640labels, adding reviewers or CCs, and modifying the work in progress property.
Edwin Kempin67498de2013-02-25 16:15:34 +01003641
3642The review must be provided in the request body as a
3643link:#review-input[ReviewInput] entity.
3644
Aaron Gable8c650212017-04-25 12:03:37 -07003645A review cannot be set on a change edit. Trying to post a review for a
3646change edit fails with `409 Conflict`.
3647
Logan Hanksf03040e2017-05-03 09:40:56 -07003648Here is an example of using this method to set labels:
Aaron Gable8c650212017-04-25 12:03:37 -07003649
Edwin Kempin67498de2013-02-25 16:15:34 +01003650.Request
3651----
3652 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003653 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003654
3655 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01003656 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01003657 "message": "Some nits need to be fixed.",
3658 "labels": {
3659 "Code-Review": -1
3660 },
3661 "comments": {
3662 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3663 {
3664 "line": 23,
3665 "message": "[nit] trailing whitespace"
3666 },
3667 {
3668 "line": 49,
3669 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09003670 },
3671 {
3672 "range": {
3673 "start_line": 50,
3674 "start_character": 0,
3675 "end_line": 55,
3676 "end_character": 20
3677 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09003678 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01003679 }
3680 ]
3681 }
3682 }
3683----
3684
Aaron Gable843b0c12017-04-21 08:25:27 -07003685As response a link:#review-result[ReviewResult] entity is returned that
Aaron Gable8c650212017-04-25 12:03:37 -07003686describes the applied labels and any added reviewers (e.g. yourself,
3687if you set a label but weren't previously a reviewer on this CL).
Edwin Kempin67498de2013-02-25 16:15:34 +01003688
3689.Response
3690----
3691 HTTP/1.1 200 OK
3692 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003693 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003694
3695 )]}'
3696 {
3697 "labels": {
3698 "Code-Review": -1
3699 }
3700 }
3701----
3702
Aaron Gable8c650212017-04-25 12:03:37 -07003703It is also possible to add one or more reviewers or CCs
Logan Hanksf03040e2017-05-03 09:40:56 -07003704to a change simultaneously with a review:
Logan Hanks5f1c7592016-07-06 14:39:33 -07003705
3706.Request
3707----
3708 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3709 Content-Type: application/json; charset=UTF-8
3710
3711 {
Aaron Gable8c650212017-04-25 12:03:37 -07003712 "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 -07003713 "reviewers": [
3714 {
3715 "reviewer": "jane.roe@example.com"
3716 },
3717 {
Aaron Gable8c650212017-04-25 12:03:37 -07003718 "reviewer": "john.doe@example.com",
3719 "state": "CC"
3720 }
3721 {
3722 "reviewer": "MyProjectVerifiers",
Logan Hanks5f1c7592016-07-06 14:39:33 -07003723 }
3724 ]
3725 }
3726----
3727
3728Each element of the `reviewers` list is an instance of
3729link:#reviewer-input[ReviewerInput]. The corresponding result of
Aaron Gable8c650212017-04-25 12:03:37 -07003730adding each reviewer will be returned in a map of inputs to
3731link:#add-reviewer-result[AddReviewerResult]s.
Logan Hanks5f1c7592016-07-06 14:39:33 -07003732
3733.Response
3734----
3735 HTTP/1.1 200 OK
3736 Content-Disposition: attachment
3737 Content-Type: application/json; charset=UTF-8
3738
3739 )]}'
3740 {
Aaron Gable8c650212017-04-25 12:03:37 -07003741 "reviewers": {
3742 "jane.roe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07003743 "input": "jane.roe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07003744 "reviewers": [
3745 {
3746 "_account_id": 1000097,
3747 "name": "Jane Roe",
3748 "email": "jane.roe@example.com"
3749 "approvals": {
3750 "Verified": " 0",
3751 "Code-Review": " 0"
3752 },
3753 },
3754 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07003755 },
Aaron Gable8c650212017-04-25 12:03:37 -07003756 "john.doe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07003757 "input": "john.doe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07003758 "ccs": [
3759 {
3760 "_account_id": 1000096,
3761 "name": "John Doe",
3762 "email": "john.doe@example.com"
3763 "approvals": {
3764 "Verified": " 0",
3765 "Code-Review": " 0"
3766 },
3767 }
3768 ]
3769 },
3770 "MyProjectVerifiers": {
3771 "input": "MyProjectVerifiers",
3772 "reviewers": [
3773 {
3774 "_account_id": 1000098,
3775 "name": "Alice Ansel",
3776 "email": "alice.ansel@example.com"
3777 "approvals": {
3778 "Verified": " 0",
3779 "Code-Review": " 0"
3780 },
3781 },
3782 {
3783 "_account_id": 1000099,
3784 "name": "Bob Bollard",
3785 "email": "bob.bollard@example.com"
3786 "approvals": {
3787 "Verified": " 0",
3788 "Code-Review": " 0"
3789 },
3790 },
3791 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07003792 }
Aaron Gable8c650212017-04-25 12:03:37 -07003793 }
Logan Hanks5f1c7592016-07-06 14:39:33 -07003794 }
3795----
3796
Logan Hankse2aacef2016-07-22 15:54:52 -07003797If there are any errors returned for reviewers, the entire review request will
Aaron Gable8c650212017-04-25 12:03:37 -07003798be rejected with `400 Bad Request`. None of the entries will have the
3799`reviewers` or `ccs` field set, and those which specifically failed will have
3800the `errors` field set containing details of why they failed.
Logan Hankse2aacef2016-07-22 15:54:52 -07003801
3802.Error Response
3803----
3804 HTTP/1.1 400 Bad Request
3805 Content-Disposition: attachment
3806 Content-Type: application/json; charset=UTF-8
3807
3808 )]}'
3809 {
3810 "reviewers": {
Aaron Gable8c650212017-04-25 12:03:37 -07003811 "jane.roe@example.com": {
3812 "input": "jane.roe@example.com",
3813 "error": "Account of jane.roe@example.com is inactive."
3814 },
3815 "john.doe@example.com": {
3816 "input": "john.doe@example.com"
3817 },
Logan Hankse2aacef2016-07-22 15:54:52 -07003818 "MyProjectVerifiers": {
3819 "input": "MyProjectVerifiers",
3820 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3821 "confirm": true
3822 }
3823 }
3824 }
3825----
3826
Dave Borowitzd2e41452017-10-26 08:06:23 -04003827[[set-review-notifications]]
Logan Hanksfc055962017-06-12 14:20:53 -07003828.Notifications
3829
3830An email will be sent using the "comment" template.
3831
3832If the top-level notify property is null or not set, then notification behavior
3833depends on whether the change is WIP, whether it has started review, and whether
3834the tag property is null.
3835
3836NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*.
3837Use the notify property of the top-level link:#review-input[ReviewInput] instead.
3838
3839For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS
3840watchers*.
3841
Logan Hanksea3e3b72017-06-12 14:21:47 -07003842[options="header",cols="2,1,1,2,2"]
Logan Hanksfc055962017-06-12 14:20:53 -07003843|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07003844|WIP State |Review Started|Tag Given|Default |notify=ALL
3845|Ready for review|N/A |N/A |everyone|everyone
3846|Work in progress|no |no |not sent|everyone
3847|Work in progress|no |yes |owner |everyone
3848|Work in progress|yes |no |everyone|everyone
3849|Work in progress|yes |yes |owner |everyone
3850
Logan Hanksfc055962017-06-12 14:20:53 -07003851|=============================
3852
3853If reviewers are added, then a second email will be sent using the "newchange"
3854template. The notification logic for this email is the same as for
3855link:#add-reviewer[Add Reviewer].
3856
Logan Hanksea3e3b72017-06-12 14:21:47 -07003857[options="header",cols="1,1,1"]
Logan Hanksfc055962017-06-12 14:20:53 -07003858|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07003859|WIP State |Default |notify=ALL
3860|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3861|Work in progress|not sent |owner, reviewers, CCs
Logan Hanksfc055962017-06-12 14:20:53 -07003862|=============================
3863
3864
Edwin Kempincdae63b2013-03-15 15:06:59 +01003865[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003866=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003867--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003868'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003869--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003870
3871Rebases a revision.
3872
Zalan Blenessy874aed72015-01-12 13:26:18 +01003873Optionally, the parent revision can be changed to another patch set through the
3874link:#rebase-input[RebaseInput] entity.
3875
Edwin Kempincdae63b2013-03-15 15:06:59 +01003876.Request
3877----
3878 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01003879 Content-Type: application/json;charset=UTF-8
3880
3881 {
3882 "base" : "1234",
3883 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01003884----
3885
3886As response a link:#change-info[ChangeInfo] entity is returned that
3887describes the rebased change. Information about the current patch set
3888is included.
3889
3890.Response
3891----
3892 HTTP/1.1 200 OK
3893 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003894 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003895
3896 )]}'
3897 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01003898 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3899 "project": "myProject",
3900 "branch": "master",
3901 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3902 "subject": "Implement Feature X",
3903 "status": "NEW",
3904 "created": "2013-02-01 09:59:32.126000000",
3905 "updated": "2013-02-21 11:16:36.775000000",
3906 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003907 "insertions": 21,
3908 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01003909 "_number": 4799,
3910 "owner": {
3911 "name": "John Doe"
3912 },
3913 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
3914 "revisions": {
3915 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09003916 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003917 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01003918 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003919 "fetch": {
3920 "http": {
3921 "url": "http://gerrit:8080/myProject",
3922 "ref": "refs/changes/99/4799/2"
3923 }
3924 },
3925 "commit": {
3926 "parents": [
3927 {
3928 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
3929 "subject": "Implement Feature A"
3930 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00003931 ],
3932 "author": {
3933 "name": "John Doe",
3934 "email": "john.doe@example.com",
3935 "date": "2013-05-07 15:21:27.000000000",
3936 "tz": 120
3937 },
3938 "committer": {
3939 "name": "Gerrit Code Review",
3940 "email": "gerrit-server@example.com",
3941 "date": "2013-05-07 15:35:43.000000000",
3942 "tz": 120
3943 },
3944 "subject": "Implement Feature X",
3945 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01003946 }
3947 }
3948 }
3949----
3950
3951If the revision cannot be rebased, e.g. due to conflicts, the response is
3952"`409 Conflict`" and the error message is contained in the response
3953body.
3954
3955.Response
3956----
3957 HTTP/1.1 409 Conflict
3958 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003959 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003960
3961 The change could not be rebased due to a path conflict during merge.
3962----
3963
Edwin Kempin14b58112013-02-26 16:30:19 +01003964[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003965=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003966--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003967'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003968--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003969
Edwin Kempin14b58112013-02-26 16:30:19 +01003970Submits a revision.
3971
Edwin Kempin14b58112013-02-26 16:30:19 +01003972.Request
3973----
3974 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003975 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003976----
3977
3978As response a link:#submit-info[SubmitInfo] entity is returned that
3979describes the status of the submitted change.
3980
3981.Response
3982----
3983 HTTP/1.1 200 OK
3984 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003985 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003986
3987 )]}'
3988 {
3989 "status": "MERGED"
3990 }
3991----
3992
3993If the revision cannot be submitted, e.g. because the submit rule
3994doesn't allow submitting the revision or the revision is not the
3995current revision, the response is "`409 Conflict`" and the error
3996message is contained in the response body.
3997
3998.Response
3999----
4000 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004001 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004002
4003 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
4004----
4005
Edwin Kempin257d70f2013-03-28 14:31:14 +01004006[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004007=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004008--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004009'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004010--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004011
4012Gets the formatted patch for one revision.
4013
4014.Request
4015----
4016 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
4017----
4018
Shawn Pearce98361f72013-05-10 16:27:36 -07004019The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01004020
4021.Response
4022----
4023 HTTP/1.1 200 OK
4024 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004025 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07004026 X-FYI-Content-Encoding: base64
4027 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01004028
Shawn Pearce98361f72013-05-10 16:27:36 -07004029 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01004030----
4031
David Ostrovsky973f38b2013-08-22 00:24:51 -07004032Adding query parameter `zip` (for example `/changes/.../patch?zip`)
4033returns the patch as a single file inside of a ZIP archive. Clients
4034can expand the ZIP to obtain the plain text patch, avoiding the
4035need for a base64 decoding step. This option implies `download`.
4036
4037Query parameter `download` (e.g. `/changes/.../patch?download`)
4038will suggest the browser save the patch as `commitsha1.diff.base64`,
4039for later processing by command line tools.
4040
Kasper Nilsson81448072016-10-17 15:04:33 -07004041If the `path` parameter is set, the returned content is a diff of the single
4042file that the path refers to.
4043
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004044[[submit-preview]]
Edwin Kempin807eb4b2016-10-18 15:49:41 +02004045=== Submit Preview
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004046--
4047'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit'
4048--
4049Gets a file containing thin bundles of all modified projects if this
4050change was submitted. The bundles are named `${ProjectName}.git`.
4051Each thin bundle contains enough to construct the state in which a project would
4052be in if this change were submitted. The base of the thin bundles are the
4053current target branches, so to make use of this call in a non-racy way, first
4054get the bundles and then fetch all projects contained in the bundle.
4055(This assumes no non-fastforward pushes).
4056
4057You need to give a parameter '?format=zip' or '?format=tar' to specify the
Stefan Beller3e586742016-10-05 15:23:22 -07004058format for the outer container. It is always possible to use tgz, even if
4059tgz is not in the list of allowed archive formats.
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004060
4061To make good use of this call, you would roughly need code as found at:
4062----
4063 $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh
4064----
4065.Request
4066----
4067 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0
4068----
4069
4070.Response
4071----
4072 HTTP/1.1 200 OK
4073 Date: Tue, 13 Sep 2016 19:13:46 GMT
4074 Content-Disposition: attachment; filename="submit-preview-147.zip"
4075 X-Content-Type-Options: nosniff
4076 Cache-Control: no-cache, no-store, max-age=0, must-revalidate
4077 Pragma: no-cache
4078 Expires: Mon, 01 Jan 1990 00:00:00 GMT
4079 Content-Type: application/x-zip
4080 Transfer-Encoding: chunked
4081
4082 [binary stuff]
4083----
4084
4085In case of an error, the response is not a zip file but a regular json response,
4086containing only the error message:
4087
4088.Response
4089----
4090 HTTP/1.1 200 OK
4091 Content-Disposition: attachment
4092 Content-Type: application/json; charset=UTF-8
4093
4094 )]}'
4095 "Anonymous users cannot submit"
4096----
4097
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004098[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004099=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004100--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004101'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004102--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004103
4104Gets the method the server will use to submit (merge) the change and
4105an indicator if the change is currently mergeable.
4106
4107.Request
4108----
4109 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
4110----
4111
Saša Živkov499873f2014-05-05 13:34:18 +02004112As response a link:#mergeable-info[MergeableInfo] entity is returned.
4113
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004114.Response
4115----
4116 HTTP/1.1 200 OK
4117 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004118 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004119
4120 )]}'
4121 {
4122 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004123 strategy: "recursive",
4124 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004125 }
4126----
4127
Saša Živkov697cab22014-04-29 16:46:50 +02004128If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08004129checked for all other branches which are listed in the
4130link:config-project-config.html#branchOrder-section[branchOrder] section in the
4131project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02004132
4133.Request
4134----
4135 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
4136----
4137
4138The response will then contain a list of all other branches where this changes
4139could merge cleanly.
4140
4141.Response
4142----
4143 HTTP/1.1 200 OK
4144 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004145 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02004146
4147 )]}'
4148 {
4149 submit_type: "MERGE_IF_NECESSARY",
4150 mergeable: true,
4151 mergeable_into: [
4152 "refs/heads/stable-2.7",
4153 "refs/heads/stable-2.8",
4154 ]
4155 }
4156----
4157
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004158[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004159=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004160--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004161'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004162--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004163
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004164Gets the method the server will use to submit (merge) the change.
4165
4166.Request
4167----
4168 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
4169----
4170
4171.Response
4172----
4173 HTTP/1.1 200 OK
4174 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004175 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004176
4177 )]}'
4178 "MERGE_IF_NECESSARY"
4179----
4180
4181[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004182=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004183--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004184'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004185--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004186
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004187Tests the submit_type Prolog rule in the project, or the one given.
4188
4189Request body may be either the Prolog code as `text/plain` or a
4190link:#rule-input[RuleInput] object. The query parameter `filters`
4191may be set to `SKIP` to bypass parent project filters while testing
4192a project-specific rule.
4193
4194.Request
4195----
4196 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004197 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004198
4199 submit_type(cherry_pick).
4200----
4201
4202.Response
4203----
4204 HTTP/1.1 200 OK
4205 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004206 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004207
4208 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07004209 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004210----
4211
4212[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004213=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004214--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004215'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004216--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004217
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004218Tests the submit_rule Prolog rule in the project, or the one given.
4219
4220Request body may be either the Prolog code as `text/plain` or a
4221link:#rule-input[RuleInput] object. The query parameter `filters`
4222may be set to `SKIP` to bypass parent project filters while testing
4223a project-specific rule.
4224
4225.Request
4226----
Shawn Pearcea3cce712014-03-21 08:16:11 -07004227 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004228 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004229
4230 submit_rule(submit(R)) :-
4231 R = label('Any-Label-Name', reject(_)).
4232----
4233
4234The response is a list of link:#submit-record[SubmitRecord] entries
4235describing the permutations that satisfy the tested submit rule.
4236
4237.Response
4238----
4239 HTTP/1.1 200 OK
4240 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004241 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004242
4243 )]}'
4244 [
4245 {
4246 "status": "NOT_READY",
4247 "reject": {
4248 "Any-Label-Name": {}
4249 }
4250 }
4251 ]
4252----
4253
Shawn Pearceb42e3032015-04-02 10:28:10 -07004254When testing with the `curl` command line client the
4255`--data-binary @rules.pl` flag should be used to ensure
4256all LFs are included in the Prolog code:
4257
4258----
4259 curl -X POST \
4260 -H 'Content-Type: text/plain; charset=UTF-8' \
4261 --data-binary @rules.pl \
4262 http://.../test.submit_rule
4263----
4264
Edwin Kempincb6724a2013-02-26 16:58:51 +01004265[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004266=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004267--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004268'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004269--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004270
Edwin Kempin3ca57192013-02-27 07:44:01 +01004271Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01004272user.
4273
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004274Returns a map of file paths to lists of link:#comment-info[CommentInfo]
4275entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004276
4277.Request
4278----
4279 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
4280----
4281
4282.Response
4283----
4284 HTTP/1.1 200 OK
4285 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004286 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01004287
4288 )]}'
4289 {
4290 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4291 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004292 "id": "TvcXrmjM",
4293 "line": 23,
4294 "message": "[nit] trailing whitespace",
4295 "updated": "2013-02-26 15:40:43.986000000"
4296 },
4297 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004298 "id": "TveXwFiA",
4299 "line": 49,
4300 "in_reply_to": "TfYX-Iuo",
4301 "message": "Done",
4302 "updated": "2013-02-26 15:40:45.328000000"
4303 }
4304 ]
4305 }
4306----
4307
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004308[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004309=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004310--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004311'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004312--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004313
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004314Creates a draft comment on a revision.
4315
4316The new draft comment must be provided in the request body inside a
4317link:#comment-input[CommentInput] entity.
4318
4319.Request
4320----
4321 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004322 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004323
4324 {
4325 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4326 "line": 23,
4327 "message": "[nit] trailing whitespace"
4328 }
4329----
4330
4331As response a link:#comment-info[CommentInfo] entity is returned that
4332describes the draft comment.
4333
4334.Response
4335----
4336 HTTP/1.1 200 OK
4337 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004338 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004339
4340 )]}'
4341 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004342 "id": "TvcXrmjM",
4343 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4344 "line": 23,
4345 "message": "[nit] trailing whitespace",
4346 "updated": "2013-02-26 15:40:43.986000000"
4347 }
4348----
4349
Edwin Kempin3ca57192013-02-27 07:44:01 +01004350[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004351=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004352--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004353'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 -08004354--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004355
Edwin Kempin3ca57192013-02-27 07:44:01 +01004356Retrieves a draft comment of a revision that belongs to the calling
4357user.
4358
4359.Request
4360----
4361 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4362----
4363
4364As response a link:#comment-info[CommentInfo] entity is returned that
4365describes the draft comment.
4366
4367.Response
4368----
4369 HTTP/1.1 200 OK
4370 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004371 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01004372
4373 )]}'
4374 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01004375 "id": "TvcXrmjM",
4376 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4377 "line": 23,
4378 "message": "[nit] trailing whitespace",
4379 "updated": "2013-02-26 15:40:43.986000000"
4380 }
4381----
4382
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004383[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004384=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004385--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004386'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 -08004387--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004388
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004389Updates a draft comment on a revision.
4390
4391The new draft comment must be provided in the request body inside a
4392link:#comment-input[CommentInput] entity.
4393
4394.Request
4395----
4396 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004397 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004398
4399 {
4400 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4401 "line": 23,
4402 "message": "[nit] trailing whitespace"
4403 }
4404----
4405
4406As response a link:#comment-info[CommentInfo] entity is returned that
4407describes the draft comment.
4408
4409.Response
4410----
4411 HTTP/1.1 200 OK
4412 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004413 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004414
4415 )]}'
4416 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004417 "id": "TvcXrmjM",
4418 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4419 "line": 23,
4420 "message": "[nit] trailing whitespace",
4421 "updated": "2013-02-26 15:40:43.986000000"
4422 }
4423----
4424
4425[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004426=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004427--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004428'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 -08004429--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004430
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004431Deletes a draft comment from a revision.
4432
4433.Request
4434----
4435 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4436----
4437
4438.Response
4439----
4440 HTTP/1.1 204 No Content
4441----
4442
John Spurlock5e402f02013-03-24 11:35:04 -04004443[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004444=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004445--
John Spurlock5e402f02013-03-24 11:35:04 -04004446'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004447--
John Spurlock5e402f02013-03-24 11:35:04 -04004448
4449Lists the published comments of a revision.
4450
4451As result a map is returned that maps the file path to a list of
4452link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07004453sorted by file path and only include file (or inline) comments. Use
4454the link:#get-change-detail[Get Change Detail] endpoint to retrieve
4455the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04004456
4457.Request
4458----
4459 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
4460----
4461
4462.Response
4463----
4464 HTTP/1.1 200 OK
4465 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004466 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004467
4468 )]}'
4469 {
4470 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4471 {
John Spurlock5e402f02013-03-24 11:35:04 -04004472 "id": "TvcXrmjM",
4473 "line": 23,
4474 "message": "[nit] trailing whitespace",
4475 "updated": "2013-02-26 15:40:43.986000000",
4476 "author": {
4477 "_account_id": 1000096,
4478 "name": "John Doe",
4479 "email": "john.doe@example.com"
4480 }
4481 },
4482 {
John Spurlock5e402f02013-03-24 11:35:04 -04004483 "id": "TveXwFiA",
4484 "line": 49,
4485 "in_reply_to": "TfYX-Iuo",
4486 "message": "Done",
4487 "updated": "2013-02-26 15:40:45.328000000",
4488 "author": {
4489 "_account_id": 1000097,
4490 "name": "Jane Roe",
4491 "email": "jane.roe@example.com"
4492 }
4493 }
4494 ]
4495 }
4496----
4497
4498[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004499=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004500--
John Spurlock5e402f02013-03-24 11:35:04 -04004501'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 -08004502--
John Spurlock5e402f02013-03-24 11:35:04 -04004503
4504Retrieves a published comment of a revision.
4505
4506.Request
4507----
4508 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
4509----
4510
4511As response a link:#comment-info[CommentInfo] entity is returned that
4512describes the published comment.
4513
4514.Response
4515----
4516 HTTP/1.1 200 OK
4517 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004518 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004519
4520 )]}'
4521 {
John Spurlock5e402f02013-03-24 11:35:04 -04004522 "id": "TvcXrmjM",
4523 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4524 "line": 23,
4525 "message": "[nit] trailing whitespace",
4526 "updated": "2013-02-26 15:40:43.986000000",
4527 "author": {
4528 "_account_id": 1000096,
4529 "name": "John Doe",
4530 "email": "john.doe@example.com"
4531 }
4532 }
4533----
4534
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01004535[[delete-comment]]
4536=== Delete Comment
4537--
4538'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' +
4539'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete'
4540--
4541
4542Deletes a published comment of a revision. Instead of deleting the
4543whole comment, this endpoint just replaces the comment's message
4544with a new message, which contains the name of the user who deletes
4545the comment and the reason why it's deleted. The reason can be
4546provided in the request body as a
4547link:#delete-comment-input[DeleteCommentInput] entity.
4548
4549Note that only users with the
4550link:access-control.html#capability_administrateServer[Administrate Server]
4551global capability are permitted to delete a comment.
4552
4553Please note that some proxies prohibit request bodies for DELETE
4554requests. In this case, if you want to specify options, use a
4555POST request:
4556
4557.Request
4558----
4559 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0
4560 Content-Type: application/json; charset=UTF-8
4561
4562 {
4563 "reason": "contains confidential information"
4564 }
4565----
4566
4567As response a link:#comment-info[CommentInfo] entity is returned that
4568describes the updated comment.
4569
4570.Response
4571----
4572 HTTP/1.1 200 OK
4573 Content-Disposition: attachment
4574 Content-Type: application/json; charset=UTF-8
4575
4576 )]}'
4577 {
4578 "id": "TvcXrmjM",
4579 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4580 "line": 23,
4581 "message": "Comment removed by: Administrator; Reason: contains confidential information",
4582 "updated": "2013-02-26 15:40:43.986000000",
4583 "author": {
4584 "_account_id": 1000096,
4585 "name": "John Doe",
4586 "email": "john.doe@example.com"
4587 }
4588 }
4589----
4590
Edwin Kempinb050a482016-12-01 09:11:19 +01004591[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02004592=== List Robot Comments
4593--
4594'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
4595--
4596
4597Lists the link:config-robot-comments.html[robot comments] of a
4598revision.
4599
4600As result a map is returned that maps the file path to a list of
4601link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
4602map are sorted by file path.
4603
4604.Request
4605----
4606 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
4607----
4608
4609.Response
4610----
4611 HTTP/1.1 200 OK
4612 Content-Disposition: attachment
4613 Content-Type: application/json; charset=UTF-8
4614
4615 )]}'
4616 {
4617 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4618 {
4619 "id": "TvcXrmjM",
4620 "line": 23,
4621 "message": "unused import",
4622 "updated": "2016-02-26 15:40:43.986000000",
4623 "author": {
4624 "_account_id": 1000110,
4625 "name": "Code Analyzer",
4626 "email": "code.analyzer@example.com"
4627 },
4628 "robotId": "importChecker",
4629 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4630 },
4631 {
4632 "id": "TveXwFiA",
4633 "line": 49,
4634 "message": "wrong indention",
4635 "updated": "2016-02-26 15:40:45.328000000",
4636 "author": {
4637 "_account_id": 1000110,
4638 "name": "Code Analyzer",
4639 "email": "code.analyzer@example.com"
4640 },
4641 "robotId": "styleChecker",
4642 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
4643 }
4644 ]
4645 }
4646----
4647
4648[[get-robot-comment]]
4649=== Get Robot Comment
4650--
4651'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
4652--
4653
4654Retrieves a link:config-robot-comments.html[robot comment] of a
4655revision.
4656
4657.Request
4658----
4659 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
4660----
4661
4662As response a link:#robot-comment-info[RobotCommentInfo] entity is
4663returned that describes the robot comment.
4664
4665.Response
4666----
4667 HTTP/1.1 200 OK
4668 Content-Disposition: attachment
4669 Content-Type: application/json; charset=UTF-8
4670
4671 )]}'
4672 {
4673 "id": "TvcXrmjM",
4674 "line": 23,
4675 "message": "unused import",
4676 "updated": "2016-02-26 15:40:43.986000000",
4677 "author": {
4678 "_account_id": 1000110,
4679 "name": "Code Analyzer",
4680 "email": "code.analyzer@example.com"
4681 },
4682 "robotId": "importChecker",
4683 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4684 }
4685----
4686
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004687[[apply-fix]]
4688=== Apply Fix
4689--
4690'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
4691--
4692
4693Applies a suggested fix by creating a change edit which includes the
4694modifications indicated by the fix suggestion. If a change edit already exists,
4695it will be updated accordingly. A fix can only be applied if no change edit
4696exists and the fix refers to the current patch set, or the fix refers to the
4697patch set on which the change edit is based.
4698
4699.Request
4700----
4701 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
4702----
4703
4704If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
4705resulting change edit is returned.
4706
4707.Response
4708----
4709 HTTP/1.1 200 OK
4710 Content-Disposition: attachment
4711 Content-Type: application/json; charset=UTF-8
4712
4713 )]}'
4714 {
4715 "commit":{
4716 "parents":[
4717 {
4718 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
4719 }
4720 ],
4721 "author":{
4722 "name":"John Doe",
4723 "email":"john.doe@example.com",
4724 "date":"2013-05-07 15:21:27.000000000",
4725 "tz":120
4726 },
4727 "committer":{
4728 "name":"Jane Doe",
4729 "email":"jane.doe@example.com",
4730 "date":"2013-05-07 15:35:43.000000000",
4731 "tz":120
4732 },
4733 "subject":"Implement feature X",
4734 "message":"Implement feature X\n\nWith this feature ..."
4735 },
4736 "base_revision":"674ac754f91e64a0efb8087e59a176484bd534d1"
4737 }
4738----
4739
4740If the application failed e.g. due to conflicts with an existing change edit,
4741the response "`409 Conflict`" including an error message in the response body
4742is returned.
4743
4744.Response
4745----
4746 HTTP/1.1 409 Conflict
4747 Content-Disposition: attachment
4748 Content-Type: text/plain; charset=UTF-8
4749
4750 The existing change edit could not be merged with another tree.
4751----
4752
Edwin Kempin682ac712013-05-14 13:40:46 +02004753[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004754=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004755--
Edwin Kempin682ac712013-05-14 13:40:46 +02004756'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004757--
Edwin Kempin682ac712013-05-14 13:40:46 +02004758
4759Lists the files that were modified, added or deleted in a revision.
4760
4761.Request
4762----
4763 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
4764----
4765
David Pursehouse11badbb2017-03-27 10:58:05 +09004766As result a map is returned that maps the link:#file-id[file path] to a list of
Edwin Kempin682ac712013-05-14 13:40:46 +02004767link:#file-info[FileInfo] entries. The entries in the map are
4768sorted by file path.
4769
4770.Response
4771----
4772 HTTP/1.1 200 OK
4773 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004774 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02004775
4776 )]}'
4777 {
4778 "/COMMIT_MSG": {
4779 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02004780 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004781 "size_delta": 551,
4782 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02004783 },
4784 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
4785 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02004786 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004787 "size_delta": 98,
4788 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02004789 }
4790 }
4791----
4792
Shawn Pearce984747d2013-07-18 00:42:16 -07004793The request parameter `reviewed` changes the response to return a list
4794of the paths the caller has marked as reviewed. Clients that also
4795need the FileInfo should make two requests.
4796
Shawn Pearce8ca03a62015-01-02 22:03:20 -08004797The request parameter `q` changes the response to return a list
4798of all files (modified or unmodified) that contain that substring
4799in the path name. This is useful to implement suggestion services
4800finding a file by partial name.
4801
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01004802The integer-valued request parameter `parent` changes the response to return a
4803list of the files which are different in this commit compared to the given
4804parent commit. This is useful for supporting review of merge commits. The value
4805is the 1-based index of the parent's position in the commit object.
4806
Shawn Pearce984747d2013-07-18 00:42:16 -07004807.Request
4808----
4809 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
4810----
4811
4812.Response
4813----
4814 HTTP/1.1 200 OK
4815 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004816 Content-Type: application/json; charset=UTF-8
Shawn Pearce984747d2013-07-18 00:42:16 -07004817
4818 )]}'
4819 [
4820 "/COMMIT_MSG",
4821 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4822 ]
4823----
4824
Edwin Kempinaef44b02013-05-07 16:15:55 +02004825[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004826=== Get Content
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004827--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004828'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 -08004829--
Edwin Kempinaef44b02013-05-07 16:15:55 +02004830
4831Gets the content of a file from a certain revision.
4832
Patrick Hiesel38667d42017-05-02 13:12:48 +02004833The optional, integer-valued `parent` parameter can be specified to request
4834the named file from a parent commit of the specified revision. The value is
4835the 1-based index of the parent's position in the commit object. If the
4836parameter is omitted or the value is non-positive, the patch set is referenced.
4837
Edwin Kempinaef44b02013-05-07 16:15:55 +02004838.Request
4839----
4840 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
4841----
4842
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004843The content is returned as base64 encoded string. The HTTP response
4844Content-Type is always `text/plain`, reflecting the base64 wrapping.
4845A Gerrit-specific `X-FYI-Content-Type` header is returned describing
4846the server detected content type of the file.
4847
4848If only the content type is required, callers should use HEAD to
4849avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02004850
4851.Response
4852----
4853 HTTP/1.1 200 OK
4854 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004855 Content-Type: text/plain; charset=ISO-8859-1
4856 X-FYI-Content-Encoding: base64
4857 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02004858
4859 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
4860----
4861
David Ostrovskyd0078672015-02-06 21:51:04 +01004862Alternatively, if the only value of the Accept request header is
4863`application/json` the content is returned as JSON string and
4864`X-FYI-Content-Encoding` is set to `json`.
4865
David Pletcherd1efb452015-09-01 17:45:55 -07004866[[get-safe-content]]
4867=== Download Content
4868--
4869'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
4870--
4871
4872Downloads the content of a file from a certain revision, in a safe format
4873that poses no risk for inadvertent execution of untrusted code.
4874
4875If the content type is defined as safe, the binary file content is returned
4876verbatim. If the content type is not safe, the file is stored inside a ZIP
4877file, containing a single entry with a random, unpredictable name having the
4878same base and suffix as the true filename. The ZIP file is returned in
4879verbatim binary form.
4880
4881See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
4882for information about safe file type configuration.
4883
4884The HTTP resource Content-Type is dependent on the file type: the
4885applicable type for safe files, or "application/zip" for unsafe files.
4886
David Pletcherec622bf2015-09-18 14:30:05 -07004887The optional, integer-valued `parent` parameter can be specified to request
4888the named file from a parent commit of the specified revision. The value is
4889the 1-based index of the parent's position in the commit object. If the
4890parameter is omitted or the value non-positive, the patch set is referenced.
4891
4892Filenames are decorated with a suffix of `_new` for the current patch,
4893`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07004894
4895.Request
4896----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004897 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07004898----
4899
4900.Response
4901----
4902 HTTP/1.1 200 OK
4903 Content-Disposition: attachment; filename="logo.png"
4904 Content-Type: image/png
4905
4906 `[binary data for logo.png]`
4907----
4908
4909.Request
4910----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004911 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 -07004912----
4913
4914.Response
4915----
4916 HTTP/1.1 200 OK
4917 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
4918 Content-Type:application/zip
4919
4920 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
4921----
4922
David Pursehouse882aef22013-06-05 10:56:37 +09004923[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004924=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004925--
David Pursehouse882aef22013-06-05 10:56:37 +09004926'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 -08004927--
David Pursehouse882aef22013-06-05 10:56:37 +09004928
4929Gets the diff of a file from a certain revision.
4930
4931.Request
4932----
4933 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
4934----
4935
4936As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
4937
4938.Response
4939----
4940 HTTP/1.1 200 OK
4941 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004942 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004943
4944 )]
4945 {
4946 "meta_a": {
4947 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004948 "content_type": "text/x-java-source",
4949 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09004950 },
4951 "meta_b": {
4952 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004953 "content_type": "text/x-java-source",
4954 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004955 },
4956 "change_type": "MODIFIED",
4957 "diff_header": [
4958 "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",
4959 "index 59b7670..9faf81c 100644",
4960 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4961 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
4962 ],
4963 "content": [
4964 {
4965 "ab": [
4966 "// Copyright (C) 2010 The Android Open Source Project",
4967 "//",
4968 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
4969 "// you may not use this file except in compliance with the License.",
4970 "// You may obtain a copy of the License at",
4971 "//",
4972 "// http://www.apache.org/licenses/LICENSE-2.0",
4973 "//",
4974 "// Unless required by applicable law or agreed to in writing, software",
4975 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
4976 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
4977 "// See the License for the specific language governing permissions and",
4978 "// limitations under the License."
4979 ]
4980 },
4981 {
4982 "b": [
4983 "//",
4984 "// Add some more lines in the header."
4985 ]
4986 },
4987 {
4988 "ab": [
4989 "",
4990 "package com.google.gerrit.server.project;",
4991 "",
4992 "import com.google.common.collect.Maps;",
4993 ...
4994 ]
4995 }
4996 ...
4997 ]
4998 }
4999----
5000
5001If the `intraline` parameter is specified, intraline differences are included in the diff.
5002
5003.Request
5004----
5005 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
5006----
5007
5008.Response
5009----
5010 HTTP/1.1 200 OK
5011 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005012 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005013
5014 )]
5015 {
5016 "meta_a": {
5017 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005018 "content_type": "text/x-java-source",
5019 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005020 },
5021 "meta_b": {
5022 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005023 "content_type": "text/x-java-source",
5024 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005025 },
5026 "change_type": "MODIFIED",
5027 "diff_header": [
5028 "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",
5029 "index 59b7670..9faf81c 100644",
5030 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5031 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5032 ],
5033 "content": [
5034 ...
5035 {
5036 "a": [
5037 "/** Manages access control for Git references (aka branches, tags). */"
5038 ],
5039 "b": [
5040 "/** Manages access control for the Git references (aka branches, tags). */"
5041 ],
5042 "edit_a": [],
5043 "edit_b": [
5044 [
5045 31,
5046 4
5047 ]
5048 ]
5049 }
5050 ]
5051 }
5052----
5053
5054The `base` parameter can be specified to control the base patch set from which the diff should
5055be generated.
5056
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005057The integer-valued request parameter `parent` can be specified to control the
5058parent commit number against which the diff should be generated. This is useful
5059for supporting review of merge commits. The value is the 1-based index of the
5060parent's position in the commit object.
5061
Edwin Kempin8cdce502014-12-06 10:55:38 +01005062[[weblinks-only]]
5063If the `weblinks-only` parameter is specified, only the diff web links are returned.
5064
David Pursehouse882aef22013-06-05 10:56:37 +09005065.Request
5066----
5067 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
5068----
5069
5070.Response
5071----
5072 HTTP/1.1 200 OK
5073 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005074 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005075
5076 )]
5077 {
5078 "meta_a": {
5079 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005080 "content_type": "text/x-java-source",
5081 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005082 },
5083 "meta_b": {
5084 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005085 "content_type": "text/x-java-source",
5086 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005087 },
5088 "change_type": "MODIFIED",
5089 "content": [
5090 {
5091 "skip": 578
5092 }
5093 ]
5094 }
5095----
5096
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01005097The `whitespace` parameter can be specified to control how whitespace
5098differences are reported in the result. Valid values are `IGNORE_NONE`,
5099`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09005100
5101The `context` parameter can be specified to control the number of lines of surrounding context
5102in the diff. Valid values are `ALL` or number of lines.
5103
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005104[[get-blame]]
5105=== Get Blame
5106--
5107'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
5108--
5109
5110Gets the blame of a file from a certain revision.
5111
5112.Request
5113----
5114 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
5115----
5116
5117As response a link:#blame-info[BlameInfo] entity is returned that describes the
5118blame.
5119
5120.Response
5121----
5122 HTTP/1.1 200 OK
5123 Content-Disposition: attachment
5124 Content-Type: application/json; charset=UTF-8
5125
5126 )]
5127 {
5128 [
5129 {
5130 "author": "Joe Daw",
5131 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
5132 "time": 1421441349,
5133 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
5134 "ranges": [
5135 {
5136 "start": 1,
5137 "end": 10
5138 },
5139 {
5140 "start": 16,
5141 "end": 296
5142 }
5143 ]
5144 },
5145 {
5146 "author": "Jane Daw",
5147 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
5148 "time": 1421825421,
5149 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
5150 "ranges": [
5151 {
5152 "start": 13,
5153 "end": 13
5154 }
5155 ]
5156 }
5157 ]
5158 }
5159----
5160
5161The `base` parameter can be specified to control the base patch set from which
5162the blame should be generated.
5163
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005164[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005165=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005166--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005167'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 -08005168--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005169
Edwin Kempinbea55a52013-05-14 13:53:39 +02005170Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005171
5172.Request
5173----
5174 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5175----
5176
5177.Response
5178----
5179 HTTP/1.1 201 Created
5180----
5181
Edwin Kempinbea55a52013-05-14 13:53:39 +02005182If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005183response is "`200 OK`".
5184
5185[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005186=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005187--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005188'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 -08005189--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005190
Edwin Kempinbea55a52013-05-14 13:53:39 +02005191Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005192
5193.Request
5194----
5195 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5196----
5197
5198.Response
5199----
5200 HTTP/1.1 204 No Content
5201----
5202
Gustaf Lundh019fb262012-11-28 14:20:22 +01005203[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005204=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005205--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005206'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005207--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005208
5209Cherry picks a revision to a destination branch.
5210
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02005211To cherry pick a commit with no change-id associated with it, see
5212link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit].
5213
Gustaf Lundh019fb262012-11-28 14:20:22 +01005214The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02005215link:#cherrypick-input[CherryPickInput] entity. If the commit message
5216does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005217
5218.Request
5219----
5220 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005221 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005222
5223 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01005224 "message" : "Implementing Feature X",
5225 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01005226 }
5227----
5228
5229As response a link:#change-info[ChangeInfo] entity is returned that
5230describes the resulting cherry picked change.
5231
5232.Response
5233----
5234 HTTP/1.1 200 OK
5235 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005236 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005237
5238 )]}'
5239 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01005240 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
5241 "project": "myProject",
5242 "branch": "release-branch",
5243 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
5244 "subject": "Implementing Feature X",
5245 "status": "NEW",
5246 "created": "2013-02-01 09:59:32.126000000",
5247 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01005248 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005249 "insertions": 12,
5250 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01005251 "_number": 3965,
5252 "owner": {
5253 "name": "John Doe"
5254 }
5255 }
5256----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005257
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005258[[revision-reviewer-endpoints]]
5259== Revision Reviewer Endpoints
5260
5261[[list-revision-reviewers]]
5262=== List Revision Reviewers
5263--
5264'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
5265--
5266
5267Lists the reviewers of a revision.
5268
5269Please note that only the current revision is supported.
5270
5271As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
5272
5273.Request
5274----
5275 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
5276----
5277
5278.Response
5279----
5280 HTTP/1.1 200 OK
5281 Content-Disposition: attachment
5282 Content-Type: application/json; charset=UTF-8
5283
5284 )]}'
5285 [
5286 {
5287 "approvals": {
5288 "Verified": "+1",
5289 "Code-Review": "+2"
5290 },
5291 "_account_id": 1000096,
5292 "name": "John Doe",
5293 "email": "john.doe@example.com"
5294 },
5295 {
5296 "approvals": {
5297 "Verified": " 0",
5298 "Code-Review": "-1"
5299 },
5300 "_account_id": 1000097,
5301 "name": "Jane Roe",
5302 "email": "jane.roe@example.com"
5303 }
5304 ]
5305----
5306
5307[[list-revision-votes]]
5308=== List Revision Votes
5309--
5310'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
5311--
5312
5313Lists the votes for a specific reviewer of the revision.
5314
5315Please note that only the current revision is supported.
5316
5317.Request
5318----
5319 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
5320----
5321
5322As result a map is returned that maps the label name to the label value.
5323The entries in the map are sorted by label name.
5324
5325.Response
5326----
5327 HTTP/1.1 200 OK
5328 Content-Disposition: attachment
5329 Content-Type: application/json;charset=UTF-8
5330
5331 )]}'
5332 {
5333 "Code-Review": -1,
5334 "Verified": 1,
5335 "Work-In-Progress": 1
5336 }
5337----
5338
5339[[delete-revision-vote]]
5340=== Delete Revision Vote
5341--
5342'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5343/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
5344'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5345/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
5346--
5347
5348Deletes a single vote from a revision. The deletion will be possible only
5349if the revision is the current revision. By using this endpoint you can prevent
5350deleting the vote (with same label) from a newer patch set by mistake.
5351
5352Note, that even when the last vote of a reviewer is removed the reviewer itself
5353is still listed on the change.
5354
5355Options can be provided in the request body as a
5356link:#delete-vote-input[DeleteVoteInput] entity.
5357
5358.Request
5359----
5360 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
5361 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5362----
5363
5364Please note that some proxies prohibit request bodies for DELETE
5365requests. In this case, if you want to specify options, use a POST
5366request:
5367
5368.Request
5369----
5370 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5371 Content-Type: application/json; charset=UTF-8
5372
5373 {
5374 "notify": "NONE"
5375 }
5376----
5377
5378.Response
5379----
5380 HTTP/1.1 204 No Content
5381----
5382
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005383[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005384== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005385
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005386[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005387=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005388--
5389--
5390
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005391[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005392=== \{change-id\}
Patrick Hiesel18da0452017-12-21 14:02:05 +01005393Identifier that uniquely identifies one change. It contains the URL-encoded
5394project name as well as the change number: "'$$<project>~<numericId>$$'"
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005395
Patrick Hiesel18da0452017-12-21 14:02:05 +01005396Depending on the server's configuration, Gerrit can still support the following
5397deprecated identifiers. These will be removed in a future release:
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005398
5399* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
5400 where for the branch the `refs/heads/` prefix can be omitted
5401 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
5402* a Change-Id if it uniquely identifies one change
5403 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
Patrick Hiesel4d2dd182017-05-09 17:35:18 +02005404* a numeric change ID ("4247")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005405
Patrick Hiesel18da0452017-12-21 14:02:05 +01005406If you need more time to migrate off of old change IDs, please see
5407link:config-gerrit.html#change.api.allowedIdentifier[change.api.allowedIdentifier]
5408for more information on how to enable the use of deprecated identifiers.
5409
John Spurlock5e402f02013-03-24 11:35:04 -04005410[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005411=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04005412UUID of a published comment.
5413
Edwin Kempin3ca57192013-02-27 07:44:01 +01005414[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005415=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01005416UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005417
David Ostrovskybeb0b842014-12-13 00:24:29 +01005418[[label-id]]
5419=== \{label-id\}
5420The name of the label.
5421
Edwin Kempinbea55a52013-05-14 13:53:39 +02005422[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09005423=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02005424The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005425
David Pursehouse11badbb2017-03-27 10:58:05 +09005426The following magic paths are supported:
5427
5428* `/COMMIT_MSG`:
5429+
5430The commit message and headers with the parent commit(s), the author
5431information and the committer information.
5432
5433* `/MERGE_LIST` (for merge commits only):
5434+
5435The list of commits that are being integrated into the destination
5436branch by submitting the merge commit.
5437
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005438[[fix-id]]
5439=== \{fix-id\}
5440UUID of a suggested fix.
5441
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005442[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005443=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005444Identifier that uniquely identifies one revision of a change.
5445
5446This can be:
5447
Shawn Pearce9c0722a2013-03-02 15:30:31 -08005448* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005449* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
5450* an abbreviated commit ID that uniquely identifies one revision of the
5451 change ("674ac754"), at least 4 digits are required
5452* a legacy numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02005453* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005454
Edwin Kempine3446292013-02-19 16:40:14 +01005455[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005456== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01005457
Edwin Kempined5364b2013-02-22 10:39:33 +01005458[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005459=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01005460The `AbandonInput` entity contains information for abandoning a change.
5461
David Pursehouseae367192014-11-25 17:24:47 +09005462[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005463|=============================
5464|Field Name ||Description
5465|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01005466Message to be added as review comment to the change when abandoning the
5467change.
Edwin Kempincd07df42016-12-01 09:10:09 +01005468|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07005469Notify handling that defines to whom email notifications should be sent after
5470the change is abandoned. +
5471Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5472If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01005473|`notify_details`|optional|
5474Additional information about whom to notify about the update as a map
5475of recipient type to link:#notify-info[NotifyInfo] entity.
5476|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01005477
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005478[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005479=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005480The `ActionInfo` entity describes a REST API call the client can
5481make to manipulate a resource. These are frequently implemented by
5482plugins and may be discovered at runtime.
5483
David Pursehouseae367192014-11-25 17:24:47 +09005484[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005485|====================================
5486|Field Name ||Description
5487|`method` |optional|
5488HTTP method to use with the action. Most actions use `POST`, `PUT`
5489or `DELETE` to cause state changes.
5490|`label` |optional|
5491Short title to display to a user describing the action. In the
5492Gerrit web interface the label is used as the text on the button
5493presented in the UI.
5494|`title` |optional|
5495Longer text to display describing the action. In a web UI this
5496should be the title attribute of the element, displaying when
5497the user hovers the mouse.
5498|`enabled` |optional|
5499If true the action is permitted at this time and the caller is
5500likely allowed to execute it. This may change if state is updated
5501at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005502|====================================
5503
Edwin Kempin392328e2013-02-25 12:50:03 +01005504[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005505=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01005506The `AddReviewerResult` entity describes the result of adding a
5507reviewer to a change.
5508
David Pursehouseae367192014-11-25 17:24:47 +09005509[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01005510|===========================
5511|Field Name ||Description
Logan Hanks23e70282016-07-06 14:31:56 -07005512|`input` ||
5513Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
5514set while adding the reviewer.
Edwin Kempin392328e2013-02-25 12:50:03 +01005515|`reviewers` |optional|
5516The newly added reviewers as a list of link:#reviewer-info[
5517ReviewerInfo] entities.
Logan Hanksee0a4182016-07-06 14:39:26 -07005518|`ccs` |optional|
5519The newly CCed accounts as a list of link:#reviewer-info[
5520ReviewerInfo] entities. This field will only appear if the requested
5521`state` for the reviewer was `CC` *and* NoteDb is enabled on the
5522server.
Edwin Kempin392328e2013-02-25 12:50:03 +01005523|`error` |optional|
5524Error message explaining why the reviewer could not be added. +
5525If a group was specified in the input and an error is returned, it
5526means that none of the members were added as reviewer.
5527|`confirm` |`false` if not set|
5528Whether adding the reviewer requires confirmation.
5529|===========================
5530
Edwin Kempine3446292013-02-19 16:40:14 +01005531[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005532=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005533The `ApprovalInfo` entity contains information about an approval from a
5534user for a label on a change.
5535
Edwin Kempin963dfd02013-02-27 12:39:32 +01005536`ApprovalInfo` has the same fields as
5537link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01005538In addition `ApprovalInfo` has the following fields:
5539
David Pursehouseae367192014-11-25 17:24:47 +09005540[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005541|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005542|Field Name ||Description
5543|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07005544The vote that the user has given for the label. If present and zero, the
5545user is permitted to vote on the label. If absent, the user is not
5546permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005547|`permitted_voting_range` |optional|
5548The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
5549on that label. If present, the user is permitted to vote on the label
5550regarding the range values. If absent, the user is not permitted to vote
5551on that label.
5552|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01005553The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005554|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005555Value of the `tag` field from link:#review-input[ReviewInput] set
5556while posting the review.
5557NOTE: To apply different tags on on different votes/comments multiple
5558invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04005559|`post_submit` |not set if `false`|
5560If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01005561|===========================
5562
Sven Selberg273a4aa2016-09-21 16:28:10 +02005563[[assignee-input]]
5564=== AssigneeInput
5565The `AssigneeInput` entity contains the identity of the user to be set as assignee.
5566
5567[options="header",cols="1,^1,5"]
5568|===========================
5569|Field Name ||Description
5570|`assignee` ||
5571The link:rest-api-accounts.html#account-id[ID] of one account that
5572should be added as assignee.
5573|===========================
5574
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005575[[blame-info]]
5576=== BlameInfo
5577The `BlameInfo` entity stores the commit metadata with the row coordinates where
5578it applies.
5579
5580[options="header",cols="1,6"]
5581|===========================
5582|Field Name | Description
5583|`author` | The author of the commit.
5584|`id` | The id of the commit.
5585|`time` | Commit time.
5586|`commit_msg` | The commit message.
5587|`ranges` |
5588The blame row coordinates as link:#range-info[RangeInfo] entities.
5589|===========================
5590
Edwin Kempin521c1242015-01-23 12:44:44 +01005591[[change-edit-input]]
5592=== ChangeEditInput
5593The `ChangeEditInput` entity contains information for restoring a
5594path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005595
Edwin Kempin521c1242015-01-23 12:44:44 +01005596[options="header",cols="1,^1,5"]
5597|===========================
5598|Field Name ||Description
5599|`restore_path`|optional|Path to file to restore.
5600|`old_path` |optional|Old path to file to rename.
5601|`new_path` |optional|New path to file to rename.
5602|===========================
5603
5604[[change-edit-message-input]]
5605=== ChangeEditMessageInput
5606The `ChangeEditMessageInput` entity contains information for changing
5607the commit message within a change edit.
5608
5609[options="header",cols="1,^1,5"]
5610|===========================
5611|Field Name ||Description
5612|`message` ||New commit message.
5613|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005614
Edwin Kempine3446292013-02-19 16:40:14 +01005615[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005616=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005617The `ChangeInfo` entity contains information about a change.
5618
David Pursehouseae367192014-11-25 17:24:47 +09005619[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005620|==================================
5621|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01005622|`id` ||
5623The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05005624where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01005625`refs/heads/` prefix is omitted.
5626|`project` ||The name of the project.
5627|`branch` ||
5628The name of the target branch. +
5629The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01005630|`topic` |optional|The topic to which this change belongs.
Edwin Kempin93b74fb2017-08-25 10:42:56 +02005631|`assignee` |optional|
5632The assignee of the change as an link:rest-api-accounts.html#account-info[
5633AccountInfo] entity.
5634|`hashtags` |optional|
5635List of hashtags that are set on the change (only populated when NoteDb
5636is enabled).
Edwin Kempine3446292013-02-19 16:40:14 +01005637|`change_id` ||The Change-Id of the change.
5638|`subject` ||
5639The subject of the change (header line of the commit message).
5640|`status` ||
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01005641The status of the change (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempine3446292013-02-19 16:40:14 +01005642|`created` ||
5643The link:rest-api.html#timestamp[timestamp] of when the change was
5644created.
5645|`updated` ||
5646The link:rest-api.html#timestamp[timestamp] of when the change was last
5647updated.
Khai Do96a7caf2016-01-07 14:07:54 -08005648|`submitted` |only set for merged changes|
5649The link:rest-api.html#timestamp[timestamp] of when the change was
5650submitted.
Dave Borowitz8ec31f92017-08-23 10:28:34 -04005651|`submitter` |only set for merged changes|
5652The user who submitted the change, as an
5653link:rest-api-accounts.html#account-info[ AccountInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01005654|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02005655Whether the calling user has starred this change with the default label.
5656|`stars` |optional|
5657A list of star labels that are applied by the calling user to this
5658change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01005659|`reviewed` |not set if `false`|
5660Whether the change was reviewed 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. +
Han-Wen Nienhuys19de6cd2018-01-16 13:15:38 +01005667Not set for merged changes, if the change has not yet been tested, or
5668if the link:#skip_mergeable[skip_mergeable] option is set.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07005669|`submittable` |optional|
5670Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07005671Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005672|`insertions` ||
5673Number of inserted lines.
5674|`deletions` ||
5675Number of deleted lines.
Changcheng Xiao81c48092017-02-08 13:04:07 +01005676|`unresolved_comment_count` |optional|
5677Number of unresolved comments. Not set if the current change index doesn't have the data.
Edwin Kempine3446292013-02-19 16:40:14 +01005678|`_number` ||The legacy numeric ID of the change.
5679|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01005680The owner of the change as an link:rest-api-accounts.html#account-info[
5681AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07005682|`actions` |optional|
5683Actions the caller might be able to perform on this revision. The
5684information is a map of view name to link:#action-info[ActionInfo]
5685entities.
Edwin Kempine3446292013-02-19 16:40:14 +01005686|`labels` |optional|
5687The labels of the change as a map that maps the label names to
5688link:#label-info[LabelInfo] entries. +
5689Only set if link:#labels[labels] or link:#detailed-labels[detailed
5690labels] are requested.
5691|`permitted_labels` |optional|
5692A map of the permitted labels that maps a label name to the list of
5693values that are allowed for that label. +
5694Only set if link:#detailed-labels[detailed labels] are requested.
5695|`removable_reviewers`|optional|
5696The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01005697link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01005698Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07005699|`reviewers` |optional|
Edwin Kempin66af3d82015-11-10 17:38:40 -08005700The reviewers as a map that maps a reviewer state to a list of
5701link:rest-api-accounts.html#account-info[AccountInfo] entities.
5702Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
5703`REVIEWER`: Users with at least one non-zero vote on the change. +
5704`CC`: Users that were added to the change, but have not voted. +
5705`REMOVED`: Users that were previously reviewers on the change, but have
5706been removed. +
5707Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07005708|`pending_reviewers` |optional|
5709Updates to `reviewers` that have been made while the change was in the
5710WIP state. Only present on WIP changes and only if there are pending
5711reviewer updates to report. These are reviewers who have not yet been
5712notified about being added to or removed from the change. +
5713Only set if link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07005714|`reviewer_updates`|optional|
5715Updates to reviewers set for the change as
5716link:#review-update-info[ReviewerUpdateInfo] entities.
5717Only set if link:#reviewer-updates[reviewer updates] are requested and
5718if NoteDb is enabled.
John Spurlock74a70cc2013-03-23 16:41:50 -04005719|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005720Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04005721link:#change-message-info[ChangeMessageInfo] entities. +
5722Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005723|`current_revision` |optional|
5724The commit ID of the current patch set of this change. +
5725Only set if link:#current-revision[the current revision] is requested
5726or if link:#all-revisions[all revisions] are requested.
5727|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05005728All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01005729patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08005730Only set if link:#current-revision[the current revision] is requested
5731(in which case it will only contain a key for the current revision) or
5732if link:#all-revisions[all revisions] are requested.
Makson Lee3568a932017-08-28 17:12:03 +08005733|`tracking_ids` |optional|
5734A list of link:#tracking-id-info[TrackingIdInfo] entities describing
5735references to external tracking systems. Only set if
5736link:#tracking-ids[tracking ids] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005737|`_more_changes` |optional, not set if `false`|
5738Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08005739Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05005740|`problems` |optional|
5741A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08005742problems with this change. Only set if link:#check[CHECK] is set.
David Ostrovskycb19cec2017-04-28 11:55:45 +02005743|`is_private` |optional, not set if `false`|
5744When present, change is marked as private.
David Ostrovsky258849b2017-03-09 23:21:03 +01005745|`work_in_progress` |optional, not set if `false`|
5746When present, change is marked as Work In Progress.
Logan Hanks724b24c2017-07-14 10:01:05 -07005747|`has_review_started` |optional, not set if `false`|
Logan Hanks296cd892017-05-03 15:14:41 -07005748When present, change has been marked Ready at some point in time.
Patrick Hiesel828f3222017-07-13 14:18:38 +02005749|`revert_of` |optional|
5750The numeric Change-Id of the change that this change reverts.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005751|==================================
5752
5753[[change-input]]
5754=== ChangeInput
5755The `ChangeInput` entity contains information about creating a new change.
5756
5757[options="header",cols="1,^1,5"]
5758|==================================
5759|Field Name ||Description
5760|`project` ||The name of the project.
5761|`branch` ||
5762The name of the target branch. +
5763The `refs/heads/` prefix is omitted.
5764|`subject` ||
5765The subject of the change (header line of the commit message).
5766|`topic` |optional|The topic to which this change belongs.
5767|`status` |optional, default to `NEW`|
David Ostrovsky4b44bdc2017-07-27 08:05:43 +02005768The status of the change (only `NEW` accepted here).
Edwin Kempin14d50ed2017-05-03 13:26:30 +02005769|`is_private` |optional, default to `false`|
5770Whether the new change should be marked as private.
5771|`work_in_progress` |optional, default to `false`|
5772Whether the new change should be set to work in progress.
David Ostrovsky9d8ec422014-12-24 00:52:09 +01005773|`base_change` |optional|
5774A link:#change-id[\{change-id\}] that identifies the base change for a create
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005775change operation.
5776|`new_branch` |optional, default to `false`|
5777Allow creating a new branch when set to `true`.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005778|`merge` |optional|
5779The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01005780|`notify` |optional|
5781Notify handling that defines to whom email notifications should be sent
5782after the change is created. +
5783Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5784If not set, the default is `ALL`.
5785|`notify_details` |optional|
5786Additional information about whom to notify about the change creation
5787as a map of recipient type to link:#notify-info[NotifyInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01005788|==================================
5789
John Spurlock74a70cc2013-03-23 16:41:50 -04005790[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005791=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04005792The `ChangeMessageInfo` entity contains information about a message
5793attached to a change.
5794
David Pursehouseae367192014-11-25 17:24:47 +09005795[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04005796|==================================
5797|Field Name ||Description
5798|`id` ||The ID of the message.
5799|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07005800Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04005801link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5802Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01005803|`real_author` |optional|
5804Real author of the message as an
5805link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5806Set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04005807|`date` ||
5808The link:rest-api.html#timestamp[timestamp] this message was posted.
5809|`message` ||The text left by the user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005810|`tag` |optional|
5811Value of the `tag` field from link:#review-input[ReviewInput] set
5812while posting the review.
5813NOTE: To apply different tags on on different votes/comments multiple
5814invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04005815|`_revision_number` |optional|
5816Which patchset (if any) generated this message.
5817|==================================
5818
Gustaf Lundh019fb262012-11-28 14:20:22 +01005819[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005820=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01005821The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
5822
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005823[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01005824|===========================
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005825|Field Name ||Description
5826|`message` ||Commit message for the cherry-picked change
5827|`destination` ||Destination branch
Changcheng Xiaoe3332582017-05-26 15:29:41 +02005828|`base` |optional|
582940-hex digit SHA-1 of the commit which will be the parent commit of the newly created change.
5830If set, it must be a merged commit or a change revision on the destination branch.
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005831|`parent` |optional, defaults to 1|
5832Number of the parent relative to which the cherry-pick should be considered.
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02005833|`notify` |optional|
5834Notify handling that defines to whom email notifications should be sent
5835after the cherry-pick. +
5836Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5837If not set, the default is `NONE`.
5838|`notify_details` |optional|
5839Additional information about whom to notify about the update as a map
5840of recipient type to link:#notify-info[NotifyInfo] entity.
Aaron Gable54bc9832017-07-05 14:44:36 -07005841|`keep_reviewers` |optional, defaults to false|
5842If true, carries reviewers and ccs over from original change to newly created one.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005843|===========================
5844
Edwin Kempincb6724a2013-02-26 16:58:51 +01005845[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005846=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05005847The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005848
David Pursehouseae367192014-11-25 17:24:47 +09005849[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01005850|===========================
5851|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005852|`patch_set` |optional|
5853The patch set number for the comment; only set in contexts where +
5854comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04005855|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005856|`path` |optional|
5857The path of the file for which the inline comment was done. +
5858Not set if returned in a map where the key is the file path.
5859|`side` |optional|
5860The side on which the comment was added. +
5861Allowed values are `REVISION` and `PARENT`. +
5862If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005863|`parent` |optional|
5864The 1-based parent number. Used only for merge commits when `side == PARENT`.
5865When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005866|`line` |optional|
5867The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04005868If range is set, this equals the end line of the range. +
5869If neither line nor range is set, it's a file comment.
5870|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005871The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005872entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005873|`in_reply_to` |optional|
5874The URL encoded UUID of the comment to which this comment is a reply.
5875|`message` |optional|The comment message.
5876|`updated` ||
5877The link:rest-api.html#timestamp[timestamp] of when this comment was
5878written.
John Spurlock5e402f02013-03-24 11:35:04 -04005879|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09005880The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04005881link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5882Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005883|`tag` |optional|
5884Value of the `tag` field from link:#review-input[ReviewInput] set
5885while posting the review.
5886NOTE: To apply different tags on on different votes/comments multiple
5887invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08005888|`unresolved` |optional|
5889Whether or not the comment must be addressed by the user. The state of
5890resolution of a comment thread is stored in the last comment in that thread
5891chronologically.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005892|===========================
5893
Edwin Kempin67498de2013-02-25 16:15:34 +01005894[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005895=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03005896The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01005897comment.
5898
David Pursehouseae367192014-11-25 17:24:47 +09005899[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01005900|===========================
5901|Field Name ||Description
5902|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01005903The URL encoded UUID of the comment if an existing draft comment should
5904be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005905|`path` |optional|
5906The path of the file for which the inline comment should be added. +
5907Doesn't need to be set if contained in a map where the key is the file
5908path.
Edwin Kempin67498de2013-02-25 16:15:34 +01005909|`side` |optional|
5910The side on which the comment should be added. +
5911Allowed values are `REVISION` and `PARENT`. +
5912If not set, the default is `REVISION`.
5913|`line` |optional|
5914The number of the line for which the comment should be added. +
5915`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04005916If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09005917If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04005918|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005919The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005920entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01005921|`in_reply_to` |optional|
5922The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005923|`updated` |optional|
5924The link:rest-api.html#timestamp[timestamp] of this comment. +
5925Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01005926|`message` |optional|
5927The comment message. +
5928If not set and an existing draft comment is updated, the existing draft
5929comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04005930|`tag` |optional, drafts only|
5931Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
5932inputs; for published comments, use the `tag` field in +
5933link#review-input[ReviewInput]
Kasper Nilsson7ec30362016-12-20 14:13:21 -08005934|`unresolved` |optional|
5935Whether or not the comment must be addressed by the user. This value will
5936default to false if the comment is an orphan, or the value of the `in_reply_to`
5937comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01005938|===========================
5939
Michael Zhou596c7682013-08-25 05:43:34 -04005940[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005941=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04005942The `CommentRange` entity describes the range of an inline comment.
5943
David Pursehouseae367192014-11-25 17:24:47 +09005944[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04005945|===========================
5946|Field Name ||Description
Alice Kober-Sotzekcd06fb62017-03-21 15:19:45 +01005947|`start_line` ||The start line number of the range. (1-based, inclusive)
5948|`start_character` ||The character position in the start line. (0-based, inclusive)
5949|`end_line` ||The end line number of the range. (1-based, exclusive)
5950|`end_character` ||The character position in the end line. (0-based, exclusive)
Michael Zhou596c7682013-08-25 05:43:34 -04005951|===========================
5952
Edwin Kempine3446292013-02-19 16:40:14 +01005953[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005954=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005955The `CommitInfo` entity contains information about a commit.
5956
Edwin Kempinf0c57152015-07-15 18:18:24 +02005957[options="header",cols="1,^1,5"]
5958|===========================
5959|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02005960|`commit` |Optional|
5961The commit ID. Not set if included in a link:#revision-info[
5962RevisionInfo] entity that is contained in a map which has the commit ID
5963as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005964|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005965The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02005966link:#commit-info[CommitInfo] entities. In each parent
5967only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005968|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005969link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005970|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005971link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005972|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005973The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02005974|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01005975|`web_links` |optional|
5976Links to the commit in external sites as a list of
5977link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005978|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01005979
Patrick Hieselfda96452017-06-14 16:44:54 +02005980[[commit-message-input]]
5981=== CommitMessageInput
5982The `CommitMessageInput` entity contains information for changing
5983the commit message of a change.
5984
5985[options="header",cols="1,^1,5"]
5986|=============================
5987|Field Name ||Description
5988|`message` ||New commit message.
5989|`notify` |optional|
5990Notify handling that defines to whom email notifications should be sent
5991after the commit message was updated. +
5992Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Logan Hanksa1e68dc2017-06-29 15:13:27 -07005993If not set, the default is `OWNER` for WIP changes and `ALL` otherwise.
Patrick Hieselfda96452017-06-14 16:44:54 +02005994|`notify_details`|optional|
5995Additional information about whom to notify about the update as a map
5996of recipient type to link:#notify-info[NotifyInfo] entity.
5997|=============================
5998
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005999[[delete-comment-input]]
6000=== DeleteCommentInput
6001The `DeleteCommentInput` entity contains the option for deleting a comment.
6002
6003[options="header",cols="1,^1,5"]
6004|=============================
6005|Field Name ||Description
6006|`reason` |optional|
6007The reason why the comment should be deleted. +
6008If set, the comment's message will be replaced with
6009"Comment removed by: `name`; Reason: `reason`",
6010or just "Comment removed by: `name`." if not set.
6011|=============================
6012
Edwin Kempin407fca32016-08-29 12:01:00 +02006013[[delete-reviewer-input]]
6014=== DeleteReviewerInput
6015The `DeleteReviewerInput` entity contains options for the deletion of a
6016reviewer.
6017
6018[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006019|=============================
6020|Field Name ||Description
6021|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02006022Notify handling that defines to whom email notifications should be sent
6023after the reviewer is deleted. +
6024Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6025If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006026|`notify_details`|optional|
6027Additional information about whom to notify about the update as a map
6028of recipient type to link:#notify-info[NotifyInfo] entity.
6029|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02006030
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006031[[delete-vote-input]]
6032=== DeleteVoteInput
6033The `DeleteVoteInput` entity contains options for the deletion of a
6034vote.
6035
6036[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006037|=============================
6038|Field Name ||Description
6039|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006040The label for which the vote should be deleted. +
6041If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01006042|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006043Notify handling that defines to whom email notifications should be sent
6044after the vote is deleted. +
6045Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6046If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006047|`notify_details`|optional|
6048Additional information about whom to notify about the update as a map
6049of recipient type to link:#notify-info[NotifyInfo] entity.
6050|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006051
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08006052[[description-input]]
6053=== DescriptionInput
6054The `DescriptionInput` entity contains information for setting a description.
6055
6056[options="header",cols="1,6"]
6057|===========================
6058|Field Name |Description
6059|`description` |The description text.
6060|===========================
6061
David Pursehouse882aef22013-06-05 10:56:37 +09006062[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006063=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09006064The `DiffContent` entity contains information about the content differences
6065in a file.
6066
David Pursehouseae367192014-11-25 17:24:47 +09006067[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006068|==========================
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006069|Field Name ||Description
6070|`a` |optional|Content only in the file on side A (deleted in B).
6071|`b` |optional|Content only in the file on side B (added in B).
6072|`ab` |optional|Content in the file on both sides (unchanged).
6073|`edit_a` |only present during a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09006074Text sections deleted from side A as a
6075link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006076|`edit_b` |only present during a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09006077Text sections inserted in side B as a
6078link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006079|`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a
6080rebase.
6081|`skip` |optional|count of lines skipped on both sides when the file is
David Pursehouse882aef22013-06-05 10:56:37 +09006082too large to include all common lines.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006083|`common` |optional|Set to `true` if the region is common according
Shawn Pearce425a2be2014-01-02 16:00:58 -08006084to the requested ignore-whitespace parameter, but a and b contain
6085differing amounts of whitespace. When present and true a and b are
6086used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09006087|==========================
6088
6089[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006090=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006091The `DiffFileMetaInfo` entity contains meta information about a file diff.
6092
David Pursehouseae367192014-11-25 17:24:47 +09006093[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006094|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006095|Field Name ||Description
6096|`name` ||The name of the file.
6097|`content_type`||The content type of the file.
6098|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01006099|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006100Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07006101link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09006102|==========================
6103
6104[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006105=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006106The `DiffInfo` entity contains information about the diff of a file
6107in a revision.
6108
Edwin Kempin8cdce502014-12-06 10:55:38 +01006109If the link:#weblinks-only[weblinks-only] parameter is specified, only
6110the `web_links` field is set.
6111
David Pursehouseae367192014-11-25 17:24:47 +09006112[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006113|==========================
6114|Field Name ||Description
6115|`meta_a` |not present when the file is added|
6116Meta information about the file on side A as a
6117link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6118|`meta_b` |not present when the file is deleted|
6119Meta information about the file on side B as a
6120link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6121|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
6122`COPIED`, `REWRITE`).
6123|`intraline_status`|only set when the `intraline` parameter was specified in the request|
6124Intraline status (`OK`, `ERROR`, `TIMEOUT`).
6125|`diff_header` ||A list of strings representing the patch set diff header.
6126|`content` ||The content differences in the file as a list of
6127link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01006128|`web_links` |optional|
6129Links to the file diff in external sites as a list of
6130link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01006131|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09006132|==========================
6133
6134[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006135=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006136The `DiffIntralineInfo` entity contains information about intraline edits in a
6137file.
6138
David Pursehouse31203f52013-06-08 17:05:45 +09006139The information consists of a list of `<skip length, mark length>` pairs, where
6140the skip length is the number of characters between the end of the previous edit
6141and the start of this edit, and the mark length is the number of edited characters
6142following the skip. The start of the edits is from the beginning of the related
6143diff content lines.
David Pursehouse882aef22013-06-05 10:56:37 +09006144
David Pursehouse31203f52013-06-08 17:05:45 +09006145Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07006146the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09006147
Edwin Kempin8cdce502014-12-06 10:55:38 +01006148[[diff-web-link-info]]
6149=== DiffWebLinkInfo
6150The `DiffWebLinkInfo` entity describes a link on a diff screen to an
6151external site.
6152
6153[options="header",cols="1,6"]
6154|=======================
6155|Field Name|Description
6156|`name` |The link name.
6157|`url` |The link URL.
6158|`image_url`|URL to the icon of the link.
6159|show_on_side_by_side_diff_view|
6160Whether the web link should be shown on the side-by-side diff screen.
6161|show_on_unified_diff_view|
6162Whether the web link should be shown on the unified diff screen.
6163|=======================
6164
David Ostrovsky9ea9c112015-01-25 00:12:38 +01006165[[edit-file-info]]
6166=== EditFileInfo
6167The `EditFileInfo` entity contains additional information
6168of a file within a change edit.
6169
6170[options="header",cols="1,^1,5"]
6171|===========================
6172|Field Name ||Description
6173|`web_links` |optional|
6174Links to the diff info in external sites as a list of
6175link:#web-link-info[WebLinkInfo] entities.
6176|===========================
6177
Edwin Kempin521c1242015-01-23 12:44:44 +01006178[[edit-info]]
6179=== EditInfo
6180The `EditInfo` entity contains information about a change edit.
6181
6182[options="header",cols="1,^1,5"]
6183|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04006184|Field Name ||Description
6185|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01006186link:#commit-info[CommitInfo] entity.
Michael Zhoud03fe282016-04-25 17:13:17 -04006187|`base_revision`||The revision of the patch set the change edit is based on.
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01006188|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006189Information about how to fetch this patch set. The fetch information is
6190provided as a map that maps the protocol name ("`git`", "`http`",
6191"`ssh`") to link:#fetch-info[FetchInfo] entities.
Michael Zhoud03fe282016-04-25 17:13:17 -04006192|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006193The files of the change edit as a map that maps the file names to
6194link:#file-info[FileInfo] entities.
6195|===========================
6196
Edwin Kempine3446292013-02-19 16:40:14 +01006197[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006198=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006199The `FetchInfo` entity contains information about how to fetch a patch
6200set via a certain protocol.
6201
David Pursehouseae367192014-11-25 17:24:47 +09006202[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006203|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02006204|Field Name ||Description
6205|`url` ||The URL of the project.
6206|`ref` ||The ref of the patch set.
6207|`commands` |optional|
6208The download commands for this patch set as a map that maps the command
6209names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09006210Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006211|==========================
6212
6213[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006214=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006215The `FileInfo` entity contains information about a file in a patch set.
6216
David Pursehouseae367192014-11-25 17:24:47 +09006217[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006218|=============================
6219|Field Name ||Description
6220|`status` |optional|
6221The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
6222"`C`"=Copied, "`W`"=Rewritten). +
6223Not set if the file was Modified ("`M`").
6224|`binary` |not set if `false`|Whether the file is binary.
6225|`old_path` |optional|
6226The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05006227Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01006228|`lines_inserted`|optional|
6229Number of inserted lines. +
6230Not set for binary files or if no lines were inserted.
6231|`lines_deleted` |optional|
6232Number of deleted lines. +
6233Not set for binary files or if no lines were deleted.
Edwin Kempin640f9842015-10-08 15:53:20 +02006234|`size_delta` ||
6235Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01006236|`size` ||
6237File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01006238|=============================
6239
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006240[[fix-input]]
6241=== FixInput
6242The `FixInput` entity contains options for fixing commits using the
6243link:#fix-change[fix change] endpoint.
6244
6245[options="header",cols="1,6"]
6246|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006247|Field Name |Description
6248|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006249database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006250|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07006251merged into the destination branch as this exact SHA-1. If not, insert
6252a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006253|==========================
6254
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006255[[fix-suggestion-info]]
6256=== FixSuggestionInfo
6257The `FixSuggestionInfo` entity represents a suggested fix.
6258
6259[options="header",cols="1,^1,5"]
6260|==========================
6261|Field Name ||Description
6262|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
6263fix. It will be generated automatically and hence will be ignored if it's set
6264for input objects.
6265|`description` ||A description of the suggested fix.
6266|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006267entities indicating how the content of one or several files should be modified.
6268Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006269|==========================
6270
6271[[fix-replacement-info]]
6272=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01006273The `FixReplacementInfo` entity describes how the content of a file should be
6274replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006275
6276[options="header",cols="1,6"]
6277|==========================
6278|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006279|`path` |The path of the file which should be modified. Any file in
6280the repository may be modified.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006281|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01006282of the file should be replaced. Lines in the file are assumed to be separated
6283by the line feed character, the carriage return character, the carriage return
6284followed by the line feed character, or one of the other Unicode linebreak
6285sequences supported by Java.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006286|`replacement` |The content which should be used instead of the current one.
6287|==========================
6288
Edwin Kempine3446292013-02-19 16:40:14 +01006289[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006290=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006291The `GitPersonInfo` entity contains information about the
6292author/committer of a commit.
6293
David Pursehouseae367192014-11-25 17:24:47 +09006294[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01006295|==========================
6296|Field Name |Description
6297|`name` |The name of the author/committer.
6298|`email` |The email address of the author/committer.
6299|`date` |The link:rest-api.html#timestamp[timestamp] of when
6300this identity was constructed.
6301|`tz` |The timezone offset from UTC of when this identity was
6302constructed.
6303|==========================
6304
Edwin Kempin521c1242015-01-23 12:44:44 +01006305[[group-base-info]]
6306=== GroupBaseInfo
6307The `GroupBaseInfo` entity contains base information about the group.
6308
6309[options="header",cols="1,6"]
6310|==========================
6311|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01006312|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01006313|`name` |The name of the group.
6314|==========================
6315
David Pursehoused9dac372016-11-24 19:41:10 +09006316[[hashtags-input]]
6317=== HashtagsInput
6318
6319The `HashtagsInput` entity contains information about hashtags to add to,
6320and/or remove from, a change.
6321
6322[options="header",cols="1,^1,5"]
6323|=======================
6324|Field Name||Description
6325|`add` |optional|The list of hashtags to be added to the change.
6326|`remove |optional|The list of hashtags to be removed from the change.
6327|=======================
6328
Edwin Kempin521c1242015-01-23 12:44:44 +01006329[[included-in-info]]
6330=== IncludedInInfo
6331The `IncludedInInfo` entity contains information about the branches a
6332change was merged into and tags it was tagged with.
6333
Edwin Kempin78279ba2015-05-22 15:22:41 +02006334[options="header",cols="1,^1,5"]
6335|=======================
6336|Field Name||Description
6337|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01006338Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02006339|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01006340Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02006341|`external`|optional|A map that maps a name to a list of external
6342systems that include this change, e.g. a list of servers on which this
6343change is deployed.
6344|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01006345
Edwin Kempine3446292013-02-19 16:40:14 +01006346[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006347=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07006348The `LabelInfo` entity contains information about a label on a change, always
6349corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01006350
Dave Borowitz88159512013-06-14 14:21:50 -07006351There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07006352link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07006353
6354* For a quick summary of the state of labels, use `LABELS`.
6355* For detailed information about labels, including exact numeric votes for all
6356 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
6357
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006358==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09006359[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006360|===========================
6361|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006362|`optional` |not set if `false`|
6363Whether the label is optional. Optional means the label may be set, but
6364it's neither necessary for submission nor does it block submission if
6365set.
Dave Borowitz88159512013-06-14 14:21:50 -07006366|===========================
6367
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006368==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09006369[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07006370|===========================
6371|Field Name ||Description
6372|`approved` |optional|One user who approved this label on the change
6373(voted the maximum value) as an
6374link:rest-api-accounts.html#account-info[AccountInfo] entity.
6375|`rejected` |optional|One user who rejected this label on the change
6376(voted the minimum value) as an
6377link:rest-api-accounts.html#account-info[AccountInfo] entity.
6378|`recommended` |optional|One user who recommended this label on the
6379change (voted positively, but not the maximum value) as an
6380link:rest-api-accounts.html#account-info[AccountInfo] entity.
6381|`disliked` |optional|One user who disliked this label on the change
6382(voted negatively, but not the minimum value) as an
6383link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01006384|`blocking` |optional|If `true`, the label blocks submit operation.
6385If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07006386|`value` |optional|The voting value of the user who
6387recommended/disliked this label on the change if it is not
6388"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07006389|`default_value`|optional|The default voting value for the label.
6390This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07006391|===========================
6392
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006393==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09006394[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07006395|===========================
6396|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006397|`all` |optional|List of all approvals for this label as a list
Aaron Gableea8a2112017-04-25 14:18:16 -07006398of link:#approval-info[ApprovalInfo] entities. Items in this list may
6399not represent actual votes cast by users; if a user votes on any label,
6400a corresponding ApprovalInfo will appear in this list for all labels.
Edwin Kempine3446292013-02-19 16:40:14 +01006401|`values` |optional|A map of all values that are allowed for this
6402label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07006403to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01006404|===========================
6405
Saša Živkov499873f2014-05-05 13:34:18 +02006406[[mergeable-info]]
6407=== MergeableInfo
6408The `MergeableInfo` entity contains information about the mergeability of a
6409change.
6410
David Pursehouseae367192014-11-25 17:24:47 +09006411[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02006412|============================
Saša Živkov697cab22014-04-29 16:46:50 +02006413|Field Name ||Description
6414|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02006415Submit type used for this change, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02006416`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Saša Živkov499873f2014-05-05 13:34:18 +02006417`CHERRY_PICK`.
Zhen Chenec13e452016-08-03 23:29:43 -07006418|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006419The strategy of the merge, can be `recursive`, `resolve`,
6420`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02006421|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02006422`true` if this change is cleanly mergeable, `false` otherwise
Zhen Chen8f00d552016-07-26 16:54:59 -07006423|`commit_merged` |optional|
6424`true` if this change is already merged, `false` otherwise
6425|`content_merged` |optional|
6426`true` if the content of this change is already merged, `false` otherwise
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006427|`conflicts`|optional|
6428A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02006429|`mergeable_into`|optional|
6430A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02006431|============================
Dave Borowitz88159512013-06-14 14:21:50 -07006432
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006433[[merge-input]]
6434=== MergeInput
6435The `MergeInput` entity contains information about the merge
6436
6437[options="header",cols="1,^1,5"]
6438|============================
6439|Field Name ||Description
6440|`source` ||
6441The source to merge from, e.g. a complete or abbreviated commit SHA-1,
6442a complete reference name, a short reference name under refs/heads, refs/tags,
6443or refs/remotes namespace, etc.
6444|`strategy` |optional|
6445The strategy of the merge, can be `recursive`, `resolve`,
6446`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
6447|============================
6448
Zhen Chenb1e07e52016-09-23 12:59:48 -07006449[[merge-patch-set-input]]
6450=== MergePatchSetInput
6451The `MergePatchSetInput` entity contains information about updating a new
6452change by creating a new merge commit.
6453
6454[options="header",cols="1,^1,5"]
6455|==================================
6456|Field Name ||Description
6457|`subject` |optional|
6458The new subject for the change, if not specified, will reuse the current patch
6459set's subject
6460|`inheritParent` |optional, default to `false`|
6461Use the current patch set's first parent as the merge tip when set to `true`.
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02006462|`base_change` |optional|
6463A link:#change-id[\{change-id\}] that identifies a change. When `inheritParent`
6464is `false`, the merge tip will be the current patch set of the `base_change` if
6465it's set. Otherwise, the current branch tip of the destination branch will be used.
Zhen Chenb1e07e52016-09-23 12:59:48 -07006466|`merge` ||
6467The detail of the source commit for merge as a link:#merge-input[MergeInput]
6468entity.
6469|==================================
6470
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306471[[move-input]]
6472=== MoveInput
6473The `MoveInput` entity contains information for moving a change to a new branch.
6474
6475[options="header",cols="1,^1,5"]
6476|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04006477|Field Name ||Description
6478|`destination_branch`||Destination branch
6479|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306480A message to be posted in this change's comments
6481|===========================
6482
Edwin Kempincd07df42016-12-01 09:10:09 +01006483[[notify-info]]
6484=== NotifyInfo
6485The `NotifyInfo` entity contains detailed information about who should
6486be notified about an update. These notifications are sent out even if a
6487`notify` option in the request input disables normal notifications.
6488`NotifyInfo` entities are normally contained in a `notify_details` map
6489in the request input where the key is the recipient type. The recipient
6490type can be `TO`, `CC` and `BCC`.
6491
6492[options="header",cols="1,^1,5"]
6493|=======================
6494|Field Name||Description
6495|`accounts`|optional|
6496A list of link:rest-api-accounts.html#account-id[account IDs] that
6497identify the accounts that should be should be notified.
6498|=======================
6499
Edwin Kempin364a86b2017-04-27 12:34:00 +02006500[[private-input]]
6501=== PrivateInput
6502The `PrivateInput` entity contains information for changing the private
6503flag on a change.
6504
6505[options="header",cols="1,^1,5"]
6506|=======================
6507|Field Name||Description
6508|`message` |optional|Message describing why the private flag was changed.
6509|=======================
6510
Edwin Kempin521c1242015-01-23 12:44:44 +01006511[[problem-info]]
6512=== ProblemInfo
6513The `ProblemInfo` entity contains a description of a potential consistency problem
6514with a change. These are not related to the code review process, but rather
6515indicate some inconsistency in Gerrit's database or repository metadata related
6516to the enclosing change.
6517
6518[options="header",cols="1,^1,5"]
6519|===========================
6520|Field Name||Description
6521|`message` ||Plaintext message describing the problem with the change.
6522|`status` |optional|
6523The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
6524fix was attempted.
6525|`outcome` |optional|
6526If `status` is set, an additional plaintext message describing the
6527outcome of the fix.
6528|===========================
6529
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006530[[publish-change-edit-input]]
6531=== PublishChangeEditInput
6532The `PublishChangeEditInput` entity contains options for the publishing of
6533change edit.
6534
6535[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006536|=============================
6537|Field Name ||Description
6538|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006539Notify handling that defines to whom email notifications should be sent
6540after the change edit is published. +
6541Allowed values are `NONE` and `ALL`. +
6542If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006543|`notify_details`|optional|
6544Additional information about whom to notify about the update as a map
6545of recipient type to link:#notify-info[NotifyInfo] entity.
6546|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006547
Patrick Hieselbb84fd72017-08-23 11:11:22 +02006548[[pure-revert-info]]
6549=== PureRevertInfo
6550The `PureRevertInfo` entity describes the result of a pure revert check.
6551
6552[options="header",cols="1,6"]
6553|======================
6554|Field Name |Description
6555|`is_pure_revert` |Outcome of the check as boolean.
6556|======================
6557
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04006558[[push-certificate-info]]
6559=== PushCertificateInfo
6560The `PushCertificateInfo` entity contains information about a push
6561certificate provided when the user pushed for review with `git push
6562--signed HEAD:refs/for/<branch>`. Only used when signed push is
6563link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
6564
6565[options="header",cols="1,6"]
6566|===========================
6567|Field Name|Description
6568|`certificate`|Signed certificate payload and GPG signature block.
6569|`key` |
6570Information about the key that signed the push, along with any problems
6571found while checking the signature or the key itself, as a
6572link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
6573|===========================
6574
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006575[[range-info]]
6576=== RangeInfo
6577The `RangeInfo` entity stores the coordinates of a range.
6578
6579[options="header",cols="1,6"]
6580|===========================
6581|Field Name | Description
6582|`start` | First index.
6583|`end` | Last index.
6584|===========================
6585
Zalan Blenessy874aed72015-01-12 13:26:18 +01006586[[rebase-input]]
6587=== RebaseInput
6588The `RebaseInput` entity contains information for changing parent when rebasing.
6589
6590[options="header",width="50%",cols="1,^1,5"]
6591|===========================
6592|Field Name ||Description
6593|`base` |optional|
6594The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
6595Alternatively, a change number can be specified, in which case the current
6596patch set is inferred. +
6597Empty string is used for rebasing directly on top of the target branch,
6598which effectively breaks dependency towards a parent change.
6599|===========================
6600
Edwin Kempin521c1242015-01-23 12:44:44 +01006601[[related-change-and-commit-info]]
6602=== RelatedChangeAndCommitInfo
6603
6604The `RelatedChangeAndCommitInfo` entity contains information about
6605a related change and commit.
6606
6607[options="header",cols="1,^1,5"]
6608|===========================
6609|Field Name ||Description
Patrick Hieselcab63512017-07-28 10:25:42 +02006610|`project` ||The project of the change or commit.
Edwin Kempin521c1242015-01-23 12:44:44 +01006611|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01006612|`commit` ||The commit as a
6613link:#commit-info[CommitInfo] entity.
6614|`_change_number` |optional|The change number.
6615|`_revision_number` |optional|The revision number.
6616|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07006617|`status` |optional|The status of the change. The status of
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01006618the change is one of (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempin521c1242015-01-23 12:44:44 +01006619|===========================
6620
6621[[related-changes-info]]
6622=== RelatedChangesInfo
6623The `RelatedChangesInfo` entity contains information about related
6624changes.
6625
6626[options="header",cols="1,6"]
6627|===========================
6628|Field Name |Description
6629|`changes` |A list of
6630link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
6631describing the related changes. Sorted by git commit order, newest to
6632oldest. Empty if there are no related changes.
6633|===========================
6634
Edwin Kempined5364b2013-02-22 10:39:33 +01006635[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006636=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01006637The `RestoreInput` entity contains information for restoring a change.
6638
David Pursehouseae367192014-11-25 17:24:47 +09006639[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01006640|===========================
6641|Field Name ||Description
6642|`message` |optional|
6643Message to be added as review comment to the change when restoring the
6644change.
6645|===========================
6646
Edwin Kempind2ec4152013-02-22 12:17:19 +01006647[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006648=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01006649The `RevertInput` entity contains information for reverting a change.
6650
David Pursehouseae367192014-11-25 17:24:47 +09006651[options="header",cols="1,^1,5"]
Edwin Kempind2ec4152013-02-22 12:17:19 +01006652|===========================
6653|Field Name ||Description
6654|`message` |optional|
6655Message to be added as review comment to the change when reverting the
6656change.
6657|===========================
6658
Edwin Kempin67498de2013-02-25 16:15:34 +01006659[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006660=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01006661The `ReviewInfo` entity contains information about a review.
6662
David Pursehouseae367192014-11-25 17:24:47 +09006663[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006664|===========================
6665|Field Name |Description
6666|`labels` |
6667The labels of the review as a map that maps the label names to the
6668voting values.
6669|===========================
6670
Viktar Donich316bf7a2016-07-06 11:29:01 -07006671[[review-update-info]]
6672=== ReviewerUpdateInfo
6673The `ReviewerUpdateInfo` entity contains information about updates to
6674change's reviewers set.
6675
6676[options="header",cols="1,6"]
6677|===========================
6678|Field Name |Description
6679|`updated`|
6680Timestamp of the update.
6681|`updated_by`|
6682The account which modified state of the reviewer in question as
6683link:rest-api-accounts.html#account-info[AccountInfo] entity.
6684|`reviewer`|
6685The reviewer account added or removed from the change as an
6686link:rest-api-accounts.html#account-info[AccountInfo] entity.
6687|`state`|
6688The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
6689|===========================
6690
Edwin Kempin67498de2013-02-25 16:15:34 +01006691[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006692=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01006693The `ReviewInput` entity contains information for adding a review to a
6694revision.
6695
David Pursehouseae367192014-11-25 17:24:47 +09006696[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006697|============================
Bill Wendling692b4ec2015-10-19 15:40:57 -07006698|Field Name ||Description
6699|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006700The message to be added as review comment.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006701|`tag` |optional|
6702Apply this tag to the review comment message, votes, and inline
6703comments. Tags may be used by CI or other automated systems to
6704distinguish them from human reviews. Comments with specific tag
6705values can be filtered out in the web UI.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006706|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006707The votes that should be added to the revision as a map that maps the
6708label names to the voting values.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006709|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006710The comments that should be added as a map that maps a file path to a
6711list of link:#comment-input[CommentInput] entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006712|`robot_comments` |optional|
6713The robot comments that should be added as a map that maps a file path
6714to a list of link:#robot-comment-input[RobotCommentInput] entities.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006715|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006716Draft handling that defines how draft comments are handled that are
6717already in the database but that were not also described in this
6718input. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05006719Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values
6720except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04006721Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05006722If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value
6723besides `KEEP` is allowed.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006724|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006725Notify handling that defines to whom email notifications should be sent
6726after the review is stored. +
6727Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6728If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006729|`notify_details` |optional|
6730Additional information about whom to notify about the update as a map
6731of recipient type to link:#notify-info[NotifyInfo] entity.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006732|`omit_duplicate_comments`|optional|
6733If `true`, comments with the same content at the same place will be omitted.
6734|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07006735link:rest-api-accounts.html#account-id[\{account-id\}] the review
6736should be posted on behalf of. To use this option the caller must
6737have been granted `labelAs-NAME` permission for all keys of labels.
Patrick Hieselcf6d9352017-04-13 10:15:42 +02006738|`reviewers` |optional|
6739A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
6740representing reviewers that should be added to the change.
Logan Hanks53c36012017-06-30 13:47:54 -07006741|`ready` |optional|
6742If true, and if the change is work in progress, then start review.
6743It is an error for both `ready` and `work_in_progress` to be true.
6744|`work_in_progress` |optional|
6745If true, mark the change as work in progress. It is an error for both
6746`ready` and `work_in_progress` to be true.
Edwin Kempin67498de2013-02-25 16:15:34 +01006747|============================
6748
Aaron Gable843b0c12017-04-21 08:25:27 -07006749[[review-result]]
6750=== ReviewResult
6751The `ReviewResult` entity contains information regarding the updates
6752that were made to a review.
6753
6754[options="header",cols="1,^1,5"]
6755|============================
6756|Field Name ||Description
6757|`labels` |optional|
6758Map of labels to values after the review was posted. Null if any reviewer
6759additions were rejected.
6760|`reviewers` |optional|
6761Map of account or group identifier to
6762link:rest-api-changes.html#add-reviewer-result[AddReviewerResult]
6763representing the outcome of adding as a reviewer.
6764Absent if no reviewer additions were requested.
Logan Hankse81ad8e2017-07-18 09:45:46 -07006765|`ready` |optional|
6766If true, the change was moved from WIP to ready for review as a result of this
6767action. Not set if false.
Aaron Gable843b0c12017-04-21 08:25:27 -07006768|============================
6769
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006770[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006771=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006772The `ReviewerInfo` entity contains information about a reviewer and its
6773votes on a change.
6774
Edwin Kempin963dfd02013-02-27 12:39:32 +01006775`ReviewerInfo` has the same fields as
6776link:rest-api-accounts.html#account-info[AccountInfo] and includes
6777link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006778In addition `ReviewerInfo` has the following fields:
6779
David Pursehouseae367192014-11-25 17:24:47 +09006780[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006781|==========================
6782|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006783|`approvals` |
6784The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09006785approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01006786|`_account_id` |
6787This field is inherited from `AccountInfo` but is optional here if an
6788unregistered reviewer was added by email. See
6789link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006790|==========================
6791
Edwin Kempin392328e2013-02-25 12:50:03 +01006792[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006793=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01006794The `ReviewerInput` entity contains information for adding a reviewer
6795to a change.
6796
David Pursehouseae367192014-11-25 17:24:47 +09006797[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006798|=============================
6799|Field Name ||Description
6800|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01006801The link:rest-api-accounts.html#account-id[ID] of one account that
6802should be added as reviewer or the link:rest-api-groups.html#group-id[
6803ID] of one group for which all members should be added as reviewers. +
6804If an ID identifies both an account and a group, only the account is
6805added as reviewer to the change.
Edwin Kempincd07df42016-12-01 09:10:09 +01006806|`state` |optional|
Logan Hanksee0a4182016-07-06 14:39:26 -07006807Add reviewer in this state. Possible reviewer states are `REVIEWER`
6808and `CC`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006809|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01006810Whether adding the reviewer is confirmed. +
6811The Gerrit server may be configured to
6812link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
6813confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01006814|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02006815Notify handling that defines to whom email notifications should be sent
6816after the reviewer is added. +
6817Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6818If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006819|`notify_details`|optional|
6820Additional information about whom to notify about the update as a map
6821of recipient type to link:#notify-info[NotifyInfo] entity.
6822|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01006823
Edwin Kempine3446292013-02-19 16:40:14 +01006824[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006825=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006826The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07006827Not all fields are returned by default. Additional fields can
6828be obtained by adding `o` parameters as described in
6829link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01006830
David Pursehouseae367192014-11-25 17:24:47 +09006831[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006832|===========================
6833|Field Name ||Description
David Pursehouse4de41112016-06-28 09:24:08 +09006834|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
6835`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Edwin Kempine3446292013-02-19 16:40:14 +01006836|`_number` ||The patch set number.
Edwin Kempin04cbd342015-02-19 16:31:22 +01006837|`created` ||
6838The link:rest-api.html#timestamp[timestamp] of when the patch set was
6839created.
6840|`uploader` ||
6841The uploader of the patch set as an
6842link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01006843|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01006844|`fetch` ||
6845Information about how to fetch this patch set. The fetch information is
6846provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07006847"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
6848only included if a plugin implementing the
6849link:intro-project-owner.html#download-commands[download commands]
6850interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07006851|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01006852link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07006853|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01006854The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07006855link:#file-info[FileInfo] entities. Only set if
6856link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
6857option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07006858|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006859Actions the caller might be able to perform on this revision. The
6860information is a map of view name to link:#action-info[ActionInfo]
6861entities.
Khai Dob3139b7532014-09-19 15:13:04 -07006862|`reviewed` |optional|
6863Indicates whether the caller is authenticated and has commented on the
6864current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07006865|`messageWithFooter` |optional|
6866If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
6867this is the current patch set, contains the full commit message with
6868Gerrit-specific commit footers, as if this revision were submitted
6869using the link:project-configuration.html#cherry_pick[Cherry Pick]
6870submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04006871|`push_certificate` |optional|
6872If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
6873contains the push certificate provided by the user when uploading this
6874patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
6875This field is always set if the option is requested; if no push
6876certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07006877|`description` |optional|
6878The description of this patchset, as displayed in the patchset
6879selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01006880|===========================
6881
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006882[[robot-comment-info]]
6883=== RobotCommentInfo
6884The `RobotCommentInfo` entity contains information about a robot inline
6885comment.
6886
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01006887`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006888In addition `RobotCommentInfo` has the following fields:
6889
6890[options="header",cols="1,^1,5"]
6891|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006892|Field Name ||Description
6893|`robot_id` ||The ID of the robot that generated this comment.
6894|`robot_run_id` ||An ID of the run of the robot.
6895|`url` |optional|URL to more information.
6896|`properties` |optional|Robot specific properties as map that maps arbitrary
6897keys to values.
6898|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
6899<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006900|===========================
6901
6902[[robot-comment-input]]
6903=== RobotCommentInput
6904The `RobotCommentInput` entity contains information for creating an inline
6905robot comment.
6906
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01006907`RobotCommentInput` has the same fields as
6908<<robot-comment-info,RobotCommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006909
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006910[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006911=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006912The `RuleInput` entity contains information to test a Prolog rule.
6913
David Pursehouseae367192014-11-25 17:24:47 +09006914[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006915|===========================
6916|Field Name ||Description
6917|`rule`||
6918Prolog code to execute instead of the code in `refs/meta/config`.
6919|`filters`|`RUN` if not set|
6920When `RUN` filter rules in the parent projects are called to
6921post-process the results of the project specific rule. This
6922behavior matches how the rule will execute if installed. +
6923If `SKIP` the parent filters are not called, allowing the test
6924to return results from the input rule.
6925|===========================
6926
Edwin Kempin14b58112013-02-26 16:30:19 +01006927[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006928=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01006929The `SubmitInfo` entity contains information about the change status
6930after submitting.
6931
Stefan Bellere4785b42015-06-18 12:31:03 -07006932[options="header",cols="1,^1,5"]
Edwin Kempin14b58112013-02-26 16:30:19 +01006933|==========================
Stefan Bellere4785b42015-06-18 12:31:03 -07006934|Field Name ||Description
6935|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07006936The status of the change after submitting is `MERGED`.
David Ostrovsky868e3412014-01-30 19:50:57 +01006937|`on_behalf_of`|optional|
6938The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
6939whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09006940have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
6941The user named by `on_behalf_of` does not need to be granted the `Submit`
6942permission. This feature is aimed for CI solutions: the CI account can be
David Pursehousea61ee502016-09-06 16:27:09 +09006943granted both permissions, so individual users don't need `Submit` permission
6944themselves. Still the changes can be submitted on behalf of real users and
David Pursehouse22bd6f92014-02-20 21:11:01 +09006945not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01006946|==========================
6947
Edwin Kempin0eddba02013-02-22 15:30:12 +01006948[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006949=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01006950The `SubmitInput` entity contains information for submitting a change.
6951
David Pursehouseae367192014-11-25 17:24:47 +09006952[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006953|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01006954|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01006955|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05006956If set, submit the change on behalf of the given user. The value may take any
6957format link:rest-api-accounts.html#account-id[accepted by the accounts REST
6958API]. Using this option requires
6959link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
6960permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01006961|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07006962Notify handling that defines to whom email notifications should be sent after
6963the change is submitted. +
6964Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6965If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006966|`notify_details`|optional|
6967Additional information about whom to notify about the update as a map
6968of recipient type to link:#notify-info[NotifyInfo] entity.
6969|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01006970
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006971[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006972=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006973The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02006974Fields in this entity roughly correspond to the fields set by `LABELS`
6975in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006976
David Pursehouseae367192014-11-25 17:24:47 +09006977[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006978|===========================
6979|Field Name ||Description
6980|`status`||
6981`OK`, the change can be submitted. +
6982`NOT_READY`, additional labels are required before submit. +
6983`CLOSED`, closed changes cannot be submitted. +
6984`RULE_ERROR`, rule code failed with an error.
6985|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006986Map of labels that are approved; an
6987link:rest-api-accounts.html#account-info[AccountInfo] identifies the
6988voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006989|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006990Map of labels that are preventing submit;
6991link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006992|`need`|optional|
6993Map of labels that need to be given to submit. The value is
6994currently an empty object.
6995|`may`|optional|
6996Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01006997link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
6998if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006999|`impossible`|optional|
7000Map of labels that should have been in `need` but cannot be
7001used by any user because of access restrictions. The value
7002is currently an empty object.
7003|`error_message`|optional|
7004When status is RULE_ERROR this message provides some text describing
7005the failure of the rule predicate.
7006|===========================
7007
Jonathan Nieder2a629b02016-06-16 15:15:25 -07007008[[submitted-together-info]]
7009=== SubmittedTogetherInfo
7010The `SubmittedTogetherInfo` entity contains information about a
7011collection of changes that would be submitted together.
7012
7013[options="header",cols="1,6"]
7014|===========================
7015|Field Name |Description
7016|`changes` |
7017A list of ChangeInfo entities representing the changes to be submitted together.
7018|`non_visible_changes`|
7019The number of changes to be submitted together that the current user
7020cannot see. (This count includes changes that are visible to the
7021current user when their reason for being submitted together involves
7022changes the user cannot see.)
7023|===========================
7024
Edwin Kempin521c1242015-01-23 12:44:44 +01007025[[suggested-reviewer-info]]
7026=== SuggestedReviewerInfo
7027The `SuggestedReviewerInfo` entity contains information about a reviewer
7028that can be added to a change (an account or a group).
7029
7030`SuggestedReviewerInfo` has either the `account` field that contains
7031the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
7032the `group` field that contains the
7033link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
7034
Logan Hanksab3c81e2016-07-20 15:42:52 -07007035[options="header",cols="1,^1,5"]
7036|===========================
7037|Field Name ||Description
7038|`account` |optional|
7039An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
7040suggestion is an account.
7041|`group` |optional|
7042A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
7043suggestion is a group.
7044|`count` ||
7045The total number of accounts in the suggestion. This is `1` if `account` is
7046present. If `group` is present, the total number of accounts that are
7047members of the group is returned (this count includes members of nested
7048groups).
7049|`confirm` |optional|
7050True if `group` is present and `count` is above the threshold where the
7051`confirmed` flag must be passed to add the group as a reviewer.
7052|===========================
7053
Edwin Kempin64006bb2013-02-22 08:17:04 +01007054[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007055=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01007056The `TopicInput` entity contains information for setting a topic.
7057
David Pursehouseae367192014-11-25 17:24:47 +09007058[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01007059|===========================
7060|Field Name ||Description
7061|`topic` |optional|The topic. +
7062The topic will be deleted if not set.
Edwin Kempin64006bb2013-02-22 08:17:04 +01007063|===========================
7064
Makson Lee3568a932017-08-28 17:12:03 +08007065[[tracking-id-info]]
7066=== TrackingIdInfo
7067The `TrackingIdInfo` entity describes a reference to an external tracking system.
7068
7069[options="header",cols="1,6"]
7070|======================
7071|Field Name|Description
7072|`system` |The name of the external tracking system.
7073|`id` |The tracking id.
7074|======================
7075
Oleg Aravinbf313bb2016-10-24 12:28:56 -07007076[[voting-range-info]]
7077=== VotingRangeInfo
7078The `VotingRangeInfo` entity describes the continuous voting range from min
7079to max values.
7080
7081[options="header",cols="1,6"]
7082|======================
7083|Field Name|Description
7084|`min` |The minimum voting value.
7085|`max` |The maximum voting value.
7086|======================
7087
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007088[[web-link-info]]
7089=== WebLinkInfo
7090The `WebLinkInfo` entity describes a link to an external site.
7091
David Pursehouseae367192014-11-25 17:24:47 +09007092[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007093|======================
7094|Field Name|Description
7095|`name` |The link name.
7096|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02007097|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007098|======================
7099
Alan Tokaev392cfca2017-04-28 11:11:31 +02007100[[work-in-progress-input]]
7101=== WorkInProgressInput
7102The `WorkInProgressInput` entity contains additional information for a change
7103set to WorkInProgress/ReadyForReview.
7104
7105[options="header",cols="1,^1,5"]
7106|=============================
7107|Field Name ||Description
7108|`message` |optional|
7109Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview.
7110|=============================
7111
Edwin Kempind0a63922013-01-23 16:32:59 +01007112GERRIT
7113------
7114Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07007115
7116SEARCHBOX
7117---------