blob: 4165f931b71f34b9addeea3bad1ed7851b3eb9b4 [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
Edwin Kempin088eeb9a2018-01-25 08:39:41 +010019To create a change the calling user must be allowed to
20link:access-control.html#category_push_review[upload to code review].
21
David Ostrovsky837c0ee2014-04-27 12:54:20 +020022.Request
23----
Paladox none4bac1952017-08-03 00:09:25 +000024 POST /changes/ HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +090025 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020026
27 {
28 "project" : "myProject",
29 "subject" : "Let's support 100% Gerrit workflow direct in browser",
30 "branch" : "master",
31 "topic" : "create-change-in-browser",
David Ostrovsky6ffb7d92017-02-13 21:16:58 +010032 "status" : "NEW"
David Ostrovsky837c0ee2014-04-27 12:54:20 +020033 }
34----
35
36As response a link:#change-info[ChangeInfo] entity is returned that describes
37the resulting change.
38
39.Response
40----
Paladox none4bac1952017-08-03 00:09:25 +000041 HTTP/1.1 201 OK
David Ostrovsky837c0ee2014-04-27 12:54:20 +020042 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090043 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020044
45 )]}'
46 {
David Ostrovsky837c0ee2014-04-27 12:54:20 +020047 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
48 "project": "myProject",
49 "branch": "master",
50 "topic": "create-change-in-browser",
51 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
52 "subject": "Let's support 100% Gerrit workflow direct in browser",
David Ostrovsky6ffb7d92017-02-13 21:16:58 +010053 "status": "NEW",
David Ostrovsky837c0ee2014-04-27 12:54:20 +020054 "created": "2014-05-05 07:15:44.639000000",
55 "updated": "2014-05-05 07:15:44.639000000",
56 "mergeable": true,
57 "insertions": 0,
58 "deletions": 0,
David Ostrovsky837c0ee2014-04-27 12:54:20 +020059 "_number": 4711,
60 "owner": {
61 "name": "John Doe"
62 }
63 }
64----
65
Edwin Kempin76202742013-02-15 13:51:50 +010066[[list-changes]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080067=== Query Changes
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080068--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010069'GET /changes/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080070--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010071
Saša Živkovdd804022014-06-23 16:44:03 +020072Queries changes visible to the caller. The
73link:user-search.html#_search_operators[query string] must be provided
74by the `q` parameter. The `n` parameter can be used to limit the
75returned results.
Edwin Kempind0a63922013-01-23 16:32:59 +010076
Edwin Kempine3446292013-02-19 16:40:14 +010077As result a list of link:#change-info[ChangeInfo] entries is returned.
78The change output is sorted by the last update time, most recently
79updated to oldest updated.
80
Edwin Kempind0a63922013-01-23 16:32:59 +010081Query for open changes of watched projects:
Edwin Kempin37440832013-02-06 11:36:00 +010082
83.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010084----
Edwin Kempin2091edb2013-01-23 19:07:38 +010085 GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010086----
Edwin Kempind0a63922013-01-23 16:32:59 +010087
Edwin Kempin37440832013-02-06 11:36:00 +010088.Response
89----
Edwin Kempind0a63922013-01-23 16:32:59 +010090 HTTP/1.1 200 OK
91 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090092 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010093
94 )]}'
John Spurlockd25fad12013-03-09 11:48:49 -050095 [
96 {
John Spurlockd25fad12013-03-09 11:48:49 -050097 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
98 "project": "demo",
99 "branch": "master",
100 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
101 "subject": "One change",
102 "status": "NEW",
103 "created": "2012-07-17 07:18:30.854000000",
104 "updated": "2012-07-17 07:19:27.766000000",
John Spurlockd25fad12013-03-09 11:48:49 -0500105 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100106 "insertions": 26,
107 "deletions": 10,
John Spurlockd25fad12013-03-09 11:48:49 -0500108 "_number": 1756,
109 "owner": {
110 "name": "John Doe"
111 },
Edwin Kempind0a63922013-01-23 16:32:59 +0100112 },
John Spurlockd25fad12013-03-09 11:48:49 -0500113 {
John Spurlockd25fad12013-03-09 11:48:49 -0500114 "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501",
115 "project": "demo",
116 "branch": "master",
117 "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501",
118 "subject": "Another change",
119 "status": "NEW",
120 "created": "2012-07-17 07:18:30.884000000",
121 "updated": "2012-07-17 07:18:30.885000000",
122 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100123 "insertions": 12,
124 "deletions": 18,
John Spurlockd25fad12013-03-09 11:48:49 -0500125 "_number": 1757,
126 "owner": {
127 "name": "John Doe"
128 },
129 "_more_changes": true
130 }
131 ]
Edwin Kempind0a63922013-01-23 16:32:59 +0100132----
133
Sebastian Schuberth02bafe02016-01-20 21:38:11 +0100134If the number of changes matching the query exceeds either the internal
135limit or a supplied `n` query parameter, the last change object has a
David Pursehouse025ea3e2014-09-03 10:47:34 +0900136`_more_changes: true` JSON field set.
137
138The `S` or `start` query parameter can be supplied to skip a number
139of changes from the list.
Edwin Kempind0a63922013-01-23 16:32:59 +0100140
141Clients are allowed to specify more than one query by setting the `q`
142parameter multiple times. In this case the result is an array of
143arrays, one per query in the same order the queries were given in.
144
Edwin Kempina64c4b92013-01-23 11:30:40 +0100145.Query for the 25 most recent open changes of the projects that you watch
146****
147get::/changes/?q=status:open+is:watched&n=25
148****
149
Edwin Kempind0a63922013-01-23 16:32:59 +0100150Query that retrieves changes for a user's dashboard:
Edwin Kempin37440832013-02-06 11:36:00 +0100151
152.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100153----
154 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 +0100155----
Edwin Kempind0a63922013-01-23 16:32:59 +0100156
Edwin Kempin37440832013-02-06 11:36:00 +0100157.Response
158----
Edwin Kempind0a63922013-01-23 16:32:59 +0100159 HTTP/1.1 200 OK
160 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900161 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100162
163 )]}'
164 [
165 [
166 {
Edwin Kempind0a63922013-01-23 16:32:59 +0100167 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
168 "project": "demo",
169 "branch": "master",
170 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
171 "subject": "One change",
172 "status": "NEW",
173 "created": "2012-07-17 07:18:30.854000000",
174 "updated": "2012-07-17 07:19:27.766000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100175 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100176 "insertions": 4,
177 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100178 "_number": 1756,
179 "owner": {
180 "name": "John Doe"
181 },
182 "labels": {
183 "Verified": {},
184 "Code-Review": {}
185 }
186 }
187 ],
188 [],
189 []
190 ]
191----
192
Edwin Kempina64c4b92013-01-23 11:30:40 +0100193.Query the changes for your user dashboard
194****
195get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS
196****
197
David Pursehouse2cf28432016-08-21 23:20:08 +0900198[[query-options]]
Edwin Kempind0a63922013-01-23 16:32:59 +0100199Additional fields can be obtained by adding `o` parameters, each
200option requires more database lookups and slows down the query
201response time to the client so they are generally disabled by
202default. Optional fields are:
203
Edwin Kempine3446292013-02-19 16:40:14 +0100204[[labels]]
205--
Edwin Kempind0a63922013-01-23 16:32:59 +0100206* `LABELS`: a summary of each label required for submit, and
207 approvers that have granted (or rejected) with that label.
Edwin Kempine3446292013-02-19 16:40:14 +0100208--
Edwin Kempind0a63922013-01-23 16:32:59 +0100209
Edwin Kempine3446292013-02-19 16:40:14 +0100210[[detailed-labels]]
211--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800212* `DETAILED_LABELS`: detailed label information, including numeric
Dave Borowitz992ddd72013-02-13 11:53:17 -0800213 values of all existing approvals, recognized label values, values
Edwin Kempin66af3d82015-11-10 17:38:40 -0800214 permitted to be set by the current user, all reviewers by state, and
215 reviewers that may be removed by the current user.
Edwin Kempine3446292013-02-19 16:40:14 +0100216--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800217
Edwin Kempine3446292013-02-19 16:40:14 +0100218[[current-revision]]
219--
Edwin Kempind0a63922013-01-23 16:32:59 +0100220* `CURRENT_REVISION`: describe the current revision (patch set)
221 of the change, including the commit SHA-1 and URLs to fetch from.
Edwin Kempine3446292013-02-19 16:40:14 +0100222--
Edwin Kempind0a63922013-01-23 16:32:59 +0100223
Edwin Kempine3446292013-02-19 16:40:14 +0100224[[all-revisions]]
225--
Edwin Kempind0a63922013-01-23 16:32:59 +0100226* `ALL_REVISIONS`: describe all revisions, not just current.
Edwin Kempine3446292013-02-19 16:40:14 +0100227--
Edwin Kempind0a63922013-01-23 16:32:59 +0100228
David Pursehouse025c1af2015-11-20 17:02:50 +0900229[[download-commands]]
Edwin Kempinea621482013-10-16 12:58:24 +0200230--
231* `DOWNLOAD_COMMANDS`: include the `commands` field in the
232 link:#fetch-info[FetchInfo] for revisions. Only valid when the
233 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
234--
235
Edwin Kempine3446292013-02-19 16:40:14 +0100236[[current-commit]]
237--
Edwin Kempind0a63922013-01-23 16:32:59 +0100238* `CURRENT_COMMIT`: parse and output all header fields from the
David Pursehouse98006e82013-10-02 10:15:52 +0900239 commit object, including message. Only valid when the
240 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100241--
Edwin Kempind0a63922013-01-23 16:32:59 +0100242
Edwin Kempine3446292013-02-19 16:40:14 +0100243[[all-commits]]
244--
Edwin Kempind0a63922013-01-23 16:32:59 +0100245* `ALL_COMMITS`: parse and output all header fields from the
246 output revisions. If only `CURRENT_REVISION` was requested
247 then only the current revision's commit data will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100248--
Edwin Kempind0a63922013-01-23 16:32:59 +0100249
Edwin Kempine3446292013-02-19 16:40:14 +0100250[[current-files]]
251--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100252* `CURRENT_FILES`: list files modified by the commit and magic files,
253 including basic line counts inserted/deleted per file. Only valid
254 when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100255--
Edwin Kempind0a63922013-01-23 16:32:59 +0100256
Edwin Kempine3446292013-02-19 16:40:14 +0100257[[all-files]]
258--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100259* `ALL_FILES`: list files modified by the commit and magic files,
260 including basic line counts inserted/deleted per file. If only the
261 `CURRENT_REVISION` was requested then only that commit's modified
262 files will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100263--
Edwin Kempind0a63922013-01-23 16:32:59 +0100264
Edwin Kempine3446292013-02-19 16:40:14 +0100265[[detailed-accounts]]
266--
Edwin Kempin4a00e222013-10-16 14:34:24 +0200267* `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username`
268 fields when referencing accounts.
Edwin Kempine3446292013-02-19 16:40:14 +0100269--
Dave Borowitz8926a882013-02-01 14:32:48 -0800270
Viktar Donich316bf7a2016-07-06 11:29:01 -0700271[[reviewer-updates]]
272--
273* `REVIEWER_UPDATES`: include updates to reviewers set as
274 link:#review-update-info[ReviewerUpdateInfo] entities.
275--
276
John Spurlock74a70cc2013-03-23 16:41:50 -0400277[[messages]]
278--
279* `MESSAGES`: include messages associated with the change.
280--
281
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700282[[actions]]
283--
284* `CURRENT_ACTIONS`: include information on available actions
Stefan Beller09cd95d2015-02-12 13:40:23 -0800285 for the change and its current revision. Ignored if the caller
286 is not authenticated.
287--
288
289[[change-actions]]
290--
291* `CHANGE_ACTIONS`: include information on available
292 change actions for the change. Ignored if the caller
293 is not authenticated.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700294--
295
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700296[[reviewed]]
297--
Dave Borowitz86669b32015-05-27 14:56:10 -0700298* `REVIEWED`: include the `reviewed` field if all of the following are
299 true:
Ardo Septama505f9ad2016-12-06 16:28:00 +0100300 - the change is open
301 - the caller is authenticated
302 - the caller has commented on the change more recently than the last update
Dave Borowitz86669b32015-05-27 14:56:10 -0700303 from the change owner, i.e. this change would show up in the results of
304 link:user-search.html#reviewedby[reviewedby:self].
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700305--
306
Han-Wen Nienhuys19de6cd2018-01-16 13:15:38 +0100307[[skip_mergeable]]
308--
309* `SKIP_MERGEABLE`: skip the `mergeable` field in
310link:#change-info[ChangeInfo]. For fast moving projects, this field must
311be recomputed often, which is slow for projects with big trees.
Patrick Hieseldb8df482019-01-24 10:11:23 +0100312+
David Pursehouseec176922019-02-05 12:31:29 +0900313When link:config-gerrit.html#change.api.excludeMergeableInChangeInfo[
314`change.api.excludeMergeableInChangeInfo`] is set in the `gerrit.config`,
315the `mergeable` field will always be omitted and `SKIP_MERGEABLE` has no
316effect.
317+
318A change's mergeability can be requested separately by calling the
319link:#get-mergeable[get-mergeable] endpoint.
Alice Kober-Sotzeka19fd752018-01-19 15:31:46 +0100320--
Gal Paikin3a2aa012019-06-21 18:30:01 +0200321[[skip_diffstat]]
322--
323* `SKIP_DIFFSTAT`: skip the 'insertions' and 'deletions' field in link:#change-info[ChangeInfo].
324 For large trees, their computation may be expensive.
325--
Han-Wen Nienhuys19de6cd2018-01-16 13:15:38 +0100326
Jonathan Niedercb51d742016-09-23 11:37:57 -0700327[[submittable]]
328--
Jonathan Niederad5240f2016-10-04 11:03:23 -0700329* `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo],
Jonathan Niedercb51d742016-09-23 11:37:57 -0700330 which can be used to tell if the change is reviewed and ready for submit.
331--
332
Khai Do2a23ec82014-09-19 16:33:02 -0700333[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100334--
Sven Selbergd26bd542014-11-21 16:28:10 +0100335* `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo],
336 therefore only valid in combination with `CURRENT_COMMIT` or
337 `ALL_COMMITS`.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100338--
339
Dave Borowitz4c46c242014-12-03 16:46:45 -0800340[[check]]
341--
342* `CHECK`: include potential problems with the change.
343--
344
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700345[[commit-footers]]
346--
347* `COMMIT_FOOTERS`: include the full commit message with
348 Gerrit-specific commit footers in the
349 link:#revision-info[RevisionInfo].
Yuxuan 'fishy' Wang16baf212015-05-05 16:49:55 -0700350--
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700351
Dave Borowitz6f58dbe2015-09-14 12:34:31 -0400352[[push-certificates]]
353--
354* `PUSH_CERTIFICATES`: include push certificate information in the
355 link:#revision-info[RevisionInfo]. Ignored if signed push is not
356 link:config-gerrit.html#receive.enableSignedPush[enabled] on the
357 server.
358--
359
Makson Lee3568a932017-08-28 17:12:03 +0800360[[tracking-ids]]
361--
362* `TRACKING_IDS`: include references to external tracking systems
363 as link:#tracking-id-info[TrackingIdInfo].
364--
365
Martin Fickb186cd72018-12-02 23:34:23 -0700366[[no-limit]]
367--
368* `NO-LIMIT`: Return all results
369--
370
Edwin Kempin37440832013-02-06 11:36:00 +0100371.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100372----
Edwin Kempinea621482013-10-16 12:58:24 +0200373 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 +0100374----
Edwin Kempind0a63922013-01-23 16:32:59 +0100375
Edwin Kempin37440832013-02-06 11:36:00 +0100376.Response
377----
Edwin Kempind0a63922013-01-23 16:32:59 +0100378 HTTP/1.1 200 OK
379 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900380 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100381
382 )]}'
383 [
384 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900385 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100386 "project": "gerrit",
387 "branch": "master",
388 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
389 "subject": "Use an EventBus to manage star icons",
390 "status": "NEW",
391 "created": "2012-04-25 00:52:25.580000000",
392 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100393 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100394 "insertions": 16,
395 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100396 "_number": 97,
397 "owner": {
398 "name": "Shawn Pearce"
399 },
400 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
401 "revisions": {
402 "184ebe53805e102605d11f6b143486d15c23a09c": {
David Pursehouse4de41112016-06-28 09:24:08 +0900403 "kind": "REWORK",
Edwin Kempind0a63922013-01-23 16:32:59 +0100404 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100405 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100406 "fetch": {
407 "git": {
408 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200409 "ref": "refs/changes/97/97/1",
410 "commands": {
411 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
412 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
413 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
414 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
415 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100416 },
417 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200418 "url": "http://myuser@127.0.0.1:8080/gerrit",
419 "ref": "refs/changes/97/97/1",
420 "commands": {
421 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
422 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
423 "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",
424 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
425 }
426 },
427 "ssh": {
428 "url": "ssh://myuser@*:29418/gerrit",
429 "ref": "refs/changes/97/97/1",
430 "commands": {
431 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
432 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
433 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
434 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
435 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100436 }
437 },
438 "commit": {
439 "parents": [
440 {
441 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
442 "subject": "Migrate contributor agreements to All-Projects."
443 }
444 ],
445 "author": {
446 "name": "Shawn O. Pearce",
447 "email": "sop@google.com",
448 "date": "2012-04-24 18:08:08.000000000",
449 "tz": -420
450 },
451 "committer": {
452 "name": "Shawn O. Pearce",
453 "email": "sop@google.com",
454 "date": "2012-04-24 18:08:08.000000000",
455 "tz": -420
456 },
457 "subject": "Use an EventBus to manage star icons",
458 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
459 },
460 "files": {
461 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200462 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100463 "size_delta": -412,
464 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100465 },
466 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200467 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100468 "size_delta": 23,
469 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100470 },
471 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
472 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200473 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100474 "size_delta": -298,
475 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100476 },
477 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
478 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200479 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100480 "size_delta": 132,
481 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100482 },
483 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
484 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200485 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100486 "size_delta": -5512,
487 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100488 },
489 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
490 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200491 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100492 "size_delta": 8345,
493 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100494 },
495 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200496 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100497 "size_delta": -343,
498 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100499 }
500 }
501 }
502 }
503 }
504 ]
505----
506
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100507[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800508=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800509--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100510'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800511--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100512
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100513Retrieves a change.
514
Dave Borowitz0314f732013-10-03 09:34:30 -0700515Additional fields can be obtained by adding `o` parameters, each
516option requires more database lookups and slows down the query
517response time to the client so they are generally disabled by
518default. Fields are described in link:#list-changes[Query Changes].
519
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100520.Request
521----
522 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
523----
524
525As response a link:#change-info[ChangeInfo] entity is returned that
526describes the change.
527
528.Response
529----
530 HTTP/1.1 200 OK
531 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900532 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100533
534 )]}'
535 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100536 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
537 "project": "myProject",
538 "branch": "master",
539 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
540 "subject": "Implementing Feature X",
541 "status": "NEW",
542 "created": "2013-02-01 09:59:32.126000000",
543 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100544 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100545 "insertions": 34,
546 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100547 "_number": 3965,
548 "owner": {
549 "name": "John Doe"
550 }
551 }
552----
553
Edwin Kempin8e492202013-02-21 15:38:25 +0100554[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800555=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800556--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100557'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800558--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100559
Edwin Kempin8e492202013-02-21 15:38:25 +0100560Retrieves a change with link:#labels[labels], link:#detailed-labels[
Viktar Donich316bf7a2016-07-06 11:29:01 -0700561detailed labels], link:#detailed-accounts[detailed accounts],
562link:#reviewer-updates[reviewer updates], and link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100563
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700564Additional fields can be obtained by adding `o` parameters, each
565option requires more database lookups and slows down the query
566response time to the client so they are generally disabled by
567default. Fields are described in link:#list-changes[Query Changes].
568
Edwin Kempin8e492202013-02-21 15:38:25 +0100569.Request
570----
571 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
572----
573
574As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700575describes the change. This response will contain all votes for each
576label and include one combined vote. The combined label vote is
577calculated in the following order (from highest to lowest):
578REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100579
580.Response
581----
582 HTTP/1.1 200 OK
583 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900584 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100585
586 )]}'
587 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100588 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
589 "project": "myProject",
590 "branch": "master",
591 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
592 "subject": "Implementing Feature X",
593 "status": "NEW",
594 "created": "2013-02-01 09:59:32.126000000",
595 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100596 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100597 "insertions": 126,
598 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100599 "_number": 3965,
600 "owner": {
601 "_account_id": 1000096,
602 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200603 "email": "john.doe@example.com",
604 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100605 },
606 "labels": {
607 "Verified": {
608 "all": [
609 {
610 "value": 0,
611 "_account_id": 1000096,
612 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200613 "email": "john.doe@example.com",
614 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100615 },
616 {
617 "value": 0,
618 "_account_id": 1000097,
619 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200620 "email": "jane.roe@example.com",
621 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100622 }
623 ],
624 "values": {
625 "-1": "Fails",
626 " 0": "No score",
627 "+1": "Verified"
628 }
629 },
630 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100631 "disliked": {
632 "_account_id": 1000096,
633 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200634 "email": "john.doe@example.com",
635 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100636 },
637 "all": [
638 {
639 "value": -1,
640 "_account_id": 1000096,
641 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200642 "email": "john.doe@example.com",
643 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100644 },
645 {
646 "value": 1,
647 "_account_id": 1000097,
648 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200649 "email": "jane.roe@example.com",
650 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100651 }
652 ]
653 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +0400654 "-2": "This shall not be merged",
655 "-1": "I would prefer this is not merged as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100656 " 0": "No score",
657 "+1": "Looks good to me, but someone else must approve",
658 "+2": "Looks good to me, approved"
659 }
660 }
661 },
662 "permitted_labels": {
663 "Verified": [
664 "-1",
665 " 0",
666 "+1"
667 ],
668 "Code-Review": [
669 "-2",
670 "-1",
671 " 0",
672 "+1",
673 "+2"
674 ]
675 },
676 "removable_reviewers": [
677 {
678 "_account_id": 1000096,
679 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200680 "email": "john.doe@example.com",
681 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100682 },
683 {
684 "_account_id": 1000097,
685 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200686 "email": "jane.roe@example.com",
687 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100688 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400689 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800690 "reviewers": {
691 "REVIEWER": [
692 {
693 "_account_id": 1000096,
694 "name": "John Doe",
695 "email": "john.doe@example.com",
696 "username": "jdoe"
697 },
698 {
699 "_account_id": 1000097,
700 "name": "Jane Roe",
701 "email": "jane.roe@example.com",
702 "username": "jroe"
703 }
704 ]
705 },
Viktar Donich316bf7a2016-07-06 11:29:01 -0700706 "reviewer_updates": [
707 {
708 "state": "REVIEWER",
709 "reviewer": {
710 "_account_id": 1000096,
711 "name": "John Doe",
712 "email": "john.doe@example.com",
713 "username": "jdoe"
714 },
715 "updated_by": {
716 "_account_id": 1000096,
717 "name": "John Doe",
718 "email": "john.doe@example.com",
719 "username": "jdoe"
720 },
721 "updated": "2016-07-21 20:12:39.000000000"
722 },
723 {
724 "state": "REMOVED",
725 "reviewer": {
726 "_account_id": 1000096,
727 "name": "John Doe",
728 "email": "john.doe@example.com",
729 "username": "jdoe"
730 },
731 "updated_by": {
732 "_account_id": 1000096,
733 "name": "John Doe",
734 "email": "john.doe@example.com",
735 "username": "jdoe"
736 },
737 "updated": "2016-07-21 20:12:33.000000000"
738 },
739 {
740 "state": "CC",
741 "reviewer": {
742 "_account_id": 1000096,
743 "name": "John Doe",
744 "email": "john.doe@example.com",
745 "username": "jdoe"
746 },
747 "updated_by": {
748 "_account_id": 1000096,
749 "name": "John Doe",
750 "email": "john.doe@example.com",
751 "username": "jdoe"
752 },
753 "updated": "2016-03-23 21:34:02.419000000",
754 },
755 ],
John Spurlock74a70cc2013-03-23 16:41:50 -0400756 "messages": [
757 {
758 "id": "YH-egE",
759 "author": {
760 "_account_id": 1000096,
761 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200762 "email": "john.doe@example.com",
763 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400764 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100765 "date": "2013-03-23 21:34:02.419000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400766 "message": "Patch Set 1:\n\nThis is the first message.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100767 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400768 },
769 {
770 "id": "WEEdhU",
771 "author": {
772 "_account_id": 1000097,
773 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200774 "email": "jane.roe@example.com",
775 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400776 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100777 "date": "2013-03-23 21:36:52.332000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400778 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100779 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400780 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100781 ]
782 }
783----
784
Aaron Gable9b413072017-08-24 13:15:21 -0700785[[create-merge-patch-set-for-change]]
786=== Create Merge Patch Set For Change
787--
788'POST /changes/link:#change-id[\{change-id\}]/merge'
789--
790
791Update an existing change by using a
792link:#merge-patch-set-input[MergePatchSetInput] entity.
793
794Gerrit will create a merge commit based on the information of
795MergePatchSetInput and add a new patch set to the change corresponding
796to the new merge commit.
797
798.Request
799----
800 POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0
801 Content-Type: application/json; charset=UTF-8
802
803 {
804 "subject": "Merge dev_branch into master",
805 "merge": {
David Pursehousef4fb1042018-03-18 23:03:46 +0900806 "source": "refs/changes/34/1234/1"
Aaron Gable9b413072017-08-24 13:15:21 -0700807 }
808 }
809----
810
811As response a link:#change-info[ChangeInfo] entity with current revision is
812returned that describes the resulting change.
813
814.Response
815----
816 HTTP/1.1 200 OK
817 Content-Disposition: attachment
818 Content-Type: application/json; charset=UTF-8
819
820 )]}'
821 {
822 "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc",
823 "project": "test",
824 "branch": "master",
825 "hashtags": [],
826 "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc",
827 "subject": "Merge dev_branch into master",
828 "status": "NEW",
829 "created": "2016-09-23 18:08:53.238000000",
830 "updated": "2016-09-23 18:09:25.934000000",
831 "submit_type": "MERGE_IF_NECESSARY",
832 "mergeable": true,
833 "insertions": 5,
834 "deletions": 0,
835 "_number": 72,
836 "owner": {
837 "_account_id": 1000000
838 },
839 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822"
840 }
841----
842
843[[set-message]]
844=== Set Commit Message
845--
846'PUT /changes/link:#change-id[\{change-id\}]/message'
847--
848
849Creates a new patch set with a new commit message.
850
851The new commit message must be provided in the request body inside a
Han-Wen Nienhuys098580a2019-07-24 20:17:41 +0200852link:#commit-message-input[CommitMessageInput] entity. If a Change-Id
853footer is specified, it must match the current Change-Id footer. If
854the Change-Id footer is absent, the current Change-Id is added to the
855message.
Aaron Gable9b413072017-08-24 13:15:21 -0700856
857.Request
858----
859 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0
860 Content-Type: application/json; charset=UTF-8
861
862 {
863 "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n"
864 }
865----
866
867.Notifications
868
869An email will be sent using the "newpatchset" template.
870
871[options="header",cols="1,1"]
872|=============================
873|WIP State |Default
874|Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers
875|Work in progress|owner
876|=============================
877
Edwin Kempin64006bb2013-02-22 08:17:04 +0100878[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800879=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800880--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100881'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800882--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100883
Edwin Kempin64006bb2013-02-22 08:17:04 +0100884Retrieves the topic of a change.
885
886.Request
887----
888 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
889----
890
891.Response
892----
893 HTTP/1.1 200 OK
894 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900895 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100896
897 )]}'
898 "Documentation"
899----
900
901If the change does not have a topic an empty string is returned.
902
903[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800904=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800905--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100906'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800907--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100908
Edwin Kempin64006bb2013-02-22 08:17:04 +0100909Sets the topic of a change.
910
911The new topic must be provided in the request body inside a
Patrick Hiesel4aa14562018-06-19 15:07:50 +0200912link:#topic-input[TopicInput] entity. Any leading or trailing whitespace
913in the topic name will be removed.
Edwin Kempin64006bb2013-02-22 08:17:04 +0100914
915.Request
916----
917 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900918 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100919
920 {
921 "topic": "Documentation"
922 }
923----
924
925As response the new topic is returned.
926
927.Response
928----
929 HTTP/1.1 200 OK
930 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900931 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100932
933 )]}'
934 "Documentation"
935----
936
937If the topic was deleted the response is "`204 No Content`".
938
939[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800940=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800941--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100942'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800943--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100944
Edwin Kempin64006bb2013-02-22 08:17:04 +0100945Deletes the topic of a change.
946
Edwin Kempin64006bb2013-02-22 08:17:04 +0100947.Request
948----
949 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
950----
951
952.Response
953----
954 HTTP/1.1 204 No Content
955----
956
Sven Selberg273a4aa2016-09-21 16:28:10 +0200957[[get-assignee]]
958=== Get Assignee
959--
960'GET /changes/link:#change-id[\{change-id\}]/assignee'
961--
962
963Retrieves the account of the user assigned to a change.
964
965.Request
966----
967 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
968----
969
970As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
971describing the assigned account is returned.
972
973.Response
974----
975 HTTP/1.1 200 OK
976 Content-Disposition: attachment
977 Content-Type: application/json; charset=UTF-8
978
979 )]}'
980 {
981 "_account_id": 1000096,
982 "name": "John Doe",
983 "email": "john.doe@example.com",
984 "username": "jdoe"
985 }
986----
987
988If the change has no assignee the response is "`204 No Content`".
989
990[[get-past-assignees]]
991=== Get Past Assignees
992--
993'GET /changes/link:#change-id[\{change-id\}]/past_assignees'
994--
995
996Returns a list of every user ever assigned to a change, in the order in which
997they were first assigned.
998
David Pursehouse90e452c2017-08-25 13:20:20 +0900999[NOTE] Past assignees are only available when NoteDb is enabled.
1000
Sven Selberg273a4aa2016-09-21 16:28:10 +02001001.Request
1002----
1003 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/past_assignees HTTP/1.0
1004----
1005
1006As a response a list of link:rest-api-accounts.html#account-info[AccountInfo]
1007entities is returned.
1008
1009.Response
1010----
1011 HTTP/1.1 200 OK
1012 Content-Disposition: attachment
1013 Content-Type: application/json; charset=UTF-8
1014
1015 )]}'
1016 [
1017 {
1018 "_account_id": 1000051,
1019 "name": "Jane Doe",
1020 "email": "jane.doe@example.com",
1021 "username": "janed"
1022 },
1023 {
1024 "_account_id": 1000096,
1025 "name": "John Doe",
1026 "email": "john.doe@example.com",
1027 "username": "jdoe"
1028 }
1029 ]
1030
1031----
1032
1033
1034[[set-assignee]]
1035=== Set Assignee
1036--
1037'PUT /changes/link:#change-id[\{change-id\}]/assignee'
1038--
1039
1040Sets the assignee of a change.
1041
1042The new assignee must be provided in the request body inside a
1043link:#assignee-input[AssigneeInput] entity.
1044
1045.Request
1046----
1047 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1048 Content-Type: application/json; charset=UTF-8
1049
1050 {
1051 "assignee": "jdoe"
1052 }
1053----
1054
1055As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1056describing the assigned account is returned.
1057
1058.Response
1059----
1060 HTTP/1.1 200 OK
1061 Content-Disposition: attachment
1062 Content-Type: application/json; charset=UTF-8
1063
1064 )]}'
1065 {
1066 "_account_id": 1000096,
1067 "name": "John Doe",
1068 "email": "john.doe@example.com",
1069 "username": "jdoe"
1070 }
1071----
1072
1073[[delete-assignee]]
1074=== Delete Assignee
1075--
1076'DELETE /changes/link:#change-id[\{change-id\}]/assignee'
1077--
1078
1079Deletes the assignee of a change.
1080
1081
1082.Request
1083----
1084 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1085----
1086
1087As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1088describing the account of the deleted assignee is returned.
1089
1090.Response
1091----
1092 HTTP/1.1 200 OK
1093 Content-Disposition: attachment
1094 Content-Type: application/json; charset=UTF-8
1095
1096 )]}'
1097 {
1098 "_account_id": 1000096,
1099 "name": "John Doe",
1100 "email": "john.doe@example.com",
1101 "username": "jdoe"
1102 }
1103----
1104
1105If the change had no assignee the response is "`204 No Content`".
1106
Patrick Hieselbb84fd72017-08-23 11:11:22 +02001107[[get-pure-revert]]
1108=== Get Pure Revert
1109--
1110'GET /changes/link:#change-id[\{change-id\}]/pure_revert'
1111--
1112
1113Check if the given change is a pure revert of the change it references in `revertOf`.
1114Optionally, the query parameter `o` can be passed in to specify a commit (SHA1 in
111540 digit hex representation) to check against. It takes precedence over `revertOf`.
1116If the change has no reference in `revertOf`, the parameter is mandatory.
1117
1118As response a link:#pure-revert-info[PureRevertInfo] entity is returned.
1119
1120.Request
1121----
1122 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0
1123----
1124
1125.Response
1126----
1127 HTTP/1.1 200 OK
1128 Content-Disposition: attachment
1129 Content-Type: application/json; charset=UTF-8
1130
1131 )]}'
1132 {
1133 "is_pure_revert" : false
1134 }
1135----
1136
Edwin Kempined5364b2013-02-22 10:39:33 +01001137[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001138=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001139--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001140'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001141--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001142
Edwin Kempined5364b2013-02-22 10:39:33 +01001143Abandons a change.
1144
1145The request body does not need to include a link:#abandon-input[
1146AbandonInput] entity if no review comment is added.
1147
1148.Request
1149----
1150 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
1151----
1152
1153As response a link:#change-info[ChangeInfo] entity is returned that
1154describes the abandoned change.
1155
1156.Response
1157----
1158 HTTP/1.1 200 OK
1159 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001160 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001161
1162 )]}'
1163 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001164 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1165 "project": "myProject",
1166 "branch": "master",
1167 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1168 "subject": "Implementing Feature X",
1169 "status": "ABANDONED",
1170 "created": "2013-02-01 09:59:32.126000000",
1171 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001172 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001173 "insertions": 3,
1174 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +01001175 "_number": 3965,
1176 "owner": {
1177 "name": "John Doe"
1178 }
1179 }
1180----
1181
1182If the change cannot be abandoned because the change state doesn't
1183allow abandoning of the change, the response is "`409 Conflict`" and
1184the error message is contained in the response body.
1185
1186.Response
1187----
1188 HTTP/1.1 409 Conflict
1189 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001190 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001191
1192 change is merged
1193----
1194
Logan Hankse43b68e2017-05-23 13:16:22 -07001195.Notifications
1196
1197An email will be sent using the "abandon" template. The notify handling is ALL.
1198Notifications are suppressed on WIP changes that have never started review.
1199
Logan Hanks87607412017-05-30 13:49:04 -07001200[options="header",cols="1,2"]
Logan Hankse43b68e2017-05-23 13:16:22 -07001201|=============================
Logan Hanks87607412017-05-30 13:49:04 -07001202|WIP State |notify=ALL
Logan Hankse43b68e2017-05-23 13:16:22 -07001203|Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1204|Work in progress|not sent
1205|Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1206|=============================
1207
Edwin Kempined5364b2013-02-22 10:39:33 +01001208[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001209=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001210--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001211'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001212--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001213
Edwin Kempined5364b2013-02-22 10:39:33 +01001214Restores a change.
1215
1216The request body does not need to include a link:#restore-input[
1217RestoreInput] entity if no review comment is added.
1218
1219.Request
1220----
1221 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1222----
1223
1224As response a link:#change-info[ChangeInfo] entity is returned that
1225describes the restored change.
1226
1227.Response
1228----
1229 HTTP/1.1 200 OK
1230 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001231 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001232
1233 )]}'
1234 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001235 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1236 "project": "myProject",
1237 "branch": "master",
1238 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1239 "subject": "Implementing Feature X",
1240 "status": "NEW",
1241 "created": "2013-02-01 09:59:32.126000000",
1242 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001243 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001244 "insertions": 2,
1245 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001246 "_number": 3965,
1247 "owner": {
1248 "name": "John Doe"
1249 }
1250 }
1251----
1252
1253If the change cannot be restored because the change state doesn't
1254allow restoring the change, the response is "`409 Conflict`" and
1255the error message is contained in the response body.
1256
1257.Response
1258----
1259 HTTP/1.1 409 Conflict
1260 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001261 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001262
1263 change is new
1264----
1265
Edwin Kempincdae63b2013-03-15 15:06:59 +01001266[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001267=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001268--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001269'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001270--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001271
1272Rebases a change.
1273
Zalan Blenessy874aed72015-01-12 13:26:18 +01001274Optionally, the parent revision can be changed to another patch set through the
1275link:#rebase-input[RebaseInput] entity.
1276
Edwin Kempincdae63b2013-03-15 15:06:59 +01001277.Request
1278----
1279 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001280 Content-Type: application/json;charset=UTF-8
1281
1282 {
1283 "base" : "1234",
1284 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001285----
1286
1287As response a link:#change-info[ChangeInfo] entity is returned that
1288describes the rebased change. Information about the current patch set
1289is included.
1290
1291.Response
1292----
1293 HTTP/1.1 200 OK
1294 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001295 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001296
1297 )]}'
1298 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001299 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1300 "project": "myProject",
1301 "branch": "master",
1302 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1303 "subject": "Implement Feature X",
1304 "status": "NEW",
1305 "created": "2013-02-01 09:59:32.126000000",
1306 "updated": "2013-02-21 11:16:36.775000000",
1307 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001308 "insertions": 33,
1309 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001310 "_number": 4799,
1311 "owner": {
1312 "name": "John Doe"
1313 },
1314 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1315 "revisions": {
1316 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001317 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001318 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001319 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001320 "fetch": {
1321 "http": {
1322 "url": "http://gerrit:8080/myProject",
1323 "ref": "refs/changes/99/4799/2"
1324 }
1325 },
1326 "commit": {
1327 "parents": [
1328 {
1329 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1330 "subject": "Implement Feature A"
1331 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001332 ],
1333 "author": {
1334 "name": "John Doe",
1335 "email": "john.doe@example.com",
1336 "date": "2013-05-07 15:21:27.000000000",
1337 "tz": 120
1338 },
1339 "committer": {
1340 "name": "Gerrit Code Review",
1341 "email": "gerrit-server@example.com",
1342 "date": "2013-05-07 15:35:43.000000000",
1343 "tz": 120
1344 },
1345 "subject": "Implement Feature X",
1346 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001347 }
1348 }
1349 }
1350----
1351
1352If the change cannot be rebased, e.g. due to conflicts, the response is
1353"`409 Conflict`" and the error message is contained in the response
1354body.
1355
1356.Response
1357----
1358 HTTP/1.1 409 Conflict
1359 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001360 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001361
1362 The change could not be rebased due to a path conflict during merge.
1363----
1364
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301365[[move-change]]
1366=== Move Change
1367--
1368'POST /changes/link:#change-id[\{change-id\}]/move'
1369--
1370
1371Move a change.
1372
1373The destination branch must be provided in the request body inside a
1374link:#move-input[MoveInput] entity.
1375
1376.Request
1377----
1378 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1379 Content-Type: application/json; charset=UTF-8
1380
1381 {
1382 "destination_branch" : "release-branch"
1383 }
1384
1385----
1386
1387As response a link:#change-info[ChangeInfo] entity is returned that
1388describes the moved change.
1389
1390.Response
1391----
1392 HTTP/1.1 200 OK
1393 Content-Disposition: attachment
1394 Content-Type: application/json; charset=UTF-8
1395
1396 )]}'
1397 {
1398 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1399 "project": "myProject",
1400 "branch": "release-branch",
1401 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1402 "subject": "Implementing Feature X",
1403 "status": "NEW",
1404 "created": "2013-02-01 09:59:32.126000000",
1405 "updated": "2013-02-21 11:16:36.775000000",
1406 "mergeable": true,
1407 "insertions": 2,
1408 "deletions": 13,
1409 "_number": 3965,
1410 "owner": {
1411 "name": "John Doe"
1412 }
1413 }
1414----
1415
Changcheng Xiao6dc90422017-08-09 10:21:58 +02001416Note that this endpoint will not update the change's parents, which is
1417different from the link:#cherry-pick[cherry-pick] endpoint.
1418
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301419If the change cannot be moved because the change state doesn't
1420allow moving the change, the response is "`409 Conflict`" and
1421the error message is contained in the response body.
1422
1423.Response
1424----
1425 HTTP/1.1 409 Conflict
1426 Content-Disposition: attachment
1427 Content-Type: text/plain; charset=UTF-8
1428
1429 change is merged
1430----
1431
1432If the change cannot be moved because the user doesn't have
1433abandon permission on the change or upload permission on the destination,
1434the response is "`409 Conflict`" and the error message is contained in the
1435response body.
1436
1437.Response
1438----
1439 HTTP/1.1 409 Conflict
1440 Content-Disposition: attachment
1441 Content-Type: text/plain; charset=UTF-8
1442
1443 move not permitted
1444----
1445
Edwin Kempind2ec4152013-02-22 12:17:19 +01001446[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001447=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001448--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001449'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001450--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001451
Edwin Kempind2ec4152013-02-22 12:17:19 +01001452Reverts a change.
1453
1454The request body does not need to include a link:#revert-input[
1455RevertInput] entity if no review comment is added.
1456
1457.Request
1458----
Michael Zhou10270492016-03-24 22:35:40 -04001459 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001460----
1461
1462As response a link:#change-info[ChangeInfo] entity is returned that
1463describes the reverting change.
1464
1465.Response
1466----
1467 HTTP/1.1 200 OK
1468 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001469 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001470
1471 )]}'
1472 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001473 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1474 "project": "myProject",
1475 "branch": "master",
1476 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1477 "subject": "Revert \"Implementing Feature X\"",
1478 "status": "NEW",
1479 "created": "2013-02-01 09:59:32.126000000",
1480 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001481 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001482 "insertions": 6,
1483 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001484 "_number": 3965,
1485 "owner": {
1486 "name": "John Doe"
1487 }
1488 }
1489----
1490
1491If the change cannot be reverted because the change state doesn't
1492allow reverting the change, the response is "`409 Conflict`" and
1493the error message is contained in the response body.
1494
1495.Response
1496----
1497 HTTP/1.1 409 Conflict
1498 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001499 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001500
1501 change is new
1502----
1503
Gal Paikinb81f56c2019-10-16 14:39:24 +02001504[[revert-submission]]
1505=== Revert Submission
1506--
1507'POST /changes/link:#change-id[\{change-id\}]/revert_submission'
1508--
1509
1510Creates open revert changes for all of the changes of a certain submission.
1511
1512Details for the revert can be specified in the request body inside a link:#revert-input[
1513RevertInput] The topic of all created revert changes will be
1514`revert-{submission_id}-{random_string_of_size_10}`.
1515
1516The changes will not be rebased on onto the destination branch so the users may still
1517have to manually rebase them to resolve conflicts and make them submittable.
1518
1519.Request
1520----
1521 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0
1522----
1523
1524As response link:#revert-submission-info[RevertSubmissionInfo] entity
1525is returned. That entity describes the revert changes.
1526
1527.Response
1528----
1529 HTTP/1.1 200 OK
1530 Content-Disposition: attachment
1531 Content-Type: application/json; charset=UTF-8
1532
1533 )]}'
1534 "revert_changes":
1535 [
1536 {
1537 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1538 "project": "myProject",
1539 "branch": "master",
1540 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1541 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1542 "subject": "Revert \"Implementing Feature X\"",
1543 "status": "NEW",
1544 "created": "2013-02-01 09:59:32.126000000",
1545 "updated": "2013-02-21 11:16:36.775000000",
1546 "mergeable": true,
1547 "insertions": 6,
1548 "deletions": 4,
1549 "_number": 3965,
1550 "owner": {
1551 "name": "John Doe"
1552 }
1553 },
1554 {
1555 "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646",
1556 "project": "anyProject",
1557 "branch": "master",
1558 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1559 "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646",
1560 "subject": "Revert \"Implementing Feature Y\"",
1561 "status": "NEW",
1562 "created": "2013-02-04 09:59:33.126000000",
1563 "updated": "2013-02-21 11:16:37.775000000",
1564 "mergeable": true,
1565 "insertions": 62,
1566 "deletions": 11,
1567 "_number": 3966,
1568 "owner": {
1569 "name": "Jane Doe"
1570 }
1571 }
1572 ]
1573----
1574
1575If any of the changes cannot be reverted because the change state doesn't
1576allow reverting the change, the response is "`409 Conflict`" and
1577the error message is contained in the response body.
1578
1579.Response
1580----
1581 HTTP/1.1 409 Conflict
1582 Content-Disposition: attachment
1583 Content-Type: text/plain; charset=UTF-8
1584
1585 change is new
1586----
1587
Edwin Kempin0eddba02013-02-22 15:30:12 +01001588[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001589=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001590--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001591'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001592--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001593
Edwin Kempin0eddba02013-02-22 15:30:12 +01001594Submits a change.
1595
1596The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001597SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001598
1599.Request
1600----
1601 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001602 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001603
1604 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001605 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001606 }
1607----
1608
1609As response a link:#change-info[ChangeInfo] entity is returned that
1610describes the submitted/merged change.
1611
1612.Response
1613----
1614 HTTP/1.1 200 OK
1615 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001616 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001617
1618 )]}'
1619 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001620 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1621 "project": "myProject",
1622 "branch": "master",
1623 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1624 "subject": "Implementing Feature X",
1625 "status": "MERGED",
1626 "created": "2013-02-01 09:59:32.126000000",
1627 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001628 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001629 "_number": 3965,
1630 "owner": {
1631 "name": "John Doe"
1632 }
1633 }
1634----
1635
1636If the change cannot be submitted because the submit rule doesn't allow
1637submitting the change, the response is "`409 Conflict`" and the error
1638message is contained in the response body.
1639
1640.Response
1641----
1642 HTTP/1.1 409 Conflict
1643 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001644 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001645
1646 blocked by Verified
1647----
1648
David Pursehouse025c1af2015-11-20 17:02:50 +09001649[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001650=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07001651--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001652'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001653--
1654
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001655Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001656link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07001657including the current change itself.
1658
Stefan Bellera7ad6612015-06-26 10:05:43 -07001659The list consists of:
1660
1661* The given change.
1662* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1663 is enabled, include all open changes with the same topic.
1664* For each change whose submit type is not CHERRY_PICK, include unmerged
1665 ancestors targeting the same branch.
1666
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001667As a special case, the list is empty if this change would be
1668submitted by itself (without other changes).
1669
1670.Request
1671----
1672 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
1673 Content-Type: application/json; charset=UTF-8
1674----
1675
1676As a response a link:#submitted-together-info[SubmittedTogetherInfo]
1677entity is returned that describes what would happen if the change were
1678submitted. This response contains a list of changes and a count of
1679changes that are not visible to the caller that are part of the set of
1680changes to be merged.
1681
1682The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001683link:#list-changes[Query Changes] with the
1684link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Patrick Hiesel6fbbdaa2018-04-05 15:10:13 +02001685link:#current-revision[`CURRENT_REVISION`],and
Jonathan Niedercb51d742016-09-23 11:37:57 -07001686link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001687
Shawn Pearce8080c3d2016-09-19 19:15:04 -07001688Standard link:#query-options[formatting options] can be specified
1689with the `o` parameter, as well as the `submitted_together` specific
1690option `NON_VISIBLE_CHANGES`.
1691
Stefan Bellera7ad6612015-06-26 10:05:43 -07001692.Response
1693----
1694 HTTP/1.1 200 OK
1695 Content-Disposition: attachment
1696 Content-Type: application/json; charset=UTF-8
1697
1698)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001699{
1700 "changes": [
1701 {
1702 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1703 "project": "gerrit",
1704 "branch": "master",
1705 "hashtags": [],
1706 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1707 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1708 "status": "NEW",
1709 "created": "2015-05-01 15:39:57.979000000",
1710 "updated": "2015-05-20 19:25:21.592000000",
1711 "mergeable": true,
1712 "insertions": 303,
1713 "deletions": 210,
1714 "_number": 1779,
1715 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001716 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001717 },
1718 "labels": {
1719 "Code-Review": {
1720 "approved": {
1721 "_account_id": 1000000
1722 },
1723 "all": [
1724 {
1725 "value": 2,
1726 "date": "2015-05-20 19:25:21.592000000",
1727 "_account_id": 1000000
1728 }
1729 ],
1730 "values": {
1731 "-2": "This shall not be merged",
1732 "-1": "I would prefer this is not merged as is",
1733 " 0": "No score",
1734 "+1": "Looks good to me, but someone else must approve",
1735 "+2": "Looks good to me, approved"
1736 },
1737 "default_value": 0
1738 },
1739 "Verified": {
1740 "approved": {
1741 "_account_id": 1000000
1742 },
1743 "all": [
1744 {
1745 "value": 1,
1746 "date": "2015-05-20 19:25:21.592000000",
1747 "_account_id": 1000000
1748 }
1749 ],
1750 "values": {
1751 "-1": "Fails",
1752 " 0": "No score",
1753 "+1": "Verified"
1754 },
1755 "default_value": 0
1756 }
1757 },
1758 "permitted_labels": {
1759 "Code-Review": [
1760 "-2",
1761 "-1",
1762 " 0",
1763 "+1",
1764 "+2"
1765 ],
1766 "Verified": [
1767 "-1",
1768 " 0",
1769 "+1"
1770 ]
1771 },
1772 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001773 {
1774 "_account_id": 1000000
1775 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001776 ],
1777 "reviewers": {
1778 "REVIEWER": [
1779 {
1780 "_account_id": 1000000
1781 }
1782 ]
1783 },
1784 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1785 "revisions": {
1786 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09001787 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001788 "_number": 1,
1789 "created": "2015-05-01 15:39:57.979000000",
1790 "uploader": {
1791 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001792 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001793 "ref": "refs/changes/79/1779/1",
1794 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07001795 }
1796 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001797 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001798 {
1799 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
1800 "project": "gerrit",
1801 "branch": "master",
1802 "hashtags": [],
1803 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
1804 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1805 "status": "NEW",
1806 "created": "2015-05-01 15:39:57.979000000",
1807 "updated": "2015-05-20 19:25:21.546000000",
1808 "mergeable": true,
1809 "insertions": 15,
1810 "deletions": 6,
1811 "_number": 1780,
1812 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001813 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001814 },
1815 "labels": {
1816 "Code-Review": {
1817 "approved": {
1818 "_account_id": 1000000
1819 },
1820 "all": [
1821 {
1822 "value": 2,
1823 "date": "2015-05-20 19:25:21.546000000",
1824 "_account_id": 1000000
1825 }
1826 ],
1827 "values": {
1828 "-2": "This shall not be merged",
1829 "-1": "I would prefer this is not merged as is",
1830 " 0": "No score",
1831 "+1": "Looks good to me, but someone else must approve",
1832 "+2": "Looks good to me, approved"
1833 },
1834 "default_value": 0
1835 },
1836 "Verified": {
1837 "approved": {
1838 "_account_id": 1000000
1839 },
1840 "all": [
1841 {
1842 "value": 1,
1843 "date": "2015-05-20 19:25:21.546000000",
1844 "_account_id": 1000000
1845 }
1846 ],
1847 "values": {
1848 "-1": "Fails",
1849 " 0": "No score",
1850 "+1": "Verified"
1851 },
1852 "default_value": 0
1853 }
1854 },
1855 "permitted_labels": {
1856 "Code-Review": [
1857 "-2",
1858 "-1",
1859 " 0",
1860 "+1",
1861 "+2"
1862 ],
1863 "Verified": [
1864 "-1",
1865 " 0",
1866 "+1"
1867 ]
1868 },
1869 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001870 {
1871 "_account_id": 1000000
1872 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001873 ],
1874 "reviewers": {
1875 "REVIEWER": [
1876 {
1877 "_account_id": 1000000
1878 }
1879 ]
1880 },
1881 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
1882 "revisions": {
1883 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09001884 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001885 "_number": 1,
1886 "created": "2015-05-01 15:39:57.979000000",
1887 "uploader": {
1888 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001889 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001890 "ref": "refs/changes/80/1780/1",
1891 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07001892 }
1893 }
1894 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001895 ],
1896 "non_visible_changes": 0
1897}
Stefan Bellera7ad6612015-06-26 10:05:43 -07001898----
1899
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001900If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
1901instead of a link:#submitted-together-info[SubmittedTogetherInfo]
1902entity, the response is a list of changes, or a 403 response with a
1903message if the set of changes to be submitted with this change
1904includes changes the caller cannot read.
1905
Stefan Bellera7ad6612015-06-26 10:05:43 -07001906
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001907[[delete-change]]
1908=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001909--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001910'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001911--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001912
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001913Deletes a change.
1914
Paladox none580ae0e2017-02-12 18:15:48 +00001915New or abandoned changes can be deleted by their owner if the user is granted
1916the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
1917otherwise only by administrators.
1918
David Ostrovsky0d69c232013-09-10 23:10:23 +02001919.Request
1920----
1921 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001922 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001923----
1924
1925.Response
1926----
1927 HTTP/1.1 204 No Content
1928----
1929
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001930[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001931=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001932--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001933'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001934--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001935
1936Retrieves the branches and tags in which a change is included. As result
1937an link:#included-in-info[IncludedInInfo] entity is returned.
1938
1939.Request
1940----
1941 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
1942----
1943
1944.Response
1945----
1946 HTTP/1.1 200 OK
1947 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001948 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001949
1950 )]}'
1951 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001952 "branches": [
1953 "master"
1954 ],
1955 "tags": []
1956 }
1957----
1958
David Pursehouse4e38b972014-05-30 10:36:40 +09001959[[index-change]]
1960=== Index Change
1961--
1962'POST /changes/link:#change-id[\{change-id\}]/index'
1963--
1964
1965Adds or updates the change in the secondary index.
1966
1967.Request
1968----
1969 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
1970----
1971
1972.Response
1973----
1974 HTTP/1.1 204 No Content
1975----
1976
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001977[[list-change-comments]]
1978=== List Change Comments
1979--
1980'GET /changes/link:#change-id[\{change-id\}]/comments'
1981--
1982
1983Lists the published comments of all revisions of the change.
1984
1985Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1986entries. The entries in the map are sorted by file path, and the
1987comments for each path are sorted by patch set number. Each comment has
1988the `patch_set` and `author` fields set.
1989
1990.Request
1991----
1992 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
1993----
1994
1995.Response
1996----
1997 HTTP/1.1 200 OK
1998 Content-Disposition: attachment
1999 Content-Type: application/json; charset=UTF-8
2000
2001 )]}'
2002 {
2003 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2004 {
2005 "patch_set": 1,
2006 "id": "TvcXrmjM",
2007 "line": 23,
2008 "message": "[nit] trailing whitespace",
2009 "updated": "2013-02-26 15:40:43.986000000"
2010 "author": {
2011 "_account_id": 1000096,
2012 "name": "John Doe",
2013 "email": "john.doe@example.com"
2014 }
2015 },
2016 {
2017 "patch_set": 2,
2018 "id": "TveXwFiA",
2019 "line": 49,
2020 "in_reply_to": "TfYX-Iuo",
2021 "message": "Done",
2022 "updated": "2013-02-26 15:40:45.328000000"
2023 "author": {
2024 "_account_id": 1000097,
2025 "name": "Jane Roe",
2026 "email": "jane.roe@example.com"
2027 }
2028 }
2029 ]
2030 }
2031----
2032
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002033[[list-change-robot-comments]]
2034=== List Change Robot Comments
2035--
2036'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
2037--
2038
2039Lists the robot comments of all revisions of the change.
2040
2041Return a map that maps the file path to a list of
2042link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
2043map are sorted by file path.
2044
2045.Request
2046----
2047 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
2048----
2049
2050.Response
2051----
2052 HTTP/1.1 200 OK
2053 Content-Disposition: attachment
2054 Content-Type: application/json; charset=UTF-8
2055
2056 )]}'
2057 {
2058 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2059 {
2060 "id": "TvcXrmjM",
2061 "line": 23,
2062 "message": "unused import",
2063 "updated": "2016-02-26 15:40:43.986000000",
2064 "author": {
2065 "_account_id": 1000110,
2066 "name": "Code Analyzer",
2067 "email": "code.analyzer@example.com"
2068 },
2069 "robotId": "importChecker",
2070 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
2071 },
2072 {
2073 "id": "TveXwFiA",
2074 "line": 49,
2075 "message": "wrong indention",
2076 "updated": "2016-02-26 15:40:45.328000000",
2077 "author": {
2078 "_account_id": 1000110,
2079 "name": "Code Analyzer",
2080 "email": "code.analyzer@example.com"
2081 },
2082 "robotId": "styleChecker",
2083 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
2084 }
2085 ]
2086 }
2087----
2088
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002089[[list-change-drafts]]
2090=== List Change Drafts
2091--
2092'GET /changes/link:#change-id[\{change-id\}]/drafts'
2093--
2094
2095Lists the draft comments of all revisions of the change that belong to
2096the calling user.
2097
2098Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2099entries. The entries in the map are sorted by file path, and the
2100comments for each path are sorted by patch set number. Each comment has
2101the `patch_set` field set, and no `author`.
2102
2103.Request
2104----
2105 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
2106----
2107
2108.Response
2109----
2110 HTTP/1.1 200 OK
2111 Content-Disposition: attachment
2112 Content-Type: application/json; charset=UTF-8
2113
2114 )]}'
2115 {
2116 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2117 {
2118 "patch_set": 1,
2119 "id": "TvcXrmjM",
2120 "line": 23,
2121 "message": "[nit] trailing whitespace",
2122 "updated": "2013-02-26 15:40:43.986000000"
2123 },
2124 {
2125 "patch_set": 2,
2126 "id": "TveXwFiA",
2127 "line": 49,
2128 "in_reply_to": "TfYX-Iuo",
2129 "message": "Done",
2130 "updated": "2013-02-26 15:40:45.328000000"
2131 }
2132 ]
2133 }
2134----
2135
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002136[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002137=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002138--
2139'GET /changes/link:#change-id[\{change-id\}]/check'
2140--
2141
2142Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002143link:#change-info[ChangeInfo] entity with the `problems` field set to a
2144list of link:#problem-info[ProblemInfo] entities.
2145
2146Depending on the type of problem, some fields not marked optional may be
2147missing from the result. At least `id`, `project`, `branch`, and
2148`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002149
2150.Request
2151----
2152 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2153----
2154
2155.Response
2156----
2157 HTTP/1.1 200 OK
2158 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002159 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002160
2161 )]}'
2162 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002163 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2164 "project": "myProject",
2165 "branch": "master",
2166 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2167 "subject": "Implementing Feature X",
2168 "status": "NEW",
2169 "created": "2013-02-01 09:59:32.126000000",
2170 "updated": "2013-02-21 11:16:36.775000000",
2171 "mergeable": true,
2172 "insertions": 34,
2173 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002174 "_number": 3965,
2175 "owner": {
2176 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002177 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002178 "problems": [
2179 {
2180 "message": "Current patch set 1 not found"
2181 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002182 ]
2183 }
2184----
2185
Dave Borowitz3be39d02014-12-03 17:57:38 -08002186[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002187=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002188--
2189'POST /changes/link:#change-id[\{change-id\}]/check'
2190--
2191
2192Performs consistency checks on the change as with link:#check-change[GET
2193/check], and additionally fixes any problems that can be fixed
2194automatically. The returned field values reflect any fixes.
2195
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002196Some fixes have options controlling their behavior, which can be set in the
2197link:#fix-input[FixInput] entity body.
2198
Dave Borowitz3be39d02014-12-03 17:57:38 -08002199Only the change owner, a project owner, or an administrator may fix changes.
2200
2201.Request
2202----
2203 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2204----
2205
2206.Response
2207----
2208 HTTP/1.1 200 OK
2209 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002210 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002211
2212 )]}'
2213 {
2214 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2215 "project": "myProject",
2216 "branch": "master",
2217 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2218 "subject": "Implementing Feature X",
2219 "status": "MERGED",
2220 "created": "2013-02-01 09:59:32.126000000",
2221 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002222 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002223 "mergeable": true,
2224 "insertions": 34,
2225 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002226 "_number": 3965,
2227 "owner": {
2228 "name": "John Doe"
2229 },
2230 "problems": [
2231 {
2232 "message": "Current patch set 2 not found"
2233 },
2234 {
2235 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2236 "status": FIXED,
2237 "outcome": "Marked change as merged"
2238 }
2239 ]
2240 }
2241----
2242
Alan Tokaev392cfca2017-04-28 11:11:31 +02002243[[set-work-in-pogress]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002244=== Set Work-In-Progress
Alan Tokaev392cfca2017-04-28 11:11:31 +02002245--
2246'POST /changes/link:#change-id[\{change-id\}]/wip'
2247--
2248
David Ostrovsky44242452018-06-09 20:25:13 +02002249Marks the change as not ready for review yet. Changes may only be marked not
2250ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002251
2252The request body does not need to include a
2253link:#work-in-progress-input[WorkInProgressInput] entity if no review comment
2254is added. Actions that create a new patch set in a WIP change default to
2255notifying *OWNER* instead of *ALL*.
2256
2257.Request
2258----
2259 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0
2260 Content-Type: application/json; charset=UTF-8
2261
2262 {
2263 "message": "Refactoring needs to be done before we can proceed here."
2264 }
2265----
2266
2267.Response
2268----
2269 HTTP/1.1 200 OK
2270----
2271
2272[[set-ready-for-review]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002273=== Set Ready-For-Review
Alan Tokaev392cfca2017-04-28 11:11:31 +02002274--
2275'POST /changes/link:#change-id[\{change-id\}]/ready'
2276--
2277
David Ostrovsky44242452018-06-09 20:25:13 +02002278Marks the change as ready for review (set WIP property to false). Changes may
2279only be marked ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002280
2281Activates notifications of reviewer. The request body does not need
2282to include a link:#work-in-progress-input[WorkInProgressInput] entity
2283if no review comment is added.
2284
2285.Request
2286----
2287 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0
2288 Content-Type: application/json;charset=UTF-8
2289
2290 {
2291 "message": "Refactoring is done."
2292 }
2293
2294----
2295
2296.Response
2297----
2298 HTTP/1.1 200 OK
2299----
2300
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002301[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002302=== Mark Private
2303--
Edwin Kempin364a86b2017-04-27 12:34:00 +02002304'POST /changes/link:#change-id[\{change-id\}]/private'
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002305--
2306
Patrick Hiesel707e61a2019-02-13 18:28:48 +01002307Marks the change to be private. Only open changes can be marked private.
2308Changes may only be marked private by the owner or site administrators.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002309
Edwin Kempin364a86b2017-04-27 12:34:00 +02002310A message can be specified in the request body inside a
2311link:#private-input[PrivateInput] entity.
2312
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002313.Request
2314----
Edwin Kempin364a86b2017-04-27 12:34:00 +02002315 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2316 Content-Type: application/json; charset=UTF-8
2317
2318 {
2319 "message": "After this security fix has been released we can make it public now."
2320 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002321----
2322
2323.Response
2324----
2325 HTTP/1.1 201 Created
2326----
2327
2328If the change was already private the response is "`200 OK`".
2329
2330[[unmark-private]]
2331=== Unmark Private
2332--
2333'DELETE /changes/link:#change-id[\{change-id\}]/private'
2334--
2335
2336Marks the change to be non-private. Note users can only unmark own private
2337changes.
2338
2339.Request
2340----
2341 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2342----
2343
2344.Response
2345----
2346 HTTP/1.1 204 No Content
2347----
2348
2349If the change was already not private, the response is "`409 Conflict`".
2350
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002351A message can be specified in the request body inside a
2352link:#private-input[PrivateInput] entity. Historically, this method allowed
2353a body in the DELETE, but that behavior is
2354link:https://www.gerritcodereview.com/releases/2.16.md[deprecated].
2355In this case, use a POST request instead:
Edwin Kempin364a86b2017-04-27 12:34:00 +02002356
2357.Request
2358----
2359 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0
2360 Content-Type: application/json; charset=UTF-8
2361
2362 {
2363 "message": "This is a security fix that must not be public."
2364 }
2365----
2366
David Pursehoused656fa82017-04-28 06:51:26 +02002367[[ignore]]
2368=== Ignore
2369--
2370'PUT /changes/link:#change-id[\{change-id\}]/ignore'
2371--
2372
2373Marks a change as ignored. The change will not be shown in the incoming
David Pursehouseaa51cba2018-07-09 11:02:17 +09002374reviews dashboard, and email notifications will be suppressed. Ignoring
2375a change does not cause the change's "updated" timestamp to be modified,
2376and the owner is not notified.
David Pursehoused656fa82017-04-28 06:51:26 +02002377
2378.Request
2379----
2380 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ignore HTTP/1.0
2381----
2382
2383[[unignore]]
2384=== Unignore
2385--
2386'PUT /changes/link:#change-id[\{change-id\}]/unignore'
2387--
2388
2389Un-marks a change as ignored.
2390
2391.Request
2392----
2393 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unignore HTTP/1.0
2394----
2395
Edwin Kempinceb673e2017-10-01 12:29:05 +02002396[[mark-as-reviewed]]
2397=== Mark as Reviewed
2398--
2399'PUT /changes/link:#change-id[\{change-id\}]/reviewed'
2400--
2401
2402Marks a change as reviewed.
2403
2404This allows users to "de-highlight" changes in their dashboard until a new
2405patch set is uploaded.
2406
2407This differs from the link:#ignore[ignore] endpoint, which will mute
2408emails and hide the change from dashboard completely until it is
2409link:#unignore[unignored] again.
2410
2411
2412.Request
2413----
2414 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewed HTTP/1.0
2415----
2416
2417[[mark-as-unreviewed]]
2418=== Mark as Unreviewed
2419--
2420'PUT /changes/link:#change-id[\{change-id\}]/unreviewed'
2421--
2422
2423Marks a change as unreviewed.
2424
2425This allows users to "highlight" changes in their dashboard
2426
2427.Request
2428----
2429 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unreviewed HTTP/1.0
2430----
2431
David Pursehouse7c79b682017-08-25 13:18:32 +09002432[[get-hashtags]]
2433=== Get Hashtags
2434--
2435'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2436--
2437
2438Gets the hashtags associated with a change.
2439
2440[NOTE] Hashtags are only available when NoteDb is enabled.
2441
2442.Request
2443----
2444 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2445----
2446
2447As response the change's hashtags are returned as a list of strings.
2448
2449.Response
2450----
2451 HTTP/1.1 200 OK
2452 Content-Disposition: attachment
2453 Content-Type: application/json; charset=UTF-8
2454
2455 )]}'
2456 [
2457 "hashtag1",
2458 "hashtag2"
2459 ]
2460----
2461
2462[[set-hashtags]]
2463=== Set Hashtags
2464--
2465'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2466--
2467
2468Adds and/or removes hashtags from a change.
2469
2470[NOTE] Hashtags are only available when NoteDb is enabled.
2471
2472The hashtags to add or remove must be provided in the request body inside a
2473link:#hashtags-input[HashtagsInput] entity.
2474
2475.Request
2476----
2477 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2478 Content-Type: application/json; charset=UTF-8
2479
2480 {
2481 "add" : [
2482 "hashtag3"
2483 ],
2484 "remove" : [
2485 "hashtag2"
2486 ]
2487 }
2488----
2489
2490As response the change's hashtags are returned as a list of strings.
2491
2492.Response
2493----
2494 HTTP/1.1 200 OK
2495 Content-Disposition: attachment
2496 Content-Type: application/json; charset=UTF-8
2497
2498 )]}'
2499 [
2500 "hashtag1",
2501 "hashtag3"
2502 ]
2503----
2504
Changcheng Xiao7fb73292018-04-25 11:43:19 +02002505[[list-change-messages]]
2506=== List Change Messages
2507--
2508'GET /changes/link:#change-id[\{change-id\}]/messages'
2509--
2510
2511Lists all the messages of a change including link:#detailed-accounts[detailed account information].
2512
2513.Request
2514----
2515 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages
2516----
2517
2518As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned.
2519
2520.Response
2521----
2522 HTTP/1.1 200 OK
2523 Content-Disposition: attachment
2524 Content-Type: application/json; charset=UTF-8
2525
2526 )]}'
2527 [
2528 {
2529 "id": "YH-egE",
2530 "author": {
2531 "_account_id": 1000096,
2532 "name": "John Doe",
2533 "email": "john.doe@example.com",
2534 "username": "jdoe"
2535 },
2536 "date": "2013-03-23 21:34:02.419000000",
2537 "message": "Patch Set 1:\n\nThis is the first message.",
2538 "_revision_number": 1
2539 },
2540 {
2541 "id": "WEEdhU",
2542 "author": {
2543 "_account_id": 1000097,
2544 "name": "Jane Roe",
2545 "email": "jane.roe@example.com",
2546 "username": "jroe"
2547 },
2548 "date": "2013-03-23 21:36:52.332000000",
2549 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
2550 "_revision_number": 1
2551 }
2552 ]
2553----
David Pursehousec32050d2017-08-25 16:27:47 +09002554
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002555[[get-change-message]]
2556=== Get Change Message
2557
2558Retrieves a change message including link:#detailed-accounts[detailed account information].
2559
2560--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002561'GET /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]'
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002562--
2563
2564As response a link:#change-message-info[ChangeMessageInfo] entity is returned.
2565
2566.Response
2567----
2568 HTTP/1.1 200 OK
2569 Content-Disposition: attachment
2570 Content-Type: application/json; charset=UTF-8
2571
2572 )]}'
2573 {
2574 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
2575 "author": {
2576 "_account_id": 1000096,
2577 "name": "John Doe",
2578 "email": "john.doe@example.com",
2579 "username": "jdoe"
2580 },
2581 "date": "2013-03-23 21:34:02.419000000",
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002582 "message": "a change message",
2583 "_revision_number": 1
2584 }
2585----
2586
2587[[delete-change-message]]
2588=== Delete Change Message
2589--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002590'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' +
2591'POST /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]/delete'
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002592--
2593
2594Deletes a change message by replacing the change message with a new message,
2595which contains the name of the user who deleted the change message and the
2596reason why it was deleted. The reason can be provided in the request body as a
2597link:#delete-change-message-input[DeleteChangeMessageInput] entity.
2598
2599Note that only users with the
2600link:access-control.html#capability_administrateServer[Administrate Server]
2601global capability are permitted to delete a change message.
2602
2603To delete a change message, send a DELETE request:
2604
2605.Request
2606----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002607 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002608----
2609
2610To provide a reason for the deletion, use a POST request:
2611
2612.Request
2613----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002614 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002615 Content-Type: application/json; charset=UTF-8
2616
2617 {
2618 "reason": "spam"
2619 }
2620----
2621
2622As response a link:#change-message-info[ChangeMessageInfo] entity is returned that
2623describes the updated change message.
2624
2625.Response
2626----
2627 HTTP/1.1 200 OK
2628 Content-Disposition: attachment
2629 Content-Type: application/json; charset=UTF-8
2630
2631 )]}'
2632 {
2633 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
2634 "author": {
2635 "_account_id": 1000096,
2636 "name": "John Doe",
2637 "email": "john.doe@example.com",
2638 "username": "jdoe"
2639 },
2640 "date": "2013-03-23 21:34:02.419000000",
2641 "message": "Change message removed by: Administrator\nReason: spam",
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002642 "_revision_number": 1
2643 }
2644----
Gustaf Lundhe8647c62017-04-28 06:51:26 +02002645
David Ostrovsky1a49f622014-07-29 00:40:02 +02002646[[edit-endpoints]]
2647== Change Edit Endpoints
2648
David Ostrovsky1a49f622014-07-29 00:40:02 +02002649[[get-edit-detail]]
2650=== Get Change Edit Details
2651--
2652'GET /changes/link:#change-id[\{change-id\}]/edit
2653--
2654
2655Retrieves a change edit details.
2656
2657.Request
2658----
2659 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2660----
2661
2662As response an link:#edit-info[EditInfo] entity is returned that
2663describes the change edit, or "`204 No Content`" when change edit doesn't
2664exist for this change. Change edits are stored on special branches and there
2665can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02002666When request parameter `list` is provided the response also includes the file
2667list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02002668against this base revision. When request parameter `download-commands` is
2669provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02002670
2671.Response
2672----
2673 HTTP/1.1 200 OK
2674 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002675 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02002676
2677 )]}'
2678 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01002679 "commit": {
2680 "parents": [
David Ostrovsky1a49f622014-07-29 00:40:02 +02002681 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01002682 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
David Ostrovsky1a49f622014-07-29 00:40:02 +02002683 }
2684 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01002685 "author": {
2686 "name": "Shawn O. Pearce",
2687 "email": "sop@google.com",
2688 "date": "2012-04-24 18:08:08.000000000",
2689 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02002690 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01002691 "committer": {
2692 "name": "Shawn O. Pearce",
2693 "email": "sop@google.com",
2694 "date": "2012-04-24 18:08:08.000000000",
2695 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02002696 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01002697 "subject": "Use an EventBus to manage star icons",
2698 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
David Ostrovsky1a49f622014-07-29 00:40:02 +02002699 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01002700 "base_patch_set_number": 1,
2701 "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3",
2702 "ref": "refs/users/01/1000001/edit-76482/1"
David Ostrovsky1a49f622014-07-29 00:40:02 +02002703 }
2704----
David Pursehouse4e38b972014-05-30 10:36:40 +09002705
David Ostrovskya5ab8292014-08-01 02:11:39 +02002706[[put-edit-file]]
2707=== Change file content in Change Edit
2708--
2709'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2710--
2711
2712Put content of a file to a change edit.
2713
2714.Request
2715----
2716 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2717----
2718
2719When change edit doesn't exist for this change yet it is created. When file
2720content isn't provided, it is wiped out for that file. As response
2721"`204 No Content`" is returned.
2722
2723.Response
2724----
2725 HTTP/1.1 204 No Content
2726----
2727
Gal Paikin68d217b2019-10-07 21:01:22 +02002728When the change edit is a no-op, for example when providing the same file
2729content that the file already has, '409 no changes were made' is returned.
2730
2731.Response
2732----
2733 HTTP/1.1 409 no changes were made
2734----
2735
David Ostrovsky138edb42014-08-15 21:31:43 +02002736[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01002737=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02002738--
2739'POST /changes/link:#change-id[\{change-id\}]/edit
2740--
2741
David Ostrovskya00c9532015-01-21 00:17:49 +01002742Creates empty change edit, restores file content or renames files in change
2743edit. The request body needs to include a
2744link:#change-edit-input[ChangeEditInput] entity when a file within change
2745edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02002746
2747.Request
2748----
2749 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002750 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02002751
2752 {
David Ostrovskybd12e172014-08-21 23:08:15 +02002753 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02002754 }
2755----
2756
David Ostrovskya00c9532015-01-21 00:17:49 +01002757or for rename:
2758
2759.Request
2760----
2761 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2762 Content-Type: application/json; charset=UTF-8
2763
2764 {
2765 "old_path": "foo",
2766 "new_path": "bar"
2767 }
2768----
2769
David Ostrovsky138edb42014-08-15 21:31:43 +02002770When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01002771and restore flag are provided in request body, this file is restored. When
2772old and new file names are provided, the file is renamed. As response
2773"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02002774
2775.Response
2776----
2777 HTTP/1.1 204 No Content
2778----
2779
David Ostrovskyc967e152014-10-24 17:36:16 +02002780[[put-change-edit-message]]
2781=== Change commit message in Change Edit
2782--
2783'PUT /changes/link:#change-id[\{change-id\}]/edit:message
2784--
2785
2786Modify commit message. The request body needs to include a
2787link:#change-edit-message-input[ChangeEditMessageInput]
2788entity.
2789
2790.Request
2791----
2792 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002793 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02002794
2795 {
2796 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
2797 }
2798----
2799
2800If a change edit doesn't exist for this change yet, it is created. As
2801response "`204 No Content`" is returned.
2802
2803.Response
2804----
2805 HTTP/1.1 204 No Content
2806----
2807
David Ostrovsky2830c292014-08-01 02:24:31 +02002808[[delete-edit-file]]
2809=== Delete file in Change Edit
2810--
2811'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
2812--
2813
2814Deletes a file from a change edit. This deletes the file from the repository
2815completely. This is not the same as reverting or restoring a file to its
2816previous contents.
2817
2818.Request
2819----
2820 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2821----
2822
2823When change edit doesn't exist for this change yet it is created.
2824
2825.Response
2826----
2827 HTTP/1.1 204 No Content
2828----
2829
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002830[[get-edit-file]]
2831=== Retrieve file content from Change Edit
2832--
2833'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2834--
2835
2836Retrieves content of a file from a change edit.
2837
2838.Request
2839----
2840 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2841----
2842
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002843The content of the file is returned as text encoded inside base64.
2844The Content-Type header will always be `text/plain` reflecting the
2845outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
2846can be examined to find the server detected content type of the file.
2847
2848When the specified file was deleted in the change edit
2849"`204 No Content`" is returned.
2850
2851If only the content type is required, callers should use HEAD to
2852avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002853
Michael Zhou551ad0c2016-04-26 01:21:42 -04002854If the `base` parameter is set to true, the returned content is from the
2855revision that the edit is based on.
2856
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002857.Response
2858----
2859 HTTP/1.1 200 OK
2860 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002861 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002862 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002863 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002864
2865 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
2866----
2867
David Ostrovskyd0078672015-02-06 21:51:04 +01002868Alternatively, if the only value of the Accept request header is
2869`application/json` the content is returned as JSON string and
2870`X-FYI-Content-Encoding` is set to `json`.
2871
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002872[[get-edit-meta-data]]
2873=== Retrieve meta data of a file from Change Edit
2874--
2875'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
2876--
2877
2878Retrieves meta data of a file from a change edit. Currently only
2879web links are returned.
2880
2881.Request
2882----
2883 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
2884----
2885
2886This REST endpoint retrieves additional information for a file in a
2887change edit. As result an link:#edit-file-info[EditFileInfo] entity is
2888returned.
2889
2890.Response
2891----
2892 HTTP/1.1 200 OK
2893 Content-Disposition: attachment
2894 Content-Type: application/json; charset=UTF-8
2895
2896 )]}'
2897 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01002898 "web_links": [
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002899 {
2900 "show_on_side_by_side_diff_view": true,
2901 "name": "side-by-side preview diff",
2902 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
2903 "url": "#/x/xdocs/c/42/1..0/README.md",
2904 "target": "_self"
2905 },
2906 {
2907 "show_on_unified_diff_view": true,
2908 "name": "unified preview diff",
2909 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
2910 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
2911 "target": "_self"
2912 }
2913 ]}
2914----
2915
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002916[[get-edit-message]]
2917=== Retrieve commit message from Change Edit or current patch set of the change
2918--
2919'GET /changes/link:#change-id[\{change-id\}]/edit:message
2920--
2921
David Ostrovsky25ad15e2014-12-15 21:18:59 +01002922Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002923
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02002924If the `base` parameter is set to true, the returned message is from the
2925revision that the edit is based on.
2926
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002927.Request
2928----
2929 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
2930----
2931
2932The commit message is returned as base64 encoded string.
2933
2934.Response
2935----
2936 HTTP/1.1 200 OK
2937
2938 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
2939M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
2940----
2941
David Ostrovskyd0078672015-02-06 21:51:04 +01002942Alternatively, if the only value of the Accept request header is
2943`application/json` the commit message is returned as JSON string:
2944
2945.Response
2946----
2947 HTTP/1.1 200 OK
2948
2949)]}'
2950"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
2951----
2952
2953
David Ostrovskye9988f92014-08-01 09:56:34 +02002954[[publish-edit]]
2955=== Publish Change Edit
2956--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002957'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02002958--
2959
2960Promotes change edit to a regular patch set.
2961
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002962Options can be provided in the request body as a
2963link:#publish-change-edit-input[PublishChangeEditInput] entity.
2964
David Ostrovskye9988f92014-08-01 09:56:34 +02002965.Request
2966----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002967 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002968 Content-Type: application/json; charset=UTF-8
2969
2970 {
2971 "notify": "NONE"
2972 }
David Ostrovskye9988f92014-08-01 09:56:34 +02002973----
2974
2975As response "`204 No Content`" is returned.
2976
2977.Response
2978----
2979 HTTP/1.1 204 No Content
2980----
2981
David Ostrovsky46999d22014-08-16 02:19:13 +02002982[[rebase-edit]]
2983=== Rebase Change Edit
2984--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002985'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02002986--
2987
2988Rebases change edit on top of latest patch set.
2989
2990.Request
2991----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002992 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02002993----
2994
2995When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09002996"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02002997based on top of the latest patch set, the response
2998"`409 Conflict`" is returned.
2999
3000.Response
3001----
3002 HTTP/1.1 204 No Content
3003----
3004
David Ostrovsky8e75f502014-08-10 00:36:31 +02003005[[delete-edit]]
3006=== Delete Change Edit
3007--
3008'DELETE /changes/link:#change-id[\{change-id\}]/edit'
3009--
3010
3011Deletes change edit.
3012
3013.Request
3014----
3015 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3016----
3017
3018As response "`204 No Content`" is returned.
3019
3020.Response
3021----
3022 HTTP/1.1 204 No Content
3023----
3024
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01003025
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003026[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003027== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003028
3029[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003030=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003031--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003032'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003033--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003034
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003035Lists the reviewers of a change.
3036
3037As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
3038
3039.Request
3040----
3041 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
3042----
3043
3044.Response
3045----
3046 HTTP/1.1 200 OK
3047 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003048 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003049
3050 )]}'
3051 [
3052 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003053 "approvals": {
3054 "Verified": "+1",
3055 "Code-Review": "+2"
3056 },
3057 "_account_id": 1000096,
3058 "name": "John Doe",
3059 "email": "john.doe@example.com"
3060 },
3061 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003062 "approvals": {
3063 "Verified": " 0",
3064 "Code-Review": "-1"
3065 },
3066 "_account_id": 1000097,
3067 "name": "Jane Roe",
3068 "email": "jane.roe@example.com"
3069 }
3070 ]
3071----
3072
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003073[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003074=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003075--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003076'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003077--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003078
3079Suggest the reviewers for a given query `q` and result limit `n`. If result
3080limit is not passed, then the default 10 is used.
3081
Edwin Kempin2639eaa2019-08-27 09:47:27 +02003082This REST endpoint only suggests accounts that
3083
3084* are active
3085* can see the change
3086* are visible to the calling user
3087* are not already reviewer on the change
3088* don't own the change
3089
Edwin Kempinec02a552019-08-27 09:30:15 +02003090Groups can be excluded from the results by specifying the 'exclude-groups'
3091request parameter:
3092
3093--
3094'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups'
3095--
Patrick Hieselc79ae0e2017-06-28 14:50:53 +02003096
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003097As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
3098
3099.Request
3100----
3101 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
3102----
3103
3104.Response
3105----
3106 HTTP/1.1 200 OK
3107 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003108 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003109
3110 )]}'
3111 [
3112 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003113 "account": {
3114 "_account_id": 1000097,
3115 "name": "Jane Roe",
3116 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003117 },
3118 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003119 },
3120 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003121 "group": {
3122 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
3123 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003124 },
3125 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003126 }
3127 ]
3128----
3129
Edwin Kempin0ca3f722019-08-27 09:43:31 +02003130To suggest CCs `reviewer-state=CC` can be specified as additional URL
3131parameter. This includes existing reviewers in the result, but excludes
3132existing CCs.
3133
3134--
3135'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC'
3136--
3137
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003138[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003139=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003140--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003141'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 -08003142--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003143
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003144Retrieves a reviewer of a change.
3145
3146As response a link:#reviewer-info[ReviewerInfo] entity is returned that
3147describes the reviewer.
3148
3149.Request
3150----
3151 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
3152----
3153
3154.Response
3155----
3156 HTTP/1.1 200 OK
3157 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003158 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003159
3160 )]}'
3161 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003162 "approvals": {
3163 "Verified": "+1",
3164 "Code-Review": "+2"
3165 },
3166 "_account_id": 1000096,
3167 "name": "John Doe",
3168 "email": "john.doe@example.com"
3169 }
3170----
3171
Edwin Kempin392328e2013-02-25 12:50:03 +01003172[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003173=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003174--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003175'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003176--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003177
Edwin Kempin392328e2013-02-25 12:50:03 +01003178Adds one user or all members of one group as reviewer to the change.
3179
3180The reviewer to be added to the change must be provided in the request
3181body as a link:#reviewer-input[ReviewerInput] entity.
3182
Edwin Kempinf9f19412019-08-28 09:28:51 +02003183Users can be moved from reviewer to CC and vice versa. This means if a
3184user is added as CC that is already a reviewer on the change, the
3185reviewer state of that user is updated to CC. If a user that is already
3186a CC on the change is added as reviewer, the reviewer state of that
3187user is updated to reviewer.
3188
Edwin Kempin392328e2013-02-25 12:50:03 +01003189.Request
3190----
3191 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003192 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003193
3194 {
3195 "reviewer": "john.doe@example.com"
3196 }
3197----
3198
3199As response an link:#add-reviewer-result[AddReviewerResult] entity is
3200returned that describes the newly added reviewers.
3201
3202.Response
3203----
3204 HTTP/1.1 200 OK
3205 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003206 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003207
3208 )]}'
3209 {
Aaron Gable8c650212017-04-25 12:03:37 -07003210 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01003211 "reviewers": [
3212 {
Aaron Gable8c650212017-04-25 12:03:37 -07003213 "_account_id": 1000096,
3214 "name": "John Doe",
3215 "email": "john.doe@example.com"
Edwin Kempin392328e2013-02-25 12:50:03 +01003216 "approvals": {
3217 "Verified": " 0",
3218 "Code-Review": " 0"
3219 },
Edwin Kempin392328e2013-02-25 12:50:03 +01003220 }
3221 ]
3222 }
3223----
3224
3225If a group is specified, adding the group members as reviewers is an
3226atomic operation. This means if an error is returned, none of the
3227members are added as reviewer.
3228
3229If a group with many members is added as reviewer a confirmation may be
3230required.
3231
Edwin Kempinf9f19412019-08-28 09:28:51 +02003232If a group is added as CC and members of this group are already
3233reviewers on the change, these members stay reviewers on the change
3234(they are not downgraded to CC). However if a group is added as
3235reviewer, all group members become reviewer of the change, even if they
3236have been added as CC before.
3237
Edwin Kempin392328e2013-02-25 12:50:03 +01003238.Request
3239----
3240 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003241 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003242
3243 {
3244 "reviewer": "MyProjectVerifiers"
3245 }
3246----
3247
3248.Response
3249----
3250 HTTP/1.1 200 OK
3251 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003252 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003253
3254 )]}'
3255 {
Logan Hanks23e70282016-07-06 14:31:56 -07003256 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01003257 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3258 "confirm": true
3259 }
3260----
3261
3262To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01003263`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01003264
3265.Request
3266----
3267 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003268 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003269
3270 {
Logan Hanks23e70282016-07-06 14:31:56 -07003271 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01003272 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01003273 }
3274----
3275
Patrick Hiesel11873ef2017-03-17 17:36:05 +01003276If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
3277for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
3278an email address of a reviewer or CC then, they will be added to the change even if they
3279don't have a Gerrit account.
3280
3281If this option is disabled, the request would fail with `400 Bad Request` if the email
3282address can't be resolved to an active Gerrit account.
3283
3284Note that the name is optional so both "un.registered@reviewer.com" and
3285"John Doe <un.registered@reviewer.com>" are valid inputs.
3286
3287Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
3288
3289.Request
3290----
3291 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
3292 Content-Type: application/json; charset=UTF-8
3293
3294 {
3295 "reviewer": "John Doe <un.registered@reviewer.com>"
3296 }
3297----
3298
3299.Response
3300----
3301 HTTP/1.1 200 OK
3302 Content-Disposition: attachment
3303 Content-Type: application/json; charset=UTF-8
3304
3305 )]}'
3306 {
3307 "input": "John Doe <un.registered@reviewer.com>"
3308 }
3309----
3310
Logan Hanksf03040e2017-05-03 09:40:56 -07003311.Notifications
3312
3313An email will be sent using the "newchange" template.
3314
3315[options="header",cols="1,1,1"]
3316|=============================
3317|WIP State |Default|notify=ALL
3318|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3319|Work in progress|not sent|owner, reviewers, CCs
3320|=============================
3321
Edwin Kempin53301072013-02-25 12:57:07 +01003322[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003323=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003324--
Edwin Kempin407fca32016-08-29 12:01:00 +02003325'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
3326'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 -08003327--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003328
Edwin Kempin53301072013-02-25 12:57:07 +01003329Deletes a reviewer from a change.
3330
3331.Request
3332----
3333 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02003334 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3335----
3336
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003337Options can be provided in the request body as a
3338link:#delete-reviewer-input[DeleteReviewerInput] entity.
3339Historically, this method allowed a body in the DELETE, but that behavior is
3340link:https://www.gerritcodereview.com/releases/2.16.md[deprecated].
3341In this case, use a POST request instead:
Edwin Kempin407fca32016-08-29 12:01:00 +02003342
3343.Request
3344----
3345 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3346 Content-Type: application/json; charset=UTF-8
3347
3348 {
3349 "notify": "NONE"
3350 }
Edwin Kempin53301072013-02-25 12:57:07 +01003351----
3352
3353.Response
3354----
3355 HTTP/1.1 204 No Content
3356----
3357
Logan Hanks87607412017-05-30 13:49:04 -07003358.Notifications
3359
3360An email will be sent using the "deleteReviewer" template. If deleting the
3361reviewer resulted in one or more approvals being removed, then the deleted
3362reviewer will also receive a notification (unless notify=NONE).
3363
3364[options="header",cols="1,5"]
3365|=============================
3366|WIP State |Default Recipients
3367|Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers
3368|Work in progress|notify=NONE: deleted reviewer (if voted)
3369|=============================
3370
David Ostrovskybeb0b842014-12-13 00:24:29 +01003371[[list-votes]]
3372=== List Votes
3373--
3374'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
3375--
3376
3377Lists the votes for a specific reviewer of the change.
3378
3379.Request
3380----
Edwin Kempin314f10a2016-07-11 11:39:05 +02003381 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01003382----
3383
3384As result a map is returned that maps the label name to the label value.
3385The entries in the map are sorted by label name.
3386
3387.Response
3388----
3389 HTTP/1.1 200 OK
3390 Content-Disposition: attachment
3391 Content-Type: application/json;charset=UTF-8
3392
3393 )]}'
3394 {
3395 "Code-Review": -1,
3396 "Verified": 1
3397 "Work-In-Progress": 1,
3398 }
3399----
3400
3401[[delete-vote]]
3402=== Delete Vote
3403--
Edwin Kempin5488dc12016-08-29 11:13:31 +02003404'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 +02003405'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 +01003406--
3407
3408Deletes a single vote from a change. Note, that even when the last vote of
3409a reviewer is removed the reviewer itself is still listed on the change.
3410
3411.Request
3412----
3413 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003414 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3415----
3416
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003417Options can be provided in the request body as a
3418link:#delete-vote-input[DeleteVoteInput] entity.
3419Historically, this method allowed a body in the DELETE, but that behavior is
3420link:https://www.gerritcodereview.com/releases/2.16.md[deprecated].
3421In this case, use a POST request instead:
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003422
3423.Request
3424----
3425 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3426 Content-Type: application/json; charset=UTF-8
3427
3428 {
3429 "notify": "NONE"
3430 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01003431----
3432
3433.Response
3434----
3435 HTTP/1.1 204 No Content
3436----
3437
Logan Hanksa1e68dc2017-06-29 15:13:27 -07003438
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003439[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003440== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003441
Shawn Pearce728ba882013-07-08 23:13:08 -07003442[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003443=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003444--
Shawn Pearce728ba882013-07-08 23:13:08 -07003445'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003446--
Shawn Pearce728ba882013-07-08 23:13:08 -07003447
3448Retrieves a parsed commit of a revision.
3449
3450.Request
3451----
3452 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
3453----
3454
3455As response a link:#commit-info[CommitInfo] entity is returned that
3456describes the revision.
3457
3458.Response
3459----
3460 HTTP/1.1 200 OK
3461 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003462 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07003463
3464 )]}'
3465 {
Edwin Kempinc8237402015-07-15 18:27:55 +02003466 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07003467 "parents": [
3468 {
3469 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3470 "subject": "Migrate contributor agreements to All-Projects."
3471 }
3472 ],
3473 "author": {
3474 "name": "Shawn O. Pearce",
3475 "email": "sop@google.com",
3476 "date": "2012-04-24 18:08:08.000000000",
3477 "tz": -420
3478 },
3479 "committer": {
3480 "name": "Shawn O. Pearce",
3481 "email": "sop@google.com",
3482 "date": "2012-04-24 18:08:08.000000000",
3483 "tz": -420
3484 },
3485 "subject": "Use an EventBus to manage star icons",
3486 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3487 }
3488----
3489
Sven Selbergd26bd542014-11-21 16:28:10 +01003490Adding query parameter `links` (for example `/changes/.../commit?links`)
3491returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07003492
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08003493[[get-description]]
3494=== Get Description
3495--
3496'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3497--
3498
3499Retrieves the description of a patch set.
3500
3501.Request
3502----
3503 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3504----
3505
3506.Response
3507----
3508 HTTP/1.1 200 OK
3509 Content-Disposition: attachment
3510 Content-Type: application/json; charset=UTF-8
3511
3512 )]}'
3513 "Added Documentation"
3514----
3515
3516If the patch set does not have a description an empty string is returned.
3517
3518[[set-description]]
3519=== Set Description
3520--
3521'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3522--
3523
3524Sets the description of a patch set.
3525
3526The new description must be provided in the request body inside a
3527link:#description-input[DescriptionInput] entity.
3528
3529.Request
3530----
3531 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3532 Content-Type: application/json; charset=UTF-8
3533
3534 {
3535 "description": "Added Documentation"
3536 }
3537----
3538
3539As response the new description is returned.
3540
3541.Response
3542----
3543 HTTP/1.1 200 OK
3544 Content-Disposition: attachment
3545 Content-Type: application/json; charset=UTF-8
3546
3547 )]}'
3548 "Added Documentation"
3549----
3550
Edwin Kempin0f229442016-09-09 13:06:12 +02003551[[get-merge-list]]
3552=== Get Merge List
3553--
3554'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
3555--
3556
3557Returns the list of commits that are being integrated into a target
3558branch by a merge commit. By default the first parent is assumed to be
3559uninteresting. By using the `parent` option another parent can be set
3560as uninteresting (parents are 1-based).
3561
3562The list of commits is returned as a list of
3563link:#commit-info[CommitInfo] entities. Web links are only included if
3564the `links` option was set.
3565
3566.Request
3567----
3568 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
3569----
3570
3571.Response
3572----
3573HTTP/1.1 200 OK
3574 Content-Disposition: attachment
3575 Content-Type: application/json; charset=UTF-8
3576
3577 )]}'
3578 [
3579 {
3580 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
3581 "parents": [
3582 {
3583 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3584 "subject": "Migrate contributor agreements to All-Projects."
3585 }
3586 ],
3587 "author": {
3588 "name": "Shawn O. Pearce",
3589 "email": "sop@google.com",
3590 "date": "2012-04-24 18:08:08.000000000",
3591 "tz": -420
3592 },
3593 "committer": {
3594 "name": "Shawn O. Pearce",
3595 "email": "sop@google.com",
3596 "date": "2012-04-24 18:08:08.000000000",
3597 "tz": -420
3598 },
3599 "subject": "Use an EventBus to manage star icons",
3600 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3601 }
3602 ]
3603----
3604
Stefan Bellerc7259662015-02-12 17:23:05 -08003605[[get-revision-actions]]
3606=== Get Revision Actions
3607--
3608'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
3609--
3610
3611Retrieves revision link:#action-info[actions] of the revision of a change.
3612
3613.Request
3614----
3615 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
3616----
3617
3618.Response
3619----
3620 HTTP/1.1 200 OK
3621 Content-Disposition: attachment
3622 Content-Type: application/json; charset=UTF-8
3623
3624 )]}'
3625
3626{
3627 "submit": {
3628 "method": "POST",
3629 "label": "Submit",
3630 "title": "Submit patch set 1 into master",
3631 "enabled": true
3632 },
3633 "cherrypick": {
3634 "method": "POST",
3635 "label": "Cherry Pick",
3636 "title": "Cherry pick change to a different branch",
3637 "enabled": true
3638 }
3639}
3640----
3641
3642The response is a flat map of possible revision actions mapped to their
3643link:#action-info[ActionInfo].
3644
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003645[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003646=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003647--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003648'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003649--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003650
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003651Retrieves a review of a revision.
3652
3653.Request
3654----
3655 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3656----
3657
3658As response a link:#change-info[ChangeInfo] entity with
3659link:#detailed-labels[detailed labels] and link:#detailed-accounts[
3660detailed accounts] is returned that describes the review of the
3661revision. The revision for which the review is retrieved is contained
3662in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05003663set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003664revision of the change. Please note that the returned labels are always
3665for the current patch set.
3666
3667.Response
3668----
3669 HTTP/1.1 200 OK
3670 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003671 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003672
3673 )]}'
3674 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003675 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
3676 "project": "myProject",
3677 "branch": "master",
3678 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
3679 "subject": "Implementing Feature X",
3680 "status": "NEW",
3681 "created": "2013-02-01 09:59:32.126000000",
3682 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003683 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003684 "insertions": 34,
3685 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003686 "_number": 3965,
3687 "owner": {
3688 "_account_id": 1000096,
3689 "name": "John Doe",
3690 "email": "john.doe@example.com"
3691 },
3692 "labels": {
3693 "Verified": {
3694 "all": [
3695 {
3696 "value": 0,
3697 "_account_id": 1000096,
3698 "name": "John Doe",
3699 "email": "john.doe@example.com"
3700 },
3701 {
3702 "value": 0,
3703 "_account_id": 1000097,
3704 "name": "Jane Roe",
3705 "email": "jane.roe@example.com"
3706 }
3707 ],
3708 "values": {
3709 "-1": "Fails",
3710 " 0": "No score",
3711 "+1": "Verified"
3712 }
3713 },
3714 "Code-Review": {
3715 "all": [
3716 {
3717 "value": -1,
3718 "_account_id": 1000096,
3719 "name": "John Doe",
3720 "email": "john.doe@example.com"
3721 },
3722 {
3723 "value": 1,
3724 "_account_id": 1000097,
3725 "name": "Jane Roe",
3726 "email": "jane.roe@example.com"
3727 }
3728 ]
3729 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04003730 "-2": "This shall not be merged",
3731 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003732 " 0": "No score",
3733 "+1": "Looks good to me, but someone else must approve",
3734 "+2": "Looks good to me, approved"
3735 }
3736 }
3737 },
3738 "permitted_labels": {
3739 "Verified": [
3740 "-1",
3741 " 0",
3742 "+1"
3743 ],
3744 "Code-Review": [
3745 "-2",
3746 "-1",
3747 " 0",
3748 "+1",
3749 "+2"
3750 ]
3751 },
3752 "removable_reviewers": [
3753 {
3754 "_account_id": 1000096,
3755 "name": "John Doe",
3756 "email": "john.doe@example.com"
3757 },
3758 {
3759 "_account_id": 1000097,
3760 "name": "Jane Roe",
3761 "email": "jane.roe@example.com"
3762 }
3763 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08003764 "reviewers": {
3765 "REVIEWER": [
3766 {
3767 "_account_id": 1000096,
3768 "name": "John Doe",
3769 "email": "john.doe@example.com"
3770 },
3771 {
3772 "_account_id": 1000097,
3773 "name": "Jane Roe",
3774 "email": "jane.roe@example.com"
3775 }
3776 ]
3777 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003778 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
3779 "revisions": {
3780 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09003781 "kind": "REWORK",
3782 "_number": 2,
3783 "ref": "refs/changes/65/3965/2",
3784 "fetch": {
3785 "http": {
3786 "url": "http://gerrit/myProject",
3787 "ref": "refs/changes/65/3965/2"
3788 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003789 }
3790 }
3791 }
3792 }
3793----
3794
David Pursehouse669f2512014-07-18 11:41:42 +09003795[[get-related-changes]]
3796=== Get Related Changes
3797--
3798'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
3799--
3800
3801Retrieves related changes of a revision. Related changes are changes that either
3802depend on, or are dependencies of the revision.
3803
3804.Request
3805----
3806 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
3807----
3808
3809As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
3810describing the related changes.
3811
3812.Response
3813----
3814 HTTP/1.1 200 OK
3815 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003816 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09003817
3818 )]}'
3819 {
3820 "changes": [
3821 {
Patrick Hieselcab63512017-07-28 10:25:42 +02003822 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09003823 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
3824 "commit": {
3825 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
3826 "parents": [
3827 {
3828 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
3829 }
3830 ],
3831 "author": {
3832 "name": "David Ostrovsky",
3833 "email": "david@ostrovsky.org",
3834 "date": "2014-07-12 15:04:24.000000000",
3835 "tz": 120
3836 },
3837 "subject": "Remove Solr"
3838 },
3839 "_change_number": 58478,
3840 "_revision_number": 2,
3841 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003842 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003843 },
3844 {
Patrick Hieselcab63512017-07-28 10:25:42 +02003845 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09003846 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
3847 "commit": {
3848 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
3849 "parents": [
3850 {
3851 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
3852 }
3853 ],
3854 "author": {
3855 "name": "David Pursehouse",
3856 "email": "david.pursehouse@sonymobile.com",
3857 "date": "2014-06-24 02:01:28.000000000",
3858 "tz": 540
3859 },
3860 "subject": "Add support for secondary index with Elasticsearch"
3861 },
3862 "_change_number": 58081,
3863 "_revision_number": 10,
3864 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003865 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003866 }
3867 ]
3868 }
3869----
3870
3871
Edwin Kempin67498de2013-02-25 16:15:34 +01003872[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003873=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003874--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003875'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003876--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003877
Logan Hanksf03040e2017-05-03 09:40:56 -07003878Sets a review on a revision, optionally also publishing draft comments, setting
Logan Hanks53c36012017-06-30 13:47:54 -07003879labels, adding reviewers or CCs, and modifying the work in progress property.
Edwin Kempin67498de2013-02-25 16:15:34 +01003880
3881The review must be provided in the request body as a
3882link:#review-input[ReviewInput] entity.
3883
Aaron Gable8c650212017-04-25 12:03:37 -07003884A review cannot be set on a change edit. Trying to post a review for a
3885change edit fails with `409 Conflict`.
3886
Logan Hanksf03040e2017-05-03 09:40:56 -07003887Here is an example of using this method to set labels:
Aaron Gable8c650212017-04-25 12:03:37 -07003888
Edwin Kempin67498de2013-02-25 16:15:34 +01003889.Request
3890----
3891 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003892 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003893
3894 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01003895 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01003896 "message": "Some nits need to be fixed.",
3897 "labels": {
3898 "Code-Review": -1
3899 },
3900 "comments": {
3901 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3902 {
3903 "line": 23,
3904 "message": "[nit] trailing whitespace"
3905 },
3906 {
3907 "line": 49,
3908 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09003909 },
3910 {
3911 "range": {
3912 "start_line": 50,
3913 "start_character": 0,
3914 "end_line": 55,
3915 "end_character": 20
3916 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09003917 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01003918 }
3919 ]
3920 }
3921 }
3922----
3923
Aaron Gable843b0c12017-04-21 08:25:27 -07003924As response a link:#review-result[ReviewResult] entity is returned that
Aaron Gable8c650212017-04-25 12:03:37 -07003925describes the applied labels and any added reviewers (e.g. yourself,
3926if you set a label but weren't previously a reviewer on this CL).
Edwin Kempin67498de2013-02-25 16:15:34 +01003927
3928.Response
3929----
3930 HTTP/1.1 200 OK
3931 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003932 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003933
3934 )]}'
3935 {
3936 "labels": {
3937 "Code-Review": -1
3938 }
3939 }
3940----
3941
Aaron Gable8c650212017-04-25 12:03:37 -07003942It is also possible to add one or more reviewers or CCs
Logan Hanksf03040e2017-05-03 09:40:56 -07003943to a change simultaneously with a review:
Logan Hanks5f1c7592016-07-06 14:39:33 -07003944
3945.Request
3946----
3947 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3948 Content-Type: application/json; charset=UTF-8
3949
3950 {
Aaron Gable8c650212017-04-25 12:03:37 -07003951 "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 -07003952 "reviewers": [
3953 {
3954 "reviewer": "jane.roe@example.com"
3955 },
3956 {
Aaron Gable8c650212017-04-25 12:03:37 -07003957 "reviewer": "john.doe@example.com",
3958 "state": "CC"
3959 }
3960 {
3961 "reviewer": "MyProjectVerifiers",
Logan Hanks5f1c7592016-07-06 14:39:33 -07003962 }
3963 ]
3964 }
3965----
3966
3967Each element of the `reviewers` list is an instance of
3968link:#reviewer-input[ReviewerInput]. The corresponding result of
Aaron Gable8c650212017-04-25 12:03:37 -07003969adding each reviewer will be returned in a map of inputs to
3970link:#add-reviewer-result[AddReviewerResult]s.
Logan Hanks5f1c7592016-07-06 14:39:33 -07003971
3972.Response
3973----
3974 HTTP/1.1 200 OK
3975 Content-Disposition: attachment
3976 Content-Type: application/json; charset=UTF-8
3977
3978 )]}'
3979 {
Aaron Gable8c650212017-04-25 12:03:37 -07003980 "reviewers": {
3981 "jane.roe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07003982 "input": "jane.roe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07003983 "reviewers": [
3984 {
3985 "_account_id": 1000097,
3986 "name": "Jane Roe",
3987 "email": "jane.roe@example.com"
3988 "approvals": {
3989 "Verified": " 0",
3990 "Code-Review": " 0"
3991 },
3992 },
3993 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07003994 },
Aaron Gable8c650212017-04-25 12:03:37 -07003995 "john.doe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07003996 "input": "john.doe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07003997 "ccs": [
3998 {
3999 "_account_id": 1000096,
4000 "name": "John Doe",
4001 "email": "john.doe@example.com"
4002 "approvals": {
4003 "Verified": " 0",
4004 "Code-Review": " 0"
4005 },
4006 }
4007 ]
4008 },
4009 "MyProjectVerifiers": {
4010 "input": "MyProjectVerifiers",
4011 "reviewers": [
4012 {
4013 "_account_id": 1000098,
4014 "name": "Alice Ansel",
4015 "email": "alice.ansel@example.com"
4016 "approvals": {
4017 "Verified": " 0",
4018 "Code-Review": " 0"
4019 },
4020 },
4021 {
4022 "_account_id": 1000099,
4023 "name": "Bob Bollard",
4024 "email": "bob.bollard@example.com"
4025 "approvals": {
4026 "Verified": " 0",
4027 "Code-Review": " 0"
4028 },
4029 },
4030 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004031 }
Aaron Gable8c650212017-04-25 12:03:37 -07004032 }
Logan Hanks5f1c7592016-07-06 14:39:33 -07004033 }
4034----
4035
Logan Hankse2aacef2016-07-22 15:54:52 -07004036If there are any errors returned for reviewers, the entire review request will
Aaron Gable8c650212017-04-25 12:03:37 -07004037be rejected with `400 Bad Request`. None of the entries will have the
4038`reviewers` or `ccs` field set, and those which specifically failed will have
4039the `errors` field set containing details of why they failed.
Logan Hankse2aacef2016-07-22 15:54:52 -07004040
4041.Error Response
4042----
4043 HTTP/1.1 400 Bad Request
4044 Content-Disposition: attachment
4045 Content-Type: application/json; charset=UTF-8
4046
4047 )]}'
4048 {
4049 "reviewers": {
Aaron Gable8c650212017-04-25 12:03:37 -07004050 "jane.roe@example.com": {
4051 "input": "jane.roe@example.com",
4052 "error": "Account of jane.roe@example.com is inactive."
4053 },
4054 "john.doe@example.com": {
4055 "input": "john.doe@example.com"
4056 },
Logan Hankse2aacef2016-07-22 15:54:52 -07004057 "MyProjectVerifiers": {
4058 "input": "MyProjectVerifiers",
4059 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
4060 "confirm": true
4061 }
4062 }
4063 }
4064----
4065
Dave Borowitzd2e41452017-10-26 08:06:23 -04004066[[set-review-notifications]]
Logan Hanksfc055962017-06-12 14:20:53 -07004067.Notifications
4068
4069An email will be sent using the "comment" template.
4070
4071If the top-level notify property is null or not set, then notification behavior
4072depends on whether the change is WIP, whether it has started review, and whether
4073the tag property is null.
4074
4075NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*.
4076Use the notify property of the top-level link:#review-input[ReviewInput] instead.
4077
4078For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS
4079watchers*.
4080
Logan Hanksea3e3b72017-06-12 14:21:47 -07004081[options="header",cols="2,1,1,2,2"]
Logan Hanksfc055962017-06-12 14:20:53 -07004082|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004083|WIP State |Review Started|Tag Given|Default |notify=ALL
4084|Ready for review|N/A |N/A |everyone|everyone
4085|Work in progress|no |no |not sent|everyone
4086|Work in progress|no |yes |owner |everyone
4087|Work in progress|yes |no |everyone|everyone
4088|Work in progress|yes |yes |owner |everyone
4089
Logan Hanksfc055962017-06-12 14:20:53 -07004090|=============================
4091
4092If reviewers are added, then a second email will be sent using the "newchange"
4093template. The notification logic for this email is the same as for
4094link:#add-reviewer[Add Reviewer].
4095
Logan Hanksea3e3b72017-06-12 14:21:47 -07004096[options="header",cols="1,1,1"]
Logan Hanksfc055962017-06-12 14:20:53 -07004097|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004098|WIP State |Default |notify=ALL
4099|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
4100|Work in progress|not sent |owner, reviewers, CCs
Logan Hanksfc055962017-06-12 14:20:53 -07004101|=============================
4102
4103
Edwin Kempincdae63b2013-03-15 15:06:59 +01004104[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004105=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004106--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004107'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004108--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004109
4110Rebases a revision.
4111
Zalan Blenessy874aed72015-01-12 13:26:18 +01004112Optionally, the parent revision can be changed to another patch set through the
4113link:#rebase-input[RebaseInput] entity.
4114
Edwin Kempincdae63b2013-03-15 15:06:59 +01004115.Request
4116----
4117 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01004118 Content-Type: application/json;charset=UTF-8
4119
4120 {
4121 "base" : "1234",
4122 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01004123----
4124
4125As response a link:#change-info[ChangeInfo] entity is returned that
4126describes the rebased change. Information about the current patch set
4127is included.
4128
4129.Response
4130----
4131 HTTP/1.1 200 OK
4132 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004133 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004134
4135 )]}'
4136 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01004137 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4138 "project": "myProject",
4139 "branch": "master",
4140 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4141 "subject": "Implement Feature X",
4142 "status": "NEW",
4143 "created": "2013-02-01 09:59:32.126000000",
4144 "updated": "2013-02-21 11:16:36.775000000",
4145 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004146 "insertions": 21,
4147 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01004148 "_number": 4799,
4149 "owner": {
4150 "name": "John Doe"
4151 },
4152 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
4153 "revisions": {
4154 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09004155 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004156 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01004157 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004158 "fetch": {
4159 "http": {
4160 "url": "http://gerrit:8080/myProject",
4161 "ref": "refs/changes/99/4799/2"
4162 }
4163 },
4164 "commit": {
4165 "parents": [
4166 {
4167 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
4168 "subject": "Implement Feature A"
4169 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00004170 ],
4171 "author": {
4172 "name": "John Doe",
4173 "email": "john.doe@example.com",
4174 "date": "2013-05-07 15:21:27.000000000",
4175 "tz": 120
4176 },
4177 "committer": {
4178 "name": "Gerrit Code Review",
4179 "email": "gerrit-server@example.com",
4180 "date": "2013-05-07 15:35:43.000000000",
4181 "tz": 120
4182 },
4183 "subject": "Implement Feature X",
4184 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01004185 }
4186 }
4187 }
4188----
4189
4190If the revision cannot be rebased, e.g. due to conflicts, the response is
4191"`409 Conflict`" and the error message is contained in the response
4192body.
4193
4194.Response
4195----
4196 HTTP/1.1 409 Conflict
4197 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004198 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004199
4200 The change could not be rebased due to a path conflict during merge.
4201----
4202
Edwin Kempin14b58112013-02-26 16:30:19 +01004203[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004204=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004205--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004206'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004207--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004208
Edwin Kempin14b58112013-02-26 16:30:19 +01004209Submits a revision.
4210
Edwin Kempin14b58112013-02-26 16:30:19 +01004211.Request
4212----
4213 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004214 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004215----
4216
4217As response a link:#submit-info[SubmitInfo] entity is returned that
4218describes the status of the submitted change.
4219
4220.Response
4221----
4222 HTTP/1.1 200 OK
4223 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004224 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004225
4226 )]}'
4227 {
4228 "status": "MERGED"
4229 }
4230----
4231
4232If the revision cannot be submitted, e.g. because the submit rule
4233doesn't allow submitting the revision or the revision is not the
4234current revision, the response is "`409 Conflict`" and the error
4235message is contained in the response body.
4236
4237.Response
4238----
4239 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004240 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004241
4242 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
4243----
4244
Edwin Kempin257d70f2013-03-28 14:31:14 +01004245[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004246=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004247--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004248'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004249--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004250
4251Gets the formatted patch for one revision.
4252
4253.Request
4254----
4255 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
4256----
4257
Shawn Pearce98361f72013-05-10 16:27:36 -07004258The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01004259
4260.Response
4261----
4262 HTTP/1.1 200 OK
4263 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004264 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07004265 X-FYI-Content-Encoding: base64
4266 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01004267
Shawn Pearce98361f72013-05-10 16:27:36 -07004268 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01004269----
4270
David Ostrovsky973f38b2013-08-22 00:24:51 -07004271Adding query parameter `zip` (for example `/changes/.../patch?zip`)
4272returns the patch as a single file inside of a ZIP archive. Clients
4273can expand the ZIP to obtain the plain text patch, avoiding the
4274need for a base64 decoding step. This option implies `download`.
4275
4276Query parameter `download` (e.g. `/changes/.../patch?download`)
4277will suggest the browser save the patch as `commitsha1.diff.base64`,
4278for later processing by command line tools.
4279
Kasper Nilsson81448072016-10-17 15:04:33 -07004280If the `path` parameter is set, the returned content is a diff of the single
4281file that the path refers to.
4282
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004283[[submit-preview]]
Edwin Kempin807eb4b2016-10-18 15:49:41 +02004284=== Submit Preview
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004285--
4286'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit'
4287--
4288Gets a file containing thin bundles of all modified projects if this
4289change was submitted. The bundles are named `${ProjectName}.git`.
4290Each thin bundle contains enough to construct the state in which a project would
4291be in if this change were submitted. The base of the thin bundles are the
4292current target branches, so to make use of this call in a non-racy way, first
4293get the bundles and then fetch all projects contained in the bundle.
4294(This assumes no non-fastforward pushes).
4295
4296You need to give a parameter '?format=zip' or '?format=tar' to specify the
Stefan Beller3e586742016-10-05 15:23:22 -07004297format for the outer container. It is always possible to use tgz, even if
4298tgz is not in the list of allowed archive formats.
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004299
4300To make good use of this call, you would roughly need code as found at:
4301----
4302 $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh
4303----
4304.Request
4305----
4306 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0
4307----
4308
4309.Response
4310----
4311 HTTP/1.1 200 OK
4312 Date: Tue, 13 Sep 2016 19:13:46 GMT
4313 Content-Disposition: attachment; filename="submit-preview-147.zip"
4314 X-Content-Type-Options: nosniff
4315 Cache-Control: no-cache, no-store, max-age=0, must-revalidate
4316 Pragma: no-cache
4317 Expires: Mon, 01 Jan 1990 00:00:00 GMT
4318 Content-Type: application/x-zip
4319 Transfer-Encoding: chunked
4320
4321 [binary stuff]
4322----
4323
4324In case of an error, the response is not a zip file but a regular json response,
4325containing only the error message:
4326
4327.Response
4328----
4329 HTTP/1.1 200 OK
4330 Content-Disposition: attachment
4331 Content-Type: application/json; charset=UTF-8
4332
4333 )]}'
4334 "Anonymous users cannot submit"
4335----
4336
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004337[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004338=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004339--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004340'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004341--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004342
4343Gets the method the server will use to submit (merge) the change and
4344an indicator if the change is currently mergeable.
4345
4346.Request
4347----
4348 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
4349----
4350
Saša Živkov499873f2014-05-05 13:34:18 +02004351As response a link:#mergeable-info[MergeableInfo] entity is returned.
4352
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004353.Response
4354----
4355 HTTP/1.1 200 OK
4356 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004357 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004358
4359 )]}'
4360 {
4361 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004362 strategy: "recursive",
4363 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004364 }
4365----
4366
Saša Živkov697cab22014-04-29 16:46:50 +02004367If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08004368checked for all other branches which are listed in the
4369link:config-project-config.html#branchOrder-section[branchOrder] section in the
4370project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02004371
4372.Request
4373----
4374 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
4375----
4376
4377The response will then contain a list of all other branches where this changes
4378could merge cleanly.
4379
4380.Response
4381----
4382 HTTP/1.1 200 OK
4383 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004384 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02004385
4386 )]}'
4387 {
4388 submit_type: "MERGE_IF_NECESSARY",
4389 mergeable: true,
4390 mergeable_into: [
4391 "refs/heads/stable-2.7",
4392 "refs/heads/stable-2.8",
4393 ]
4394 }
4395----
4396
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004397[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004398=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004399--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004400'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004401--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004402
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004403Gets the method the server will use to submit (merge) the change.
4404
4405.Request
4406----
4407 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
4408----
4409
4410.Response
4411----
4412 HTTP/1.1 200 OK
4413 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004414 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004415
4416 )]}'
4417 "MERGE_IF_NECESSARY"
4418----
4419
4420[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004421=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004422--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004423'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004424--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004425
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004426Tests the submit_type Prolog rule in the project, or the one given.
4427
4428Request body may be either the Prolog code as `text/plain` or a
4429link:#rule-input[RuleInput] object. The query parameter `filters`
4430may be set to `SKIP` to bypass parent project filters while testing
4431a project-specific rule.
4432
4433.Request
4434----
4435 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004436 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004437
4438 submit_type(cherry_pick).
4439----
4440
4441.Response
4442----
4443 HTTP/1.1 200 OK
4444 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004445 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004446
4447 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07004448 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004449----
4450
4451[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004452=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004453--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004454'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004455--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004456
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004457Tests the submit_rule Prolog rule in the project, or the one given.
4458
4459Request body may be either the Prolog code as `text/plain` or a
4460link:#rule-input[RuleInput] object. The query parameter `filters`
4461may be set to `SKIP` to bypass parent project filters while testing
4462a project-specific rule.
4463
4464.Request
4465----
Shawn Pearcea3cce712014-03-21 08:16:11 -07004466 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004467 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004468
4469 submit_rule(submit(R)) :-
4470 R = label('Any-Label-Name', reject(_)).
4471----
4472
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004473The response is a link:#submit-record[SubmitRecord] describing the
4474permutations that satisfy the tested submit rule.
4475
David Pursehouse87a3fb02019-10-29 16:01:27 +09004476If the submit rule was a no-op, the response is "`204 No Content`".
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004477
4478.Response
4479----
4480 HTTP/1.1 200 OK
4481 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004482 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004483
4484 )]}'
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004485 {
4486 "status": "NOT_READY",
4487 "reject": {
4488 "Any-Label-Name": {}
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004489 }
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004490 }
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004491----
4492
Shawn Pearceb42e3032015-04-02 10:28:10 -07004493When testing with the `curl` command line client the
4494`--data-binary @rules.pl` flag should be used to ensure
4495all LFs are included in the Prolog code:
4496
4497----
4498 curl -X POST \
4499 -H 'Content-Type: text/plain; charset=UTF-8' \
4500 --data-binary @rules.pl \
4501 http://.../test.submit_rule
4502----
4503
Edwin Kempincb6724a2013-02-26 16:58:51 +01004504[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004505=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004506--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004507'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004508--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004509
Edwin Kempin3ca57192013-02-27 07:44:01 +01004510Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01004511user.
4512
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004513Returns a map of file paths to lists of link:#comment-info[CommentInfo]
4514entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004515
4516.Request
4517----
4518 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
4519----
4520
4521.Response
4522----
4523 HTTP/1.1 200 OK
4524 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004525 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01004526
4527 )]}'
4528 {
4529 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4530 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004531 "id": "TvcXrmjM",
4532 "line": 23,
4533 "message": "[nit] trailing whitespace",
4534 "updated": "2013-02-26 15:40:43.986000000"
4535 },
4536 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004537 "id": "TveXwFiA",
4538 "line": 49,
4539 "in_reply_to": "TfYX-Iuo",
4540 "message": "Done",
4541 "updated": "2013-02-26 15:40:45.328000000"
4542 }
4543 ]
4544 }
4545----
4546
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004547[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004548=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004549--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004550'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004551--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004552
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004553Creates a draft comment on a revision.
4554
4555The new draft comment must be provided in the request body inside a
4556link:#comment-input[CommentInput] entity.
4557
4558.Request
4559----
4560 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004561 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004562
4563 {
4564 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4565 "line": 23,
4566 "message": "[nit] trailing whitespace"
4567 }
4568----
4569
4570As response a link:#comment-info[CommentInfo] entity is returned that
4571describes the draft comment.
4572
4573.Response
4574----
4575 HTTP/1.1 200 OK
4576 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004577 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004578
4579 )]}'
4580 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004581 "id": "TvcXrmjM",
4582 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4583 "line": 23,
4584 "message": "[nit] trailing whitespace",
4585 "updated": "2013-02-26 15:40:43.986000000"
4586 }
4587----
4588
Edwin Kempin3ca57192013-02-27 07:44:01 +01004589[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004590=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004591--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004592'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 -08004593--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004594
Edwin Kempin3ca57192013-02-27 07:44:01 +01004595Retrieves a draft comment of a revision that belongs to the calling
4596user.
4597
4598.Request
4599----
4600 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4601----
4602
4603As response a link:#comment-info[CommentInfo] entity is returned that
4604describes the draft comment.
4605
4606.Response
4607----
4608 HTTP/1.1 200 OK
4609 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004610 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01004611
4612 )]}'
4613 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01004614 "id": "TvcXrmjM",
4615 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4616 "line": 23,
4617 "message": "[nit] trailing whitespace",
4618 "updated": "2013-02-26 15:40:43.986000000"
4619 }
4620----
4621
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004622[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004623=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004624--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004625'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 -08004626--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004627
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004628Updates a draft comment on a revision.
4629
4630The new draft comment must be provided in the request body inside a
4631link:#comment-input[CommentInput] entity.
4632
4633.Request
4634----
4635 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004636 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004637
4638 {
4639 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4640 "line": 23,
4641 "message": "[nit] trailing whitespace"
4642 }
4643----
4644
4645As response a link:#comment-info[CommentInfo] entity is returned that
4646describes the draft comment.
4647
4648.Response
4649----
4650 HTTP/1.1 200 OK
4651 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004652 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004653
4654 )]}'
4655 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004656 "id": "TvcXrmjM",
4657 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4658 "line": 23,
4659 "message": "[nit] trailing whitespace",
4660 "updated": "2013-02-26 15:40:43.986000000"
4661 }
4662----
4663
4664[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004665=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004666--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004667'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 -08004668--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004669
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004670Deletes a draft comment from a revision.
4671
4672.Request
4673----
4674 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4675----
4676
4677.Response
4678----
4679 HTTP/1.1 204 No Content
4680----
4681
John Spurlock5e402f02013-03-24 11:35:04 -04004682[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004683=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004684--
John Spurlock5e402f02013-03-24 11:35:04 -04004685'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004686--
John Spurlock5e402f02013-03-24 11:35:04 -04004687
4688Lists the published comments of a revision.
4689
4690As result a map is returned that maps the file path to a list of
4691link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07004692sorted by file path and only include file (or inline) comments. Use
4693the link:#get-change-detail[Get Change Detail] endpoint to retrieve
4694the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04004695
4696.Request
4697----
4698 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
4699----
4700
4701.Response
4702----
4703 HTTP/1.1 200 OK
4704 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004705 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004706
4707 )]}'
4708 {
4709 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4710 {
John Spurlock5e402f02013-03-24 11:35:04 -04004711 "id": "TvcXrmjM",
4712 "line": 23,
4713 "message": "[nit] trailing whitespace",
4714 "updated": "2013-02-26 15:40:43.986000000",
4715 "author": {
4716 "_account_id": 1000096,
4717 "name": "John Doe",
4718 "email": "john.doe@example.com"
4719 }
4720 },
4721 {
John Spurlock5e402f02013-03-24 11:35:04 -04004722 "id": "TveXwFiA",
4723 "line": 49,
4724 "in_reply_to": "TfYX-Iuo",
4725 "message": "Done",
4726 "updated": "2013-02-26 15:40:45.328000000",
4727 "author": {
4728 "_account_id": 1000097,
4729 "name": "Jane Roe",
4730 "email": "jane.roe@example.com"
4731 }
4732 }
4733 ]
4734 }
4735----
4736
4737[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004738=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004739--
John Spurlock5e402f02013-03-24 11:35:04 -04004740'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 -08004741--
John Spurlock5e402f02013-03-24 11:35:04 -04004742
4743Retrieves a published comment of a revision.
4744
4745.Request
4746----
4747 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
4748----
4749
4750As response a link:#comment-info[CommentInfo] entity is returned that
4751describes the published comment.
4752
4753.Response
4754----
4755 HTTP/1.1 200 OK
4756 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004757 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004758
4759 )]}'
4760 {
John Spurlock5e402f02013-03-24 11:35:04 -04004761 "id": "TvcXrmjM",
4762 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4763 "line": 23,
4764 "message": "[nit] trailing whitespace",
4765 "updated": "2013-02-26 15:40:43.986000000",
4766 "author": {
4767 "_account_id": 1000096,
4768 "name": "John Doe",
4769 "email": "john.doe@example.com"
4770 }
4771 }
4772----
4773
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01004774[[delete-comment]]
4775=== Delete Comment
4776--
4777'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' +
4778'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete'
4779--
4780
4781Deletes a published comment of a revision. Instead of deleting the
4782whole comment, this endpoint just replaces the comment's message
4783with a new message, which contains the name of the user who deletes
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02004784the comment and the reason why it's deleted.
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01004785
4786Note that only users with the
4787link:access-control.html#capability_administrateServer[Administrate Server]
4788global capability are permitted to delete a comment.
4789
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02004790Deletion reason can be provided in the request body as a
4791link:#delete-comment-input[DeleteCommentInput] entity.
4792Historically, this method allowed a body in the DELETE, but that behavior is
4793link:https://www.gerritcodereview.com/releases/2.16.md[deprecated].
4794In this case, use a POST request instead:
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01004795
4796.Request
4797----
4798 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0
4799 Content-Type: application/json; charset=UTF-8
4800
4801 {
4802 "reason": "contains confidential information"
4803 }
4804----
4805
4806As response a link:#comment-info[CommentInfo] entity is returned that
4807describes the updated comment.
4808
4809.Response
4810----
4811 HTTP/1.1 200 OK
4812 Content-Disposition: attachment
4813 Content-Type: application/json; charset=UTF-8
4814
4815 )]}'
4816 {
4817 "id": "TvcXrmjM",
4818 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4819 "line": 23,
4820 "message": "Comment removed by: Administrator; Reason: contains confidential information",
4821 "updated": "2013-02-26 15:40:43.986000000",
4822 "author": {
4823 "_account_id": 1000096,
4824 "name": "John Doe",
4825 "email": "john.doe@example.com"
4826 }
4827 }
4828----
4829
Edwin Kempinb050a482016-12-01 09:11:19 +01004830[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02004831=== List Robot Comments
4832--
4833'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
4834--
4835
4836Lists the link:config-robot-comments.html[robot comments] of a
4837revision.
4838
4839As result a map is returned that maps the file path to a list of
4840link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
4841map are sorted by file path.
4842
4843.Request
4844----
4845 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
4846----
4847
4848.Response
4849----
4850 HTTP/1.1 200 OK
4851 Content-Disposition: attachment
4852 Content-Type: application/json; charset=UTF-8
4853
4854 )]}'
4855 {
4856 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4857 {
4858 "id": "TvcXrmjM",
4859 "line": 23,
4860 "message": "unused import",
4861 "updated": "2016-02-26 15:40:43.986000000",
4862 "author": {
4863 "_account_id": 1000110,
4864 "name": "Code Analyzer",
4865 "email": "code.analyzer@example.com"
4866 },
4867 "robotId": "importChecker",
4868 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4869 },
4870 {
4871 "id": "TveXwFiA",
4872 "line": 49,
4873 "message": "wrong indention",
4874 "updated": "2016-02-26 15:40:45.328000000",
4875 "author": {
4876 "_account_id": 1000110,
4877 "name": "Code Analyzer",
4878 "email": "code.analyzer@example.com"
4879 },
4880 "robotId": "styleChecker",
4881 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
4882 }
4883 ]
4884 }
4885----
4886
4887[[get-robot-comment]]
4888=== Get Robot Comment
4889--
4890'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
4891--
4892
4893Retrieves a link:config-robot-comments.html[robot comment] of a
4894revision.
4895
4896.Request
4897----
4898 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
4899----
4900
4901As response a link:#robot-comment-info[RobotCommentInfo] entity is
4902returned that describes the robot comment.
4903
4904.Response
4905----
4906 HTTP/1.1 200 OK
4907 Content-Disposition: attachment
4908 Content-Type: application/json; charset=UTF-8
4909
4910 )]}'
4911 {
4912 "id": "TvcXrmjM",
4913 "line": 23,
4914 "message": "unused import",
4915 "updated": "2016-02-26 15:40:43.986000000",
4916 "author": {
4917 "_account_id": 1000110,
4918 "name": "Code Analyzer",
4919 "email": "code.analyzer@example.com"
4920 },
4921 "robotId": "importChecker",
4922 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4923 }
4924----
4925
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004926[[apply-fix]]
4927=== Apply Fix
4928--
4929'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
4930--
4931
4932Applies a suggested fix by creating a change edit which includes the
4933modifications indicated by the fix suggestion. If a change edit already exists,
4934it will be updated accordingly. A fix can only be applied if no change edit
4935exists and the fix refers to the current patch set, or the fix refers to the
4936patch set on which the change edit is based.
4937
4938.Request
4939----
4940 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
4941----
4942
4943If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
4944resulting change edit is returned.
4945
4946.Response
4947----
4948 HTTP/1.1 200 OK
4949 Content-Disposition: attachment
4950 Content-Type: application/json; charset=UTF-8
4951
4952 )]}'
4953 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01004954 "commit": {
4955 "parents": [
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004956 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01004957 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004958 }
4959 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01004960 "author": {
4961 "name": "John Doe",
4962 "email": "john.doe@example.com",
4963 "date": "2013-05-07 15:21:27.000000000",
4964 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004965 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01004966 "committer": {
4967 "name": "Jane Doe",
4968 "email": "jane.doe@example.com",
4969 "date": "2013-05-07 15:35:43.000000000",
4970 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004971 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01004972 "subject": "Implement feature X",
4973 "message": "Implement feature X\n\nWith this feature ..."
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004974 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01004975 "base_patch_set_number": 1,
4976 "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1"
4977 "ref": "refs/users/01/1000001/edit-42622/1"
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004978 }
4979----
4980
4981If the application failed e.g. due to conflicts with an existing change edit,
4982the response "`409 Conflict`" including an error message in the response body
4983is returned.
4984
4985.Response
4986----
4987 HTTP/1.1 409 Conflict
4988 Content-Disposition: attachment
4989 Content-Type: text/plain; charset=UTF-8
4990
4991 The existing change edit could not be merged with another tree.
4992----
4993
Edwin Kempin682ac712013-05-14 13:40:46 +02004994[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004995=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004996--
Edwin Kempin682ac712013-05-14 13:40:46 +02004997'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004998--
Edwin Kempin682ac712013-05-14 13:40:46 +02004999
5000Lists the files that were modified, added or deleted in a revision.
5001
5002.Request
5003----
5004 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
5005----
5006
Makson Leefaf05c22018-07-26 22:42:59 +00005007As result a map is returned that maps the link:#file-id[file path] to a
5008link:#file-info[FileInfo] entry. The entries in the map are
Edwin Kempin682ac712013-05-14 13:40:46 +02005009sorted by file path.
5010
5011.Response
5012----
5013 HTTP/1.1 200 OK
5014 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005015 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02005016
5017 )]}'
5018 {
5019 "/COMMIT_MSG": {
5020 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02005021 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005022 "size_delta": 551,
5023 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02005024 },
5025 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
5026 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02005027 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005028 "size_delta": 98,
5029 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02005030 }
5031 }
5032----
5033
Shawn Pearce984747d2013-07-18 00:42:16 -07005034The request parameter `reviewed` changes the response to return a list
5035of the paths the caller has marked as reviewed. Clients that also
5036need the FileInfo should make two requests.
5037
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005038The request parameter `q` changes the response to return a list
5039of all files (modified or unmodified) that contain that substring
5040in the path name. This is useful to implement suggestion services
David Pursehousefcfb29d2019-08-01 12:55:16 +09005041finding a file by partial name. Clients that also need the FileInfo
5042should make two requests.
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005043
David Pursehouse89c00ca2019-08-03 13:47:29 +09005044For merge commits only, the integer-valued request parameter `parent`
5045changes the response to return a map of the files which are different
5046in this commit compared to the given parent commit. The value is the
Andrii Shyshkalov350a4512019-09-23 02:26:33 -070050471-based index of the parent's position in the commit object,
5048with the first parent always belonging to the target branch. If not
David Pursehouse89c00ca2019-08-03 13:47:29 +09005049specified, the response contains a map of the files different in the
5050auto merge result.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005051
David Pursehousefcfb29d2019-08-01 12:55:16 +09005052The request parameter `base` changes the response to return a map of the
5053files which are different in this commit compared to the given revision. The
5054revision must correspond to a patch set in the change.
5055
5056The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive.
5057That is, only one of them may be used at a time.
Shawn Pearce984747d2013-07-18 00:42:16 -07005058
5059.Request
5060----
5061 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
5062----
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005063
Shawn Pearce984747d2013-07-18 00:42:16 -07005064.Response
5065----
5066 HTTP/1.1 200 OK
5067 Content-Disposition: attachment
5068 Content-Type: application/json; charset=UTF-8
5069
5070 )]}'
5071 [
Edwin Kempinaef44b02013-05-07 16:15:55 +02005072 "/COMMIT_MSG",
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005073 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005074 ]
Edwin Kempinbea55a52013-05-14 13:53:39 +02005075----
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005076
Edwin Kempinaef44b02013-05-07 16:15:55 +02005077[[get-content]]
5078=== Get Content
5079--
5080'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
5081--
5082
5083Gets the content of a file from a certain revision.
5084
Patrick Hiesel38667d42017-05-02 13:12:48 +02005085The optional, integer-valued `parent` parameter can be specified to request
5086the named file from a parent commit of the specified revision. The value is
5087the 1-based index of the parent's position in the commit object. If the
5088parameter is omitted or the value is non-positive, the patch set is referenced.
5089
Edwin Kempinaef44b02013-05-07 16:15:55 +02005090.Request
5091----
5092 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
5093----
5094
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005095The content is returned as base64 encoded string. The HTTP response
5096Content-Type is always `text/plain`, reflecting the base64 wrapping.
5097A Gerrit-specific `X-FYI-Content-Type` header is returned describing
5098the server detected content type of the file.
5099
5100If only the content type is required, callers should use HEAD to
5101avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02005102
5103.Response
5104----
5105 HTTP/1.1 200 OK
5106 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005107 Content-Type: text/plain; charset=ISO-8859-1
5108 X-FYI-Content-Encoding: base64
5109 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02005110
5111 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
5112----
5113
David Ostrovskyd0078672015-02-06 21:51:04 +01005114Alternatively, if the only value of the Accept request header is
5115`application/json` the content is returned as JSON string and
5116`X-FYI-Content-Encoding` is set to `json`.
5117
David Pletcherd1efb452015-09-01 17:45:55 -07005118[[get-safe-content]]
5119=== Download Content
5120--
5121'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
5122--
5123
5124Downloads the content of a file from a certain revision, in a safe format
5125that poses no risk for inadvertent execution of untrusted code.
5126
5127If the content type is defined as safe, the binary file content is returned
5128verbatim. If the content type is not safe, the file is stored inside a ZIP
5129file, containing a single entry with a random, unpredictable name having the
5130same base and suffix as the true filename. The ZIP file is returned in
5131verbatim binary form.
5132
5133See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
5134for information about safe file type configuration.
5135
5136The HTTP resource Content-Type is dependent on the file type: the
5137applicable type for safe files, or "application/zip" for unsafe files.
5138
David Pletcherec622bf2015-09-18 14:30:05 -07005139The optional, integer-valued `parent` parameter can be specified to request
5140the named file from a parent commit of the specified revision. The value is
5141the 1-based index of the parent's position in the commit object. If the
5142parameter is omitted or the value non-positive, the patch set is referenced.
5143
5144Filenames are decorated with a suffix of `_new` for the current patch,
5145`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07005146
5147.Request
5148----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005149 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07005150----
5151
5152.Response
5153----
5154 HTTP/1.1 200 OK
5155 Content-Disposition: attachment; filename="logo.png"
5156 Content-Type: image/png
5157
5158 `[binary data for logo.png]`
5159----
5160
5161.Request
5162----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005163 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 -07005164----
5165
5166.Response
5167----
5168 HTTP/1.1 200 OK
5169 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
5170 Content-Type:application/zip
5171
5172 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
5173----
5174
David Pursehouse882aef22013-06-05 10:56:37 +09005175[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005176=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005177--
David Pursehouse882aef22013-06-05 10:56:37 +09005178'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 -08005179--
David Pursehouse882aef22013-06-05 10:56:37 +09005180
5181Gets the diff of a file from a certain revision.
5182
5183.Request
5184----
5185 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
5186----
5187
5188As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
5189
5190.Response
5191----
5192 HTTP/1.1 200 OK
5193 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005194 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005195
5196 )]
5197 {
5198 "meta_a": {
5199 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005200 "content_type": "text/x-java-source",
5201 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005202 },
5203 "meta_b": {
5204 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005205 "content_type": "text/x-java-source",
5206 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005207 },
5208 "change_type": "MODIFIED",
5209 "diff_header": [
5210 "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",
5211 "index 59b7670..9faf81c 100644",
5212 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5213 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5214 ],
5215 "content": [
5216 {
5217 "ab": [
5218 "// Copyright (C) 2010 The Android Open Source Project",
5219 "//",
5220 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
5221 "// you may not use this file except in compliance with the License.",
5222 "// You may obtain a copy of the License at",
5223 "//",
5224 "// http://www.apache.org/licenses/LICENSE-2.0",
5225 "//",
5226 "// Unless required by applicable law or agreed to in writing, software",
5227 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
5228 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
5229 "// See the License for the specific language governing permissions and",
5230 "// limitations under the License."
5231 ]
5232 },
5233 {
5234 "b": [
5235 "//",
5236 "// Add some more lines in the header."
5237 ]
5238 },
5239 {
5240 "ab": [
5241 "",
5242 "package com.google.gerrit.server.project;",
5243 "",
5244 "import com.google.common.collect.Maps;",
5245 ...
5246 ]
5247 }
5248 ...
5249 ]
5250 }
5251----
5252
5253If the `intraline` parameter is specified, intraline differences are included in the diff.
5254
5255.Request
5256----
5257 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
5258----
5259
5260.Response
5261----
5262 HTTP/1.1 200 OK
5263 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005264 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005265
5266 )]
5267 {
5268 "meta_a": {
5269 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005270 "content_type": "text/x-java-source",
5271 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005272 },
5273 "meta_b": {
5274 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005275 "content_type": "text/x-java-source",
5276 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005277 },
5278 "change_type": "MODIFIED",
5279 "diff_header": [
5280 "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",
5281 "index 59b7670..9faf81c 100644",
5282 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5283 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5284 ],
5285 "content": [
5286 ...
5287 {
5288 "a": [
5289 "/** Manages access control for Git references (aka branches, tags). */"
5290 ],
5291 "b": [
5292 "/** Manages access control for the Git references (aka branches, tags). */"
5293 ],
5294 "edit_a": [],
5295 "edit_b": [
5296 [
5297 31,
5298 4
5299 ]
5300 ]
5301 }
5302 ]
5303 }
5304----
5305
5306The `base` parameter can be specified to control the base patch set from which the diff should
5307be generated.
5308
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005309The integer-valued request parameter `parent` can be specified to control the
5310parent commit number against which the diff should be generated. This is useful
5311for supporting review of merge commits. The value is the 1-based index of the
5312parent's position in the commit object.
5313
David Pursehouse882aef22013-06-05 10:56:37 +09005314.Request
5315----
5316 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
5317----
5318
5319.Response
5320----
5321 HTTP/1.1 200 OK
5322 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005323 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005324
5325 )]
5326 {
5327 "meta_a": {
5328 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005329 "content_type": "text/x-java-source",
5330 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005331 },
5332 "meta_b": {
5333 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005334 "content_type": "text/x-java-source",
5335 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005336 },
5337 "change_type": "MODIFIED",
5338 "content": [
5339 {
5340 "skip": 578
5341 }
5342 ]
5343 }
5344----
5345
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01005346The `whitespace` parameter can be specified to control how whitespace
5347differences are reported in the result. Valid values are `IGNORE_NONE`,
5348`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09005349
5350The `context` parameter can be specified to control the number of lines of surrounding context
5351in the diff. Valid values are `ALL` or number of lines.
5352
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005353[[get-blame]]
5354=== Get Blame
5355--
5356'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
5357--
5358
5359Gets the blame of a file from a certain revision.
5360
5361.Request
5362----
5363 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
5364----
5365
5366As response a link:#blame-info[BlameInfo] entity is returned that describes the
5367blame.
5368
5369.Response
5370----
5371 HTTP/1.1 200 OK
5372 Content-Disposition: attachment
5373 Content-Type: application/json; charset=UTF-8
5374
5375 )]
5376 {
5377 [
5378 {
5379 "author": "Joe Daw",
5380 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
5381 "time": 1421441349,
5382 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
5383 "ranges": [
5384 {
5385 "start": 1,
5386 "end": 10
5387 },
5388 {
5389 "start": 16,
5390 "end": 296
5391 }
5392 ]
5393 },
5394 {
5395 "author": "Jane Daw",
5396 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
5397 "time": 1421825421,
5398 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
5399 "ranges": [
5400 {
5401 "start": 13,
5402 "end": 13
5403 }
5404 ]
5405 }
5406 ]
5407 }
5408----
5409
5410The `base` parameter can be specified to control the base patch set from which
5411the blame should be generated.
5412
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005413[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005414=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005415--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005416'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 -08005417--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005418
Edwin Kempinbea55a52013-05-14 13:53:39 +02005419Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005420
5421.Request
5422----
5423 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5424----
5425
5426.Response
5427----
5428 HTTP/1.1 201 Created
5429----
5430
Edwin Kempinbea55a52013-05-14 13:53:39 +02005431If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005432response is "`200 OK`".
5433
5434[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005435=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005436--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005437'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 -08005438--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005439
Edwin Kempinbea55a52013-05-14 13:53:39 +02005440Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005441
5442.Request
5443----
5444 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5445----
5446
5447.Response
5448----
5449 HTTP/1.1 204 No Content
5450----
5451
Gustaf Lundh019fb262012-11-28 14:20:22 +01005452[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005453=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005454--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005455'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005456--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005457
5458Cherry picks a revision to a destination branch.
5459
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02005460To cherry pick a commit with no change-id associated with it, see
5461link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit].
5462
Gustaf Lundh019fb262012-11-28 14:20:22 +01005463The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02005464link:#cherrypick-input[CherryPickInput] entity. If the commit message
5465does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005466
5467.Request
5468----
5469 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005470 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005471
5472 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01005473 "message" : "Implementing Feature X",
5474 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01005475 }
5476----
5477
Edwin Kempin5ac370d2018-10-05 13:39:34 +02005478As response a link:#cherry-pick-change-info[CherryPickChangeInfo]
5479entity is returned that describes the resulting cherry-pick change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005480
5481.Response
5482----
5483 HTTP/1.1 200 OK
5484 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005485 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005486
5487 )]}'
5488 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01005489 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
5490 "project": "myProject",
5491 "branch": "release-branch",
5492 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
5493 "subject": "Implementing Feature X",
5494 "status": "NEW",
5495 "created": "2013-02-01 09:59:32.126000000",
5496 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01005497 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005498 "insertions": 12,
5499 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01005500 "_number": 3965,
5501 "owner": {
5502 "name": "John Doe"
5503 }
5504 }
5505----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005506
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005507[[revision-reviewer-endpoints]]
5508== Revision Reviewer Endpoints
5509
5510[[list-revision-reviewers]]
5511=== List Revision Reviewers
5512--
5513'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
5514--
5515
5516Lists the reviewers of a revision.
5517
5518Please note that only the current revision is supported.
5519
5520As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
5521
5522.Request
5523----
5524 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
5525----
5526
5527.Response
5528----
5529 HTTP/1.1 200 OK
5530 Content-Disposition: attachment
5531 Content-Type: application/json; charset=UTF-8
5532
5533 )]}'
5534 [
5535 {
5536 "approvals": {
5537 "Verified": "+1",
5538 "Code-Review": "+2"
5539 },
5540 "_account_id": 1000096,
5541 "name": "John Doe",
5542 "email": "john.doe@example.com"
5543 },
5544 {
5545 "approvals": {
5546 "Verified": " 0",
5547 "Code-Review": "-1"
5548 },
5549 "_account_id": 1000097,
5550 "name": "Jane Roe",
5551 "email": "jane.roe@example.com"
5552 }
5553 ]
5554----
5555
5556[[list-revision-votes]]
5557=== List Revision Votes
5558--
5559'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
5560--
5561
5562Lists the votes for a specific reviewer of the revision.
5563
5564Please note that only the current revision is supported.
5565
5566.Request
5567----
5568 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
5569----
5570
5571As result a map is returned that maps the label name to the label value.
5572The entries in the map are sorted by label name.
5573
5574.Response
5575----
5576 HTTP/1.1 200 OK
5577 Content-Disposition: attachment
5578 Content-Type: application/json;charset=UTF-8
5579
5580 )]}'
5581 {
5582 "Code-Review": -1,
5583 "Verified": 1,
5584 "Work-In-Progress": 1
5585 }
5586----
5587
5588[[delete-revision-vote]]
5589=== Delete Revision Vote
5590--
5591'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5592/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
5593'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5594/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
5595--
5596
5597Deletes a single vote from a revision. The deletion will be possible only
5598if the revision is the current revision. By using this endpoint you can prevent
5599deleting the vote (with same label) from a newer patch set by mistake.
5600
5601Note, that even when the last vote of a reviewer is removed the reviewer itself
5602is still listed on the change.
5603
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005604.Request
5605----
5606 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
5607 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5608----
5609
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005610Options can be provided in the request body as a
5611link:#delete-vote-input[DeleteVoteInput] entity.
5612Historically, this method allowed a body in the DELETE, but that behavior is
5613link:https://www.gerritcodereview.com/releases/2.16.md[deprecated].
5614In this case, use a POST request instead:
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005615
5616.Request
5617----
5618 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5619 Content-Type: application/json; charset=UTF-8
5620
5621 {
5622 "notify": "NONE"
5623 }
5624----
5625
5626.Response
5627----
5628 HTTP/1.1 204 No Content
5629----
5630
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005631[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005632== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005633
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005634[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005635=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005636--
5637--
5638
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005639[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005640=== \{change-id\}
Patrick Hiesel18da0452017-12-21 14:02:05 +01005641Identifier that uniquely identifies one change. It contains the URL-encoded
5642project name as well as the change number: "'$$<project>~<numericId>$$'"
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005643
Patrick Hiesel18da0452017-12-21 14:02:05 +01005644Depending on the server's configuration, Gerrit can still support the following
5645deprecated identifiers. These will be removed in a future release:
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005646
5647* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
5648 where for the branch the `refs/heads/` prefix can be omitted
5649 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
5650* a Change-Id if it uniquely identifies one change
5651 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
Patrick Hiesel4d2dd182017-05-09 17:35:18 +02005652* a numeric change ID ("4247")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005653
Patrick Hiesel18da0452017-12-21 14:02:05 +01005654If you need more time to migrate off of old change IDs, please see
5655link:config-gerrit.html#change.api.allowedIdentifier[change.api.allowedIdentifier]
5656for more information on how to enable the use of deprecated identifiers.
5657
Changcheng Xiaod61590f2018-04-30 10:59:14 +02005658[[change-message-id]]
5659=== \{change-message-id\}
5660ID of a change message returned in a link:#change-message-info[ChangeMessageInfo].
5661
John Spurlock5e402f02013-03-24 11:35:04 -04005662[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005663=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04005664UUID of a published comment.
5665
Edwin Kempin3ca57192013-02-27 07:44:01 +01005666[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005667=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01005668UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005669
David Ostrovskybeb0b842014-12-13 00:24:29 +01005670[[label-id]]
5671=== \{label-id\}
5672The name of the label.
5673
Edwin Kempinbea55a52013-05-14 13:53:39 +02005674[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09005675=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02005676The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005677
David Pursehouse11badbb2017-03-27 10:58:05 +09005678The following magic paths are supported:
5679
5680* `/COMMIT_MSG`:
5681+
5682The commit message and headers with the parent commit(s), the author
5683information and the committer information.
5684
5685* `/MERGE_LIST` (for merge commits only):
5686+
5687The list of commits that are being integrated into the destination
5688branch by submitting the merge commit.
5689
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005690[[fix-id]]
5691=== \{fix-id\}
5692UUID of a suggested fix.
5693
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005694[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005695=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005696Identifier that uniquely identifies one revision of a change.
5697
5698This can be:
5699
Shawn Pearce9c0722a2013-03-02 15:30:31 -08005700* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005701* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
5702* an abbreviated commit ID that uniquely identifies one revision of the
5703 change ("674ac754"), at least 4 digits are required
5704* a legacy numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02005705* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005706
Edwin Kempine3446292013-02-19 16:40:14 +01005707[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005708== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01005709
Edwin Kempined5364b2013-02-22 10:39:33 +01005710[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005711=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01005712The `AbandonInput` entity contains information for abandoning a change.
5713
David Pursehouseae367192014-11-25 17:24:47 +09005714[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005715|=============================
5716|Field Name ||Description
5717|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01005718Message to be added as review comment to the change when abandoning the
5719change.
Edwin Kempincd07df42016-12-01 09:10:09 +01005720|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07005721Notify handling that defines to whom email notifications should be sent after
5722the change is abandoned. +
5723Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5724If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01005725|`notify_details`|optional|
5726Additional information about whom to notify about the update as a map
5727of recipient type to link:#notify-info[NotifyInfo] entity.
5728|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01005729
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005730[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005731=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005732The `ActionInfo` entity describes a REST API call the client can
5733make to manipulate a resource. These are frequently implemented by
5734plugins and may be discovered at runtime.
5735
David Pursehouseae367192014-11-25 17:24:47 +09005736[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005737|====================================
5738|Field Name ||Description
5739|`method` |optional|
5740HTTP method to use with the action. Most actions use `POST`, `PUT`
5741or `DELETE` to cause state changes.
5742|`label` |optional|
5743Short title to display to a user describing the action. In the
5744Gerrit web interface the label is used as the text on the button
5745presented in the UI.
5746|`title` |optional|
5747Longer text to display describing the action. In a web UI this
5748should be the title attribute of the element, displaying when
5749the user hovers the mouse.
5750|`enabled` |optional|
5751If true the action is permitted at this time and the caller is
5752likely allowed to execute it. This may change if state is updated
5753at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005754|====================================
5755
Edwin Kempin392328e2013-02-25 12:50:03 +01005756[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005757=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01005758The `AddReviewerResult` entity describes the result of adding a
5759reviewer to a change.
5760
David Pursehouseae367192014-11-25 17:24:47 +09005761[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01005762|===========================
5763|Field Name ||Description
Logan Hanks23e70282016-07-06 14:31:56 -07005764|`input` ||
5765Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
5766set while adding the reviewer.
Edwin Kempin392328e2013-02-25 12:50:03 +01005767|`reviewers` |optional|
5768The newly added reviewers as a list of link:#reviewer-info[
5769ReviewerInfo] entities.
Logan Hanksee0a4182016-07-06 14:39:26 -07005770|`ccs` |optional|
5771The newly CCed accounts as a list of link:#reviewer-info[
5772ReviewerInfo] entities. This field will only appear if the requested
5773`state` for the reviewer was `CC` *and* NoteDb is enabled on the
5774server.
Edwin Kempin392328e2013-02-25 12:50:03 +01005775|`error` |optional|
5776Error message explaining why the reviewer could not be added. +
5777If a group was specified in the input and an error is returned, it
5778means that none of the members were added as reviewer.
5779|`confirm` |`false` if not set|
5780Whether adding the reviewer requires confirmation.
5781|===========================
5782
Edwin Kempine3446292013-02-19 16:40:14 +01005783[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005784=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005785The `ApprovalInfo` entity contains information about an approval from a
5786user for a label on a change.
5787
Edwin Kempin963dfd02013-02-27 12:39:32 +01005788`ApprovalInfo` has the same fields as
5789link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01005790In addition `ApprovalInfo` has the following fields:
5791
David Pursehouseae367192014-11-25 17:24:47 +09005792[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005793|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005794|Field Name ||Description
5795|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07005796The vote that the user has given for the label. If present and zero, the
5797user is permitted to vote on the label. If absent, the user is not
5798permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005799|`permitted_voting_range` |optional|
5800The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
5801on that label. If present, the user is permitted to vote on the label
5802regarding the range values. If absent, the user is not permitted to vote
5803on that label.
5804|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01005805The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005806|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005807Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00005808while posting the review. Votes/comments that contain `tag` with
5809'autogenerated:' prefix can be filtered out in the web UI.
5810NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005811invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04005812|`post_submit` |not set if `false`|
5813If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01005814|===========================
5815
Sven Selberg273a4aa2016-09-21 16:28:10 +02005816[[assignee-input]]
5817=== AssigneeInput
5818The `AssigneeInput` entity contains the identity of the user to be set as assignee.
5819
5820[options="header",cols="1,^1,5"]
5821|===========================
5822|Field Name ||Description
5823|`assignee` ||
5824The link:rest-api-accounts.html#account-id[ID] of one account that
5825should be added as assignee.
5826|===========================
5827
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005828[[blame-info]]
5829=== BlameInfo
5830The `BlameInfo` entity stores the commit metadata with the row coordinates where
5831it applies.
5832
5833[options="header",cols="1,6"]
5834|===========================
5835|Field Name | Description
5836|`author` | The author of the commit.
5837|`id` | The id of the commit.
5838|`time` | Commit time.
5839|`commit_msg` | The commit message.
5840|`ranges` |
5841The blame row coordinates as link:#range-info[RangeInfo] entities.
5842|===========================
5843
Edwin Kempin521c1242015-01-23 12:44:44 +01005844[[change-edit-input]]
5845=== ChangeEditInput
5846The `ChangeEditInput` entity contains information for restoring a
5847path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005848
Edwin Kempin521c1242015-01-23 12:44:44 +01005849[options="header",cols="1,^1,5"]
5850|===========================
5851|Field Name ||Description
5852|`restore_path`|optional|Path to file to restore.
5853|`old_path` |optional|Old path to file to rename.
5854|`new_path` |optional|New path to file to rename.
5855|===========================
5856
5857[[change-edit-message-input]]
5858=== ChangeEditMessageInput
5859The `ChangeEditMessageInput` entity contains information for changing
5860the commit message within a change edit.
5861
5862[options="header",cols="1,^1,5"]
5863|===========================
5864|Field Name ||Description
5865|`message` ||New commit message.
5866|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005867
Edwin Kempine3446292013-02-19 16:40:14 +01005868[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005869=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005870The `ChangeInfo` entity contains information about a change.
5871
David Pursehouseae367192014-11-25 17:24:47 +09005872[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005873|==================================
5874|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01005875|`id` ||
5876The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05005877where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01005878`refs/heads/` prefix is omitted.
5879|`project` ||The name of the project.
5880|`branch` ||
5881The name of the target branch. +
5882The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01005883|`topic` |optional|The topic to which this change belongs.
Edwin Kempin93b74fb2017-08-25 10:42:56 +02005884|`assignee` |optional|
5885The assignee of the change as an link:rest-api-accounts.html#account-info[
5886AccountInfo] entity.
5887|`hashtags` |optional|
5888List of hashtags that are set on the change (only populated when NoteDb
5889is enabled).
Edwin Kempine3446292013-02-19 16:40:14 +01005890|`change_id` ||The Change-Id of the change.
5891|`subject` ||
5892The subject of the change (header line of the commit message).
5893|`status` ||
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01005894The status of the change (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempine3446292013-02-19 16:40:14 +01005895|`created` ||
5896The link:rest-api.html#timestamp[timestamp] of when the change was
5897created.
5898|`updated` ||
5899The link:rest-api.html#timestamp[timestamp] of when the change was last
5900updated.
Khai Do96a7caf2016-01-07 14:07:54 -08005901|`submitted` |only set for merged changes|
5902The link:rest-api.html#timestamp[timestamp] of when the change was
5903submitted.
Dave Borowitz8ec31f92017-08-23 10:28:34 -04005904|`submitter` |only set for merged changes|
5905The user who submitted the change, as an
5906link:rest-api-accounts.html#account-info[ AccountInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01005907|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02005908Whether the calling user has starred this change with the default label.
5909|`stars` |optional|
5910A list of star labels that are applied by the calling user to this
5911change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01005912|`reviewed` |not set if `false`|
5913Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005914Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05005915|`submit_type` |optional|
Changcheng Xiao21885982019-01-15 18:16:51 +01005916The link:config-project-config.html#submit-type[submit type] of the change. +
Dave Borowitzace32102015-12-17 13:08:25 -05005917Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01005918|`mergeable` |optional|
5919Whether the change is mergeable. +
Han-Wen Nienhuys19de6cd2018-01-16 13:15:38 +01005920Not set for merged changes, if the change has not yet been tested, or
Patrick Hieseldb8df482019-01-24 10:11:23 +01005921if the link:#skip_mergeable[skip_mergeable] option is set or when
5922link:config-gerrit.html#change.api.excludeMergeableInChangeInfo[change.api.excludeMergeableInChangeInfo]
5923is set.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07005924|`submittable` |optional|
5925Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07005926Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005927|`insertions` ||
5928Number of inserted lines.
5929|`deletions` ||
5930Number of deleted lines.
Dave Borowitzc001f322018-10-31 14:31:08 -07005931|`total_comment_count` |optional|
5932Total number of inline comments across all patch sets. Not set if the current
5933change index doesn't have the data.
Changcheng Xiao81c48092017-02-08 13:04:07 +01005934|`unresolved_comment_count` |optional|
Dave Borowitzc001f322018-10-31 14:31:08 -07005935Number of unresolved inline comment threads across all patch sets. Not set if
5936the current change index doesn't have the data.
Edwin Kempine3446292013-02-19 16:40:14 +01005937|`_number` ||The legacy numeric ID of the change.
5938|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01005939The owner of the change as an link:rest-api-accounts.html#account-info[
5940AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07005941|`actions` |optional|
5942Actions the caller might be able to perform on this revision. The
5943information is a map of view name to link:#action-info[ActionInfo]
5944entities.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01005945|`requirements` |optional|
5946List of the link:rest-api-changes.html#requirement[requirements] to be met before this change
5947can be submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01005948|`labels` |optional|
5949The labels of the change as a map that maps the label names to
5950link:#label-info[LabelInfo] entries. +
5951Only set if link:#labels[labels] or link:#detailed-labels[detailed
5952labels] are requested.
5953|`permitted_labels` |optional|
5954A map of the permitted labels that maps a label name to the list of
5955values that are allowed for that label. +
5956Only set if link:#detailed-labels[detailed labels] are requested.
5957|`removable_reviewers`|optional|
5958The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01005959link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01005960Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07005961|`reviewers` |optional|
Edwin Kempin66af3d82015-11-10 17:38:40 -08005962The reviewers as a map that maps a reviewer state to a list of
5963link:rest-api-accounts.html#account-info[AccountInfo] entities.
5964Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
5965`REVIEWER`: Users with at least one non-zero vote on the change. +
5966`CC`: Users that were added to the change, but have not voted. +
5967`REMOVED`: Users that were previously reviewers on the change, but have
5968been removed. +
5969Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07005970|`pending_reviewers` |optional|
5971Updates to `reviewers` that have been made while the change was in the
5972WIP state. Only present on WIP changes and only if there are pending
5973reviewer updates to report. These are reviewers who have not yet been
5974notified about being added to or removed from the change. +
5975Only set if link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07005976|`reviewer_updates`|optional|
5977Updates to reviewers set for the change as
5978link:#review-update-info[ReviewerUpdateInfo] entities.
5979Only set if link:#reviewer-updates[reviewer updates] are requested and
5980if NoteDb is enabled.
John Spurlock74a70cc2013-03-23 16:41:50 -04005981|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005982Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04005983link:#change-message-info[ChangeMessageInfo] entities. +
5984Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005985|`current_revision` |optional|
5986The commit ID of the current patch set of this change. +
5987Only set if link:#current-revision[the current revision] is requested
5988or if link:#all-revisions[all revisions] are requested.
5989|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05005990All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01005991patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08005992Only set if link:#current-revision[the current revision] is requested
5993(in which case it will only contain a key for the current revision) or
5994if link:#all-revisions[all revisions] are requested.
Makson Lee3568a932017-08-28 17:12:03 +08005995|`tracking_ids` |optional|
5996A list of link:#tracking-id-info[TrackingIdInfo] entities describing
5997references to external tracking systems. Only set if
5998link:#tracking-ids[tracking ids] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005999|`_more_changes` |optional, not set if `false`|
6000Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08006001Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05006002|`problems` |optional|
6003A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08006004problems with this change. Only set if link:#check[CHECK] is set.
David Ostrovskycb19cec2017-04-28 11:55:45 +02006005|`is_private` |optional, not set if `false`|
6006When present, change is marked as private.
David Ostrovsky258849b2017-03-09 23:21:03 +01006007|`work_in_progress` |optional, not set if `false`|
6008When present, change is marked as Work In Progress.
Logan Hanks724b24c2017-07-14 10:01:05 -07006009|`has_review_started` |optional, not set if `false`|
Logan Hanks296cd892017-05-03 15:14:41 -07006010When present, change has been marked Ready at some point in time.
Patrick Hiesel828f3222017-07-13 14:18:38 +02006011|`revert_of` |optional|
6012The numeric Change-Id of the change that this change reverts.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006013|==================================
6014
6015[[change-input]]
6016=== ChangeInput
6017The `ChangeInput` entity contains information about creating a new change.
6018
6019[options="header",cols="1,^1,5"]
6020|==================================
6021|Field Name ||Description
6022|`project` ||The name of the project.
6023|`branch` ||
6024The name of the target branch. +
6025The `refs/heads/` prefix is omitted.
6026|`subject` ||
David Pursehouse38cb32d2018-06-07 14:44:33 +09006027The commit message of the change. Comment lines (beginning with `#`) will
6028be removed.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006029|`topic` |optional|The topic to which this change belongs.
6030|`status` |optional, default to `NEW`|
David Ostrovsky4b44bdc2017-07-27 08:05:43 +02006031The status of the change (only `NEW` accepted here).
Edwin Kempin14d50ed2017-05-03 13:26:30 +02006032|`is_private` |optional, default to `false`|
6033Whether the new change should be marked as private.
6034|`work_in_progress` |optional, default to `false`|
6035Whether the new change should be set to work in progress.
David Ostrovsky9d8ec422014-12-24 00:52:09 +01006036|`base_change` |optional|
6037A link:#change-id[\{change-id\}] that identifies the base change for a create
Aaron Gablee8e73282018-04-26 11:09:30 -07006038change operation. Mutually exclusive with `base_commit`.
6039|`base_commit` |optional|
6040A 40-digit hex SHA-1 of the commit which will be the parent commit of the newly
6041created change. If set, it must be a merged commit on the destination branch.
6042Mutually exclusive with `base_change`.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006043|`new_branch` |optional, default to `false`|
Edwin Kempine94bb872019-10-08 13:47:41 +02006044Allow creating a new branch when set to `true`. Using this option is
6045only possible for non-merge commits (if the `merge` field is not set).
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006046|`merge` |optional|
6047The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempine94bb872019-10-08 13:47:41 +02006048If set, the target branch (see `branch` field) must exist (it is not
6049possible to create it automatically by setting the `new_branch` field
6050to `true`.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01006051|`notify` |optional|
6052Notify handling that defines to whom email notifications should be sent
6053after the change is created. +
6054Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6055If not set, the default is `ALL`.
6056|`notify_details` |optional|
6057Additional information about whom to notify about the change creation
6058as a map of recipient type to link:#notify-info[NotifyInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01006059|==================================
6060
John Spurlock74a70cc2013-03-23 16:41:50 -04006061[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006062=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04006063The `ChangeMessageInfo` entity contains information about a message
6064attached to a change.
6065
David Pursehouseae367192014-11-25 17:24:47 +09006066[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04006067|==================================
6068|Field Name ||Description
6069|`id` ||The ID of the message.
6070|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07006071Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04006072link:rest-api-accounts.html#account-info[AccountInfo] entity. +
6073Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01006074|`real_author` |optional|
6075Real author of the message as an
6076link:rest-api-accounts.html#account-info[AccountInfo] entity. +
6077Set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04006078|`date` ||
6079The link:rest-api.html#timestamp[timestamp] this message was posted.
6080|`message` ||The text left by the user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006081|`tag` |optional|
6082Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006083while posting the review. Votes/comments that contain `tag` with
6084'autogenerated:' prefix can be filtered out in the web UI.
6085NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006086invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04006087|`_revision_number` |optional|
6088Which patchset (if any) generated this message.
6089|==================================
6090
Edwin Kempin5ac370d2018-10-05 13:39:34 +02006091[[cherry-pick-change-info]]
6092=== CherryPickChangeInfo
6093The `CherryPickChangeInfo` entity contains information about a
6094cherry-pick change.
6095
6096`CherryPickChangeInfo` has the same fields as link:#change-info[
6097ChangeInfo]. In addition `CherryPickChangeInfo` has the following
6098fields:
6099
6100[options="header",cols="1,^1,5"]
6101|======================================
6102|Field Name ||Description
6103|`contains_git_conflicts` |optional, not set if `false`|
6104Whether any file in the change contains Git conflict markers.
6105|======================================
6106
6107
Gustaf Lundh019fb262012-11-28 14:20:22 +01006108[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006109=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01006110The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
6111
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006112[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01006113|===========================
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006114|Field Name ||Description
Edwin Kempin159804b2019-09-23 11:09:39 +02006115|`message` |optional|
6116Commit message for the cherry-pick change. If not set, the commit message of
6117the cherry-picked commit is used.
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006118|`destination` ||Destination branch
Changcheng Xiaoe3332582017-05-26 15:29:41 +02006119|`base` |optional|
612040-hex digit SHA-1 of the commit which will be the parent commit of the newly created change.
6121If set, it must be a merged commit or a change revision on the destination branch.
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006122|`parent` |optional, defaults to 1|
6123Number of the parent relative to which the cherry-pick should be considered.
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02006124|`notify` |optional|
6125Notify handling that defines to whom email notifications should be sent
6126after the cherry-pick. +
6127Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6128If not set, the default is `NONE`.
6129|`notify_details` |optional|
6130Additional information about whom to notify about the update as a map
6131of recipient type to link:#notify-info[NotifyInfo] entity.
Aaron Gable54bc9832017-07-05 14:44:36 -07006132|`keep_reviewers` |optional, defaults to false|
Edwin Kempin5ac370d2018-10-05 13:39:34 +02006133If `true`, carries reviewers and ccs over from original change to newly created one.
6134|`allow_conflicts` |optional, defaults to false|
6135If `true`, the cherry-pick uses content merge and succeeds also if
6136there are conflicts. If there are conflicts the file contents of the
6137created change contain git conflict markers to indicate the conflicts.
6138Callers can find out if there were conflicts by checking the
6139`contains_git_conflicts` field in the link:#cherry-pick-change-info[
6140CherryPickChangeInfo] that is returned by the cherry-pick REST
Edwin Kempin3c4113a2018-10-12 10:49:33 +02006141endpoints. If there are conflicts the cherry-pick change is marked as
6142work-in-progress.
Gustaf Lundh019fb262012-11-28 14:20:22 +01006143|===========================
6144
Edwin Kempincb6724a2013-02-26 16:58:51 +01006145[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006146=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05006147The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006148
David Pursehouseae367192014-11-25 17:24:47 +09006149[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01006150|===========================
6151|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07006152|`patch_set` |optional|
6153The patch set number for the comment; only set in contexts where +
6154comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04006155|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006156|`path` |optional|
6157The path of the file for which the inline comment was done. +
6158Not set if returned in a map where the key is the file path.
6159|`side` |optional|
6160The side on which the comment was added. +
6161Allowed values are `REVISION` and `PARENT`. +
6162If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01006163|`parent` |optional|
6164The 1-based parent number. Used only for merge commits when `side == PARENT`.
6165When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006166|`line` |optional|
6167The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04006168If range is set, this equals the end line of the range. +
6169If neither line nor range is set, it's a file comment.
6170|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09006171The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04006172entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006173|`in_reply_to` |optional|
6174The URL encoded UUID of the comment to which this comment is a reply.
6175|`message` |optional|The comment message.
6176|`updated` ||
6177The link:rest-api.html#timestamp[timestamp] of when this comment was
6178written.
John Spurlock5e402f02013-03-24 11:35:04 -04006179|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09006180The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04006181link:rest-api-accounts.html#account-info[AccountInfo] entity. +
6182Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006183|`tag` |optional|
6184Value of the `tag` field from link:#review-input[ReviewInput] set
6185while posting the review.
Sven Selberg1a6728d2018-09-28 12:30:12 +02006186NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006187invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08006188|`unresolved` |optional|
6189Whether or not the comment must be addressed by the user. The state of
6190resolution of a comment thread is stored in the last comment in that thread
6191chronologically.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006192|===========================
6193
Edwin Kempin67498de2013-02-25 16:15:34 +01006194[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006195=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03006196The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01006197comment.
6198
David Pursehouseae367192014-11-25 17:24:47 +09006199[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006200|===========================
6201|Field Name ||Description
6202|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01006203The URL encoded UUID of the comment if an existing draft comment should
6204be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01006205|`path` |optional|
6206The path of the file for which the inline comment should be added. +
6207Doesn't need to be set if contained in a map where the key is the file
6208path.
Edwin Kempin67498de2013-02-25 16:15:34 +01006209|`side` |optional|
6210The side on which the comment should be added. +
6211Allowed values are `REVISION` and `PARENT`. +
6212If not set, the default is `REVISION`.
6213|`line` |optional|
6214The number of the line for which the comment should be added. +
6215`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04006216If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09006217If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04006218|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09006219The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04006220entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01006221|`in_reply_to` |optional|
6222The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01006223|`updated` |optional|
6224The link:rest-api.html#timestamp[timestamp] of this comment. +
6225Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01006226|`message` |optional|
6227The comment message. +
6228If not set and an existing draft comment is updated, the existing draft
6229comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04006230|`tag` |optional, drafts only|
6231Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
6232inputs; for published comments, use the `tag` field in +
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006233link#review-input[ReviewInput]. Votes/comments that contain `tag` with
6234'autogenerated:' prefix can be filtered out in the web UI.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08006235|`unresolved` |optional|
6236Whether or not the comment must be addressed by the user. This value will
6237default to false if the comment is an orphan, or the value of the `in_reply_to`
6238comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01006239|===========================
6240
Michael Zhou596c7682013-08-25 05:43:34 -04006241[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006242=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04006243The `CommentRange` entity describes the range of an inline comment.
6244
Quinten Yearsley31786712018-07-16 13:44:33 -07006245The comment range is a range from the start position, specified by `start_line`
6246and `start_character`, to the end position, specified by `end_line` and
6247`end_character`. The start position is *inclusive* and the end position is
6248*exclusive*.
6249
6250So, a range over part of a line will have `start_line` equal to
6251`end_line`; however a range with `end_line` set to 5 and `end_character` equal
6252to 0 will not include any characters on line 5,
6253
David Pursehouseae367192014-11-25 17:24:47 +09006254[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04006255|===========================
Quinten Yearsley31786712018-07-16 13:44:33 -07006256|Field Name ||Description
6257|`start_line` ||The start line number of the range. (1-based)
6258|`start_character` ||The character position in the start line. (0-based)
6259|`end_line` ||The end line number of the range. (1-based)
6260|`end_character` ||The character position in the end line. (0-based)
Michael Zhou596c7682013-08-25 05:43:34 -04006261|===========================
6262
Edwin Kempine3446292013-02-19 16:40:14 +01006263[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006264=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006265The `CommitInfo` entity contains information about a commit.
6266
Edwin Kempinf0c57152015-07-15 18:18:24 +02006267[options="header",cols="1,^1,5"]
6268|===========================
6269|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02006270|`commit` |Optional|
6271The commit ID. Not set if included in a link:#revision-info[
6272RevisionInfo] entity that is contained in a map which has the commit ID
6273as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006274|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01006275The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02006276link:#commit-info[CommitInfo] entities. In each parent
6277only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006278|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01006279link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006280|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01006281link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006282|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01006283The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02006284|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01006285|`web_links` |optional|
6286Links to the commit in external sites as a list of
6287link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006288|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01006289
Patrick Hieselfda96452017-06-14 16:44:54 +02006290[[commit-message-input]]
6291=== CommitMessageInput
6292The `CommitMessageInput` entity contains information for changing
6293the commit message of a change.
6294
6295[options="header",cols="1,^1,5"]
6296|=============================
6297|Field Name ||Description
6298|`message` ||New commit message.
6299|`notify` |optional|
6300Notify handling that defines to whom email notifications should be sent
6301after the commit message was updated. +
6302Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Logan Hanksa1e68dc2017-06-29 15:13:27 -07006303If not set, the default is `OWNER` for WIP changes and `ALL` otherwise.
Patrick Hieselfda96452017-06-14 16:44:54 +02006304|`notify_details`|optional|
6305Additional information about whom to notify about the update as a map
6306of recipient type to link:#notify-info[NotifyInfo] entity.
6307|=============================
6308
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02006309[[delete-change-message-input]]
6310=== DeleteChangeMessageInput
6311The `DeleteChangeMessageInput` entity contains the options for deleting a change message.
6312
6313[options="header",cols="1,^1,5"]
6314|=============================
6315|Field Name ||Description
6316|`reason` |optional|
6317The reason why the change message should be deleted. +
6318If set, the change message will be replaced with
6319"Change message removed by: `name`\nReason: `reason`",
6320or just "Change message removed by: `name`." if not set.
6321|=============================
6322
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01006323[[delete-comment-input]]
6324=== DeleteCommentInput
6325The `DeleteCommentInput` entity contains the option for deleting a comment.
6326
6327[options="header",cols="1,^1,5"]
6328|=============================
6329|Field Name ||Description
6330|`reason` |optional|
6331The reason why the comment should be deleted. +
6332If set, the comment's message will be replaced with
6333"Comment removed by: `name`; Reason: `reason`",
6334or just "Comment removed by: `name`." if not set.
6335|=============================
6336
Edwin Kempin407fca32016-08-29 12:01:00 +02006337[[delete-reviewer-input]]
6338=== DeleteReviewerInput
6339The `DeleteReviewerInput` entity contains options for the deletion of a
6340reviewer.
6341
6342[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006343|=============================
6344|Field Name ||Description
6345|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02006346Notify handling that defines to whom email notifications should be sent
6347after the reviewer is deleted. +
6348Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6349If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006350|`notify_details`|optional|
6351Additional information about whom to notify about the update as a map
6352of recipient type to link:#notify-info[NotifyInfo] entity.
6353|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02006354
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006355[[delete-vote-input]]
6356=== DeleteVoteInput
6357The `DeleteVoteInput` entity contains options for the deletion of a
6358vote.
6359
6360[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006361|=============================
6362|Field Name ||Description
6363|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006364The label for which the vote should be deleted. +
6365If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01006366|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006367Notify handling that defines to whom email notifications should be sent
6368after the vote is deleted. +
6369Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6370If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006371|`notify_details`|optional|
6372Additional information about whom to notify about the update as a map
6373of recipient type to link:#notify-info[NotifyInfo] entity.
6374|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006375
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08006376[[description-input]]
6377=== DescriptionInput
6378The `DescriptionInput` entity contains information for setting a description.
6379
6380[options="header",cols="1,6"]
6381|===========================
6382|Field Name |Description
6383|`description` |The description text.
6384|===========================
6385
David Pursehouse882aef22013-06-05 10:56:37 +09006386[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006387=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09006388The `DiffContent` entity contains information about the content differences
6389in a file.
6390
David Pursehouseae367192014-11-25 17:24:47 +09006391[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006392|==========================
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006393|Field Name ||Description
6394|`a` |optional|Content only in the file on side A (deleted in B).
6395|`b` |optional|Content only in the file on side B (added in B).
6396|`ab` |optional|Content in the file on both sides (unchanged).
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02006397|`edit_a` |only present when the `intraline` parameter is set and the
6398DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09006399Text sections deleted from side A as a
6400link:#diff-intraline-info[DiffIntralineInfo] entity.
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02006401|`edit_b` |only present when the `intraline` parameter is set and the
6402DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09006403Text sections inserted in side B as a
6404link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006405|`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a
6406rebase.
6407|`skip` |optional|count of lines skipped on both sides when the file is
David Pursehouse882aef22013-06-05 10:56:37 +09006408too large to include all common lines.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006409|`common` |optional|Set to `true` if the region is common according
Shawn Pearce425a2be2014-01-02 16:00:58 -08006410to the requested ignore-whitespace parameter, but a and b contain
6411differing amounts of whitespace. When present and true a and b are
6412used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09006413|==========================
6414
6415[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006416=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006417The `DiffFileMetaInfo` entity contains meta information about a file diff.
6418
David Pursehouseae367192014-11-25 17:24:47 +09006419[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006420|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006421|Field Name ||Description
6422|`name` ||The name of the file.
6423|`content_type`||The content type of the file.
6424|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01006425|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006426Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07006427link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09006428|==========================
6429
6430[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006431=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006432The `DiffInfo` entity contains information about the diff of a file
6433in a revision.
6434
Edwin Kempin8cdce502014-12-06 10:55:38 +01006435If the link:#weblinks-only[weblinks-only] parameter is specified, only
6436the `web_links` field is set.
6437
David Pursehouseae367192014-11-25 17:24:47 +09006438[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006439|==========================
6440|Field Name ||Description
6441|`meta_a` |not present when the file is added|
6442Meta information about the file on side A as a
6443link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6444|`meta_b` |not present when the file is deleted|
6445Meta information about the file on side B as a
6446link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6447|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
6448`COPIED`, `REWRITE`).
6449|`intraline_status`|only set when the `intraline` parameter was specified in the request|
6450Intraline status (`OK`, `ERROR`, `TIMEOUT`).
6451|`diff_header` ||A list of strings representing the patch set diff header.
6452|`content` ||The content differences in the file as a list of
6453link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01006454|`web_links` |optional|
6455Links to the file diff in external sites as a list of
6456link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01006457|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09006458|==========================
6459
6460[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006461=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006462The `DiffIntralineInfo` entity contains information about intraline edits in a
6463file.
6464
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02006465The information consists of a list of `<skip length, edit length>` pairs, where
David Pursehouse31203f52013-06-08 17:05:45 +09006466the skip length is the number of characters between the end of the previous edit
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02006467and the start of this edit, and the edit length is the number of edited characters
David Pursehouse31203f52013-06-08 17:05:45 +09006468following the skip. The start of the edits is from the beginning of the related
Tao Zhou42430482019-09-13 11:26:01 +02006469diff content lines. If the list is empty, the entire DiffContent should be considered
6470as unedited.
David Pursehouse882aef22013-06-05 10:56:37 +09006471
David Pursehouse31203f52013-06-08 17:05:45 +09006472Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07006473the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09006474
Edwin Kempin8cdce502014-12-06 10:55:38 +01006475[[diff-web-link-info]]
6476=== DiffWebLinkInfo
6477The `DiffWebLinkInfo` entity describes a link on a diff screen to an
6478external site.
6479
6480[options="header",cols="1,6"]
6481|=======================
6482|Field Name|Description
6483|`name` |The link name.
6484|`url` |The link URL.
6485|`image_url`|URL to the icon of the link.
6486|show_on_side_by_side_diff_view|
6487Whether the web link should be shown on the side-by-side diff screen.
6488|show_on_unified_diff_view|
6489Whether the web link should be shown on the unified diff screen.
6490|=======================
6491
David Ostrovsky9ea9c112015-01-25 00:12:38 +01006492[[edit-file-info]]
6493=== EditFileInfo
6494The `EditFileInfo` entity contains additional information
6495of a file within a change edit.
6496
6497[options="header",cols="1,^1,5"]
6498|===========================
6499|Field Name ||Description
6500|`web_links` |optional|
6501Links to the diff info in external sites as a list of
6502link:#web-link-info[WebLinkInfo] entities.
6503|===========================
6504
Edwin Kempin521c1242015-01-23 12:44:44 +01006505[[edit-info]]
6506=== EditInfo
6507The `EditInfo` entity contains information about a change edit.
6508
6509[options="header",cols="1,^1,5"]
6510|===========================
David Pursehouse5934d3f2019-01-07 15:23:49 +09006511|Field Name ||Description
6512|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01006513link:#commit-info[CommitInfo] entity.
David Pursehouse5934d3f2019-01-07 15:23:49 +09006514|`base_patch_set_number`||The patch set number of the patch set the change edit is based on.
6515|`base_revision` ||The revision of the patch set the change edit is based on.
David Pursehouse1bb55ff2019-01-07 15:28:22 +09006516|`ref` ||The ref of the change edit.
David Pursehouse5934d3f2019-01-07 15:23:49 +09006517|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006518Information about how to fetch this patch set. The fetch information is
6519provided as a map that maps the protocol name ("`git`", "`http`",
6520"`ssh`") to link:#fetch-info[FetchInfo] entities.
David Pursehouse5934d3f2019-01-07 15:23:49 +09006521|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006522The files of the change edit as a map that maps the file names to
6523link:#file-info[FileInfo] entities.
6524|===========================
6525
Edwin Kempine3446292013-02-19 16:40:14 +01006526[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006527=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006528The `FetchInfo` entity contains information about how to fetch a patch
6529set via a certain protocol.
6530
David Pursehouseae367192014-11-25 17:24:47 +09006531[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006532|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02006533|Field Name ||Description
6534|`url` ||The URL of the project.
6535|`ref` ||The ref of the patch set.
6536|`commands` |optional|
6537The download commands for this patch set as a map that maps the command
6538names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09006539Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006540|==========================
6541
6542[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006543=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006544The `FileInfo` entity contains information about a file in a patch set.
6545
David Pursehouseae367192014-11-25 17:24:47 +09006546[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006547|=============================
6548|Field Name ||Description
6549|`status` |optional|
6550The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
6551"`C`"=Copied, "`W`"=Rewritten). +
6552Not set if the file was Modified ("`M`").
6553|`binary` |not set if `false`|Whether the file is binary.
6554|`old_path` |optional|
6555The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05006556Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01006557|`lines_inserted`|optional|
6558Number of inserted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02006559Not set for binary files or if no lines were inserted. +
6560An empty last line is not included in the count and hence this number can
6561differ by one from details provided in <<#diff-info,DiffInfo>>.
Edwin Kempine3446292013-02-19 16:40:14 +01006562|`lines_deleted` |optional|
6563Number of deleted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02006564Not set for binary files or if no lines were deleted. +
6565An empty last line is not included in the count and hence this number can
6566differ by one from details provided in <<#diff-info,DiffInfo>>.
Edwin Kempin640f9842015-10-08 15:53:20 +02006567|`size_delta` ||
6568Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01006569|`size` ||
6570File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01006571|=============================
6572
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006573[[fix-input]]
6574=== FixInput
6575The `FixInput` entity contains options for fixing commits using the
6576link:#fix-change[fix change] endpoint.
6577
6578[options="header",cols="1,6"]
6579|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006580|Field Name |Description
6581|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006582database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006583|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07006584merged into the destination branch as this exact SHA-1. If not, insert
6585a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006586|==========================
6587
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006588[[fix-suggestion-info]]
6589=== FixSuggestionInfo
6590The `FixSuggestionInfo` entity represents a suggested fix.
6591
6592[options="header",cols="1,^1,5"]
6593|==========================
6594|Field Name ||Description
6595|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
6596fix. It will be generated automatically and hence will be ignored if it's set
6597for input objects.
6598|`description` ||A description of the suggested fix.
6599|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006600entities indicating how the content of one or several files should be modified.
6601Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006602|==========================
6603
6604[[fix-replacement-info]]
6605=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01006606The `FixReplacementInfo` entity describes how the content of a file should be
6607replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006608
6609[options="header",cols="1,6"]
6610|==========================
6611|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006612|`path` |The path of the file which should be modified. Any file in
6613the repository may be modified.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006614|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01006615of the file should be replaced. Lines in the file are assumed to be separated
6616by the line feed character, the carriage return character, the carriage return
6617followed by the line feed character, or one of the other Unicode linebreak
6618sequences supported by Java.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006619|`replacement` |The content which should be used instead of the current one.
6620|==========================
6621
Edwin Kempine3446292013-02-19 16:40:14 +01006622[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006623=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006624The `GitPersonInfo` entity contains information about the
6625author/committer of a commit.
6626
David Pursehouseae367192014-11-25 17:24:47 +09006627[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01006628|==========================
6629|Field Name |Description
6630|`name` |The name of the author/committer.
6631|`email` |The email address of the author/committer.
6632|`date` |The link:rest-api.html#timestamp[timestamp] of when
6633this identity was constructed.
6634|`tz` |The timezone offset from UTC of when this identity was
6635constructed.
6636|==========================
6637
Edwin Kempin521c1242015-01-23 12:44:44 +01006638[[group-base-info]]
6639=== GroupBaseInfo
6640The `GroupBaseInfo` entity contains base information about the group.
6641
6642[options="header",cols="1,6"]
6643|==========================
6644|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01006645|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01006646|`name` |The name of the group.
6647|==========================
6648
David Pursehoused9dac372016-11-24 19:41:10 +09006649[[hashtags-input]]
6650=== HashtagsInput
6651
6652The `HashtagsInput` entity contains information about hashtags to add to,
6653and/or remove from, a change.
6654
6655[options="header",cols="1,^1,5"]
6656|=======================
6657|Field Name||Description
6658|`add` |optional|The list of hashtags to be added to the change.
6659|`remove |optional|The list of hashtags to be removed from the change.
6660|=======================
6661
Edwin Kempin521c1242015-01-23 12:44:44 +01006662[[included-in-info]]
6663=== IncludedInInfo
6664The `IncludedInInfo` entity contains information about the branches a
6665change was merged into and tags it was tagged with.
6666
Edwin Kempin78279ba2015-05-22 15:22:41 +02006667[options="header",cols="1,^1,5"]
6668|=======================
6669|Field Name||Description
6670|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01006671Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02006672|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01006673Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02006674|`external`|optional|A map that maps a name to a list of external
6675systems that include this change, e.g. a list of servers on which this
6676change is deployed.
6677|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01006678
Edwin Kempine3446292013-02-19 16:40:14 +01006679[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006680=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07006681The `LabelInfo` entity contains information about a label on a change, always
6682corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01006683
Dave Borowitz88159512013-06-14 14:21:50 -07006684There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07006685link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07006686
6687* For a quick summary of the state of labels, use `LABELS`.
6688* For detailed information about labels, including exact numeric votes for all
6689 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
6690
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006691==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09006692[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006693|===========================
6694|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006695|`optional` |not set if `false`|
6696Whether the label is optional. Optional means the label may be set, but
6697it's neither necessary for submission nor does it block submission if
6698set.
Dave Borowitz88159512013-06-14 14:21:50 -07006699|===========================
6700
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006701==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09006702[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07006703|===========================
6704|Field Name ||Description
6705|`approved` |optional|One user who approved this label on the change
6706(voted the maximum value) as an
6707link:rest-api-accounts.html#account-info[AccountInfo] entity.
6708|`rejected` |optional|One user who rejected this label on the change
6709(voted the minimum value) as an
6710link:rest-api-accounts.html#account-info[AccountInfo] entity.
6711|`recommended` |optional|One user who recommended this label on the
6712change (voted positively, but not the maximum value) as an
6713link:rest-api-accounts.html#account-info[AccountInfo] entity.
6714|`disliked` |optional|One user who disliked this label on the change
6715(voted negatively, but not the minimum value) as an
6716link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01006717|`blocking` |optional|If `true`, the label blocks submit operation.
6718If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07006719|`value` |optional|The voting value of the user who
6720recommended/disliked this label on the change if it is not
6721"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07006722|`default_value`|optional|The default voting value for the label.
6723This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07006724|===========================
6725
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006726==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09006727[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07006728|===========================
6729|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006730|`all` |optional|List of all approvals for this label as a list
Aaron Gableea8a2112017-04-25 14:18:16 -07006731of link:#approval-info[ApprovalInfo] entities. Items in this list may
6732not represent actual votes cast by users; if a user votes on any label,
6733a corresponding ApprovalInfo will appear in this list for all labels.
Edwin Kempine3446292013-02-19 16:40:14 +01006734|`values` |optional|A map of all values that are allowed for this
6735label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07006736to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01006737|===========================
6738
Saša Živkov499873f2014-05-05 13:34:18 +02006739[[mergeable-info]]
6740=== MergeableInfo
6741The `MergeableInfo` entity contains information about the mergeability of a
6742change.
6743
David Pursehouseae367192014-11-25 17:24:47 +09006744[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02006745|============================
Saša Živkov697cab22014-04-29 16:46:50 +02006746|Field Name ||Description
6747|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02006748Submit type used for this change, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02006749`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Saša Živkov499873f2014-05-05 13:34:18 +02006750`CHERRY_PICK`.
Zhen Chenec13e452016-08-03 23:29:43 -07006751|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006752The strategy of the merge, can be `recursive`, `resolve`,
6753`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02006754|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02006755`true` if this change is cleanly mergeable, `false` otherwise
Zhen Chen8f00d552016-07-26 16:54:59 -07006756|`commit_merged` |optional|
6757`true` if this change is already merged, `false` otherwise
6758|`content_merged` |optional|
6759`true` if the content of this change is already merged, `false` otherwise
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006760|`conflicts`|optional|
6761A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02006762|`mergeable_into`|optional|
6763A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02006764|============================
Dave Borowitz88159512013-06-14 14:21:50 -07006765
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006766[[merge-input]]
6767=== MergeInput
6768The `MergeInput` entity contains information about the merge
6769
6770[options="header",cols="1,^1,5"]
6771|============================
6772|Field Name ||Description
6773|`source` ||
6774The source to merge from, e.g. a complete or abbreviated commit SHA-1,
David Pursehouse4abaef932018-03-18 15:05:08 +09006775a complete reference name, a short reference name under `refs/heads`, `refs/tags`,
6776or `refs/remotes` namespace, etc.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006777|`strategy` |optional|
6778The strategy of the merge, can be `recursive`, `resolve`,
6779`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
6780|============================
6781
Zhen Chenb1e07e52016-09-23 12:59:48 -07006782[[merge-patch-set-input]]
6783=== MergePatchSetInput
6784The `MergePatchSetInput` entity contains information about updating a new
6785change by creating a new merge commit.
6786
6787[options="header",cols="1,^1,5"]
6788|==================================
6789|Field Name ||Description
6790|`subject` |optional|
6791The new subject for the change, if not specified, will reuse the current patch
6792set's subject
6793|`inheritParent` |optional, default to `false`|
6794Use the current patch set's first parent as the merge tip when set to `true`.
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02006795|`base_change` |optional|
6796A link:#change-id[\{change-id\}] that identifies a change. When `inheritParent`
6797is `false`, the merge tip will be the current patch set of the `base_change` if
6798it's set. Otherwise, the current branch tip of the destination branch will be used.
Zhen Chenb1e07e52016-09-23 12:59:48 -07006799|`merge` ||
6800The detail of the source commit for merge as a link:#merge-input[MergeInput]
6801entity.
6802|==================================
6803
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306804[[move-input]]
6805=== MoveInput
6806The `MoveInput` entity contains information for moving a change to a new branch.
6807
6808[options="header",cols="1,^1,5"]
6809|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04006810|Field Name ||Description
6811|`destination_branch`||Destination branch
6812|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306813A message to be posted in this change's comments
6814|===========================
6815
Edwin Kempincd07df42016-12-01 09:10:09 +01006816[[notify-info]]
6817=== NotifyInfo
6818The `NotifyInfo` entity contains detailed information about who should
6819be notified about an update. These notifications are sent out even if a
6820`notify` option in the request input disables normal notifications.
6821`NotifyInfo` entities are normally contained in a `notify_details` map
6822in the request input where the key is the recipient type. The recipient
6823type can be `TO`, `CC` and `BCC`.
6824
6825[options="header",cols="1,^1,5"]
6826|=======================
6827|Field Name||Description
6828|`accounts`|optional|
6829A list of link:rest-api-accounts.html#account-id[account IDs] that
6830identify the accounts that should be should be notified.
6831|=======================
6832
Edwin Kempin364a86b2017-04-27 12:34:00 +02006833[[private-input]]
6834=== PrivateInput
6835The `PrivateInput` entity contains information for changing the private
6836flag on a change.
6837
6838[options="header",cols="1,^1,5"]
6839|=======================
6840|Field Name||Description
6841|`message` |optional|Message describing why the private flag was changed.
6842|=======================
6843
Edwin Kempin521c1242015-01-23 12:44:44 +01006844[[problem-info]]
6845=== ProblemInfo
6846The `ProblemInfo` entity contains a description of a potential consistency problem
6847with a change. These are not related to the code review process, but rather
6848indicate some inconsistency in Gerrit's database or repository metadata related
6849to the enclosing change.
6850
6851[options="header",cols="1,^1,5"]
6852|===========================
6853|Field Name||Description
6854|`message` ||Plaintext message describing the problem with the change.
6855|`status` |optional|
6856The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
6857fix was attempted.
6858|`outcome` |optional|
6859If `status` is set, an additional plaintext message describing the
6860outcome of the fix.
6861|===========================
6862
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006863[[publish-change-edit-input]]
6864=== PublishChangeEditInput
6865The `PublishChangeEditInput` entity contains options for the publishing of
6866change edit.
6867
6868[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006869|=============================
6870|Field Name ||Description
6871|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006872Notify handling that defines to whom email notifications should be sent
6873after the change edit is published. +
6874Allowed values are `NONE` and `ALL`. +
6875If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006876|`notify_details`|optional|
6877Additional information about whom to notify about the update as a map
6878of recipient type to link:#notify-info[NotifyInfo] entity.
6879|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006880
Patrick Hieselbb84fd72017-08-23 11:11:22 +02006881[[pure-revert-info]]
6882=== PureRevertInfo
6883The `PureRevertInfo` entity describes the result of a pure revert check.
6884
6885[options="header",cols="1,6"]
6886|======================
6887|Field Name |Description
6888|`is_pure_revert` |Outcome of the check as boolean.
6889|======================
6890
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04006891[[push-certificate-info]]
6892=== PushCertificateInfo
6893The `PushCertificateInfo` entity contains information about a push
6894certificate provided when the user pushed for review with `git push
6895--signed HEAD:refs/for/<branch>`. Only used when signed push is
6896link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
6897
6898[options="header",cols="1,6"]
6899|===========================
6900|Field Name|Description
6901|`certificate`|Signed certificate payload and GPG signature block.
6902|`key` |
6903Information about the key that signed the push, along with any problems
6904found while checking the signature or the key itself, as a
6905link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
6906|===========================
6907
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006908[[range-info]]
6909=== RangeInfo
6910The `RangeInfo` entity stores the coordinates of a range.
6911
6912[options="header",cols="1,6"]
6913|===========================
6914|Field Name | Description
6915|`start` | First index.
6916|`end` | Last index.
6917|===========================
6918
Zalan Blenessy874aed72015-01-12 13:26:18 +01006919[[rebase-input]]
6920=== RebaseInput
6921The `RebaseInput` entity contains information for changing parent when rebasing.
6922
6923[options="header",width="50%",cols="1,^1,5"]
6924|===========================
6925|Field Name ||Description
6926|`base` |optional|
6927The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
6928Alternatively, a change number can be specified, in which case the current
6929patch set is inferred. +
6930Empty string is used for rebasing directly on top of the target branch,
6931which effectively breaks dependency towards a parent change.
6932|===========================
6933
Edwin Kempin521c1242015-01-23 12:44:44 +01006934[[related-change-and-commit-info]]
6935=== RelatedChangeAndCommitInfo
6936
6937The `RelatedChangeAndCommitInfo` entity contains information about
6938a related change and commit.
6939
6940[options="header",cols="1,^1,5"]
6941|===========================
6942|Field Name ||Description
Patrick Hieselcab63512017-07-28 10:25:42 +02006943|`project` ||The project of the change or commit.
Edwin Kempin521c1242015-01-23 12:44:44 +01006944|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01006945|`commit` ||The commit as a
6946link:#commit-info[CommitInfo] entity.
6947|`_change_number` |optional|The change number.
6948|`_revision_number` |optional|The revision number.
6949|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07006950|`status` |optional|The status of the change. The status of
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01006951the change is one of (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempin521c1242015-01-23 12:44:44 +01006952|===========================
6953
6954[[related-changes-info]]
6955=== RelatedChangesInfo
6956The `RelatedChangesInfo` entity contains information about related
6957changes.
6958
6959[options="header",cols="1,6"]
6960|===========================
6961|Field Name |Description
6962|`changes` |A list of
6963link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
6964describing the related changes. Sorted by git commit order, newest to
6965oldest. Empty if there are no related changes.
6966|===========================
6967
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01006968
6969[[requirement]]
6970=== Requirement
6971The `Requirement` entity contains information about a requirement relative to a change.
6972
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01006973[options="header",cols="1,^1,5"]
6974|===========================
6975|Field Name | |Description
6976|`status` | | Status of the requirement. Can be either `OK`, `NOT_READY` or `RULE_ERROR`.
6977|`fallbackText` | | A human readable reason
6978|`type` | |
6979Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it
6980was triggered. Can be seen as a class: requirements sharing the same type were created for a similar
6981reason, and the data structure will follow one set of rules.
6982|`data` |optional|
6983Holds custom key-value strings, used in templates to render richer status messages
6984|===========================
6985
6986
Edwin Kempined5364b2013-02-22 10:39:33 +01006987[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006988=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01006989The `RestoreInput` entity contains information for restoring a change.
6990
David Pursehouseae367192014-11-25 17:24:47 +09006991[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01006992|===========================
6993|Field Name ||Description
6994|`message` |optional|
6995Message to be added as review comment to the change when restoring the
6996change.
6997|===========================
6998
Edwin Kempind2ec4152013-02-22 12:17:19 +01006999[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007000=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01007001The `RevertInput` entity contains information for reverting a change.
7002
David Pursehouseae367192014-11-25 17:24:47 +09007003[options="header",cols="1,^1,5"]
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01007004|=============================
7005|Field Name ||Description
7006|`message` |optional|
Edwin Kempind2ec4152013-02-22 12:17:19 +01007007Message to be added as review comment to the change when reverting the
7008change.
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01007009|`notify` |optional|
7010Notify handling that defines to whom email notifications should be sent
7011for reverting the change. +
7012Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7013If not set, the default is `ALL`.
7014|`notify_details`|optional|
7015Additional information about whom to notify about the revert as a map
7016of recipient type to link:#notify-info[NotifyInfo] entity.
Gal Paikincc93c562019-10-09 13:24:12 +02007017|`topic` |optional|
Gal Paikinb81f56c2019-10-16 14:39:24 +02007018Name of the topic for the revert change. If not set, the default for Revert
7019endpoint is the topic of the change being reverted, and the default for the
7020RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`.
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02007021|=============================
Gal Paikinb81f56c2019-10-16 14:39:24 +02007022
7023[[revert-submission-info]]
7024=== RevertSubmissionInfo
7025The `RevertSubmissionInfo` describes the revert changes.
7026
7027[options="header",cols="1,6"]
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02007028|==============================
Gal Paikinb81f56c2019-10-16 14:39:24 +02007029|Field Name | Description
7030|`revert_changes` |
Edwin Kempin6e7fb4e2019-10-24 17:20:51 +02007031A list of link:#change-info[ChangeInfo] that describes the revert changes. Each
7032entity in that list is a revert change that was created in that revert
7033submission.
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02007034|==============================
Edwin Kempind2ec4152013-02-22 12:17:19 +01007035
Edwin Kempin67498de2013-02-25 16:15:34 +01007036[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007037=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01007038The `ReviewInfo` entity contains information about a review.
7039
David Pursehouseae367192014-11-25 17:24:47 +09007040[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01007041|===========================
7042|Field Name |Description
7043|`labels` |
7044The labels of the review as a map that maps the label names to the
7045voting values.
7046|===========================
7047
Viktar Donich316bf7a2016-07-06 11:29:01 -07007048[[review-update-info]]
7049=== ReviewerUpdateInfo
7050The `ReviewerUpdateInfo` entity contains information about updates to
7051change's reviewers set.
7052
7053[options="header",cols="1,6"]
7054|===========================
7055|Field Name |Description
7056|`updated`|
7057Timestamp of the update.
7058|`updated_by`|
7059The account which modified state of the reviewer in question as
7060link:rest-api-accounts.html#account-info[AccountInfo] entity.
7061|`reviewer`|
7062The reviewer account added or removed from the change as an
7063link:rest-api-accounts.html#account-info[AccountInfo] entity.
7064|`state`|
7065The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
7066|===========================
7067
Edwin Kempin67498de2013-02-25 16:15:34 +01007068[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007069=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01007070The `ReviewInput` entity contains information for adding a review to a
7071revision.
7072
David Pursehouseae367192014-11-25 17:24:47 +09007073[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01007074|============================
Bill Wendling692b4ec2015-10-19 15:40:57 -07007075|Field Name ||Description
7076|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007077The message to be added as review comment.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007078|`tag` |optional|
7079Apply this tag to the review comment message, votes, and inline
7080comments. Tags may be used by CI or other automated systems to
Vitaliy Lotorevea882812018-06-28 20:16:39 +00007081distinguish them from human reviews. Votes/comments that contain `tag` with
7082'autogenerated:' prefix can be filtered out in the web UI.
Bill Wendling692b4ec2015-10-19 15:40:57 -07007083|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007084The votes that should be added to the revision as a map that maps the
7085label names to the voting values.
Bill Wendling692b4ec2015-10-19 15:40:57 -07007086|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007087The comments that should be added as a map that maps a file path to a
7088list of link:#comment-input[CommentInput] entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007089|`robot_comments` |optional|
7090The robot comments that should be added as a map that maps a file path
7091to a list of link:#robot-comment-input[RobotCommentInput] entities.
Bill Wendling692b4ec2015-10-19 15:40:57 -07007092|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007093Draft handling that defines how draft comments are handled that are
7094already in the database but that were not also described in this
7095input. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05007096Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values
7097except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04007098Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05007099If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value
7100besides `KEEP` is allowed.
Bill Wendling692b4ec2015-10-19 15:40:57 -07007101|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007102Notify handling that defines to whom email notifications should be sent
7103after the review is stored. +
7104Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7105If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007106|`notify_details` |optional|
7107Additional information about whom to notify about the update as a map
7108of recipient type to link:#notify-info[NotifyInfo] entity.
Bill Wendling692b4ec2015-10-19 15:40:57 -07007109|`omit_duplicate_comments`|optional|
7110If `true`, comments with the same content at the same place will be omitted.
7111|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07007112link:rest-api-accounts.html#account-id[\{account-id\}] the review
7113should be posted on behalf of. To use this option the caller must
7114have been granted `labelAs-NAME` permission for all keys of labels.
Patrick Hieselcf6d9352017-04-13 10:15:42 +02007115|`reviewers` |optional|
7116A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
7117representing reviewers that should be added to the change.
Logan Hanks53c36012017-06-30 13:47:54 -07007118|`ready` |optional|
7119If true, and if the change is work in progress, then start review.
7120It is an error for both `ready` and `work_in_progress` to be true.
7121|`work_in_progress` |optional|
7122If true, mark the change as work in progress. It is an error for both
7123`ready` and `work_in_progress` to be true.
Edwin Kempin67498de2013-02-25 16:15:34 +01007124|============================
7125
Aaron Gable843b0c12017-04-21 08:25:27 -07007126[[review-result]]
7127=== ReviewResult
7128The `ReviewResult` entity contains information regarding the updates
7129that were made to a review.
7130
7131[options="header",cols="1,^1,5"]
7132|============================
7133|Field Name ||Description
7134|`labels` |optional|
7135Map of labels to values after the review was posted. Null if any reviewer
7136additions were rejected.
7137|`reviewers` |optional|
7138Map of account or group identifier to
7139link:rest-api-changes.html#add-reviewer-result[AddReviewerResult]
7140representing the outcome of adding as a reviewer.
7141Absent if no reviewer additions were requested.
Logan Hankse81ad8e2017-07-18 09:45:46 -07007142|`ready` |optional|
7143If true, the change was moved from WIP to ready for review as a result of this
7144action. Not set if false.
Aaron Gable843b0c12017-04-21 08:25:27 -07007145|============================
7146
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007147[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007148=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007149The `ReviewerInfo` entity contains information about a reviewer and its
7150votes on a change.
7151
Edwin Kempin963dfd02013-02-27 12:39:32 +01007152`ReviewerInfo` has the same fields as
7153link:rest-api-accounts.html#account-info[AccountInfo] and includes
7154link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007155In addition `ReviewerInfo` has the following fields:
7156
David Pursehouseae367192014-11-25 17:24:47 +09007157[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007158|==========================
7159|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007160|`approvals` |
7161The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09007162approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01007163|`_account_id` |
7164This field is inherited from `AccountInfo` but is optional here if an
7165unregistered reviewer was added by email. See
7166link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007167|==========================
7168
Edwin Kempin392328e2013-02-25 12:50:03 +01007169[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007170=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01007171The `ReviewerInput` entity contains information for adding a reviewer
7172to a change.
7173
David Pursehouseae367192014-11-25 17:24:47 +09007174[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007175|=============================
7176|Field Name ||Description
7177|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01007178The link:rest-api-accounts.html#account-id[ID] of one account that
7179should be added as reviewer or the link:rest-api-groups.html#group-id[
7180ID] of one group for which all members should be added as reviewers. +
7181If an ID identifies both an account and a group, only the account is
7182added as reviewer to the change.
Edwin Kempincd07df42016-12-01 09:10:09 +01007183|`state` |optional|
Logan Hanksee0a4182016-07-06 14:39:26 -07007184Add reviewer in this state. Possible reviewer states are `REVIEWER`
7185and `CC`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007186|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01007187Whether adding the reviewer is confirmed. +
7188The Gerrit server may be configured to
7189link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
7190confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01007191|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02007192Notify handling that defines to whom email notifications should be sent
7193after the reviewer is added. +
7194Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7195If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007196|`notify_details`|optional|
7197Additional information about whom to notify about the update as a map
7198of recipient type to link:#notify-info[NotifyInfo] entity.
7199|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01007200
Edwin Kempine3446292013-02-19 16:40:14 +01007201[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007202=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007203The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07007204Not all fields are returned by default. Additional fields can
7205be obtained by adding `o` parameters as described in
7206link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01007207
David Pursehouseae367192014-11-25 17:24:47 +09007208[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007209|===========================
7210|Field Name ||Description
David Pursehouse4de41112016-06-28 09:24:08 +09007211|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
7212`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Kasper Nilssonbe3616d2018-01-23 14:10:36 -08007213|`_number` ||The patch set number, or `edit` if the patch set is an edit.
Edwin Kempin04cbd342015-02-19 16:31:22 +01007214|`created` ||
7215The link:rest-api.html#timestamp[timestamp] of when the patch set was
7216created.
7217|`uploader` ||
7218The uploader of the patch set as an
7219link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01007220|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01007221|`fetch` ||
7222Information about how to fetch this patch set. The fetch information is
7223provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07007224"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
7225only included if a plugin implementing the
7226link:intro-project-owner.html#download-commands[download commands]
7227interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07007228|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01007229link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07007230|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01007231The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07007232link:#file-info[FileInfo] entities. Only set if
7233link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
7234option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07007235|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07007236Actions the caller might be able to perform on this revision. The
7237information is a map of view name to link:#action-info[ActionInfo]
7238entities.
Khai Dob3139b7532014-09-19 15:13:04 -07007239|`reviewed` |optional|
7240Indicates whether the caller is authenticated and has commented on the
7241current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Quinten Yearsley28cd2122019-06-10 14:41:13 -07007242|`commit_with_footers` |optional|
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07007243If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
7244this is the current patch set, contains the full commit message with
7245Gerrit-specific commit footers, as if this revision were submitted
7246using the link:project-configuration.html#cherry_pick[Cherry Pick]
7247submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04007248|`push_certificate` |optional|
7249If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
7250contains the push certificate provided by the user when uploading this
7251patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
7252This field is always set if the option is requested; if no push
7253certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07007254|`description` |optional|
7255The description of this patchset, as displayed in the patchset
7256selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01007257|===========================
7258
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007259[[robot-comment-info]]
7260=== RobotCommentInfo
7261The `RobotCommentInfo` entity contains information about a robot inline
7262comment.
7263
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01007264`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007265In addition `RobotCommentInfo` has the following fields:
7266
7267[options="header",cols="1,^1,5"]
7268|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007269|Field Name ||Description
7270|`robot_id` ||The ID of the robot that generated this comment.
7271|`robot_run_id` ||An ID of the run of the robot.
7272|`url` |optional|URL to more information.
7273|`properties` |optional|Robot specific properties as map that maps arbitrary
7274keys to values.
7275|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
7276<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007277|===========================
7278
7279[[robot-comment-input]]
7280=== RobotCommentInput
7281The `RobotCommentInput` entity contains information for creating an inline
7282robot comment.
7283
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01007284`RobotCommentInput` has the same fields as
7285<<robot-comment-info,RobotCommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007286
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007287[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007288=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007289The `RuleInput` entity contains information to test a Prolog rule.
7290
David Pursehouseae367192014-11-25 17:24:47 +09007291[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007292|===========================
7293|Field Name ||Description
7294|`rule`||
7295Prolog code to execute instead of the code in `refs/meta/config`.
7296|`filters`|`RUN` if not set|
7297When `RUN` filter rules in the parent projects are called to
7298post-process the results of the project specific rule. This
7299behavior matches how the rule will execute if installed. +
7300If `SKIP` the parent filters are not called, allowing the test
7301to return results from the input rule.
7302|===========================
7303
Edwin Kempin14b58112013-02-26 16:30:19 +01007304[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007305=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01007306The `SubmitInfo` entity contains information about the change status
7307after submitting.
7308
Stefan Bellere4785b42015-06-18 12:31:03 -07007309[options="header",cols="1,^1,5"]
Edwin Kempin14b58112013-02-26 16:30:19 +01007310|==========================
Stefan Bellere4785b42015-06-18 12:31:03 -07007311|Field Name ||Description
7312|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07007313The status of the change after submitting is `MERGED`.
David Ostrovsky868e3412014-01-30 19:50:57 +01007314|`on_behalf_of`|optional|
7315The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
7316whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09007317have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
7318The user named by `on_behalf_of` does not need to be granted the `Submit`
7319permission. This feature is aimed for CI solutions: the CI account can be
David Pursehousea61ee502016-09-06 16:27:09 +09007320granted both permissions, so individual users don't need `Submit` permission
7321themselves. Still the changes can be submitted on behalf of real users and
David Pursehouse22bd6f92014-02-20 21:11:01 +09007322not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01007323|==========================
7324
Edwin Kempin0eddba02013-02-22 15:30:12 +01007325[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007326=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01007327The `SubmitInput` entity contains information for submitting a change.
7328
David Pursehouseae367192014-11-25 17:24:47 +09007329[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007330|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01007331|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01007332|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05007333If set, submit the change on behalf of the given user. The value may take any
7334format link:rest-api-accounts.html#account-id[accepted by the accounts REST
7335API]. Using this option requires
7336link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
7337permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01007338|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07007339Notify handling that defines to whom email notifications should be sent after
7340the change is submitted. +
7341Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7342If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007343|`notify_details`|optional|
7344Additional information about whom to notify about the update as a map
7345of recipient type to link:#notify-info[NotifyInfo] entity.
7346|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01007347
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007348[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007349=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007350The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02007351Fields in this entity roughly correspond to the fields set by `LABELS`
7352in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007353
David Pursehouseae367192014-11-25 17:24:47 +09007354[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007355|===========================
7356|Field Name ||Description
7357|`status`||
7358`OK`, the change can be submitted. +
7359`NOT_READY`, additional labels are required before submit. +
7360`CLOSED`, closed changes cannot be submitted. +
7361`RULE_ERROR`, rule code failed with an error.
7362|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01007363Map of labels that are approved; an
7364link:rest-api-accounts.html#account-info[AccountInfo] identifies the
7365voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007366|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01007367Map of labels that are preventing submit;
7368link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007369|`need`|optional|
7370Map of labels that need to be given to submit. The value is
7371currently an empty object.
7372|`may`|optional|
7373Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01007374link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
7375if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007376|`impossible`|optional|
7377Map of labels that should have been in `need` but cannot be
7378used by any user because of access restrictions. The value
7379is currently an empty object.
7380|`error_message`|optional|
7381When status is RULE_ERROR this message provides some text describing
7382the failure of the rule predicate.
7383|===========================
7384
Jonathan Nieder2a629b02016-06-16 15:15:25 -07007385[[submitted-together-info]]
7386=== SubmittedTogetherInfo
7387The `SubmittedTogetherInfo` entity contains information about a
7388collection of changes that would be submitted together.
7389
7390[options="header",cols="1,6"]
7391|===========================
7392|Field Name |Description
7393|`changes` |
7394A list of ChangeInfo entities representing the changes to be submitted together.
7395|`non_visible_changes`|
7396The number of changes to be submitted together that the current user
7397cannot see. (This count includes changes that are visible to the
7398current user when their reason for being submitted together involves
7399changes the user cannot see.)
7400|===========================
7401
Edwin Kempin521c1242015-01-23 12:44:44 +01007402[[suggested-reviewer-info]]
7403=== SuggestedReviewerInfo
7404The `SuggestedReviewerInfo` entity contains information about a reviewer
7405that can be added to a change (an account or a group).
7406
7407`SuggestedReviewerInfo` has either the `account` field that contains
7408the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
7409the `group` field that contains the
7410link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
7411
Logan Hanksab3c81e2016-07-20 15:42:52 -07007412[options="header",cols="1,^1,5"]
7413|===========================
7414|Field Name ||Description
7415|`account` |optional|
7416An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
7417suggestion is an account.
7418|`group` |optional|
7419A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
7420suggestion is a group.
7421|`count` ||
7422The total number of accounts in the suggestion. This is `1` if `account` is
7423present. If `group` is present, the total number of accounts that are
7424members of the group is returned (this count includes members of nested
7425groups).
7426|`confirm` |optional|
7427True if `group` is present and `count` is above the threshold where the
7428`confirmed` flag must be passed to add the group as a reviewer.
7429|===========================
7430
Edwin Kempin64006bb2013-02-22 08:17:04 +01007431[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007432=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01007433The `TopicInput` entity contains information for setting a topic.
7434
David Pursehouseae367192014-11-25 17:24:47 +09007435[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01007436|===========================
7437|Field Name ||Description
7438|`topic` |optional|The topic. +
7439The topic will be deleted if not set.
Edwin Kempin64006bb2013-02-22 08:17:04 +01007440|===========================
7441
Makson Lee3568a932017-08-28 17:12:03 +08007442[[tracking-id-info]]
7443=== TrackingIdInfo
7444The `TrackingIdInfo` entity describes a reference to an external tracking system.
7445
7446[options="header",cols="1,6"]
7447|======================
7448|Field Name|Description
7449|`system` |The name of the external tracking system.
7450|`id` |The tracking id.
7451|======================
7452
Oleg Aravinbf313bb2016-10-24 12:28:56 -07007453[[voting-range-info]]
7454=== VotingRangeInfo
7455The `VotingRangeInfo` entity describes the continuous voting range from min
7456to max values.
7457
7458[options="header",cols="1,6"]
7459|======================
7460|Field Name|Description
7461|`min` |The minimum voting value.
7462|`max` |The maximum voting value.
7463|======================
7464
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007465[[web-link-info]]
7466=== WebLinkInfo
7467The `WebLinkInfo` entity describes a link to an external site.
7468
David Pursehouseae367192014-11-25 17:24:47 +09007469[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007470|======================
7471|Field Name|Description
7472|`name` |The link name.
7473|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02007474|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007475|======================
7476
Alan Tokaev392cfca2017-04-28 11:11:31 +02007477[[work-in-progress-input]]
7478=== WorkInProgressInput
7479The `WorkInProgressInput` entity contains additional information for a change
7480set to WorkInProgress/ReadyForReview.
7481
7482[options="header",cols="1,^1,5"]
7483|=============================
7484|Field Name ||Description
7485|`message` |optional|
7486Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview.
7487|=============================
7488
Edwin Kempind0a63922013-01-23 16:32:59 +01007489GERRIT
7490------
7491Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07007492
7493SEARCHBOX
7494---------