blob: fbad2120497d2bed050ea38917280f0540633014 [file] [log] [blame]
Marian Harbachebeb1542019-12-13 10:42:46 +01001:linkattrs:
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002= Gerrit Code Review - /changes/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01003
4This page describes the change related REST endpoints.
5Please also take note of the general information on the
6link:rest-api.html[REST API].
7
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008[[change-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08009== Change Endpoints
Edwin Kempind0a63922013-01-23 16:32:59 +010010
David Ostrovsky837c0ee2014-04-27 12:54:20 +020011[[create-change]]
12=== Create Change
13--
David Pursehousea92d2e92017-08-03 06:03:47 +000014'POST /changes/'
David Ostrovsky837c0ee2014-04-27 12:54:20 +020015--
16
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -080017The change input link:#change-input[ChangeInput] entity must be provided in the
18request body.
David Ostrovsky837c0ee2014-04-27 12:54:20 +020019
Edwin Kempin088eeb9a2018-01-25 08:39:41 +010020To create a change the calling user must be allowed to
21link:access-control.html#category_push_review[upload to code review].
22
David Ostrovsky837c0ee2014-04-27 12:54:20 +020023.Request
24----
Paladox none4bac1952017-08-03 00:09:25 +000025 POST /changes/ HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +090026 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020027
28 {
29 "project" : "myProject",
30 "subject" : "Let's support 100% Gerrit workflow direct in browser",
31 "branch" : "master",
32 "topic" : "create-change-in-browser",
David Ostrovsky6ffb7d92017-02-13 21:16:58 +010033 "status" : "NEW"
David Ostrovsky837c0ee2014-04-27 12:54:20 +020034 }
35----
36
37As response a link:#change-info[ChangeInfo] entity is returned that describes
38the resulting change.
39
40.Response
41----
Paladox none4bac1952017-08-03 00:09:25 +000042 HTTP/1.1 201 OK
David Ostrovsky837c0ee2014-04-27 12:54:20 +020043 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090044 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020045
46 )]}'
47 {
David Ostrovsky837c0ee2014-04-27 12:54:20 +020048 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
49 "project": "myProject",
50 "branch": "master",
51 "topic": "create-change-in-browser",
52 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
53 "subject": "Let's support 100% Gerrit workflow direct in browser",
David Ostrovsky6ffb7d92017-02-13 21:16:58 +010054 "status": "NEW",
David Ostrovsky837c0ee2014-04-27 12:54:20 +020055 "created": "2014-05-05 07:15:44.639000000",
56 "updated": "2014-05-05 07:15:44.639000000",
57 "mergeable": true,
58 "insertions": 0,
59 "deletions": 0,
David Ostrovsky837c0ee2014-04-27 12:54:20 +020060 "_number": 4711,
61 "owner": {
62 "name": "John Doe"
63 }
64 }
65----
66
Edwin Kempin76202742013-02-15 13:51:50 +010067[[list-changes]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080068=== Query Changes
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080069--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010070'GET /changes/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080071--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010072
Saša Živkovdd804022014-06-23 16:44:03 +020073Queries changes visible to the caller. The
74link:user-search.html#_search_operators[query string] must be provided
75by the `q` parameter. The `n` parameter can be used to limit the
Patrick Hieseld6afdcf2020-01-07 15:03:28 +010076returned results. The `no-limit` parameter can be used remove the default
77limit on queries and return all results. This might not be supported by
78all index backends.
Edwin Kempind0a63922013-01-23 16:32:59 +010079
Edwin Kempine3446292013-02-19 16:40:14 +010080As result a list of link:#change-info[ChangeInfo] entries is returned.
81The change output is sorted by the last update time, most recently
82updated to oldest updated.
83
Edwin Kempind0a63922013-01-23 16:32:59 +010084Query for open changes of watched projects:
Edwin Kempin37440832013-02-06 11:36:00 +010085
86.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010087----
Edwin Kempin2091edb2013-01-23 19:07:38 +010088 GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010089----
Edwin Kempind0a63922013-01-23 16:32:59 +010090
Edwin Kempin37440832013-02-06 11:36:00 +010091.Response
92----
Edwin Kempind0a63922013-01-23 16:32:59 +010093 HTTP/1.1 200 OK
94 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090095 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010096
97 )]}'
John Spurlockd25fad12013-03-09 11:48:49 -050098 [
99 {
John Spurlockd25fad12013-03-09 11:48:49 -0500100 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
101 "project": "demo",
102 "branch": "master",
Gal Paikinc326de42020-06-16 18:49:00 +0300103 "attention_set": [
104 {
105 "account": {
106 "name": "John Doe"
107 },
108 "last_update": "2012-07-17 07:19:27.766000000",
109 "reason": "reviewer or cc replied"
110 }
111 ]
John Spurlockd25fad12013-03-09 11:48:49 -0500112 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
113 "subject": "One change",
114 "status": "NEW",
115 "created": "2012-07-17 07:18:30.854000000",
116 "updated": "2012-07-17 07:19:27.766000000",
John Spurlockd25fad12013-03-09 11:48:49 -0500117 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100118 "insertions": 26,
119 "deletions": 10,
John Spurlockd25fad12013-03-09 11:48:49 -0500120 "_number": 1756,
121 "owner": {
122 "name": "John Doe"
123 },
Edwin Kempind0a63922013-01-23 16:32:59 +0100124 },
John Spurlockd25fad12013-03-09 11:48:49 -0500125 {
John Spurlockd25fad12013-03-09 11:48:49 -0500126 "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501",
127 "project": "demo",
128 "branch": "master",
129 "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501",
130 "subject": "Another change",
131 "status": "NEW",
132 "created": "2012-07-17 07:18:30.884000000",
133 "updated": "2012-07-17 07:18:30.885000000",
134 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100135 "insertions": 12,
136 "deletions": 18,
John Spurlockd25fad12013-03-09 11:48:49 -0500137 "_number": 1757,
138 "owner": {
139 "name": "John Doe"
140 },
141 "_more_changes": true
142 }
143 ]
Edwin Kempind0a63922013-01-23 16:32:59 +0100144----
145
Sebastian Schuberth02bafe02016-01-20 21:38:11 +0100146If the number of changes matching the query exceeds either the internal
147limit or a supplied `n` query parameter, the last change object has a
David Pursehouse025ea3e2014-09-03 10:47:34 +0900148`_more_changes: true` JSON field set.
149
150The `S` or `start` query parameter can be supplied to skip a number
151of changes from the list.
Edwin Kempind0a63922013-01-23 16:32:59 +0100152
153Clients are allowed to specify more than one query by setting the `q`
154parameter multiple times. In this case the result is an array of
155arrays, one per query in the same order the queries were given in.
156
Edwin Kempina64c4b92013-01-23 11:30:40 +0100157.Query for the 25 most recent open changes of the projects that you watch
158****
159get::/changes/?q=status:open+is:watched&n=25
160****
161
Edwin Kempind0a63922013-01-23 16:32:59 +0100162Query that retrieves changes for a user's dashboard:
Edwin Kempin37440832013-02-06 11:36:00 +0100163
164.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100165----
166 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 +0100167----
Edwin Kempind0a63922013-01-23 16:32:59 +0100168
Edwin Kempin37440832013-02-06 11:36:00 +0100169.Response
170----
Edwin Kempind0a63922013-01-23 16:32:59 +0100171 HTTP/1.1 200 OK
172 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900173 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100174
175 )]}'
176 [
177 [
178 {
Edwin Kempind0a63922013-01-23 16:32:59 +0100179 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
180 "project": "demo",
181 "branch": "master",
182 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
183 "subject": "One change",
184 "status": "NEW",
185 "created": "2012-07-17 07:18:30.854000000",
186 "updated": "2012-07-17 07:19:27.766000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100187 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100188 "insertions": 4,
189 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100190 "_number": 1756,
191 "owner": {
192 "name": "John Doe"
193 },
194 "labels": {
195 "Verified": {},
196 "Code-Review": {}
197 }
198 }
199 ],
200 [],
201 []
202 ]
203----
204
Edwin Kempina64c4b92013-01-23 11:30:40 +0100205.Query the changes for your user dashboard
206****
207get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS
208****
209
David Pursehouse2cf28432016-08-21 23:20:08 +0900210[[query-options]]
Edwin Kempind0a63922013-01-23 16:32:59 +0100211Additional fields can be obtained by adding `o` parameters, each
212option requires more database lookups and slows down the query
213response time to the client so they are generally disabled by
214default. Optional fields are:
215
Edwin Kempine3446292013-02-19 16:40:14 +0100216[[labels]]
217--
Edwin Kempind0a63922013-01-23 16:32:59 +0100218* `LABELS`: a summary of each label required for submit, and
219 approvers that have granted (or rejected) with that label.
Edwin Kempine3446292013-02-19 16:40:14 +0100220--
Edwin Kempind0a63922013-01-23 16:32:59 +0100221
Edwin Kempine3446292013-02-19 16:40:14 +0100222[[detailed-labels]]
223--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800224* `DETAILED_LABELS`: detailed label information, including numeric
Dave Borowitz992ddd72013-02-13 11:53:17 -0800225 values of all existing approvals, recognized label values, values
Edwin Kempin66af3d82015-11-10 17:38:40 -0800226 permitted to be set by the current user, all reviewers by state, and
227 reviewers that may be removed by the current user.
Edwin Kempine3446292013-02-19 16:40:14 +0100228--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800229
Edwin Kempine3446292013-02-19 16:40:14 +0100230[[current-revision]]
231--
Edwin Kempind0a63922013-01-23 16:32:59 +0100232* `CURRENT_REVISION`: describe the current revision (patch set)
233 of the change, including the commit SHA-1 and URLs to fetch from.
Edwin Kempine3446292013-02-19 16:40:14 +0100234--
Edwin Kempind0a63922013-01-23 16:32:59 +0100235
Edwin Kempine3446292013-02-19 16:40:14 +0100236[[all-revisions]]
237--
Edwin Kempind0a63922013-01-23 16:32:59 +0100238* `ALL_REVISIONS`: describe all revisions, not just current.
Edwin Kempine3446292013-02-19 16:40:14 +0100239--
Edwin Kempind0a63922013-01-23 16:32:59 +0100240
David Pursehouse025c1af2015-11-20 17:02:50 +0900241[[download-commands]]
Edwin Kempinea621482013-10-16 12:58:24 +0200242--
243* `DOWNLOAD_COMMANDS`: include the `commands` field in the
244 link:#fetch-info[FetchInfo] for revisions. Only valid when the
245 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
246--
247
Edwin Kempine3446292013-02-19 16:40:14 +0100248[[current-commit]]
249--
Edwin Kempind0a63922013-01-23 16:32:59 +0100250* `CURRENT_COMMIT`: parse and output all header fields from the
David Pursehouse98006e82013-10-02 10:15:52 +0900251 commit object, including message. Only valid when the
252 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100253--
Edwin Kempind0a63922013-01-23 16:32:59 +0100254
Edwin Kempine3446292013-02-19 16:40:14 +0100255[[all-commits]]
256--
Edwin Kempind0a63922013-01-23 16:32:59 +0100257* `ALL_COMMITS`: parse and output all header fields from the
258 output revisions. If only `CURRENT_REVISION` was requested
259 then only the current revision's commit data will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100260--
Edwin Kempind0a63922013-01-23 16:32:59 +0100261
Edwin Kempine3446292013-02-19 16:40:14 +0100262[[current-files]]
263--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100264* `CURRENT_FILES`: list files modified by the commit and magic files,
265 including basic line counts inserted/deleted per file. Only valid
266 when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100267--
Edwin Kempind0a63922013-01-23 16:32:59 +0100268
Edwin Kempine3446292013-02-19 16:40:14 +0100269[[all-files]]
270--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100271* `ALL_FILES`: list files modified by the commit and magic files,
272 including basic line counts inserted/deleted per file. If only the
273 `CURRENT_REVISION` was requested then only that commit's modified
274 files will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100275--
Edwin Kempind0a63922013-01-23 16:32:59 +0100276
Edwin Kempine3446292013-02-19 16:40:14 +0100277[[detailed-accounts]]
278--
Edwin Kempin4a00e222013-10-16 14:34:24 +0200279* `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username`
280 fields when referencing accounts.
Edwin Kempine3446292013-02-19 16:40:14 +0100281--
Dave Borowitz8926a882013-02-01 14:32:48 -0800282
Viktar Donich316bf7a2016-07-06 11:29:01 -0700283[[reviewer-updates]]
284--
285* `REVIEWER_UPDATES`: include updates to reviewers set as
286 link:#review-update-info[ReviewerUpdateInfo] entities.
287--
288
John Spurlock74a70cc2013-03-23 16:41:50 -0400289[[messages]]
290--
291* `MESSAGES`: include messages associated with the change.
292--
293
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700294[[actions]]
295--
296* `CURRENT_ACTIONS`: include information on available actions
Stefan Beller09cd95d2015-02-12 13:40:23 -0800297 for the change and its current revision. Ignored if the caller
298 is not authenticated.
299--
300
301[[change-actions]]
302--
303* `CHANGE_ACTIONS`: include information on available
304 change actions for the change. Ignored if the caller
305 is not authenticated.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700306--
307
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700308[[reviewed]]
309--
Dave Borowitz86669b32015-05-27 14:56:10 -0700310* `REVIEWED`: include the `reviewed` field if all of the following are
311 true:
Ardo Septama505f9ad2016-12-06 16:28:00 +0100312 - the change is open
313 - the caller is authenticated
314 - the caller has commented on the change more recently than the last update
Dave Borowitz86669b32015-05-27 14:56:10 -0700315 from the change owner, i.e. this change would show up in the results of
316 link:user-search.html#reviewedby[reviewedby:self].
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700317--
Gal Paikin3a2aa012019-06-21 18:30:01 +0200318[[skip_diffstat]]
319--
320* `SKIP_DIFFSTAT`: skip the 'insertions' and 'deletions' field in link:#change-info[ChangeInfo].
321 For large trees, their computation may be expensive.
322--
Han-Wen Nienhuys19de6cd2018-01-16 13:15:38 +0100323
Jonathan Niedercb51d742016-09-23 11:37:57 -0700324[[submittable]]
325--
Jonathan Niederad5240f2016-10-04 11:03:23 -0700326* `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo],
Jonathan Niedercb51d742016-09-23 11:37:57 -0700327 which can be used to tell if the change is reviewed and ready for submit.
328--
329
Khai Do2a23ec82014-09-19 16:33:02 -0700330[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100331--
Sven Selbergd26bd542014-11-21 16:28:10 +0100332* `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo],
333 therefore only valid in combination with `CURRENT_COMMIT` or
334 `ALL_COMMITS`.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100335--
336
Dave Borowitz4c46c242014-12-03 16:46:45 -0800337[[check]]
338--
339* `CHECK`: include potential problems with the change.
340--
341
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700342[[commit-footers]]
343--
344* `COMMIT_FOOTERS`: include the full commit message with
345 Gerrit-specific commit footers in the
346 link:#revision-info[RevisionInfo].
Yuxuan 'fishy' Wang16baf212015-05-05 16:49:55 -0700347--
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700348
Dave Borowitz6f58dbe2015-09-14 12:34:31 -0400349[[push-certificates]]
350--
351* `PUSH_CERTIFICATES`: include push certificate information in the
352 link:#revision-info[RevisionInfo]. Ignored if signed push is not
353 link:config-gerrit.html#receive.enableSignedPush[enabled] on the
354 server.
355--
356
Makson Lee3568a932017-08-28 17:12:03 +0800357[[tracking-ids]]
358--
359* `TRACKING_IDS`: include references to external tracking systems
360 as link:#tracking-id-info[TrackingIdInfo].
361--
362
Edwin Kempin37440832013-02-06 11:36:00 +0100363.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100364----
Edwin Kempinea621482013-10-16 12:58:24 +0200365 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 +0100366----
Edwin Kempind0a63922013-01-23 16:32:59 +0100367
Edwin Kempin37440832013-02-06 11:36:00 +0100368.Response
369----
Edwin Kempind0a63922013-01-23 16:32:59 +0100370 HTTP/1.1 200 OK
371 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900372 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100373
374 )]}'
375 [
376 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900377 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100378 "project": "gerrit",
379 "branch": "master",
380 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
381 "subject": "Use an EventBus to manage star icons",
382 "status": "NEW",
383 "created": "2012-04-25 00:52:25.580000000",
384 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100385 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100386 "insertions": 16,
387 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100388 "_number": 97,
389 "owner": {
390 "name": "Shawn Pearce"
391 },
392 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
393 "revisions": {
394 "184ebe53805e102605d11f6b143486d15c23a09c": {
David Pursehouse4de41112016-06-28 09:24:08 +0900395 "kind": "REWORK",
Edwin Kempind0a63922013-01-23 16:32:59 +0100396 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100397 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100398 "fetch": {
399 "git": {
400 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200401 "ref": "refs/changes/97/97/1",
402 "commands": {
403 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
404 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
405 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
406 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
407 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100408 },
409 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200410 "url": "http://myuser@127.0.0.1:8080/gerrit",
411 "ref": "refs/changes/97/97/1",
412 "commands": {
413 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
414 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
415 "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",
416 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
417 }
418 },
419 "ssh": {
420 "url": "ssh://myuser@*:29418/gerrit",
421 "ref": "refs/changes/97/97/1",
422 "commands": {
423 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
424 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
425 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
426 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
427 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100428 }
429 },
430 "commit": {
431 "parents": [
432 {
433 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
434 "subject": "Migrate contributor agreements to All-Projects."
435 }
436 ],
437 "author": {
438 "name": "Shawn O. Pearce",
439 "email": "sop@google.com",
440 "date": "2012-04-24 18:08:08.000000000",
441 "tz": -420
442 },
443 "committer": {
444 "name": "Shawn O. Pearce",
445 "email": "sop@google.com",
446 "date": "2012-04-24 18:08:08.000000000",
447 "tz": -420
448 },
449 "subject": "Use an EventBus to manage star icons",
450 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
451 },
452 "files": {
453 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200454 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100455 "size_delta": -412,
456 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100457 },
458 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200459 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100460 "size_delta": 23,
461 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100462 },
463 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
464 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200465 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100466 "size_delta": -298,
467 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100468 },
469 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
470 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200471 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100472 "size_delta": 132,
473 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100474 },
475 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
476 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200477 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100478 "size_delta": -5512,
479 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100480 },
481 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
482 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200483 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100484 "size_delta": 8345,
485 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100486 },
487 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200488 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100489 "size_delta": -343,
490 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100491 }
492 }
493 }
494 }
495 }
496 ]
497----
498
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100499[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800500=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800501--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100502'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800503--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100504
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100505Retrieves a change.
506
Dave Borowitz0314f732013-10-03 09:34:30 -0700507Additional fields can be obtained by adding `o` parameters, each
508option requires more database lookups and slows down the query
509response time to the client so they are generally disabled by
510default. Fields are described in link:#list-changes[Query Changes].
511
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100512.Request
513----
514 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
515----
516
517As response a link:#change-info[ChangeInfo] entity is returned that
518describes the change.
519
520.Response
521----
522 HTTP/1.1 200 OK
523 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900524 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100525
526 )]}'
527 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100528 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
529 "project": "myProject",
530 "branch": "master",
Gal Paikinc326de42020-06-16 18:49:00 +0300531 "attention_set": [
532 {
533 "account": {
534 "name": "John Doe"
535 },
536 "last_update": "2013-02-21 11:16:36.775000000",
537 "reason": "reviewer or cc replied"
538 }
539 ]
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100540 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
541 "subject": "Implementing Feature X",
542 "status": "NEW",
543 "created": "2013-02-01 09:59:32.126000000",
544 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100545 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100546 "insertions": 34,
547 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100548 "_number": 3965,
549 "owner": {
550 "name": "John Doe"
551 }
552 }
553----
554
Edwin Kempin8e492202013-02-21 15:38:25 +0100555[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800556=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800557--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100558'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800559--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100560
Edwin Kempin8e492202013-02-21 15:38:25 +0100561Retrieves a change with link:#labels[labels], link:#detailed-labels[
Viktar Donich316bf7a2016-07-06 11:29:01 -0700562detailed labels], link:#detailed-accounts[detailed accounts],
563link:#reviewer-updates[reviewer updates], and link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100564
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700565Additional fields can be obtained by adding `o` parameters, each
566option requires more database lookups and slows down the query
567response time to the client so they are generally disabled by
568default. Fields are described in link:#list-changes[Query Changes].
569
Edwin Kempin8e492202013-02-21 15:38:25 +0100570.Request
571----
572 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
573----
574
575As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700576describes the change. This response will contain all votes for each
577label and include one combined vote. The combined label vote is
578calculated in the following order (from highest to lowest):
579REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100580
581.Response
582----
583 HTTP/1.1 200 OK
584 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900585 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100586
587 )]}'
588 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100589 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
590 "project": "myProject",
591 "branch": "master",
Gal Paikinc326de42020-06-16 18:49:00 +0300592 "attention_set": [
593 {
594 "account": {
595 "_account_id": 1000096,
596 "name": "John Doe",
597 "email": "john.doe@example.com",
598 "username": "jdoe"
599 },
600 "last_update": "2013-02-21 11:16:36.775000000",
601 "reason": "reviewer or cc replied"
602 }
603 ]
Edwin Kempin8e492202013-02-21 15:38:25 +0100604 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
605 "subject": "Implementing Feature X",
606 "status": "NEW",
607 "created": "2013-02-01 09:59:32.126000000",
608 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100609 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100610 "insertions": 126,
611 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100612 "_number": 3965,
613 "owner": {
614 "_account_id": 1000096,
615 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200616 "email": "john.doe@example.com",
617 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100618 },
619 "labels": {
620 "Verified": {
621 "all": [
622 {
623 "value": 0,
624 "_account_id": 1000096,
625 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200626 "email": "john.doe@example.com",
627 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100628 },
629 {
630 "value": 0,
631 "_account_id": 1000097,
632 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200633 "email": "jane.roe@example.com",
634 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100635 }
636 ],
637 "values": {
638 "-1": "Fails",
639 " 0": "No score",
640 "+1": "Verified"
641 }
642 },
643 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100644 "disliked": {
645 "_account_id": 1000096,
646 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200647 "email": "john.doe@example.com",
648 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100649 },
650 "all": [
651 {
652 "value": -1,
653 "_account_id": 1000096,
654 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200655 "email": "john.doe@example.com",
656 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100657 },
658 {
659 "value": 1,
660 "_account_id": 1000097,
661 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200662 "email": "jane.roe@example.com",
663 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100664 }
665 ]
666 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +0400667 "-2": "This shall not be merged",
668 "-1": "I would prefer this is not merged as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100669 " 0": "No score",
670 "+1": "Looks good to me, but someone else must approve",
671 "+2": "Looks good to me, approved"
672 }
673 }
674 },
675 "permitted_labels": {
676 "Verified": [
677 "-1",
678 " 0",
679 "+1"
680 ],
681 "Code-Review": [
682 "-2",
683 "-1",
684 " 0",
685 "+1",
686 "+2"
687 ]
688 },
689 "removable_reviewers": [
690 {
691 "_account_id": 1000096,
692 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200693 "email": "john.doe@example.com",
694 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100695 },
696 {
697 "_account_id": 1000097,
698 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200699 "email": "jane.roe@example.com",
700 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100701 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400702 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800703 "reviewers": {
704 "REVIEWER": [
705 {
706 "_account_id": 1000096,
707 "name": "John Doe",
708 "email": "john.doe@example.com",
709 "username": "jdoe"
710 },
711 {
712 "_account_id": 1000097,
713 "name": "Jane Roe",
714 "email": "jane.roe@example.com",
715 "username": "jroe"
716 }
717 ]
718 },
Viktar Donich316bf7a2016-07-06 11:29:01 -0700719 "reviewer_updates": [
720 {
721 "state": "REVIEWER",
722 "reviewer": {
723 "_account_id": 1000096,
724 "name": "John Doe",
725 "email": "john.doe@example.com",
726 "username": "jdoe"
727 },
728 "updated_by": {
729 "_account_id": 1000096,
730 "name": "John Doe",
731 "email": "john.doe@example.com",
732 "username": "jdoe"
733 },
734 "updated": "2016-07-21 20:12:39.000000000"
735 },
736 {
737 "state": "REMOVED",
738 "reviewer": {
739 "_account_id": 1000096,
740 "name": "John Doe",
741 "email": "john.doe@example.com",
742 "username": "jdoe"
743 },
744 "updated_by": {
745 "_account_id": 1000096,
746 "name": "John Doe",
747 "email": "john.doe@example.com",
748 "username": "jdoe"
749 },
750 "updated": "2016-07-21 20:12:33.000000000"
751 },
752 {
753 "state": "CC",
754 "reviewer": {
755 "_account_id": 1000096,
756 "name": "John Doe",
757 "email": "john.doe@example.com",
758 "username": "jdoe"
759 },
760 "updated_by": {
761 "_account_id": 1000096,
762 "name": "John Doe",
763 "email": "john.doe@example.com",
764 "username": "jdoe"
765 },
766 "updated": "2016-03-23 21:34:02.419000000",
767 },
768 ],
John Spurlock74a70cc2013-03-23 16:41:50 -0400769 "messages": [
770 {
771 "id": "YH-egE",
772 "author": {
773 "_account_id": 1000096,
774 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200775 "email": "john.doe@example.com",
776 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400777 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100778 "date": "2013-03-23 21:34:02.419000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400779 "message": "Patch Set 1:\n\nThis is the first message.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100780 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400781 },
782 {
783 "id": "WEEdhU",
784 "author": {
785 "_account_id": 1000097,
786 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200787 "email": "jane.roe@example.com",
788 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400789 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100790 "date": "2013-03-23 21:36:52.332000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400791 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100792 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400793 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100794 ]
795 }
796----
797
Aaron Gable9b413072017-08-24 13:15:21 -0700798[[create-merge-patch-set-for-change]]
799=== Create Merge Patch Set For Change
800--
801'POST /changes/link:#change-id[\{change-id\}]/merge'
802--
803
804Update an existing change by using a
805link:#merge-patch-set-input[MergePatchSetInput] entity.
806
807Gerrit will create a merge commit based on the information of
808MergePatchSetInput and add a new patch set to the change corresponding
809to the new merge commit.
810
811.Request
812----
813 POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0
814 Content-Type: application/json; charset=UTF-8
815
816 {
817 "subject": "Merge dev_branch into master",
818 "merge": {
David Pursehousef4fb1042018-03-18 23:03:46 +0900819 "source": "refs/changes/34/1234/1"
Aaron Gable9b413072017-08-24 13:15:21 -0700820 }
821 }
822----
823
824As response a link:#change-info[ChangeInfo] entity with current revision is
825returned that describes the resulting change.
826
827.Response
828----
829 HTTP/1.1 200 OK
830 Content-Disposition: attachment
831 Content-Type: application/json; charset=UTF-8
832
833 )]}'
834 {
835 "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc",
836 "project": "test",
837 "branch": "master",
838 "hashtags": [],
839 "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc",
840 "subject": "Merge dev_branch into master",
841 "status": "NEW",
842 "created": "2016-09-23 18:08:53.238000000",
843 "updated": "2016-09-23 18:09:25.934000000",
844 "submit_type": "MERGE_IF_NECESSARY",
845 "mergeable": true,
846 "insertions": 5,
847 "deletions": 0,
848 "_number": 72,
849 "owner": {
850 "_account_id": 1000000
851 },
852 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822"
853 }
854----
855
856[[set-message]]
857=== Set Commit Message
858--
859'PUT /changes/link:#change-id[\{change-id\}]/message'
860--
861
862Creates a new patch set with a new commit message.
863
864The new commit message must be provided in the request body inside a
Han-Wen Nienhuys098580a2019-07-24 20:17:41 +0200865link:#commit-message-input[CommitMessageInput] entity. If a Change-Id
866footer is specified, it must match the current Change-Id footer. If
867the Change-Id footer is absent, the current Change-Id is added to the
868message.
Aaron Gable9b413072017-08-24 13:15:21 -0700869
870.Request
871----
872 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0
873 Content-Type: application/json; charset=UTF-8
874
875 {
876 "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n"
877 }
878----
879
880.Notifications
881
882An email will be sent using the "newpatchset" template.
883
884[options="header",cols="1,1"]
885|=============================
886|WIP State |Default
887|Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers
888|Work in progress|owner
889|=============================
890
Edwin Kempin64006bb2013-02-22 08:17:04 +0100891[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800892=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800893--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100894'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800895--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100896
Edwin Kempin64006bb2013-02-22 08:17:04 +0100897Retrieves the topic of a change.
898
899.Request
900----
901 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
902----
903
904.Response
905----
906 HTTP/1.1 200 OK
907 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900908 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100909
910 )]}'
911 "Documentation"
912----
913
914If the change does not have a topic an empty string is returned.
915
916[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800917=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800918--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100919'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800920--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100921
Edwin Kempin64006bb2013-02-22 08:17:04 +0100922Sets the topic of a change.
923
924The new topic must be provided in the request body inside a
Patrick Hiesel4aa14562018-06-19 15:07:50 +0200925link:#topic-input[TopicInput] entity. Any leading or trailing whitespace
926in the topic name will be removed.
Edwin Kempin64006bb2013-02-22 08:17:04 +0100927
928.Request
929----
930 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
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 "topic": "Documentation"
935 }
936----
937
938As response the new topic is returned.
939
940.Response
941----
942 HTTP/1.1 200 OK
943 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900944 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100945
946 )]}'
947 "Documentation"
948----
949
950If the topic was deleted the response is "`204 No Content`".
951
952[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800953=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800954--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100955'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800956--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100957
Edwin Kempin64006bb2013-02-22 08:17:04 +0100958Deletes the topic of a change.
959
Edwin Kempin64006bb2013-02-22 08:17:04 +0100960.Request
961----
962 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
963----
964
965.Response
966----
967 HTTP/1.1 204 No Content
968----
969
Sven Selberg273a4aa2016-09-21 16:28:10 +0200970[[get-assignee]]
971=== Get Assignee
972--
973'GET /changes/link:#change-id[\{change-id\}]/assignee'
974--
975
976Retrieves the account of the user assigned to a change.
977
978.Request
979----
980 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
981----
982
983As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
984describing the assigned account is returned.
985
986.Response
987----
988 HTTP/1.1 200 OK
989 Content-Disposition: attachment
990 Content-Type: application/json; charset=UTF-8
991
992 )]}'
993 {
994 "_account_id": 1000096,
995 "name": "John Doe",
996 "email": "john.doe@example.com",
997 "username": "jdoe"
998 }
999----
1000
1001If the change has no assignee the response is "`204 No Content`".
1002
1003[[get-past-assignees]]
1004=== Get Past Assignees
1005--
1006'GET /changes/link:#change-id[\{change-id\}]/past_assignees'
1007--
1008
1009Returns a list of every user ever assigned to a change, in the order in which
1010they were first assigned.
1011
1012.Request
1013----
1014 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/past_assignees HTTP/1.0
1015----
1016
1017As a response a list of link:rest-api-accounts.html#account-info[AccountInfo]
1018entities is returned.
1019
1020.Response
1021----
1022 HTTP/1.1 200 OK
1023 Content-Disposition: attachment
1024 Content-Type: application/json; charset=UTF-8
1025
1026 )]}'
1027 [
1028 {
1029 "_account_id": 1000051,
1030 "name": "Jane Doe",
1031 "email": "jane.doe@example.com",
1032 "username": "janed"
1033 },
1034 {
1035 "_account_id": 1000096,
1036 "name": "John Doe",
1037 "email": "john.doe@example.com",
1038 "username": "jdoe"
1039 }
1040 ]
1041
1042----
1043
1044
1045[[set-assignee]]
1046=== Set Assignee
1047--
1048'PUT /changes/link:#change-id[\{change-id\}]/assignee'
1049--
1050
1051Sets the assignee of a change.
1052
1053The new assignee must be provided in the request body inside a
1054link:#assignee-input[AssigneeInput] entity.
1055
1056.Request
1057----
1058 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1059 Content-Type: application/json; charset=UTF-8
1060
1061 {
1062 "assignee": "jdoe"
1063 }
1064----
1065
1066As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1067describing the assigned account is returned.
1068
1069.Response
1070----
1071 HTTP/1.1 200 OK
1072 Content-Disposition: attachment
1073 Content-Type: application/json; charset=UTF-8
1074
1075 )]}'
1076 {
1077 "_account_id": 1000096,
1078 "name": "John Doe",
1079 "email": "john.doe@example.com",
1080 "username": "jdoe"
1081 }
1082----
1083
1084[[delete-assignee]]
1085=== Delete Assignee
1086--
1087'DELETE /changes/link:#change-id[\{change-id\}]/assignee'
1088--
1089
1090Deletes the assignee of a change.
1091
1092
1093.Request
1094----
1095 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1096----
1097
1098As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1099describing the account of the deleted assignee is returned.
1100
1101.Response
1102----
1103 HTTP/1.1 200 OK
1104 Content-Disposition: attachment
1105 Content-Type: application/json; charset=UTF-8
1106
1107 )]}'
1108 {
1109 "_account_id": 1000096,
1110 "name": "John Doe",
1111 "email": "john.doe@example.com",
1112 "username": "jdoe"
1113 }
1114----
1115
1116If the change had no assignee the response is "`204 No Content`".
1117
Patrick Hieselbb84fd72017-08-23 11:11:22 +02001118[[get-pure-revert]]
1119=== Get Pure Revert
1120--
1121'GET /changes/link:#change-id[\{change-id\}]/pure_revert'
1122--
1123
1124Check if the given change is a pure revert of the change it references in `revertOf`.
1125Optionally, the query parameter `o` can be passed in to specify a commit (SHA1 in
112640 digit hex representation) to check against. It takes precedence over `revertOf`.
1127If the change has no reference in `revertOf`, the parameter is mandatory.
1128
1129As response a link:#pure-revert-info[PureRevertInfo] entity is returned.
1130
1131.Request
1132----
1133 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0
1134----
1135
1136.Response
1137----
1138 HTTP/1.1 200 OK
1139 Content-Disposition: attachment
1140 Content-Type: application/json; charset=UTF-8
1141
1142 )]}'
1143 {
1144 "is_pure_revert" : false
1145 }
1146----
1147
Edwin Kempined5364b2013-02-22 10:39:33 +01001148[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001149=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001150--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001151'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001152--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001153
Edwin Kempined5364b2013-02-22 10:39:33 +01001154Abandons a change.
1155
1156The request body does not need to include a link:#abandon-input[
1157AbandonInput] entity if no review comment is added.
1158
Gal Paikinc326de42020-06-16 18:49:00 +03001159Abandoning a change also removes all users from the link:#attention-set[attention set].
1160
Edwin Kempined5364b2013-02-22 10:39:33 +01001161.Request
1162----
1163 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
1164----
1165
1166As response a link:#change-info[ChangeInfo] entity is returned that
1167describes the abandoned change.
1168
1169.Response
1170----
1171 HTTP/1.1 200 OK
1172 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001173 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001174
1175 )]}'
1176 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001177 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1178 "project": "myProject",
1179 "branch": "master",
1180 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1181 "subject": "Implementing Feature X",
1182 "status": "ABANDONED",
1183 "created": "2013-02-01 09:59:32.126000000",
1184 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001185 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001186 "insertions": 3,
1187 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +01001188 "_number": 3965,
1189 "owner": {
1190 "name": "John Doe"
1191 }
1192 }
1193----
1194
1195If the change cannot be abandoned because the change state doesn't
1196allow abandoning of the change, the response is "`409 Conflict`" and
1197the error message is contained in the response body.
1198
1199.Response
1200----
1201 HTTP/1.1 409 Conflict
1202 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001203 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001204
1205 change is merged
1206----
1207
Logan Hankse43b68e2017-05-23 13:16:22 -07001208.Notifications
1209
1210An email will be sent using the "abandon" template. The notify handling is ALL.
1211Notifications are suppressed on WIP changes that have never started review.
1212
Logan Hanks87607412017-05-30 13:49:04 -07001213[options="header",cols="1,2"]
Logan Hankse43b68e2017-05-23 13:16:22 -07001214|=============================
Logan Hanks87607412017-05-30 13:49:04 -07001215|WIP State |notify=ALL
Logan Hankse43b68e2017-05-23 13:16:22 -07001216|Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1217|Work in progress|not sent
1218|Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1219|=============================
1220
Edwin Kempined5364b2013-02-22 10:39:33 +01001221[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001222=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001223--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001224'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001225--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001226
Edwin Kempined5364b2013-02-22 10:39:33 +01001227Restores a change.
1228
1229The request body does not need to include a link:#restore-input[
1230RestoreInput] entity if no review comment is added.
1231
1232.Request
1233----
1234 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1235----
1236
1237As response a link:#change-info[ChangeInfo] entity is returned that
1238describes the restored change.
1239
1240.Response
1241----
1242 HTTP/1.1 200 OK
1243 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001244 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001245
1246 )]}'
1247 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001248 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1249 "project": "myProject",
1250 "branch": "master",
1251 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1252 "subject": "Implementing Feature X",
1253 "status": "NEW",
1254 "created": "2013-02-01 09:59:32.126000000",
1255 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001256 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001257 "insertions": 2,
1258 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001259 "_number": 3965,
1260 "owner": {
1261 "name": "John Doe"
1262 }
1263 }
1264----
1265
1266If the change cannot be restored because the change state doesn't
1267allow restoring the change, the response is "`409 Conflict`" and
1268the error message is contained in the response body.
1269
1270.Response
1271----
1272 HTTP/1.1 409 Conflict
1273 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001274 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001275
1276 change is new
1277----
1278
Edwin Kempincdae63b2013-03-15 15:06:59 +01001279[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001280=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001281--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001282'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001283--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001284
1285Rebases a change.
1286
Zalan Blenessy874aed72015-01-12 13:26:18 +01001287Optionally, the parent revision can be changed to another patch set through the
1288link:#rebase-input[RebaseInput] entity.
1289
Edwin Kempincdae63b2013-03-15 15:06:59 +01001290.Request
1291----
1292 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001293 Content-Type: application/json;charset=UTF-8
1294
1295 {
1296 "base" : "1234",
1297 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001298----
1299
1300As response a link:#change-info[ChangeInfo] entity is returned that
1301describes the rebased change. Information about the current patch set
1302is included.
1303
1304.Response
1305----
1306 HTTP/1.1 200 OK
1307 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001308 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001309
1310 )]}'
1311 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001312 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1313 "project": "myProject",
1314 "branch": "master",
1315 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1316 "subject": "Implement Feature X",
1317 "status": "NEW",
1318 "created": "2013-02-01 09:59:32.126000000",
1319 "updated": "2013-02-21 11:16:36.775000000",
1320 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001321 "insertions": 33,
1322 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001323 "_number": 4799,
1324 "owner": {
1325 "name": "John Doe"
1326 },
1327 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1328 "revisions": {
1329 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001330 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001331 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001332 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001333 "fetch": {
1334 "http": {
1335 "url": "http://gerrit:8080/myProject",
1336 "ref": "refs/changes/99/4799/2"
1337 }
1338 },
1339 "commit": {
1340 "parents": [
1341 {
1342 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1343 "subject": "Implement Feature A"
1344 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001345 ],
1346 "author": {
1347 "name": "John Doe",
1348 "email": "john.doe@example.com",
1349 "date": "2013-05-07 15:21:27.000000000",
1350 "tz": 120
1351 },
1352 "committer": {
1353 "name": "Gerrit Code Review",
1354 "email": "gerrit-server@example.com",
1355 "date": "2013-05-07 15:35:43.000000000",
1356 "tz": 120
1357 },
1358 "subject": "Implement Feature X",
1359 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001360 }
1361 }
1362 }
1363----
1364
1365If the change cannot be rebased, e.g. due to conflicts, the response is
1366"`409 Conflict`" and the error message is contained in the response
1367body.
1368
1369.Response
1370----
1371 HTTP/1.1 409 Conflict
1372 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001373 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001374
1375 The change could not be rebased due to a path conflict during merge.
1376----
1377
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301378[[move-change]]
1379=== Move Change
1380--
1381'POST /changes/link:#change-id[\{change-id\}]/move'
1382--
1383
1384Move a change.
1385
1386The destination branch must be provided in the request body inside a
1387link:#move-input[MoveInput] entity.
1388
1389.Request
1390----
1391 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1392 Content-Type: application/json; charset=UTF-8
1393
1394 {
1395 "destination_branch" : "release-branch"
1396 }
1397
1398----
1399
1400As response a link:#change-info[ChangeInfo] entity is returned that
1401describes the moved change.
1402
1403.Response
1404----
1405 HTTP/1.1 200 OK
1406 Content-Disposition: attachment
1407 Content-Type: application/json; charset=UTF-8
1408
1409 )]}'
1410 {
1411 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1412 "project": "myProject",
1413 "branch": "release-branch",
1414 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1415 "subject": "Implementing Feature X",
1416 "status": "NEW",
1417 "created": "2013-02-01 09:59:32.126000000",
1418 "updated": "2013-02-21 11:16:36.775000000",
1419 "mergeable": true,
1420 "insertions": 2,
1421 "deletions": 13,
1422 "_number": 3965,
1423 "owner": {
1424 "name": "John Doe"
1425 }
1426 }
1427----
1428
Changcheng Xiao6dc90422017-08-09 10:21:58 +02001429Note that this endpoint will not update the change's parents, which is
1430different from the link:#cherry-pick[cherry-pick] endpoint.
1431
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301432If the change cannot be moved because the change state doesn't
1433allow moving the change, the response is "`409 Conflict`" and
1434the error message is contained in the response body.
1435
1436.Response
1437----
1438 HTTP/1.1 409 Conflict
1439 Content-Disposition: attachment
1440 Content-Type: text/plain; charset=UTF-8
1441
1442 change is merged
1443----
1444
1445If the change cannot be moved because the user doesn't have
1446abandon permission on the change or upload permission on the destination,
1447the response is "`409 Conflict`" and the error message is contained in the
1448response body.
1449
1450.Response
1451----
1452 HTTP/1.1 409 Conflict
1453 Content-Disposition: attachment
1454 Content-Type: text/plain; charset=UTF-8
1455
1456 move not permitted
1457----
1458
Edwin Kempind2ec4152013-02-22 12:17:19 +01001459[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001460=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001461--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001462'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001463--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001464
Edwin Kempind2ec4152013-02-22 12:17:19 +01001465Reverts a change.
1466
Gal Paikin006d52b2019-12-19 11:22:09 +01001467The subject of the newly created change will be
1468'Revert "<subject-of-reverted-change>"'. If the subject of the change reverted is
1469above 63 characters, it will be cut down to 59 characters with "..." in the end.
1470
Edwin Kempind2ec4152013-02-22 12:17:19 +01001471The request body does not need to include a link:#revert-input[
1472RevertInput] entity if no review comment is added.
1473
1474.Request
1475----
Michael Zhou10270492016-03-24 22:35:40 -04001476 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001477----
1478
1479As response a link:#change-info[ChangeInfo] entity is returned that
1480describes the reverting change.
1481
1482.Response
1483----
1484 HTTP/1.1 200 OK
1485 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001486 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001487
1488 )]}'
1489 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001490 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1491 "project": "myProject",
1492 "branch": "master",
1493 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1494 "subject": "Revert \"Implementing Feature X\"",
1495 "status": "NEW",
1496 "created": "2013-02-01 09:59:32.126000000",
1497 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001498 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001499 "insertions": 6,
1500 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001501 "_number": 3965,
1502 "owner": {
1503 "name": "John Doe"
1504 }
1505 }
1506----
1507
Gal Paikin6c9ed952020-01-22 10:36:35 +01001508If the user doesn't have revert permission on the change or upload permission on
1509the destination branch, the response is "`403 Forbidden`", and the error message is
1510contained in the response body.
1511
Edwin Kempind2ec4152013-02-22 12:17:19 +01001512If the change cannot be reverted because the change state doesn't
Gal Paikin6c9ed952020-01-22 10:36:35 +01001513allow reverting the change the response is "`409 Conflict`", and the error
1514message is contained in the response body.
Edwin Kempind2ec4152013-02-22 12:17:19 +01001515
1516.Response
1517----
1518 HTTP/1.1 409 Conflict
1519 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001520 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001521
1522 change is new
1523----
1524
Gal Paikinb81f56c2019-10-16 14:39:24 +02001525[[revert-submission]]
1526=== Revert Submission
1527--
1528'POST /changes/link:#change-id[\{change-id\}]/revert_submission'
1529--
1530
1531Creates open revert changes for all of the changes of a certain submission.
1532
Gal Paikin006d52b2019-12-19 11:22:09 +01001533The subject of each revert change will be 'Revert "<subject-of-reverted-change"'.
Gal Paikin100bf602019-12-23 14:50:41 +01001534If the subject is above 60 characters, the subject will be cut to 56 characters
1535with "..." in the end. However, whenever reverting the submission of a revert
1536submission, the subject will be shortened from
1537'Revert "Revert "<subject-of-reverted-change""' to
1538'Revert^2 "<subject-of-reverted-change"'. Also, for every future revert submission,
1539the only difference in the subject will be the number of the revert (instead of
1540Revert^2 the subject will change to Revert^3 and so on).
1541There are no guarantees about the subjects if the users change the default subjects.
Gal Paikinaffd0242019-12-18 18:10:08 +01001542
Gal Paikinb81f56c2019-10-16 14:39:24 +02001543Details for the revert can be specified in the request body inside a link:#revert-input[
1544RevertInput] The topic of all created revert changes will be
1545`revert-{submission_id}-{random_string_of_size_10}`.
1546
1547The changes will not be rebased on onto the destination branch so the users may still
1548have to manually rebase them to resolve conflicts and make them submittable.
1549
Gal Paikin653a8522019-11-25 11:40:10 +01001550However, the changes that have the same project and branch will be rebased on top
1551of each other. E.g, the first revert change will have the original change as a
1552parent, and the second revert change will have the first revert change as a
1553parent.
1554
1555There is one special case that involves merge commits; if a user has multiple
1556changes in the same project and branch, but not in the same change series, those
1557changes can still get submitted together if they have the same topic and
1558link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] in
1559gerrit.config is set to true. In the case, Gerrit may create merge commits on
1560submit (depending on the link:config-project-config.html#submit-type[submit types]
1561of the project).
1562The first parent for the reverts will be the most recent merge commit that was
1563created by Gerrit to merge the different change series into the target branch.
1564
Gal Paikinb81f56c2019-10-16 14:39:24 +02001565.Request
1566----
1567 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0
1568----
1569
1570As response link:#revert-submission-info[RevertSubmissionInfo] entity
1571is returned. That entity describes the revert changes.
1572
1573.Response
1574----
1575 HTTP/1.1 200 OK
1576 Content-Disposition: attachment
1577 Content-Type: application/json; charset=UTF-8
1578
1579 )]}'
1580 "revert_changes":
1581 [
1582 {
1583 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1584 "project": "myProject",
1585 "branch": "master",
1586 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1587 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1588 "subject": "Revert \"Implementing Feature X\"",
1589 "status": "NEW",
1590 "created": "2013-02-01 09:59:32.126000000",
1591 "updated": "2013-02-21 11:16:36.775000000",
1592 "mergeable": true,
1593 "insertions": 6,
1594 "deletions": 4,
1595 "_number": 3965,
1596 "owner": {
1597 "name": "John Doe"
1598 }
1599 },
1600 {
1601 "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646",
1602 "project": "anyProject",
1603 "branch": "master",
1604 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1605 "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646",
1606 "subject": "Revert \"Implementing Feature Y\"",
1607 "status": "NEW",
1608 "created": "2013-02-04 09:59:33.126000000",
1609 "updated": "2013-02-21 11:16:37.775000000",
1610 "mergeable": true,
1611 "insertions": 62,
1612 "deletions": 11,
1613 "_number": 3966,
1614 "owner": {
1615 "name": "Jane Doe"
1616 }
1617 }
1618 ]
1619----
1620
Gal Paikin6c9ed952020-01-22 10:36:35 +01001621If the user doesn't have revert permission on the change or upload permission on
1622the destination, the response is "`403 Forbidden`", and the error message is
1623contained in the response body.
1624
1625If the change cannot be reverted because the change state doesn't
1626allow reverting the change the response is "`409 Conflict`", and the error
1627message is contained in the response body.
Gal Paikinb81f56c2019-10-16 14:39:24 +02001628
1629.Response
1630----
1631 HTTP/1.1 409 Conflict
1632 Content-Disposition: attachment
1633 Content-Type: text/plain; charset=UTF-8
1634
1635 change is new
1636----
1637
Edwin Kempin0eddba02013-02-22 15:30:12 +01001638[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001639=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001640--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001641'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001642--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001643
Edwin Kempin0eddba02013-02-22 15:30:12 +01001644Submits a change.
1645
1646The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001647SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001648
Gal Paikinc326de42020-06-16 18:49:00 +03001649Submitting a change also removes all users from the link:#attention-set[attention set].
1650
Edwin Kempin0eddba02013-02-22 15:30:12 +01001651.Request
1652----
1653 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001654 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001655
1656 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001657 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001658 }
1659----
1660
1661As response a link:#change-info[ChangeInfo] entity is returned that
1662describes the submitted/merged change.
1663
1664.Response
1665----
1666 HTTP/1.1 200 OK
1667 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001668 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001669
1670 )]}'
1671 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001672 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1673 "project": "myProject",
1674 "branch": "master",
1675 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1676 "subject": "Implementing Feature X",
1677 "status": "MERGED",
1678 "created": "2013-02-01 09:59:32.126000000",
1679 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001680 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001681 "_number": 3965,
1682 "owner": {
1683 "name": "John Doe"
1684 }
1685 }
1686----
1687
1688If the change cannot be submitted because the submit rule doesn't allow
1689submitting the change, the response is "`409 Conflict`" and the error
1690message is contained in the response body.
1691
1692.Response
1693----
1694 HTTP/1.1 409 Conflict
1695 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001696 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001697
1698 blocked by Verified
1699----
1700
David Pursehouse025c1af2015-11-20 17:02:50 +09001701[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001702=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07001703--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001704'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001705--
1706
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001707Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001708link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07001709including the current change itself.
1710
Stefan Bellera7ad6612015-06-26 10:05:43 -07001711The list consists of:
1712
1713* The given change.
1714* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1715 is enabled, include all open changes with the same topic.
1716* For each change whose submit type is not CHERRY_PICK, include unmerged
1717 ancestors targeting the same branch.
1718
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001719As a special case, the list is empty if this change would be
1720submitted by itself (without other changes).
1721
1722.Request
1723----
1724 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
1725 Content-Type: application/json; charset=UTF-8
1726----
1727
1728As a response a link:#submitted-together-info[SubmittedTogetherInfo]
1729entity is returned that describes what would happen if the change were
1730submitted. This response contains a list of changes and a count of
1731changes that are not visible to the caller that are part of the set of
1732changes to be merged.
1733
1734The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001735link:#list-changes[Query Changes] with the
1736link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Patrick Hiesel6fbbdaa2018-04-05 15:10:13 +02001737link:#current-revision[`CURRENT_REVISION`],and
Jonathan Niedercb51d742016-09-23 11:37:57 -07001738link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001739
Shawn Pearce8080c3d2016-09-19 19:15:04 -07001740Standard link:#query-options[formatting options] can be specified
1741with the `o` parameter, as well as the `submitted_together` specific
1742option `NON_VISIBLE_CHANGES`.
1743
Stefan Bellera7ad6612015-06-26 10:05:43 -07001744.Response
1745----
1746 HTTP/1.1 200 OK
1747 Content-Disposition: attachment
1748 Content-Type: application/json; charset=UTF-8
1749
1750)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001751{
1752 "changes": [
1753 {
1754 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1755 "project": "gerrit",
1756 "branch": "master",
1757 "hashtags": [],
1758 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1759 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1760 "status": "NEW",
1761 "created": "2015-05-01 15:39:57.979000000",
1762 "updated": "2015-05-20 19:25:21.592000000",
1763 "mergeable": true,
1764 "insertions": 303,
1765 "deletions": 210,
1766 "_number": 1779,
1767 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001768 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001769 },
1770 "labels": {
1771 "Code-Review": {
1772 "approved": {
1773 "_account_id": 1000000
1774 },
1775 "all": [
1776 {
1777 "value": 2,
1778 "date": "2015-05-20 19:25:21.592000000",
1779 "_account_id": 1000000
1780 }
1781 ],
1782 "values": {
1783 "-2": "This shall not be merged",
1784 "-1": "I would prefer this is not merged as is",
1785 " 0": "No score",
1786 "+1": "Looks good to me, but someone else must approve",
1787 "+2": "Looks good to me, approved"
1788 },
1789 "default_value": 0
1790 },
1791 "Verified": {
1792 "approved": {
1793 "_account_id": 1000000
1794 },
1795 "all": [
1796 {
1797 "value": 1,
1798 "date": "2015-05-20 19:25:21.592000000",
1799 "_account_id": 1000000
1800 }
1801 ],
1802 "values": {
1803 "-1": "Fails",
1804 " 0": "No score",
1805 "+1": "Verified"
1806 },
1807 "default_value": 0
1808 }
1809 },
1810 "permitted_labels": {
1811 "Code-Review": [
1812 "-2",
1813 "-1",
1814 " 0",
1815 "+1",
1816 "+2"
1817 ],
1818 "Verified": [
1819 "-1",
1820 " 0",
1821 "+1"
1822 ]
1823 },
1824 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001825 {
1826 "_account_id": 1000000
1827 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001828 ],
1829 "reviewers": {
1830 "REVIEWER": [
1831 {
1832 "_account_id": 1000000
1833 }
1834 ]
1835 },
1836 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1837 "revisions": {
1838 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09001839 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001840 "_number": 1,
1841 "created": "2015-05-01 15:39:57.979000000",
1842 "uploader": {
1843 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001844 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001845 "ref": "refs/changes/79/1779/1",
1846 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07001847 }
1848 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001849 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001850 {
1851 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
1852 "project": "gerrit",
1853 "branch": "master",
1854 "hashtags": [],
1855 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
1856 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1857 "status": "NEW",
1858 "created": "2015-05-01 15:39:57.979000000",
1859 "updated": "2015-05-20 19:25:21.546000000",
1860 "mergeable": true,
1861 "insertions": 15,
1862 "deletions": 6,
1863 "_number": 1780,
1864 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001865 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001866 },
1867 "labels": {
1868 "Code-Review": {
1869 "approved": {
1870 "_account_id": 1000000
1871 },
1872 "all": [
1873 {
1874 "value": 2,
1875 "date": "2015-05-20 19:25:21.546000000",
1876 "_account_id": 1000000
1877 }
1878 ],
1879 "values": {
1880 "-2": "This shall not be merged",
1881 "-1": "I would prefer this is not merged as is",
1882 " 0": "No score",
1883 "+1": "Looks good to me, but someone else must approve",
1884 "+2": "Looks good to me, approved"
1885 },
1886 "default_value": 0
1887 },
1888 "Verified": {
1889 "approved": {
1890 "_account_id": 1000000
1891 },
1892 "all": [
1893 {
1894 "value": 1,
1895 "date": "2015-05-20 19:25:21.546000000",
1896 "_account_id": 1000000
1897 }
1898 ],
1899 "values": {
1900 "-1": "Fails",
1901 " 0": "No score",
1902 "+1": "Verified"
1903 },
1904 "default_value": 0
1905 }
1906 },
1907 "permitted_labels": {
1908 "Code-Review": [
1909 "-2",
1910 "-1",
1911 " 0",
1912 "+1",
1913 "+2"
1914 ],
1915 "Verified": [
1916 "-1",
1917 " 0",
1918 "+1"
1919 ]
1920 },
1921 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001922 {
1923 "_account_id": 1000000
1924 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001925 ],
1926 "reviewers": {
1927 "REVIEWER": [
1928 {
1929 "_account_id": 1000000
1930 }
1931 ]
1932 },
1933 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
1934 "revisions": {
1935 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09001936 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001937 "_number": 1,
1938 "created": "2015-05-01 15:39:57.979000000",
1939 "uploader": {
1940 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001941 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001942 "ref": "refs/changes/80/1780/1",
1943 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07001944 }
1945 }
1946 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001947 ],
1948 "non_visible_changes": 0
1949}
Stefan Bellera7ad6612015-06-26 10:05:43 -07001950----
1951
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001952If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
1953instead of a link:#submitted-together-info[SubmittedTogetherInfo]
1954entity, the response is a list of changes, or a 403 response with a
1955message if the set of changes to be submitted with this change
1956includes changes the caller cannot read.
1957
Stefan Bellera7ad6612015-06-26 10:05:43 -07001958
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001959[[delete-change]]
1960=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001961--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001962'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001963--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001964
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001965Deletes a change.
1966
Paladox none580ae0e2017-02-12 18:15:48 +00001967New or abandoned changes can be deleted by their owner if the user is granted
1968the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
1969otherwise only by administrators.
1970
David Ostrovsky0d69c232013-09-10 23:10:23 +02001971.Request
1972----
1973 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001974 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001975----
1976
1977.Response
1978----
1979 HTTP/1.1 204 No Content
1980----
1981
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001982[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001983=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001984--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001985'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001986--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001987
1988Retrieves the branches and tags in which a change is included. As result
1989an link:#included-in-info[IncludedInInfo] entity is returned.
1990
1991.Request
1992----
1993 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
1994----
1995
1996.Response
1997----
1998 HTTP/1.1 200 OK
1999 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002000 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002001
2002 )]}'
2003 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002004 "branches": [
2005 "master"
2006 ],
2007 "tags": []
2008 }
2009----
2010
David Pursehouse4e38b972014-05-30 10:36:40 +09002011[[index-change]]
2012=== Index Change
2013--
2014'POST /changes/link:#change-id[\{change-id\}]/index'
2015--
2016
2017Adds or updates the change in the secondary index.
2018
2019.Request
2020----
2021 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
2022----
2023
2024.Response
2025----
2026 HTTP/1.1 204 No Content
2027----
2028
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002029[[list-change-comments]]
2030=== List Change Comments
2031--
2032'GET /changes/link:#change-id[\{change-id\}]/comments'
2033--
2034
2035Lists the published comments of all revisions of the change.
2036
2037Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2038entries. The entries in the map are sorted by file path, and the
2039comments for each path are sorted by patch set number. Each comment has
2040the `patch_set` and `author` fields set.
2041
2042.Request
2043----
2044 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
2045----
2046
2047.Response
2048----
2049 HTTP/1.1 200 OK
2050 Content-Disposition: attachment
2051 Content-Type: application/json; charset=UTF-8
2052
2053 )]}'
2054 {
2055 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2056 {
2057 "patch_set": 1,
2058 "id": "TvcXrmjM",
2059 "line": 23,
2060 "message": "[nit] trailing whitespace",
2061 "updated": "2013-02-26 15:40:43.986000000"
2062 "author": {
2063 "_account_id": 1000096,
2064 "name": "John Doe",
2065 "email": "john.doe@example.com"
2066 }
2067 },
2068 {
2069 "patch_set": 2,
2070 "id": "TveXwFiA",
2071 "line": 49,
2072 "in_reply_to": "TfYX-Iuo",
2073 "message": "Done",
2074 "updated": "2013-02-26 15:40:45.328000000"
2075 "author": {
2076 "_account_id": 1000097,
2077 "name": "Jane Roe",
2078 "email": "jane.roe@example.com"
2079 }
2080 }
2081 ]
2082 }
2083----
2084
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002085[[list-change-robot-comments]]
2086=== List Change Robot Comments
2087--
2088'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
2089--
2090
2091Lists the robot comments of all revisions of the change.
2092
2093Return a map that maps the file path to a list of
2094link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
2095map are sorted by file path.
2096
2097.Request
2098----
2099 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
2100----
2101
2102.Response
2103----
2104 HTTP/1.1 200 OK
2105 Content-Disposition: attachment
2106 Content-Type: application/json; charset=UTF-8
2107
2108 )]}'
2109 {
2110 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2111 {
2112 "id": "TvcXrmjM",
2113 "line": 23,
2114 "message": "unused import",
2115 "updated": "2016-02-26 15:40:43.986000000",
2116 "author": {
2117 "_account_id": 1000110,
2118 "name": "Code Analyzer",
2119 "email": "code.analyzer@example.com"
2120 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002121 "robot_id": "importChecker",
2122 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002123 },
2124 {
2125 "id": "TveXwFiA",
2126 "line": 49,
2127 "message": "wrong indention",
2128 "updated": "2016-02-26 15:40:45.328000000",
2129 "author": {
2130 "_account_id": 1000110,
2131 "name": "Code Analyzer",
2132 "email": "code.analyzer@example.com"
2133 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002134 "robot_id": "styleChecker",
2135 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002136 }
2137 ]
2138 }
2139----
2140
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002141[[list-change-drafts]]
2142=== List Change Drafts
2143--
2144'GET /changes/link:#change-id[\{change-id\}]/drafts'
2145--
2146
2147Lists the draft comments of all revisions of the change that belong to
2148the calling user.
2149
2150Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2151entries. The entries in the map are sorted by file path, and the
2152comments for each path are sorted by patch set number. Each comment has
2153the `patch_set` field set, and no `author`.
2154
2155.Request
2156----
2157 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
2158----
2159
2160.Response
2161----
2162 HTTP/1.1 200 OK
2163 Content-Disposition: attachment
2164 Content-Type: application/json; charset=UTF-8
2165
2166 )]}'
2167 {
2168 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2169 {
2170 "patch_set": 1,
2171 "id": "TvcXrmjM",
2172 "line": 23,
2173 "message": "[nit] trailing whitespace",
2174 "updated": "2013-02-26 15:40:43.986000000"
2175 },
2176 {
2177 "patch_set": 2,
2178 "id": "TveXwFiA",
2179 "line": 49,
2180 "in_reply_to": "TfYX-Iuo",
2181 "message": "Done",
2182 "updated": "2013-02-26 15:40:45.328000000"
2183 }
2184 ]
2185 }
2186----
2187
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002188[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002189=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002190--
2191'GET /changes/link:#change-id[\{change-id\}]/check'
2192--
2193
2194Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002195link:#change-info[ChangeInfo] entity with the `problems` field set to a
2196list of link:#problem-info[ProblemInfo] entities.
2197
2198Depending on the type of problem, some fields not marked optional may be
2199missing from the result. At least `id`, `project`, `branch`, and
2200`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002201
2202.Request
2203----
2204 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2205----
2206
2207.Response
2208----
2209 HTTP/1.1 200 OK
2210 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002211 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002212
2213 )]}'
2214 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002215 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2216 "project": "myProject",
2217 "branch": "master",
2218 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2219 "subject": "Implementing Feature X",
2220 "status": "NEW",
2221 "created": "2013-02-01 09:59:32.126000000",
2222 "updated": "2013-02-21 11:16:36.775000000",
2223 "mergeable": true,
2224 "insertions": 34,
2225 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002226 "_number": 3965,
2227 "owner": {
2228 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002229 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002230 "problems": [
2231 {
2232 "message": "Current patch set 1 not found"
2233 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002234 ]
2235 }
2236----
2237
Dave Borowitz3be39d02014-12-03 17:57:38 -08002238[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002239=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002240--
2241'POST /changes/link:#change-id[\{change-id\}]/check'
2242--
2243
2244Performs consistency checks on the change as with link:#check-change[GET
2245/check], and additionally fixes any problems that can be fixed
2246automatically. The returned field values reflect any fixes.
2247
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002248Some fixes have options controlling their behavior, which can be set in the
2249link:#fix-input[FixInput] entity body.
2250
Dave Borowitz3be39d02014-12-03 17:57:38 -08002251Only the change owner, a project owner, or an administrator may fix changes.
2252
2253.Request
2254----
2255 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2256----
2257
2258.Response
2259----
2260 HTTP/1.1 200 OK
2261 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002262 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002263
2264 )]}'
2265 {
2266 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2267 "project": "myProject",
2268 "branch": "master",
2269 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2270 "subject": "Implementing Feature X",
2271 "status": "MERGED",
2272 "created": "2013-02-01 09:59:32.126000000",
2273 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002274 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002275 "mergeable": true,
2276 "insertions": 34,
2277 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002278 "_number": 3965,
2279 "owner": {
2280 "name": "John Doe"
2281 },
2282 "problems": [
2283 {
2284 "message": "Current patch set 2 not found"
2285 },
2286 {
2287 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2288 "status": FIXED,
2289 "outcome": "Marked change as merged"
2290 }
2291 ]
2292 }
2293----
2294
Alan Tokaev392cfca2017-04-28 11:11:31 +02002295[[set-work-in-pogress]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002296=== Set Work-In-Progress
Alan Tokaev392cfca2017-04-28 11:11:31 +02002297--
2298'POST /changes/link:#change-id[\{change-id\}]/wip'
2299--
2300
David Ostrovsky44242452018-06-09 20:25:13 +02002301Marks the change as not ready for review yet. Changes may only be marked not
2302ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002303
2304The request body does not need to include a
2305link:#work-in-progress-input[WorkInProgressInput] entity if no review comment
2306is added. Actions that create a new patch set in a WIP change default to
2307notifying *OWNER* instead of *ALL*.
2308
Gal Paikinc326de42020-06-16 18:49:00 +03002309Marking a change work in progress also removes all users from the
2310link:#attention-set[attention set].
2311
Alan Tokaev392cfca2017-04-28 11:11:31 +02002312.Request
2313----
2314 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0
2315 Content-Type: application/json; charset=UTF-8
2316
2317 {
2318 "message": "Refactoring needs to be done before we can proceed here."
2319 }
2320----
2321
2322.Response
2323----
2324 HTTP/1.1 200 OK
2325----
2326
2327[[set-ready-for-review]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002328=== Set Ready-For-Review
Alan Tokaev392cfca2017-04-28 11:11:31 +02002329--
2330'POST /changes/link:#change-id[\{change-id\}]/ready'
2331--
2332
David Ostrovsky44242452018-06-09 20:25:13 +02002333Marks the change as ready for review (set WIP property to false). Changes may
2334only be marked ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002335
2336Activates notifications of reviewer. The request body does not need
2337to include a link:#work-in-progress-input[WorkInProgressInput] entity
2338if no review comment is added.
2339
Gal Paikinc326de42020-06-16 18:49:00 +03002340Marking a change ready for review also adds all of the reviewers of the change
2341to the link:#attention-set[attention set].
2342
Alan Tokaev392cfca2017-04-28 11:11:31 +02002343.Request
2344----
2345 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0
2346 Content-Type: application/json;charset=UTF-8
2347
2348 {
2349 "message": "Refactoring is done."
2350 }
2351
2352----
2353
2354.Response
2355----
2356 HTTP/1.1 200 OK
2357----
2358
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002359[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002360=== Mark Private
2361--
Edwin Kempin364a86b2017-04-27 12:34:00 +02002362'POST /changes/link:#change-id[\{change-id\}]/private'
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002363--
2364
Patrick Hiesel707e61a2019-02-13 18:28:48 +01002365Marks the change to be private. Only open changes can be marked private.
2366Changes may only be marked private by the owner or site administrators.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002367
Edwin Kempin364a86b2017-04-27 12:34:00 +02002368A message can be specified in the request body inside a
2369link:#private-input[PrivateInput] entity.
2370
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002371.Request
2372----
Edwin Kempin364a86b2017-04-27 12:34:00 +02002373 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2374 Content-Type: application/json; charset=UTF-8
2375
2376 {
2377 "message": "After this security fix has been released we can make it public now."
2378 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002379----
2380
2381.Response
2382----
2383 HTTP/1.1 201 Created
2384----
2385
2386If the change was already private the response is "`200 OK`".
2387
2388[[unmark-private]]
2389=== Unmark Private
2390--
2391'DELETE /changes/link:#change-id[\{change-id\}]/private'
2392--
2393
2394Marks the change to be non-private. Note users can only unmark own private
2395changes.
2396
2397.Request
2398----
2399 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2400----
2401
2402.Response
2403----
2404 HTTP/1.1 204 No Content
2405----
2406
2407If the change was already not private, the response is "`409 Conflict`".
2408
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002409A message can be specified in the request body inside a
2410link:#private-input[PrivateInput] entity. Historically, this method allowed
2411a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01002412link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002413In this case, use a POST request instead:
Edwin Kempin364a86b2017-04-27 12:34:00 +02002414
2415.Request
2416----
2417 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0
2418 Content-Type: application/json; charset=UTF-8
2419
2420 {
2421 "message": "This is a security fix that must not be public."
2422 }
2423----
2424
David Pursehoused656fa82017-04-28 06:51:26 +02002425[[ignore]]
2426=== Ignore
2427--
2428'PUT /changes/link:#change-id[\{change-id\}]/ignore'
2429--
2430
2431Marks a change as ignored. The change will not be shown in the incoming
David Pursehouseaa51cba2018-07-09 11:02:17 +09002432reviews dashboard, and email notifications will be suppressed. Ignoring
2433a change does not cause the change's "updated" timestamp to be modified,
2434and the owner is not notified.
David Pursehoused656fa82017-04-28 06:51:26 +02002435
2436.Request
2437----
2438 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ignore HTTP/1.0
2439----
2440
2441[[unignore]]
2442=== Unignore
2443--
2444'PUT /changes/link:#change-id[\{change-id\}]/unignore'
2445--
2446
2447Un-marks a change as ignored.
2448
2449.Request
2450----
2451 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unignore HTTP/1.0
2452----
2453
Edwin Kempinceb673e2017-10-01 12:29:05 +02002454[[mark-as-reviewed]]
2455=== Mark as Reviewed
2456--
2457'PUT /changes/link:#change-id[\{change-id\}]/reviewed'
2458--
2459
2460Marks a change as reviewed.
2461
2462This allows users to "de-highlight" changes in their dashboard until a new
2463patch set is uploaded.
2464
2465This differs from the link:#ignore[ignore] endpoint, which will mute
2466emails and hide the change from dashboard completely until it is
2467link:#unignore[unignored] again.
2468
2469
2470.Request
2471----
2472 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewed HTTP/1.0
2473----
2474
2475[[mark-as-unreviewed]]
2476=== Mark as Unreviewed
2477--
2478'PUT /changes/link:#change-id[\{change-id\}]/unreviewed'
2479--
2480
2481Marks a change as unreviewed.
2482
2483This allows users to "highlight" changes in their dashboard
2484
2485.Request
2486----
2487 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unreviewed HTTP/1.0
2488----
2489
David Pursehouse7c79b682017-08-25 13:18:32 +09002490[[get-hashtags]]
2491=== Get Hashtags
2492--
2493'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2494--
2495
2496Gets the hashtags associated with a change.
2497
David Pursehouse7c79b682017-08-25 13:18:32 +09002498.Request
2499----
2500 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2501----
2502
2503As response the change's hashtags are returned as a list of strings.
2504
2505.Response
2506----
2507 HTTP/1.1 200 OK
2508 Content-Disposition: attachment
2509 Content-Type: application/json; charset=UTF-8
2510
2511 )]}'
2512 [
2513 "hashtag1",
2514 "hashtag2"
2515 ]
2516----
2517
2518[[set-hashtags]]
2519=== Set Hashtags
2520--
2521'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2522--
2523
2524Adds and/or removes hashtags from a change.
2525
David Pursehouse7c79b682017-08-25 13:18:32 +09002526The hashtags to add or remove must be provided in the request body inside a
2527link:#hashtags-input[HashtagsInput] entity.
2528
2529.Request
2530----
2531 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2532 Content-Type: application/json; charset=UTF-8
2533
2534 {
2535 "add" : [
2536 "hashtag3"
2537 ],
2538 "remove" : [
2539 "hashtag2"
2540 ]
2541 }
2542----
2543
2544As response the change's hashtags are returned as a list of strings.
2545
2546.Response
2547----
2548 HTTP/1.1 200 OK
2549 Content-Disposition: attachment
2550 Content-Type: application/json; charset=UTF-8
2551
2552 )]}'
2553 [
2554 "hashtag1",
2555 "hashtag3"
2556 ]
2557----
2558
Changcheng Xiao7fb73292018-04-25 11:43:19 +02002559[[list-change-messages]]
2560=== List Change Messages
2561--
2562'GET /changes/link:#change-id[\{change-id\}]/messages'
2563--
2564
2565Lists all the messages of a change including link:#detailed-accounts[detailed account information].
2566
2567.Request
2568----
2569 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages
2570----
2571
2572As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned.
2573
2574.Response
2575----
2576 HTTP/1.1 200 OK
2577 Content-Disposition: attachment
2578 Content-Type: application/json; charset=UTF-8
2579
2580 )]}'
2581 [
2582 {
2583 "id": "YH-egE",
2584 "author": {
2585 "_account_id": 1000096,
2586 "name": "John Doe",
2587 "email": "john.doe@example.com",
2588 "username": "jdoe"
2589 },
2590 "date": "2013-03-23 21:34:02.419000000",
2591 "message": "Patch Set 1:\n\nThis is the first message.",
2592 "_revision_number": 1
2593 },
2594 {
2595 "id": "WEEdhU",
2596 "author": {
2597 "_account_id": 1000097,
2598 "name": "Jane Roe",
2599 "email": "jane.roe@example.com",
2600 "username": "jroe"
2601 },
2602 "date": "2013-03-23 21:36:52.332000000",
2603 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
2604 "_revision_number": 1
2605 }
2606 ]
2607----
David Pursehousec32050d2017-08-25 16:27:47 +09002608
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002609[[get-change-message]]
2610=== Get Change Message
2611
2612Retrieves a change message including link:#detailed-accounts[detailed account information].
2613
2614--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002615'GET /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]'
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002616--
2617
2618As response a link:#change-message-info[ChangeMessageInfo] entity is returned.
2619
2620.Response
2621----
2622 HTTP/1.1 200 OK
2623 Content-Disposition: attachment
2624 Content-Type: application/json; charset=UTF-8
2625
2626 )]}'
2627 {
2628 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
2629 "author": {
2630 "_account_id": 1000096,
2631 "name": "John Doe",
2632 "email": "john.doe@example.com",
2633 "username": "jdoe"
2634 },
2635 "date": "2013-03-23 21:34:02.419000000",
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002636 "message": "a change message",
2637 "_revision_number": 1
2638 }
2639----
2640
2641[[delete-change-message]]
2642=== Delete Change Message
2643--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002644'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' +
2645'POST /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]/delete'
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002646--
2647
2648Deletes a change message by replacing the change message with a new message,
2649which contains the name of the user who deleted the change message and the
2650reason why it was deleted. The reason can be provided in the request body as a
2651link:#delete-change-message-input[DeleteChangeMessageInput] entity.
2652
2653Note that only users with the
2654link:access-control.html#capability_administrateServer[Administrate Server]
2655global capability are permitted to delete a change message.
2656
2657To delete a change message, send a DELETE request:
2658
2659.Request
2660----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002661 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002662----
2663
2664To provide a reason for the deletion, use a POST request:
2665
2666.Request
2667----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002668 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002669 Content-Type: application/json; charset=UTF-8
2670
2671 {
2672 "reason": "spam"
2673 }
2674----
2675
2676As response a link:#change-message-info[ChangeMessageInfo] entity is returned that
2677describes the updated change message.
2678
2679.Response
2680----
2681 HTTP/1.1 200 OK
2682 Content-Disposition: attachment
2683 Content-Type: application/json; charset=UTF-8
2684
2685 )]}'
2686 {
2687 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
2688 "author": {
2689 "_account_id": 1000096,
2690 "name": "John Doe",
2691 "email": "john.doe@example.com",
2692 "username": "jdoe"
2693 },
2694 "date": "2013-03-23 21:34:02.419000000",
2695 "message": "Change message removed by: Administrator\nReason: spam",
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002696 "_revision_number": 1
2697 }
2698----
Gustaf Lundhe8647c62017-04-28 06:51:26 +02002699
David Ostrovsky1a49f622014-07-29 00:40:02 +02002700[[edit-endpoints]]
2701== Change Edit Endpoints
2702
David Ostrovsky1a49f622014-07-29 00:40:02 +02002703[[get-edit-detail]]
2704=== Get Change Edit Details
2705--
2706'GET /changes/link:#change-id[\{change-id\}]/edit
2707--
2708
2709Retrieves a change edit details.
2710
2711.Request
2712----
2713 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2714----
2715
2716As response an link:#edit-info[EditInfo] entity is returned that
2717describes the change edit, or "`204 No Content`" when change edit doesn't
2718exist for this change. Change edits are stored on special branches and there
2719can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02002720When request parameter `list` is provided the response also includes the file
2721list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02002722against this base revision. When request parameter `download-commands` is
2723provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02002724
2725.Response
2726----
2727 HTTP/1.1 200 OK
2728 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002729 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02002730
2731 )]}'
2732 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01002733 "commit": {
2734 "parents": [
David Ostrovsky1a49f622014-07-29 00:40:02 +02002735 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01002736 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
David Ostrovsky1a49f622014-07-29 00:40:02 +02002737 }
2738 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01002739 "author": {
2740 "name": "Shawn O. Pearce",
2741 "email": "sop@google.com",
2742 "date": "2012-04-24 18:08:08.000000000",
2743 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02002744 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01002745 "committer": {
2746 "name": "Shawn O. Pearce",
2747 "email": "sop@google.com",
2748 "date": "2012-04-24 18:08:08.000000000",
2749 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02002750 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01002751 "subject": "Use an EventBus to manage star icons",
2752 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
David Ostrovsky1a49f622014-07-29 00:40:02 +02002753 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01002754 "base_patch_set_number": 1,
2755 "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3",
2756 "ref": "refs/users/01/1000001/edit-76482/1"
David Ostrovsky1a49f622014-07-29 00:40:02 +02002757 }
2758----
David Pursehouse4e38b972014-05-30 10:36:40 +09002759
David Ostrovskya5ab8292014-08-01 02:11:39 +02002760[[put-edit-file]]
2761=== Change file content in Change Edit
2762--
2763'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2764--
2765
2766Put content of a file to a change edit.
2767
2768.Request
2769----
2770 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2771----
2772
Paladox none28920b42020-02-22 19:28:21 +00002773To upload a file as binary data in the request body:
2774
2775.Request
2776----
2777 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2778 Content-Type: application/json; charset=UTF-8
2779
2780 {
2781 "binary_content": "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="
2782 }
2783----
2784
2785Note that it must be base-64 encoded data uri.
2786
David Ostrovskya5ab8292014-08-01 02:11:39 +02002787When change edit doesn't exist for this change yet it is created. When file
2788content isn't provided, it is wiped out for that file. As response
2789"`204 No Content`" is returned.
2790
2791.Response
2792----
2793 HTTP/1.1 204 No Content
2794----
2795
Gal Paikin68d217b2019-10-07 21:01:22 +02002796When the change edit is a no-op, for example when providing the same file
2797content that the file already has, '409 no changes were made' is returned.
2798
2799.Response
2800----
2801 HTTP/1.1 409 no changes were made
2802----
2803
David Ostrovsky138edb42014-08-15 21:31:43 +02002804[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01002805=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02002806--
2807'POST /changes/link:#change-id[\{change-id\}]/edit
2808--
2809
David Ostrovskya00c9532015-01-21 00:17:49 +01002810Creates empty change edit, restores file content or renames files in change
2811edit. The request body needs to include a
2812link:#change-edit-input[ChangeEditInput] entity when a file within change
2813edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02002814
2815.Request
2816----
2817 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002818 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02002819
2820 {
David Ostrovskybd12e172014-08-21 23:08:15 +02002821 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02002822 }
2823----
2824
David Ostrovskya00c9532015-01-21 00:17:49 +01002825or for rename:
2826
2827.Request
2828----
2829 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2830 Content-Type: application/json; charset=UTF-8
2831
2832 {
2833 "old_path": "foo",
2834 "new_path": "bar"
2835 }
2836----
2837
David Ostrovsky138edb42014-08-15 21:31:43 +02002838When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01002839and restore flag are provided in request body, this file is restored. When
2840old and new file names are provided, the file is renamed. As response
2841"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02002842
2843.Response
2844----
2845 HTTP/1.1 204 No Content
2846----
2847
David Ostrovskyc967e152014-10-24 17:36:16 +02002848[[put-change-edit-message]]
2849=== Change commit message in Change Edit
2850--
2851'PUT /changes/link:#change-id[\{change-id\}]/edit:message
2852--
2853
2854Modify commit message. The request body needs to include a
2855link:#change-edit-message-input[ChangeEditMessageInput]
2856entity.
2857
2858.Request
2859----
2860 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002861 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02002862
2863 {
2864 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
2865 }
2866----
2867
2868If a change edit doesn't exist for this change yet, it is created. As
2869response "`204 No Content`" is returned.
2870
2871.Response
2872----
2873 HTTP/1.1 204 No Content
2874----
2875
David Ostrovsky2830c292014-08-01 02:24:31 +02002876[[delete-edit-file]]
2877=== Delete file in Change Edit
2878--
2879'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
2880--
2881
2882Deletes a file from a change edit. This deletes the file from the repository
2883completely. This is not the same as reverting or restoring a file to its
2884previous contents.
2885
2886.Request
2887----
2888 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2889----
2890
2891When change edit doesn't exist for this change yet it is created.
2892
2893.Response
2894----
2895 HTTP/1.1 204 No Content
2896----
2897
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002898[[get-edit-file]]
2899=== Retrieve file content from Change Edit
2900--
2901'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2902--
2903
2904Retrieves content of a file from a change edit.
2905
2906.Request
2907----
2908 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2909----
2910
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002911The content of the file is returned as text encoded inside base64.
2912The Content-Type header will always be `text/plain` reflecting the
2913outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
2914can be examined to find the server detected content type of the file.
2915
2916When the specified file was deleted in the change edit
2917"`204 No Content`" is returned.
2918
2919If only the content type is required, callers should use HEAD to
2920avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002921
Michael Zhou551ad0c2016-04-26 01:21:42 -04002922If the `base` parameter is set to true, the returned content is from the
2923revision that the edit is based on.
2924
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002925.Response
2926----
2927 HTTP/1.1 200 OK
2928 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002929 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002930 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002931 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002932
2933 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
2934----
2935
David Ostrovskyd0078672015-02-06 21:51:04 +01002936Alternatively, if the only value of the Accept request header is
2937`application/json` the content is returned as JSON string and
2938`X-FYI-Content-Encoding` is set to `json`.
2939
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002940[[get-edit-meta-data]]
2941=== Retrieve meta data of a file from Change Edit
2942--
2943'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
2944--
2945
2946Retrieves meta data of a file from a change edit. Currently only
2947web links are returned.
2948
2949.Request
2950----
2951 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
2952----
2953
2954This REST endpoint retrieves additional information for a file in a
2955change edit. As result an link:#edit-file-info[EditFileInfo] entity is
2956returned.
2957
2958.Response
2959----
2960 HTTP/1.1 200 OK
2961 Content-Disposition: attachment
2962 Content-Type: application/json; charset=UTF-8
2963
2964 )]}'
2965 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01002966 "web_links": [
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002967 {
2968 "show_on_side_by_side_diff_view": true,
2969 "name": "side-by-side preview diff",
2970 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
2971 "url": "#/x/xdocs/c/42/1..0/README.md",
2972 "target": "_self"
2973 },
2974 {
2975 "show_on_unified_diff_view": true,
2976 "name": "unified preview diff",
2977 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
2978 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
2979 "target": "_self"
2980 }
2981 ]}
2982----
2983
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002984[[get-edit-message]]
2985=== Retrieve commit message from Change Edit or current patch set of the change
2986--
2987'GET /changes/link:#change-id[\{change-id\}]/edit:message
2988--
2989
David Ostrovsky25ad15e2014-12-15 21:18:59 +01002990Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002991
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02002992If the `base` parameter is set to true, the returned message is from the
2993revision that the edit is based on.
2994
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002995.Request
2996----
2997 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
2998----
2999
3000The commit message is returned as base64 encoded string.
3001
3002.Response
3003----
3004 HTTP/1.1 200 OK
3005
3006 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
3007M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
3008----
3009
David Ostrovskyd0078672015-02-06 21:51:04 +01003010Alternatively, if the only value of the Accept request header is
3011`application/json` the commit message is returned as JSON string:
3012
3013.Response
3014----
3015 HTTP/1.1 200 OK
3016
3017)]}'
3018"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
3019----
3020
3021
David Ostrovskye9988f92014-08-01 09:56:34 +02003022[[publish-edit]]
3023=== Publish Change Edit
3024--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003025'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02003026--
3027
3028Promotes change edit to a regular patch set.
3029
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003030Options can be provided in the request body as a
3031link:#publish-change-edit-input[PublishChangeEditInput] entity.
3032
David Ostrovskye9988f92014-08-01 09:56:34 +02003033.Request
3034----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003035 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003036 Content-Type: application/json; charset=UTF-8
3037
3038 {
3039 "notify": "NONE"
3040 }
David Ostrovskye9988f92014-08-01 09:56:34 +02003041----
3042
3043As response "`204 No Content`" is returned.
3044
3045.Response
3046----
3047 HTTP/1.1 204 No Content
3048----
3049
David Ostrovsky46999d22014-08-16 02:19:13 +02003050[[rebase-edit]]
3051=== Rebase Change Edit
3052--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003053'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02003054--
3055
3056Rebases change edit on top of latest patch set.
3057
3058.Request
3059----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003060 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02003061----
3062
3063When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09003064"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02003065based on top of the latest patch set, the response
3066"`409 Conflict`" is returned.
3067
3068.Response
3069----
3070 HTTP/1.1 204 No Content
3071----
3072
David Ostrovsky8e75f502014-08-10 00:36:31 +02003073[[delete-edit]]
3074=== Delete Change Edit
3075--
3076'DELETE /changes/link:#change-id[\{change-id\}]/edit'
3077--
3078
3079Deletes change edit.
3080
3081.Request
3082----
3083 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3084----
3085
3086As response "`204 No Content`" is returned.
3087
3088.Response
3089----
3090 HTTP/1.1 204 No Content
3091----
3092
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01003093
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003094[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003095== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003096
3097[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003098=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003099--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003100'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003101--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003102
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003103Lists the reviewers of a change.
3104
3105As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
3106
3107.Request
3108----
3109 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
3110----
3111
3112.Response
3113----
3114 HTTP/1.1 200 OK
3115 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003116 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003117
3118 )]}'
3119 [
3120 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003121 "approvals": {
3122 "Verified": "+1",
3123 "Code-Review": "+2"
3124 },
3125 "_account_id": 1000096,
3126 "name": "John Doe",
3127 "email": "john.doe@example.com"
3128 },
3129 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003130 "approvals": {
3131 "Verified": " 0",
3132 "Code-Review": "-1"
3133 },
3134 "_account_id": 1000097,
3135 "name": "Jane Roe",
3136 "email": "jane.roe@example.com"
3137 }
3138 ]
3139----
3140
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003141[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003142=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003143--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003144'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003145--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003146
3147Suggest the reviewers for a given query `q` and result limit `n`. If result
3148limit is not passed, then the default 10 is used.
3149
Edwin Kempin2639eaa2019-08-27 09:47:27 +02003150This REST endpoint only suggests accounts that
3151
3152* are active
3153* can see the change
3154* are visible to the calling user
3155* are not already reviewer on the change
3156* don't own the change
3157
Edwin Kempinec02a552019-08-27 09:30:15 +02003158Groups can be excluded from the results by specifying the 'exclude-groups'
3159request parameter:
3160
3161--
3162'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups'
3163--
Patrick Hieselc79ae0e2017-06-28 14:50:53 +02003164
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003165As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
3166
3167.Request
3168----
3169 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
3170----
3171
3172.Response
3173----
3174 HTTP/1.1 200 OK
3175 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003176 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003177
3178 )]}'
3179 [
3180 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003181 "account": {
3182 "_account_id": 1000097,
3183 "name": "Jane Roe",
3184 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003185 },
3186 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003187 },
3188 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003189 "group": {
3190 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
3191 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003192 },
3193 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003194 }
3195 ]
3196----
3197
Edwin Kempin0ca3f722019-08-27 09:43:31 +02003198To suggest CCs `reviewer-state=CC` can be specified as additional URL
3199parameter. This includes existing reviewers in the result, but excludes
3200existing CCs.
3201
3202--
3203'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC'
3204--
3205
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003206[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003207=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003208--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003209'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 -08003210--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003211
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003212Retrieves a reviewer of a change.
3213
3214As response a link:#reviewer-info[ReviewerInfo] entity is returned that
3215describes the reviewer.
3216
3217.Request
3218----
3219 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
3220----
3221
3222.Response
3223----
3224 HTTP/1.1 200 OK
3225 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003226 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003227
3228 )]}'
3229 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003230 "approvals": {
3231 "Verified": "+1",
3232 "Code-Review": "+2"
3233 },
3234 "_account_id": 1000096,
3235 "name": "John Doe",
3236 "email": "john.doe@example.com"
3237 }
3238----
3239
Edwin Kempin392328e2013-02-25 12:50:03 +01003240[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003241=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003242--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003243'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003244--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003245
Edwin Kempin392328e2013-02-25 12:50:03 +01003246Adds one user or all members of one group as reviewer to the change.
3247
3248The reviewer to be added to the change must be provided in the request
3249body as a link:#reviewer-input[ReviewerInput] entity.
3250
Edwin Kempinf9f19412019-08-28 09:28:51 +02003251Users can be moved from reviewer to CC and vice versa. This means if a
3252user is added as CC that is already a reviewer on the change, the
3253reviewer state of that user is updated to CC. If a user that is already
3254a CC on the change is added as reviewer, the reviewer state of that
3255user is updated to reviewer.
3256
Gal Paikinc326de42020-06-16 18:49:00 +03003257Adding a new reviewer also adds that reviewer to the attention set, unless
3258the change is work in progress.
3259Also, moving a reviewer to CC removes that user from the attention set.
3260
Edwin Kempin392328e2013-02-25 12:50:03 +01003261.Request
3262----
3263 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003264 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003265
3266 {
3267 "reviewer": "john.doe@example.com"
3268 }
3269----
3270
3271As response an link:#add-reviewer-result[AddReviewerResult] entity is
3272returned that describes the newly added reviewers.
3273
3274.Response
3275----
3276 HTTP/1.1 200 OK
3277 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003278 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003279
3280 )]}'
3281 {
Aaron Gable8c650212017-04-25 12:03:37 -07003282 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01003283 "reviewers": [
3284 {
Aaron Gable8c650212017-04-25 12:03:37 -07003285 "_account_id": 1000096,
3286 "name": "John Doe",
3287 "email": "john.doe@example.com"
Edwin Kempin392328e2013-02-25 12:50:03 +01003288 "approvals": {
3289 "Verified": " 0",
3290 "Code-Review": " 0"
3291 },
Edwin Kempin392328e2013-02-25 12:50:03 +01003292 }
3293 ]
3294 }
3295----
3296
3297If a group is specified, adding the group members as reviewers is an
3298atomic operation. This means if an error is returned, none of the
3299members are added as reviewer.
3300
3301If a group with many members is added as reviewer a confirmation may be
3302required.
3303
Edwin Kempinf9f19412019-08-28 09:28:51 +02003304If a group is added as CC and members of this group are already
3305reviewers on the change, these members stay reviewers on the change
3306(they are not downgraded to CC). However if a group is added as
3307reviewer, all group members become reviewer of the change, even if they
3308have been added as CC before.
3309
Edwin Kempin392328e2013-02-25 12:50:03 +01003310.Request
3311----
3312 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003313 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003314
3315 {
3316 "reviewer": "MyProjectVerifiers"
3317 }
3318----
3319
3320.Response
3321----
3322 HTTP/1.1 200 OK
3323 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003324 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003325
3326 )]}'
3327 {
Logan Hanks23e70282016-07-06 14:31:56 -07003328 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01003329 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3330 "confirm": true
3331 }
3332----
3333
3334To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01003335`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01003336
3337.Request
3338----
3339 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003340 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003341
3342 {
Logan Hanks23e70282016-07-06 14:31:56 -07003343 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01003344 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01003345 }
3346----
3347
Patrick Hiesel11873ef2017-03-17 17:36:05 +01003348If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
3349for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
3350an email address of a reviewer or CC then, they will be added to the change even if they
3351don't have a Gerrit account.
3352
3353If this option is disabled, the request would fail with `400 Bad Request` if the email
3354address can't be resolved to an active Gerrit account.
3355
3356Note that the name is optional so both "un.registered@reviewer.com" and
3357"John Doe <un.registered@reviewer.com>" are valid inputs.
3358
3359Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
3360
3361.Request
3362----
3363 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
3364 Content-Type: application/json; charset=UTF-8
3365
3366 {
3367 "reviewer": "John Doe <un.registered@reviewer.com>"
3368 }
3369----
3370
3371.Response
3372----
3373 HTTP/1.1 200 OK
3374 Content-Disposition: attachment
3375 Content-Type: application/json; charset=UTF-8
3376
3377 )]}'
3378 {
3379 "input": "John Doe <un.registered@reviewer.com>"
3380 }
3381----
3382
Logan Hanksf03040e2017-05-03 09:40:56 -07003383.Notifications
3384
3385An email will be sent using the "newchange" template.
3386
3387[options="header",cols="1,1,1"]
3388|=============================
3389|WIP State |Default|notify=ALL
3390|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3391|Work in progress|not sent|owner, reviewers, CCs
3392|=============================
3393
Edwin Kempin53301072013-02-25 12:57:07 +01003394[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003395=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003396--
Edwin Kempin407fca32016-08-29 12:01:00 +02003397'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
3398'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 -08003399--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003400
Edwin Kempin53301072013-02-25 12:57:07 +01003401Deletes a reviewer from a change.
Gal Paikinc326de42020-06-16 18:49:00 +03003402Deleting a reviewer also removes that user from the attention set.
Edwin Kempin53301072013-02-25 12:57:07 +01003403
3404.Request
3405----
3406 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02003407 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3408----
3409
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003410Options can be provided in the request body as a
3411link:#delete-reviewer-input[DeleteReviewerInput] entity.
3412Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003413link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003414In this case, use a POST request instead:
Edwin Kempin407fca32016-08-29 12:01:00 +02003415
3416.Request
3417----
3418 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3419 Content-Type: application/json; charset=UTF-8
3420
3421 {
3422 "notify": "NONE"
3423 }
Edwin Kempin53301072013-02-25 12:57:07 +01003424----
3425
3426.Response
3427----
3428 HTTP/1.1 204 No Content
3429----
3430
Logan Hanks87607412017-05-30 13:49:04 -07003431.Notifications
3432
3433An email will be sent using the "deleteReviewer" template. If deleting the
3434reviewer resulted in one or more approvals being removed, then the deleted
3435reviewer will also receive a notification (unless notify=NONE).
3436
3437[options="header",cols="1,5"]
3438|=============================
3439|WIP State |Default Recipients
3440|Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers
3441|Work in progress|notify=NONE: deleted reviewer (if voted)
3442|=============================
3443
David Ostrovskybeb0b842014-12-13 00:24:29 +01003444[[list-votes]]
3445=== List Votes
3446--
3447'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
3448--
3449
3450Lists the votes for a specific reviewer of the change.
3451
3452.Request
3453----
Edwin Kempin314f10a2016-07-11 11:39:05 +02003454 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01003455----
3456
3457As result a map is returned that maps the label name to the label value.
3458The entries in the map are sorted by label name.
3459
3460.Response
3461----
3462 HTTP/1.1 200 OK
3463 Content-Disposition: attachment
3464 Content-Type: application/json;charset=UTF-8
3465
3466 )]}'
3467 {
3468 "Code-Review": -1,
3469 "Verified": 1
3470 "Work-In-Progress": 1,
3471 }
3472----
3473
3474[[delete-vote]]
3475=== Delete Vote
3476--
Edwin Kempin5488dc12016-08-29 11:13:31 +02003477'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 +02003478'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 +01003479--
3480
3481Deletes a single vote from a change. Note, that even when the last vote of
3482a reviewer is removed the reviewer itself is still listed on the change.
3483
3484.Request
3485----
3486 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003487 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3488----
3489
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003490Options can be provided in the request body as a
3491link:#delete-vote-input[DeleteVoteInput] entity.
3492Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003493link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003494In this case, use a POST request instead:
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003495
3496.Request
3497----
3498 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3499 Content-Type: application/json; charset=UTF-8
3500
3501 {
3502 "notify": "NONE"
3503 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01003504----
3505
3506.Response
3507----
3508 HTTP/1.1 204 No Content
3509----
3510
Logan Hanksa1e68dc2017-06-29 15:13:27 -07003511
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003512[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003513== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003514
Shawn Pearce728ba882013-07-08 23:13:08 -07003515[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003516=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003517--
Shawn Pearce728ba882013-07-08 23:13:08 -07003518'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003519--
Shawn Pearce728ba882013-07-08 23:13:08 -07003520
3521Retrieves a parsed commit of a revision.
3522
3523.Request
3524----
3525 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
3526----
3527
3528As response a link:#commit-info[CommitInfo] entity is returned that
3529describes the revision.
3530
3531.Response
3532----
3533 HTTP/1.1 200 OK
3534 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003535 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07003536
3537 )]}'
3538 {
Edwin Kempinc8237402015-07-15 18:27:55 +02003539 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07003540 "parents": [
3541 {
3542 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3543 "subject": "Migrate contributor agreements to All-Projects."
3544 }
3545 ],
3546 "author": {
3547 "name": "Shawn O. Pearce",
3548 "email": "sop@google.com",
3549 "date": "2012-04-24 18:08:08.000000000",
3550 "tz": -420
3551 },
3552 "committer": {
3553 "name": "Shawn O. Pearce",
3554 "email": "sop@google.com",
3555 "date": "2012-04-24 18:08:08.000000000",
3556 "tz": -420
3557 },
3558 "subject": "Use an EventBus to manage star icons",
3559 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3560 }
3561----
3562
Sven Selbergd26bd542014-11-21 16:28:10 +01003563Adding query parameter `links` (for example `/changes/.../commit?links`)
3564returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07003565
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08003566[[get-description]]
3567=== Get Description
3568--
3569'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3570--
3571
3572Retrieves the description of a patch set.
3573
3574.Request
3575----
3576 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3577----
3578
3579.Response
3580----
3581 HTTP/1.1 200 OK
3582 Content-Disposition: attachment
3583 Content-Type: application/json; charset=UTF-8
3584
3585 )]}'
3586 "Added Documentation"
3587----
3588
3589If the patch set does not have a description an empty string is returned.
3590
3591[[set-description]]
3592=== Set Description
3593--
3594'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3595--
3596
3597Sets the description of a patch set.
3598
3599The new description must be provided in the request body inside a
3600link:#description-input[DescriptionInput] entity.
3601
3602.Request
3603----
3604 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3605 Content-Type: application/json; charset=UTF-8
3606
3607 {
3608 "description": "Added Documentation"
3609 }
3610----
3611
3612As response the new description is returned.
3613
3614.Response
3615----
3616 HTTP/1.1 200 OK
3617 Content-Disposition: attachment
3618 Content-Type: application/json; charset=UTF-8
3619
3620 )]}'
3621 "Added Documentation"
3622----
3623
Edwin Kempin0f229442016-09-09 13:06:12 +02003624[[get-merge-list]]
3625=== Get Merge List
3626--
3627'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
3628--
3629
3630Returns the list of commits that are being integrated into a target
3631branch by a merge commit. By default the first parent is assumed to be
3632uninteresting. By using the `parent` option another parent can be set
3633as uninteresting (parents are 1-based).
3634
3635The list of commits is returned as a list of
3636link:#commit-info[CommitInfo] entities. Web links are only included if
3637the `links` option was set.
3638
3639.Request
3640----
3641 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
3642----
3643
3644.Response
3645----
3646HTTP/1.1 200 OK
3647 Content-Disposition: attachment
3648 Content-Type: application/json; charset=UTF-8
3649
3650 )]}'
3651 [
3652 {
3653 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
3654 "parents": [
3655 {
3656 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3657 "subject": "Migrate contributor agreements to All-Projects."
3658 }
3659 ],
3660 "author": {
3661 "name": "Shawn O. Pearce",
3662 "email": "sop@google.com",
3663 "date": "2012-04-24 18:08:08.000000000",
3664 "tz": -420
3665 },
3666 "committer": {
3667 "name": "Shawn O. Pearce",
3668 "email": "sop@google.com",
3669 "date": "2012-04-24 18:08:08.000000000",
3670 "tz": -420
3671 },
3672 "subject": "Use an EventBus to manage star icons",
3673 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3674 }
3675 ]
3676----
3677
Stefan Bellerc7259662015-02-12 17:23:05 -08003678[[get-revision-actions]]
3679=== Get Revision Actions
3680--
3681'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
3682--
3683
3684Retrieves revision link:#action-info[actions] of the revision of a change.
3685
3686.Request
3687----
3688 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
3689----
3690
3691.Response
3692----
3693 HTTP/1.1 200 OK
3694 Content-Disposition: attachment
3695 Content-Type: application/json; charset=UTF-8
3696
3697 )]}'
3698
3699{
3700 "submit": {
3701 "method": "POST",
3702 "label": "Submit",
3703 "title": "Submit patch set 1 into master",
3704 "enabled": true
3705 },
3706 "cherrypick": {
3707 "method": "POST",
3708 "label": "Cherry Pick",
3709 "title": "Cherry pick change to a different branch",
3710 "enabled": true
3711 }
3712}
3713----
3714
3715The response is a flat map of possible revision actions mapped to their
3716link:#action-info[ActionInfo].
3717
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003718[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003719=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003720--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003721'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003722--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003723
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003724Retrieves a review of a revision.
3725
3726.Request
3727----
3728 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3729----
3730
3731As response a link:#change-info[ChangeInfo] entity with
3732link:#detailed-labels[detailed labels] and link:#detailed-accounts[
3733detailed accounts] is returned that describes the review of the
3734revision. The revision for which the review is retrieved is contained
3735in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05003736set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003737revision of the change. Please note that the returned labels are always
3738for the current patch set.
3739
3740.Response
3741----
3742 HTTP/1.1 200 OK
3743 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003744 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003745
3746 )]}'
3747 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003748 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
3749 "project": "myProject",
3750 "branch": "master",
3751 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
3752 "subject": "Implementing Feature X",
3753 "status": "NEW",
3754 "created": "2013-02-01 09:59:32.126000000",
3755 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003756 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003757 "insertions": 34,
3758 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003759 "_number": 3965,
3760 "owner": {
3761 "_account_id": 1000096,
3762 "name": "John Doe",
3763 "email": "john.doe@example.com"
3764 },
3765 "labels": {
3766 "Verified": {
3767 "all": [
3768 {
3769 "value": 0,
3770 "_account_id": 1000096,
3771 "name": "John Doe",
3772 "email": "john.doe@example.com"
3773 },
3774 {
3775 "value": 0,
3776 "_account_id": 1000097,
3777 "name": "Jane Roe",
3778 "email": "jane.roe@example.com"
3779 }
3780 ],
3781 "values": {
3782 "-1": "Fails",
3783 " 0": "No score",
3784 "+1": "Verified"
3785 }
3786 },
3787 "Code-Review": {
3788 "all": [
3789 {
3790 "value": -1,
3791 "_account_id": 1000096,
3792 "name": "John Doe",
3793 "email": "john.doe@example.com"
3794 },
3795 {
3796 "value": 1,
3797 "_account_id": 1000097,
3798 "name": "Jane Roe",
3799 "email": "jane.roe@example.com"
3800 }
3801 ]
3802 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04003803 "-2": "This shall not be merged",
3804 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003805 " 0": "No score",
3806 "+1": "Looks good to me, but someone else must approve",
3807 "+2": "Looks good to me, approved"
3808 }
3809 }
3810 },
3811 "permitted_labels": {
3812 "Verified": [
3813 "-1",
3814 " 0",
3815 "+1"
3816 ],
3817 "Code-Review": [
3818 "-2",
3819 "-1",
3820 " 0",
3821 "+1",
3822 "+2"
3823 ]
3824 },
3825 "removable_reviewers": [
3826 {
3827 "_account_id": 1000096,
3828 "name": "John Doe",
3829 "email": "john.doe@example.com"
3830 },
3831 {
3832 "_account_id": 1000097,
3833 "name": "Jane Roe",
3834 "email": "jane.roe@example.com"
3835 }
3836 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08003837 "reviewers": {
3838 "REVIEWER": [
3839 {
3840 "_account_id": 1000096,
3841 "name": "John Doe",
3842 "email": "john.doe@example.com"
3843 },
3844 {
3845 "_account_id": 1000097,
3846 "name": "Jane Roe",
3847 "email": "jane.roe@example.com"
3848 }
3849 ]
3850 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003851 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
3852 "revisions": {
3853 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09003854 "kind": "REWORK",
3855 "_number": 2,
3856 "ref": "refs/changes/65/3965/2",
3857 "fetch": {
3858 "http": {
3859 "url": "http://gerrit/myProject",
3860 "ref": "refs/changes/65/3965/2"
3861 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003862 }
3863 }
3864 }
3865 }
3866----
3867
David Pursehouse669f2512014-07-18 11:41:42 +09003868[[get-related-changes]]
3869=== Get Related Changes
3870--
3871'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
3872--
3873
3874Retrieves related changes of a revision. Related changes are changes that either
3875depend on, or are dependencies of the revision.
3876
3877.Request
3878----
3879 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
3880----
3881
3882As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
3883describing the related changes.
3884
3885.Response
3886----
3887 HTTP/1.1 200 OK
3888 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003889 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09003890
3891 )]}'
3892 {
3893 "changes": [
3894 {
Patrick Hieselcab63512017-07-28 10:25:42 +02003895 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09003896 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
3897 "commit": {
3898 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
3899 "parents": [
3900 {
3901 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
3902 }
3903 ],
3904 "author": {
3905 "name": "David Ostrovsky",
3906 "email": "david@ostrovsky.org",
3907 "date": "2014-07-12 15:04:24.000000000",
3908 "tz": 120
3909 },
3910 "subject": "Remove Solr"
3911 },
3912 "_change_number": 58478,
3913 "_revision_number": 2,
3914 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003915 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003916 },
3917 {
Patrick Hieselcab63512017-07-28 10:25:42 +02003918 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09003919 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
3920 "commit": {
3921 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
3922 "parents": [
3923 {
3924 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
3925 }
3926 ],
3927 "author": {
3928 "name": "David Pursehouse",
3929 "email": "david.pursehouse@sonymobile.com",
3930 "date": "2014-06-24 02:01:28.000000000",
3931 "tz": 540
3932 },
3933 "subject": "Add support for secondary index with Elasticsearch"
3934 },
3935 "_change_number": 58081,
3936 "_revision_number": 10,
3937 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003938 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003939 }
3940 ]
3941 }
3942----
3943
3944
Edwin Kempin67498de2013-02-25 16:15:34 +01003945[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003946=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003947--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003948'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003949--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003950
Logan Hanksf03040e2017-05-03 09:40:56 -07003951Sets a review on a revision, optionally also publishing draft comments, setting
Logan Hanks53c36012017-06-30 13:47:54 -07003952labels, adding reviewers or CCs, and modifying the work in progress property.
Edwin Kempin67498de2013-02-25 16:15:34 +01003953
3954The review must be provided in the request body as a
3955link:#review-input[ReviewInput] entity.
3956
Youssef Elghareeb12add162019-12-18 18:43:23 +01003957If the labels are set, the user sending the request will automatically be
3958added as a reviewer, otherwise (if they only commented) they are added to
3959the CC list.
3960
Gal Paikinc326de42020-06-16 18:49:00 +03003961Some updates to the attention set occur here. If more than one update should
3962occur, only the first update in the order of the below documentation occurs:
3963
3964If a user is part of remove_from_attention_set, the user will be explicitly
3965removed from the attention set.
3966
3967If a user is part of add_to_attention_set, the user will be explicitly
3968added to the attention set.
3969
3970If the boolean ignore_default_attention_set_rules is set to true, all
3971other rules below will be ignored:
3972
3973The user who created the review is removed from the attention set.
3974
3975If the change is ready for review, the following also apply:
3976
3977When the uploader replies, the owner is added to the attention set.
3978
3979When the owner or uploader replies, all the reviewers are added to
3980the attention set.
3981
3982When neither the owner nor the uploader replies, add the owner and the
3983uploader to the attention set.
3984
3985Then, new reviewers are added to the attention set, and removed reviewers
3986(by becoming CC) are removed from the attention set.
3987
Aaron Gable8c650212017-04-25 12:03:37 -07003988A review cannot be set on a change edit. Trying to post a review for a
3989change edit fails with `409 Conflict`.
3990
Logan Hanksf03040e2017-05-03 09:40:56 -07003991Here is an example of using this method to set labels:
Aaron Gable8c650212017-04-25 12:03:37 -07003992
Edwin Kempin67498de2013-02-25 16:15:34 +01003993.Request
3994----
3995 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003996 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003997
3998 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01003999 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01004000 "message": "Some nits need to be fixed.",
4001 "labels": {
4002 "Code-Review": -1
4003 },
4004 "comments": {
4005 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4006 {
4007 "line": 23,
4008 "message": "[nit] trailing whitespace"
4009 },
4010 {
4011 "line": 49,
4012 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09004013 },
4014 {
4015 "range": {
4016 "start_line": 50,
4017 "start_character": 0,
4018 "end_line": 55,
4019 "end_character": 20
4020 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09004021 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01004022 }
4023 ]
4024 }
4025 }
4026----
4027
Aaron Gable843b0c12017-04-21 08:25:27 -07004028As response a link:#review-result[ReviewResult] entity is returned that
Aaron Gable8c650212017-04-25 12:03:37 -07004029describes the applied labels and any added reviewers (e.g. yourself,
4030if you set a label but weren't previously a reviewer on this CL).
Edwin Kempin67498de2013-02-25 16:15:34 +01004031
4032.Response
4033----
4034 HTTP/1.1 200 OK
4035 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004036 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01004037
4038 )]}'
4039 {
4040 "labels": {
4041 "Code-Review": -1
4042 }
4043 }
4044----
4045
Aaron Gable8c650212017-04-25 12:03:37 -07004046It is also possible to add one or more reviewers or CCs
Logan Hanksf03040e2017-05-03 09:40:56 -07004047to a change simultaneously with a review:
Logan Hanks5f1c7592016-07-06 14:39:33 -07004048
4049.Request
4050----
4051 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
4052 Content-Type: application/json; charset=UTF-8
4053
4054 {
Aaron Gable8c650212017-04-25 12:03:37 -07004055 "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 -07004056 "reviewers": [
4057 {
4058 "reviewer": "jane.roe@example.com"
4059 },
4060 {
Aaron Gable8c650212017-04-25 12:03:37 -07004061 "reviewer": "john.doe@example.com",
4062 "state": "CC"
4063 }
4064 {
4065 "reviewer": "MyProjectVerifiers",
Logan Hanks5f1c7592016-07-06 14:39:33 -07004066 }
4067 ]
4068 }
4069----
4070
4071Each element of the `reviewers` list is an instance of
4072link:#reviewer-input[ReviewerInput]. The corresponding result of
Aaron Gable8c650212017-04-25 12:03:37 -07004073adding each reviewer will be returned in a map of inputs to
4074link:#add-reviewer-result[AddReviewerResult]s.
Logan Hanks5f1c7592016-07-06 14:39:33 -07004075
4076.Response
4077----
4078 HTTP/1.1 200 OK
4079 Content-Disposition: attachment
4080 Content-Type: application/json; charset=UTF-8
4081
4082 )]}'
4083 {
Aaron Gable8c650212017-04-25 12:03:37 -07004084 "reviewers": {
4085 "jane.roe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004086 "input": "jane.roe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004087 "reviewers": [
4088 {
4089 "_account_id": 1000097,
4090 "name": "Jane Roe",
4091 "email": "jane.roe@example.com"
4092 "approvals": {
4093 "Verified": " 0",
4094 "Code-Review": " 0"
4095 },
4096 },
4097 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004098 },
Aaron Gable8c650212017-04-25 12:03:37 -07004099 "john.doe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004100 "input": "john.doe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004101 "ccs": [
4102 {
4103 "_account_id": 1000096,
4104 "name": "John Doe",
4105 "email": "john.doe@example.com"
4106 "approvals": {
4107 "Verified": " 0",
4108 "Code-Review": " 0"
4109 },
4110 }
4111 ]
4112 },
4113 "MyProjectVerifiers": {
4114 "input": "MyProjectVerifiers",
4115 "reviewers": [
4116 {
4117 "_account_id": 1000098,
4118 "name": "Alice Ansel",
4119 "email": "alice.ansel@example.com"
4120 "approvals": {
4121 "Verified": " 0",
4122 "Code-Review": " 0"
4123 },
4124 },
4125 {
4126 "_account_id": 1000099,
4127 "name": "Bob Bollard",
4128 "email": "bob.bollard@example.com"
4129 "approvals": {
4130 "Verified": " 0",
4131 "Code-Review": " 0"
4132 },
4133 },
4134 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004135 }
Aaron Gable8c650212017-04-25 12:03:37 -07004136 }
Logan Hanks5f1c7592016-07-06 14:39:33 -07004137 }
4138----
4139
Logan Hankse2aacef2016-07-22 15:54:52 -07004140If there are any errors returned for reviewers, the entire review request will
Aaron Gable8c650212017-04-25 12:03:37 -07004141be rejected with `400 Bad Request`. None of the entries will have the
4142`reviewers` or `ccs` field set, and those which specifically failed will have
4143the `errors` field set containing details of why they failed.
Logan Hankse2aacef2016-07-22 15:54:52 -07004144
4145.Error Response
4146----
4147 HTTP/1.1 400 Bad Request
4148 Content-Disposition: attachment
4149 Content-Type: application/json; charset=UTF-8
4150
4151 )]}'
4152 {
4153 "reviewers": {
Aaron Gable8c650212017-04-25 12:03:37 -07004154 "jane.roe@example.com": {
4155 "input": "jane.roe@example.com",
4156 "error": "Account of jane.roe@example.com is inactive."
4157 },
4158 "john.doe@example.com": {
4159 "input": "john.doe@example.com"
4160 },
Logan Hankse2aacef2016-07-22 15:54:52 -07004161 "MyProjectVerifiers": {
4162 "input": "MyProjectVerifiers",
4163 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
4164 "confirm": true
4165 }
4166 }
4167 }
4168----
4169
Dave Borowitzd2e41452017-10-26 08:06:23 -04004170[[set-review-notifications]]
Logan Hanksfc055962017-06-12 14:20:53 -07004171.Notifications
4172
4173An email will be sent using the "comment" template.
4174
4175If the top-level notify property is null or not set, then notification behavior
4176depends on whether the change is WIP, whether it has started review, and whether
4177the tag property is null.
4178
4179NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*.
4180Use the notify property of the top-level link:#review-input[ReviewInput] instead.
4181
4182For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS
4183watchers*.
4184
Logan Hanksea3e3b72017-06-12 14:21:47 -07004185[options="header",cols="2,1,1,2,2"]
Logan Hanksfc055962017-06-12 14:20:53 -07004186|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004187|WIP State |Review Started|Tag Given|Default |notify=ALL
4188|Ready for review|N/A |N/A |everyone|everyone
4189|Work in progress|no |no |not sent|everyone
4190|Work in progress|no |yes |owner |everyone
4191|Work in progress|yes |no |everyone|everyone
4192|Work in progress|yes |yes |owner |everyone
4193
Logan Hanksfc055962017-06-12 14:20:53 -07004194|=============================
4195
4196If reviewers are added, then a second email will be sent using the "newchange"
4197template. The notification logic for this email is the same as for
4198link:#add-reviewer[Add Reviewer].
4199
Logan Hanksea3e3b72017-06-12 14:21:47 -07004200[options="header",cols="1,1,1"]
Logan Hanksfc055962017-06-12 14:20:53 -07004201|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004202|WIP State |Default |notify=ALL
4203|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
4204|Work in progress|not sent |owner, reviewers, CCs
Logan Hanksfc055962017-06-12 14:20:53 -07004205|=============================
4206
4207
Edwin Kempincdae63b2013-03-15 15:06:59 +01004208[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004209=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004210--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004211'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004212--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004213
4214Rebases a revision.
4215
Zalan Blenessy874aed72015-01-12 13:26:18 +01004216Optionally, the parent revision can be changed to another patch set through the
4217link:#rebase-input[RebaseInput] entity.
4218
Edwin Kempincdae63b2013-03-15 15:06:59 +01004219.Request
4220----
4221 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01004222 Content-Type: application/json;charset=UTF-8
4223
4224 {
4225 "base" : "1234",
4226 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01004227----
4228
4229As response a link:#change-info[ChangeInfo] entity is returned that
4230describes the rebased change. Information about the current patch set
4231is included.
4232
4233.Response
4234----
4235 HTTP/1.1 200 OK
4236 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004237 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004238
4239 )]}'
4240 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01004241 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4242 "project": "myProject",
4243 "branch": "master",
4244 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4245 "subject": "Implement Feature X",
4246 "status": "NEW",
4247 "created": "2013-02-01 09:59:32.126000000",
4248 "updated": "2013-02-21 11:16:36.775000000",
4249 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004250 "insertions": 21,
4251 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01004252 "_number": 4799,
4253 "owner": {
4254 "name": "John Doe"
4255 },
4256 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
4257 "revisions": {
4258 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09004259 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004260 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01004261 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004262 "fetch": {
4263 "http": {
4264 "url": "http://gerrit:8080/myProject",
4265 "ref": "refs/changes/99/4799/2"
4266 }
4267 },
4268 "commit": {
4269 "parents": [
4270 {
4271 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
4272 "subject": "Implement Feature A"
4273 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00004274 ],
4275 "author": {
4276 "name": "John Doe",
4277 "email": "john.doe@example.com",
4278 "date": "2013-05-07 15:21:27.000000000",
4279 "tz": 120
4280 },
4281 "committer": {
4282 "name": "Gerrit Code Review",
4283 "email": "gerrit-server@example.com",
4284 "date": "2013-05-07 15:35:43.000000000",
4285 "tz": 120
4286 },
4287 "subject": "Implement Feature X",
4288 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01004289 }
4290 }
4291 }
4292----
4293
4294If the revision cannot be rebased, e.g. due to conflicts, the response is
4295"`409 Conflict`" and the error message is contained in the response
4296body.
4297
4298.Response
4299----
4300 HTTP/1.1 409 Conflict
4301 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004302 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004303
4304 The change could not be rebased due to a path conflict during merge.
4305----
4306
Edwin Kempin14b58112013-02-26 16:30:19 +01004307[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004308=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004309--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004310'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004311--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004312
Edwin Kempin14b58112013-02-26 16:30:19 +01004313Submits a revision.
4314
Edwin Kempin14b58112013-02-26 16:30:19 +01004315.Request
4316----
4317 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
Edwin Kempin14b58112013-02-26 16:30:19 +01004318----
4319
4320As response a link:#submit-info[SubmitInfo] entity is returned that
4321describes the status of the submitted change.
4322
4323.Response
4324----
4325 HTTP/1.1 200 OK
4326 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004327 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004328
4329 )]}'
4330 {
4331 "status": "MERGED"
4332 }
4333----
4334
4335If the revision cannot be submitted, e.g. because the submit rule
4336doesn't allow submitting the revision or the revision is not the
4337current revision, the response is "`409 Conflict`" and the error
4338message is contained in the response body.
4339
4340.Response
4341----
4342 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004343 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004344
4345 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
4346----
4347
Edwin Kempin257d70f2013-03-28 14:31:14 +01004348[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004349=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004350--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004351'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004352--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004353
4354Gets the formatted patch for one revision.
4355
4356.Request
4357----
4358 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
4359----
4360
Shawn Pearce98361f72013-05-10 16:27:36 -07004361The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01004362
4363.Response
4364----
4365 HTTP/1.1 200 OK
4366 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004367 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07004368 X-FYI-Content-Encoding: base64
4369 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01004370
Shawn Pearce98361f72013-05-10 16:27:36 -07004371 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01004372----
4373
David Ostrovsky973f38b2013-08-22 00:24:51 -07004374Adding query parameter `zip` (for example `/changes/.../patch?zip`)
4375returns the patch as a single file inside of a ZIP archive. Clients
4376can expand the ZIP to obtain the plain text patch, avoiding the
4377need for a base64 decoding step. This option implies `download`.
4378
4379Query parameter `download` (e.g. `/changes/.../patch?download`)
4380will suggest the browser save the patch as `commitsha1.diff.base64`,
4381for later processing by command line tools.
4382
Kasper Nilsson81448072016-10-17 15:04:33 -07004383If the `path` parameter is set, the returned content is a diff of the single
4384file that the path refers to.
4385
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004386[[submit-preview]]
Edwin Kempin807eb4b2016-10-18 15:49:41 +02004387=== Submit Preview
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004388--
4389'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit'
4390--
4391Gets a file containing thin bundles of all modified projects if this
4392change was submitted. The bundles are named `${ProjectName}.git`.
4393Each thin bundle contains enough to construct the state in which a project would
4394be in if this change were submitted. The base of the thin bundles are the
4395current target branches, so to make use of this call in a non-racy way, first
4396get the bundles and then fetch all projects contained in the bundle.
4397(This assumes no non-fastforward pushes).
4398
4399You need to give a parameter '?format=zip' or '?format=tar' to specify the
Stefan Beller3e586742016-10-05 15:23:22 -07004400format for the outer container. It is always possible to use tgz, even if
4401tgz is not in the list of allowed archive formats.
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004402
4403To make good use of this call, you would roughly need code as found at:
4404----
4405 $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh
4406----
4407.Request
4408----
4409 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0
4410----
4411
4412.Response
4413----
4414 HTTP/1.1 200 OK
4415 Date: Tue, 13 Sep 2016 19:13:46 GMT
4416 Content-Disposition: attachment; filename="submit-preview-147.zip"
4417 X-Content-Type-Options: nosniff
4418 Cache-Control: no-cache, no-store, max-age=0, must-revalidate
4419 Pragma: no-cache
4420 Expires: Mon, 01 Jan 1990 00:00:00 GMT
4421 Content-Type: application/x-zip
4422 Transfer-Encoding: chunked
4423
4424 [binary stuff]
4425----
4426
4427In case of an error, the response is not a zip file but a regular json response,
4428containing only the error message:
4429
4430.Response
4431----
4432 HTTP/1.1 200 OK
4433 Content-Disposition: attachment
4434 Content-Type: application/json; charset=UTF-8
4435
4436 )]}'
4437 "Anonymous users cannot submit"
4438----
4439
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004440[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004441=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004442--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004443'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004444--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004445
4446Gets the method the server will use to submit (merge) the change and
4447an indicator if the change is currently mergeable.
4448
4449.Request
4450----
4451 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
4452----
4453
Saša Živkov499873f2014-05-05 13:34:18 +02004454As response a link:#mergeable-info[MergeableInfo] entity is returned.
4455
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004456.Response
4457----
4458 HTTP/1.1 200 OK
4459 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004460 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004461
4462 )]}'
4463 {
4464 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004465 strategy: "recursive",
4466 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004467 }
4468----
4469
Saša Živkov697cab22014-04-29 16:46:50 +02004470If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08004471checked for all other branches which are listed in the
4472link:config-project-config.html#branchOrder-section[branchOrder] section in the
4473project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02004474
4475.Request
4476----
4477 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
4478----
4479
4480The response will then contain a list of all other branches where this changes
4481could merge cleanly.
4482
4483.Response
4484----
4485 HTTP/1.1 200 OK
4486 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004487 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02004488
4489 )]}'
4490 {
4491 submit_type: "MERGE_IF_NECESSARY",
4492 mergeable: true,
4493 mergeable_into: [
4494 "refs/heads/stable-2.7",
4495 "refs/heads/stable-2.8",
4496 ]
4497 }
4498----
4499
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004500[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004501=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004502--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004503'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004504--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004505
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004506Gets the method the server will use to submit (merge) the change.
4507
4508.Request
4509----
4510 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
4511----
4512
4513.Response
4514----
4515 HTTP/1.1 200 OK
4516 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004517 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004518
4519 )]}'
4520 "MERGE_IF_NECESSARY"
4521----
4522
4523[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004524=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004525--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004526'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004527--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004528
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004529Tests the submit_type Prolog rule in the project, or the one given.
4530
4531Request body may be either the Prolog code as `text/plain` or a
4532link:#rule-input[RuleInput] object. The query parameter `filters`
4533may be set to `SKIP` to bypass parent project filters while testing
4534a project-specific rule.
4535
4536.Request
4537----
4538 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09004539 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004540
4541 submit_type(cherry_pick).
4542----
4543
4544.Response
4545----
4546 HTTP/1.1 200 OK
4547 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004548 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004549
4550 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07004551 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004552----
4553
4554[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004555=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004556--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004557'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004558--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004559
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004560Tests the submit_rule Prolog rule in the project, or the one given.
4561
4562Request body may be either the Prolog code as `text/plain` or a
4563link:#rule-input[RuleInput] object. The query parameter `filters`
4564may be set to `SKIP` to bypass parent project filters while testing
4565a project-specific rule.
4566
4567.Request
4568----
Shawn Pearcea3cce712014-03-21 08:16:11 -07004569 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09004570 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004571
4572 submit_rule(submit(R)) :-
4573 R = label('Any-Label-Name', reject(_)).
4574----
4575
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004576The response is a link:#submit-record[SubmitRecord] describing the
4577permutations that satisfy the tested submit rule.
4578
David Pursehouse87a3fb02019-10-29 16:01:27 +09004579If the submit rule was a no-op, the response is "`204 No Content`".
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004580
4581.Response
4582----
4583 HTTP/1.1 200 OK
4584 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004585 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004586
4587 )]}'
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004588 {
4589 "status": "NOT_READY",
4590 "reject": {
4591 "Any-Label-Name": {}
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004592 }
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004593 }
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004594----
4595
Shawn Pearceb42e3032015-04-02 10:28:10 -07004596When testing with the `curl` command line client the
4597`--data-binary @rules.pl` flag should be used to ensure
4598all LFs are included in the Prolog code:
4599
4600----
4601 curl -X POST \
4602 -H 'Content-Type: text/plain; charset=UTF-8' \
4603 --data-binary @rules.pl \
4604 http://.../test.submit_rule
4605----
4606
Edwin Kempincb6724a2013-02-26 16:58:51 +01004607[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004608=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004609--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004610'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004611--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004612
Edwin Kempin3ca57192013-02-27 07:44:01 +01004613Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01004614user.
4615
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004616Returns a map of file paths to lists of link:#comment-info[CommentInfo]
4617entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004618
4619.Request
4620----
4621 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
4622----
4623
4624.Response
4625----
4626 HTTP/1.1 200 OK
4627 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004628 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01004629
4630 )]}'
4631 {
4632 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4633 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004634 "id": "TvcXrmjM",
4635 "line": 23,
4636 "message": "[nit] trailing whitespace",
4637 "updated": "2013-02-26 15:40:43.986000000"
4638 },
4639 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004640 "id": "TveXwFiA",
4641 "line": 49,
4642 "in_reply_to": "TfYX-Iuo",
4643 "message": "Done",
4644 "updated": "2013-02-26 15:40:45.328000000"
4645 }
4646 ]
4647 }
4648----
4649
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004650[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004651=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004652--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004653'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004654--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004655
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004656Creates a draft comment on a revision.
4657
4658The new draft comment must be provided in the request body inside a
4659link:#comment-input[CommentInput] entity.
4660
4661.Request
4662----
4663 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004664 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004665
4666 {
4667 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4668 "line": 23,
4669 "message": "[nit] trailing whitespace"
4670 }
4671----
4672
4673As response a link:#comment-info[CommentInfo] entity is returned that
4674describes the draft comment.
4675
4676.Response
4677----
4678 HTTP/1.1 200 OK
4679 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004680 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004681
4682 )]}'
4683 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004684 "id": "TvcXrmjM",
4685 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4686 "line": 23,
4687 "message": "[nit] trailing whitespace",
4688 "updated": "2013-02-26 15:40:43.986000000"
4689 }
4690----
4691
Edwin Kempin3ca57192013-02-27 07:44:01 +01004692[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004693=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004694--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004695'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 -08004696--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004697
Edwin Kempin3ca57192013-02-27 07:44:01 +01004698Retrieves a draft comment of a revision that belongs to the calling
4699user.
4700
4701.Request
4702----
4703 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4704----
4705
4706As response a link:#comment-info[CommentInfo] entity is returned that
4707describes the draft comment.
4708
4709.Response
4710----
4711 HTTP/1.1 200 OK
4712 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004713 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01004714
4715 )]}'
4716 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01004717 "id": "TvcXrmjM",
4718 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4719 "line": 23,
4720 "message": "[nit] trailing whitespace",
4721 "updated": "2013-02-26 15:40:43.986000000"
4722 }
4723----
4724
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004725[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004726=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004727--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004728'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 -08004729--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004730
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004731Updates a draft comment on a revision.
4732
4733The new draft comment must be provided in the request body inside a
4734link:#comment-input[CommentInput] entity.
4735
4736.Request
4737----
4738 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004739 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004740
4741 {
4742 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4743 "line": 23,
4744 "message": "[nit] trailing whitespace"
4745 }
4746----
4747
4748As response a link:#comment-info[CommentInfo] entity is returned that
4749describes the draft comment.
4750
4751.Response
4752----
4753 HTTP/1.1 200 OK
4754 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004755 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004756
4757 )]}'
4758 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004759 "id": "TvcXrmjM",
4760 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4761 "line": 23,
4762 "message": "[nit] trailing whitespace",
4763 "updated": "2013-02-26 15:40:43.986000000"
4764 }
4765----
4766
4767[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004768=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004769--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004770'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 -08004771--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004772
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004773Deletes a draft comment from a revision.
4774
4775.Request
4776----
4777 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4778----
4779
4780.Response
4781----
4782 HTTP/1.1 204 No Content
4783----
4784
John Spurlock5e402f02013-03-24 11:35:04 -04004785[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004786=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004787--
John Spurlock5e402f02013-03-24 11:35:04 -04004788'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004789--
John Spurlock5e402f02013-03-24 11:35:04 -04004790
4791Lists the published comments of a revision.
4792
4793As result a map is returned that maps the file path to a list of
4794link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07004795sorted by file path and only include file (or inline) comments. Use
4796the link:#get-change-detail[Get Change Detail] endpoint to retrieve
4797the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04004798
4799.Request
4800----
4801 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
4802----
4803
4804.Response
4805----
4806 HTTP/1.1 200 OK
4807 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004808 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004809
4810 )]}'
4811 {
4812 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4813 {
John Spurlock5e402f02013-03-24 11:35:04 -04004814 "id": "TvcXrmjM",
4815 "line": 23,
4816 "message": "[nit] trailing whitespace",
4817 "updated": "2013-02-26 15:40:43.986000000",
4818 "author": {
4819 "_account_id": 1000096,
4820 "name": "John Doe",
4821 "email": "john.doe@example.com"
4822 }
4823 },
4824 {
John Spurlock5e402f02013-03-24 11:35:04 -04004825 "id": "TveXwFiA",
4826 "line": 49,
4827 "in_reply_to": "TfYX-Iuo",
4828 "message": "Done",
4829 "updated": "2013-02-26 15:40:45.328000000",
4830 "author": {
4831 "_account_id": 1000097,
4832 "name": "Jane Roe",
4833 "email": "jane.roe@example.com"
4834 }
4835 }
4836 ]
4837 }
4838----
4839
4840[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004841=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004842--
John Spurlock5e402f02013-03-24 11:35:04 -04004843'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 -08004844--
John Spurlock5e402f02013-03-24 11:35:04 -04004845
4846Retrieves a published comment of a revision.
4847
4848.Request
4849----
4850 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
4851----
4852
4853As response a link:#comment-info[CommentInfo] entity is returned that
4854describes the published comment.
4855
4856.Response
4857----
4858 HTTP/1.1 200 OK
4859 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004860 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004861
4862 )]}'
4863 {
John Spurlock5e402f02013-03-24 11:35:04 -04004864 "id": "TvcXrmjM",
4865 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4866 "line": 23,
4867 "message": "[nit] trailing whitespace",
4868 "updated": "2013-02-26 15:40:43.986000000",
4869 "author": {
4870 "_account_id": 1000096,
4871 "name": "John Doe",
4872 "email": "john.doe@example.com"
4873 }
4874 }
4875----
4876
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01004877[[delete-comment]]
4878=== Delete Comment
4879--
4880'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' +
4881'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete'
4882--
4883
4884Deletes a published comment of a revision. Instead of deleting the
4885whole comment, this endpoint just replaces the comment's message
4886with a new message, which contains the name of the user who deletes
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02004887the comment and the reason why it's deleted.
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01004888
4889Note that only users with the
4890link:access-control.html#capability_administrateServer[Administrate Server]
4891global capability are permitted to delete a comment.
4892
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02004893Deletion reason can be provided in the request body as a
4894link:#delete-comment-input[DeleteCommentInput] entity.
4895Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01004896link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02004897In this case, use a POST request instead:
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01004898
4899.Request
4900----
4901 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0
4902 Content-Type: application/json; charset=UTF-8
4903
4904 {
4905 "reason": "contains confidential information"
4906 }
4907----
4908
4909As response a link:#comment-info[CommentInfo] entity is returned that
4910describes the updated comment.
4911
4912.Response
4913----
4914 HTTP/1.1 200 OK
4915 Content-Disposition: attachment
4916 Content-Type: application/json; charset=UTF-8
4917
4918 )]}'
4919 {
4920 "id": "TvcXrmjM",
4921 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4922 "line": 23,
4923 "message": "Comment removed by: Administrator; Reason: contains confidential information",
4924 "updated": "2013-02-26 15:40:43.986000000",
4925 "author": {
4926 "_account_id": 1000096,
4927 "name": "John Doe",
4928 "email": "john.doe@example.com"
4929 }
4930 }
4931----
4932
Edwin Kempinb050a482016-12-01 09:11:19 +01004933[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02004934=== List Robot Comments
4935--
4936'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
4937--
4938
4939Lists the link:config-robot-comments.html[robot comments] of a
4940revision.
4941
4942As result a map is returned that maps the file path to a list of
4943link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
4944map are sorted by file path.
4945
4946.Request
4947----
4948 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
4949----
4950
4951.Response
4952----
4953 HTTP/1.1 200 OK
4954 Content-Disposition: attachment
4955 Content-Type: application/json; charset=UTF-8
4956
4957 )]}'
4958 {
4959 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4960 {
4961 "id": "TvcXrmjM",
4962 "line": 23,
4963 "message": "unused import",
4964 "updated": "2016-02-26 15:40:43.986000000",
4965 "author": {
4966 "_account_id": 1000110,
4967 "name": "Code Analyzer",
4968 "email": "code.analyzer@example.com"
4969 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09004970 "robot_id": "importChecker",
4971 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02004972 },
4973 {
4974 "id": "TveXwFiA",
4975 "line": 49,
4976 "message": "wrong indention",
4977 "updated": "2016-02-26 15:40:45.328000000",
4978 "author": {
4979 "_account_id": 1000110,
4980 "name": "Code Analyzer",
4981 "email": "code.analyzer@example.com"
4982 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09004983 "robot_id": "styleChecker",
4984 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02004985 }
4986 ]
4987 }
4988----
4989
4990[[get-robot-comment]]
4991=== Get Robot Comment
4992--
4993'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
4994--
4995
4996Retrieves a link:config-robot-comments.html[robot comment] of a
4997revision.
4998
4999.Request
5000----
5001 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
5002----
5003
5004As response a link:#robot-comment-info[RobotCommentInfo] entity is
5005returned that describes the robot comment.
5006
5007.Response
5008----
5009 HTTP/1.1 200 OK
5010 Content-Disposition: attachment
5011 Content-Type: application/json; charset=UTF-8
5012
5013 )]}'
5014 {
5015 "id": "TvcXrmjM",
5016 "line": 23,
5017 "message": "unused import",
5018 "updated": "2016-02-26 15:40:43.986000000",
5019 "author": {
5020 "_account_id": 1000110,
5021 "name": "Code Analyzer",
5022 "email": "code.analyzer@example.com"
5023 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005024 "robot_id": "importChecker",
5025 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005026 }
5027----
5028
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005029[[apply-fix]]
5030=== Apply Fix
5031--
5032'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
5033--
5034
5035Applies a suggested fix by creating a change edit which includes the
5036modifications indicated by the fix suggestion. If a change edit already exists,
5037it will be updated accordingly. A fix can only be applied if no change edit
5038exists and the fix refers to the current patch set, or the fix refers to the
5039patch set on which the change edit is based.
5040
5041.Request
5042----
5043 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
5044----
5045
5046If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
5047resulting change edit is returned.
5048
5049.Response
5050----
5051 HTTP/1.1 200 OK
5052 Content-Disposition: attachment
5053 Content-Type: application/json; charset=UTF-8
5054
5055 )]}'
5056 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005057 "commit": {
5058 "parents": [
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005059 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005060 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005061 }
5062 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01005063 "author": {
5064 "name": "John Doe",
5065 "email": "john.doe@example.com",
5066 "date": "2013-05-07 15:21:27.000000000",
5067 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005068 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005069 "committer": {
5070 "name": "Jane Doe",
5071 "email": "jane.doe@example.com",
5072 "date": "2013-05-07 15:35:43.000000000",
5073 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005074 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005075 "subject": "Implement feature X",
5076 "message": "Implement feature X\n\nWith this feature ..."
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005077 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005078 "base_patch_set_number": 1,
5079 "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1"
5080 "ref": "refs/users/01/1000001/edit-42622/1"
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005081 }
5082----
5083
5084If the application failed e.g. due to conflicts with an existing change edit,
5085the response "`409 Conflict`" including an error message in the response body
5086is returned.
5087
5088.Response
5089----
5090 HTTP/1.1 409 Conflict
5091 Content-Disposition: attachment
5092 Content-Type: text/plain; charset=UTF-8
5093
5094 The existing change edit could not be merged with another tree.
5095----
5096
Edwin Kempin682ac712013-05-14 13:40:46 +02005097[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005098=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005099--
Edwin Kempin682ac712013-05-14 13:40:46 +02005100'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005101--
Edwin Kempin682ac712013-05-14 13:40:46 +02005102
5103Lists the files that were modified, added or deleted in a revision.
5104
5105.Request
5106----
5107 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
5108----
5109
Makson Leefaf05c22018-07-26 22:42:59 +00005110As result a map is returned that maps the link:#file-id[file path] to a
5111link:#file-info[FileInfo] entry. The entries in the map are
Edwin Kempin682ac712013-05-14 13:40:46 +02005112sorted by file path.
5113
5114.Response
5115----
5116 HTTP/1.1 200 OK
5117 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005118 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02005119
5120 )]}'
5121 {
5122 "/COMMIT_MSG": {
5123 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02005124 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005125 "size_delta": 551,
5126 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02005127 },
5128 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
5129 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02005130 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005131 "size_delta": 98,
5132 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02005133 }
5134 }
5135----
5136
Shawn Pearce984747d2013-07-18 00:42:16 -07005137The request parameter `reviewed` changes the response to return a list
5138of the paths the caller has marked as reviewed. Clients that also
5139need the FileInfo should make two requests.
5140
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005141The request parameter `q` changes the response to return a list
5142of all files (modified or unmodified) that contain that substring
5143in the path name. This is useful to implement suggestion services
David Pursehousefcfb29d2019-08-01 12:55:16 +09005144finding a file by partial name. Clients that also need the FileInfo
5145should make two requests.
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005146
David Pursehouse89c00ca2019-08-03 13:47:29 +09005147For merge commits only, the integer-valued request parameter `parent`
5148changes the response to return a map of the files which are different
5149in this commit compared to the given parent commit. The value is the
Andrii Shyshkalov350a4512019-09-23 02:26:33 -070051501-based index of the parent's position in the commit object,
5151with the first parent always belonging to the target branch. If not
David Pursehouse89c00ca2019-08-03 13:47:29 +09005152specified, the response contains a map of the files different in the
5153auto merge result.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005154
David Pursehousefcfb29d2019-08-01 12:55:16 +09005155The request parameter `base` changes the response to return a map of the
5156files which are different in this commit compared to the given revision. The
5157revision must correspond to a patch set in the change.
5158
5159The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive.
5160That is, only one of them may be used at a time.
Shawn Pearce984747d2013-07-18 00:42:16 -07005161
5162.Request
5163----
5164 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
5165----
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005166
Shawn Pearce984747d2013-07-18 00:42:16 -07005167.Response
5168----
5169 HTTP/1.1 200 OK
5170 Content-Disposition: attachment
5171 Content-Type: application/json; charset=UTF-8
5172
5173 )]}'
5174 [
Edwin Kempinaef44b02013-05-07 16:15:55 +02005175 "/COMMIT_MSG",
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005176 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005177 ]
Edwin Kempinbea55a52013-05-14 13:53:39 +02005178----
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005179
Edwin Kempinaef44b02013-05-07 16:15:55 +02005180[[get-content]]
5181=== Get Content
5182--
5183'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
5184--
5185
5186Gets the content of a file from a certain revision.
5187
Patrick Hiesel38667d42017-05-02 13:12:48 +02005188The optional, integer-valued `parent` parameter can be specified to request
5189the named file from a parent commit of the specified revision. The value is
5190the 1-based index of the parent's position in the commit object. If the
5191parameter is omitted or the value is non-positive, the patch set is referenced.
5192
Edwin Kempinaef44b02013-05-07 16:15:55 +02005193.Request
5194----
5195 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
5196----
5197
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005198The content is returned as base64 encoded string. The HTTP response
5199Content-Type is always `text/plain`, reflecting the base64 wrapping.
5200A Gerrit-specific `X-FYI-Content-Type` header is returned describing
5201the server detected content type of the file.
5202
5203If only the content type is required, callers should use HEAD to
5204avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02005205
5206.Response
5207----
5208 HTTP/1.1 200 OK
5209 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005210 Content-Type: text/plain; charset=ISO-8859-1
5211 X-FYI-Content-Encoding: base64
5212 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02005213
5214 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
5215----
5216
David Ostrovskyd0078672015-02-06 21:51:04 +01005217Alternatively, if the only value of the Accept request header is
5218`application/json` the content is returned as JSON string and
5219`X-FYI-Content-Encoding` is set to `json`.
5220
David Pletcherd1efb452015-09-01 17:45:55 -07005221[[get-safe-content]]
5222=== Download Content
5223--
5224'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
5225--
5226
5227Downloads the content of a file from a certain revision, in a safe format
5228that poses no risk for inadvertent execution of untrusted code.
5229
5230If the content type is defined as safe, the binary file content is returned
5231verbatim. If the content type is not safe, the file is stored inside a ZIP
5232file, containing a single entry with a random, unpredictable name having the
5233same base and suffix as the true filename. The ZIP file is returned in
5234verbatim binary form.
5235
5236See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
5237for information about safe file type configuration.
5238
5239The HTTP resource Content-Type is dependent on the file type: the
5240applicable type for safe files, or "application/zip" for unsafe files.
5241
David Pletcherec622bf2015-09-18 14:30:05 -07005242The optional, integer-valued `parent` parameter can be specified to request
5243the named file from a parent commit of the specified revision. The value is
5244the 1-based index of the parent's position in the commit object. If the
5245parameter is omitted or the value non-positive, the patch set is referenced.
5246
5247Filenames are decorated with a suffix of `_new` for the current patch,
5248`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07005249
5250.Request
5251----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005252 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07005253----
5254
5255.Response
5256----
5257 HTTP/1.1 200 OK
5258 Content-Disposition: attachment; filename="logo.png"
5259 Content-Type: image/png
5260
5261 `[binary data for logo.png]`
5262----
5263
5264.Request
5265----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005266 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 -07005267----
5268
5269.Response
5270----
5271 HTTP/1.1 200 OK
5272 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
5273 Content-Type:application/zip
5274
5275 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
5276----
5277
David Pursehouse882aef22013-06-05 10:56:37 +09005278[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005279=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005280--
David Pursehouse882aef22013-06-05 10:56:37 +09005281'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 -08005282--
David Pursehouse882aef22013-06-05 10:56:37 +09005283
5284Gets the diff of a file from a certain revision.
5285
5286.Request
5287----
5288 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
5289----
5290
5291As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
5292
5293.Response
5294----
5295 HTTP/1.1 200 OK
5296 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005297 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005298
5299 )]
5300 {
5301 "meta_a": {
5302 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005303 "content_type": "text/x-java-source",
5304 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005305 },
5306 "meta_b": {
5307 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005308 "content_type": "text/x-java-source",
5309 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005310 },
5311 "change_type": "MODIFIED",
5312 "diff_header": [
5313 "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",
5314 "index 59b7670..9faf81c 100644",
5315 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5316 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5317 ],
5318 "content": [
5319 {
5320 "ab": [
5321 "// Copyright (C) 2010 The Android Open Source Project",
5322 "//",
5323 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
5324 "// you may not use this file except in compliance with the License.",
5325 "// You may obtain a copy of the License at",
5326 "//",
5327 "// http://www.apache.org/licenses/LICENSE-2.0",
5328 "//",
5329 "// Unless required by applicable law or agreed to in writing, software",
5330 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
5331 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
5332 "// See the License for the specific language governing permissions and",
5333 "// limitations under the License."
5334 ]
5335 },
5336 {
5337 "b": [
5338 "//",
5339 "// Add some more lines in the header."
5340 ]
5341 },
5342 {
5343 "ab": [
5344 "",
5345 "package com.google.gerrit.server.project;",
5346 "",
5347 "import com.google.common.collect.Maps;",
5348 ...
5349 ]
5350 }
5351 ...
5352 ]
5353 }
5354----
5355
5356If the `intraline` parameter is specified, intraline differences are included in the diff.
5357
5358.Request
5359----
5360 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
5361----
5362
5363.Response
5364----
5365 HTTP/1.1 200 OK
5366 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005367 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005368
5369 )]
5370 {
5371 "meta_a": {
5372 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005373 "content_type": "text/x-java-source",
5374 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005375 },
5376 "meta_b": {
5377 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005378 "content_type": "text/x-java-source",
5379 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005380 },
5381 "change_type": "MODIFIED",
5382 "diff_header": [
5383 "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",
5384 "index 59b7670..9faf81c 100644",
5385 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5386 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5387 ],
5388 "content": [
5389 ...
5390 {
5391 "a": [
5392 "/** Manages access control for Git references (aka branches, tags). */"
5393 ],
5394 "b": [
5395 "/** Manages access control for the Git references (aka branches, tags). */"
5396 ],
5397 "edit_a": [],
5398 "edit_b": [
5399 [
5400 31,
5401 4
5402 ]
5403 ]
5404 }
5405 ]
5406 }
5407----
5408
5409The `base` parameter can be specified to control the base patch set from which the diff should
5410be generated.
5411
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005412The integer-valued request parameter `parent` can be specified to control the
5413parent commit number against which the diff should be generated. This is useful
5414for supporting review of merge commits. The value is the 1-based index of the
5415parent's position in the commit object.
5416
David Pursehouse882aef22013-06-05 10:56:37 +09005417.Request
5418----
5419 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
5420----
5421
5422.Response
5423----
5424 HTTP/1.1 200 OK
5425 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005426 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005427
5428 )]
5429 {
5430 "meta_a": {
5431 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005432 "content_type": "text/x-java-source",
5433 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005434 },
5435 "meta_b": {
5436 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005437 "content_type": "text/x-java-source",
5438 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005439 },
5440 "change_type": "MODIFIED",
5441 "content": [
5442 {
5443 "skip": 578
5444 }
5445 ]
5446 }
5447----
5448
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01005449The `whitespace` parameter can be specified to control how whitespace
5450differences are reported in the result. Valid values are `IGNORE_NONE`,
5451`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09005452
5453The `context` parameter can be specified to control the number of lines of surrounding context
5454in the diff. Valid values are `ALL` or number of lines.
5455
Dmitrii Filippovbf3f08b2019-12-06 03:13:06 +01005456[[preview-fix]]
5457=== Preview fix
5458--
5459'GET /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/preview'
5460--
5461
5462Gets the diffs of all files for a certain <<fix-id,\{fix-id\}>>.
5463As response, a map of link:#diff-info[DiffInfo] entities is returned that describes the diffs.
5464
5465Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id and a virtual patch set with the applied fix.
5466
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005467[[get-blame]]
5468=== Get Blame
5469--
5470'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
5471--
5472
5473Gets the blame of a file from a certain revision.
5474
5475.Request
5476----
5477 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
5478----
5479
5480As response a link:#blame-info[BlameInfo] entity is returned that describes the
5481blame.
5482
5483.Response
5484----
5485 HTTP/1.1 200 OK
5486 Content-Disposition: attachment
5487 Content-Type: application/json; charset=UTF-8
5488
5489 )]
5490 {
5491 [
5492 {
5493 "author": "Joe Daw",
5494 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
5495 "time": 1421441349,
5496 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
5497 "ranges": [
5498 {
5499 "start": 1,
5500 "end": 10
5501 },
5502 {
5503 "start": 16,
5504 "end": 296
5505 }
5506 ]
5507 },
5508 {
5509 "author": "Jane Daw",
5510 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
5511 "time": 1421825421,
5512 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
5513 "ranges": [
5514 {
5515 "start": 13,
5516 "end": 13
5517 }
5518 ]
5519 }
5520 ]
5521 }
5522----
5523
5524The `base` parameter can be specified to control the base patch set from which
5525the blame should be generated.
5526
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005527[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005528=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005529--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005530'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 -08005531--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005532
Edwin Kempinbea55a52013-05-14 13:53:39 +02005533Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005534
5535.Request
5536----
5537 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5538----
5539
5540.Response
5541----
5542 HTTP/1.1 201 Created
5543----
5544
Edwin Kempinbea55a52013-05-14 13:53:39 +02005545If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005546response is "`200 OK`".
5547
5548[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005549=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005550--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005551'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 -08005552--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005553
Edwin Kempinbea55a52013-05-14 13:53:39 +02005554Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005555
5556.Request
5557----
5558 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5559----
5560
5561.Response
5562----
5563 HTTP/1.1 204 No Content
5564----
5565
Gustaf Lundh019fb262012-11-28 14:20:22 +01005566[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005567=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005568--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005569'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005570--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005571
5572Cherry picks a revision to a destination branch.
5573
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02005574To cherry pick a commit with no change-id associated with it, see
5575link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit].
5576
Gustaf Lundh019fb262012-11-28 14:20:22 +01005577The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02005578link:#cherrypick-input[CherryPickInput] entity. If the commit message
5579does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005580
5581.Request
5582----
5583 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005584 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005585
5586 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01005587 "message" : "Implementing Feature X",
5588 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01005589 }
5590----
5591
Edwin Kempinaab27d32020-01-29 13:17:04 +01005592As response a link:#change-info[ChangeInfo] entity is returned that
5593describes the resulting cherry-pick change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005594
5595.Response
5596----
5597 HTTP/1.1 200 OK
5598 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005599 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005600
5601 )]}'
5602 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01005603 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
5604 "project": "myProject",
5605 "branch": "release-branch",
5606 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
5607 "subject": "Implementing Feature X",
5608 "status": "NEW",
5609 "created": "2013-02-01 09:59:32.126000000",
5610 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01005611 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005612 "insertions": 12,
5613 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01005614 "_number": 3965,
5615 "owner": {
5616 "name": "John Doe"
5617 }
5618 }
5619----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005620
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005621[[revision-reviewer-endpoints]]
5622== Revision Reviewer Endpoints
5623
5624[[list-revision-reviewers]]
5625=== List Revision Reviewers
5626--
5627'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
5628--
5629
5630Lists the reviewers of a revision.
5631
5632Please note that only the current revision is supported.
5633
5634As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
5635
5636.Request
5637----
5638 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
5639----
5640
5641.Response
5642----
5643 HTTP/1.1 200 OK
5644 Content-Disposition: attachment
5645 Content-Type: application/json; charset=UTF-8
5646
5647 )]}'
5648 [
5649 {
5650 "approvals": {
5651 "Verified": "+1",
5652 "Code-Review": "+2"
5653 },
5654 "_account_id": 1000096,
5655 "name": "John Doe",
5656 "email": "john.doe@example.com"
5657 },
5658 {
5659 "approvals": {
5660 "Verified": " 0",
5661 "Code-Review": "-1"
5662 },
5663 "_account_id": 1000097,
5664 "name": "Jane Roe",
5665 "email": "jane.roe@example.com"
5666 }
5667 ]
5668----
5669
5670[[list-revision-votes]]
5671=== List Revision Votes
5672--
5673'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
5674--
5675
5676Lists the votes for a specific reviewer of the revision.
5677
5678Please note that only the current revision is supported.
5679
5680.Request
5681----
5682 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
5683----
5684
5685As result a map is returned that maps the label name to the label value.
5686The entries in the map are sorted by label name.
5687
5688.Response
5689----
5690 HTTP/1.1 200 OK
5691 Content-Disposition: attachment
5692 Content-Type: application/json;charset=UTF-8
5693
5694 )]}'
5695 {
5696 "Code-Review": -1,
5697 "Verified": 1,
5698 "Work-In-Progress": 1
5699 }
5700----
5701
5702[[delete-revision-vote]]
5703=== Delete Revision Vote
5704--
5705'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5706/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
5707'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5708/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
5709--
5710
5711Deletes a single vote from a revision. The deletion will be possible only
5712if the revision is the current revision. By using this endpoint you can prevent
5713deleting the vote (with same label) from a newer patch set by mistake.
5714
5715Note, that even when the last vote of a reviewer is removed the reviewer itself
5716is still listed on the change.
5717
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005718.Request
5719----
5720 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
5721 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5722----
5723
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005724Options can be provided in the request body as a
5725link:#delete-vote-input[DeleteVoteInput] entity.
5726Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01005727link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005728In this case, use a POST request instead:
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005729
5730.Request
5731----
5732 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5733 Content-Type: application/json; charset=UTF-8
5734
5735 {
5736 "notify": "NONE"
5737 }
5738----
5739
5740.Response
5741----
5742 HTTP/1.1 204 No Content
5743----
5744
Gal Paikinc326de42020-06-16 18:49:00 +03005745[[attention-set-endpoints]]
5746== Attention Set Endpoints
5747
5748[[get-attention-set]]
5749=== Get Attention Set
5750--
5751'GET /changes/link:#change-id[\{change-id\}]/attention'
5752--
5753
5754Returns all users that are currently in the attention set.
5755As response a list of link:#attention-set-info[AttentionSetInfo]
5756entity is returned.
5757
5758.Request
5759----
5760 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
5761----
5762
5763.Response
5764----
5765 HTTP/1.1 200 OK
5766 Content-Disposition: attachment
5767 Content-Type: application/json; charset=UTF-8
5768
5769 )]}'
5770 [
5771 {
5772 "account": {
5773 "_account_id": 1000096,
5774 "name": "John Doe",
5775 "email": "john.doe@example.com",
5776 "username": "jdoe"
5777 },
5778 "last_update": "2013-02-01 09:59:32.126000000",
5779 "reason": "reviewer or cc replied"
5780 },
5781 {
5782 "account": {
5783 "_account_id": 1000097,
5784 "name": "Jane Doe",
5785 "email": "jane.doe@example.com",
5786 "username": "janedoe"
5787 },
5788 "last_update": "2013-02-01 09:59:32.126000000",
5789 "reason": "Reviewer was added"
5790 }
5791 ]
5792----
5793
5794[[add-to-attention-set]]
5795=== Add To Attention Set
5796--
5797'POST /changes/link:#change-id[\{change-id\}]/attention'
5798--
5799
5800Adds a single user to the attention set of a change.
5801
5802A user can only be added if they are not in the attention set.
5803If a user is added while already in the attention set, the
5804request is silently ignored.
5805
5806.Request
5807----
5808 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
5809----
5810
5811Details should be provided in the request body as an
5812link:#attention-set-input[AttentionSetInput] entity.
5813
5814.Request
5815----
5816 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
5817 Content-Type: application/json; charset=UTF-8
5818
5819 {
5820 "user": "John Doe",
5821 "reason": "reason"
5822 }
5823----
5824
5825.Response
5826----
5827 HTTP/1.1 200 OK
5828 Content-Disposition: attachment
5829 Content-Type: application/json; charset=UTF-8
5830
5831 )]}'
5832 {
5833 "_account_id": 1000096,
5834 "name": "John Doe",
5835 "email": "john.doe@example.com",
5836 "username": "jdoe"
5837 }
5838----
5839
5840[[remove-from-attention-set]]
5841=== Remove from Attention Set
5842--
5843'DELETE /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]' +
5844'POST /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]/delete'
5845--
5846
5847Deletes a single user from the attention set of a change.
5848
5849A user can only be removed from the attention set if they
5850are currently in the attention set. Otherwise, the request
5851is silently ignored.
5852
5853.Request
5854----
5855 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe HTTP/1.0
5856 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
5857----
5858
5859Reason can be provided in the request body as an
5860link:#attention-set-input[AttentionSetInput] entity.
5861
5862User must be left empty, or the user must be exactly
5863the same user as in the request header.
5864
5865.Request
5866----
5867 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
5868 Content-Type: application/json; charset=UTF-8
5869
5870 {
5871 "reason": "reason"
5872 }
5873----
5874
5875.Response
5876----
5877 HTTP/1.1 204 No Content
5878----
5879
5880[[attention-set]]
5881== Attention Set
5882Attention Set is the set of users that should perform some action on the
5883change. E.g, reviewers should review the change, owner/uploader should
5884add a new patchset or respond to comments.
5885
5886Users are added to the attention set if one the following apply:
5887
5888* They are manually added in link:#review-input[ReviewInput] in
5889 add_to_attention_set.
5890* They are added as reviewers.
5891* The change is marked ready for review.
5892* As an owner/uploader, when someone replies on your change.
5893* As a reviewer, when the owner/uploader replies.
5894
5895Users are removed from the attention set if one the following apply:
5896
5897* They are manually removed in link:#review-input[ReviewInput] in
5898 remove_from_attention_set.
5899* They are removed from reviewers.
5900* The change is marked work in progress, abandoned, or submitted.
5901* When the user replies on a change.
5902
5903If the ignore_default_attention_set_rules in link:#review-input[ReviewInput]
5904is set to true, no other changes to the attention set will occur during the
5905link:#set-review[set-review].
5906Also, users specified in the list will occur instead of any of the implicit
5907changes to the attention set. E.g, if a user is added by add_to_attention_set
5908in link:#review-input[ReviewInput], but also the change is marked work in
5909progress, the user will still be added.
5910
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005911[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005912== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005913
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005914[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005915=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005916--
5917--
5918
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005919[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005920=== \{change-id\}
Patrick Hiesel18da0452017-12-21 14:02:05 +01005921Identifier that uniquely identifies one change. It contains the URL-encoded
5922project name as well as the change number: "'$$<project>~<numericId>$$'"
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005923
David Pursehousea5923972020-02-26 09:39:38 +09005924Gerrit also supports the following identifiers:
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005925
5926* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
5927 where for the branch the `refs/heads/` prefix can be omitted
5928 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
5929* a Change-Id if it uniquely identifies one change
5930 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
Patrick Hiesel4d2dd182017-05-09 17:35:18 +02005931* a numeric change ID ("4247")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005932
Changcheng Xiaod61590f2018-04-30 10:59:14 +02005933[[change-message-id]]
5934=== \{change-message-id\}
5935ID of a change message returned in a link:#change-message-info[ChangeMessageInfo].
5936
John Spurlock5e402f02013-03-24 11:35:04 -04005937[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005938=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04005939UUID of a published comment.
5940
Edwin Kempin3ca57192013-02-27 07:44:01 +01005941[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005942=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01005943UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005944
David Ostrovskybeb0b842014-12-13 00:24:29 +01005945[[label-id]]
5946=== \{label-id\}
5947The name of the label.
5948
Edwin Kempinbea55a52013-05-14 13:53:39 +02005949[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09005950=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02005951The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005952
David Pursehouse11badbb2017-03-27 10:58:05 +09005953The following magic paths are supported:
5954
5955* `/COMMIT_MSG`:
5956+
5957The commit message and headers with the parent commit(s), the author
5958information and the committer information.
5959
5960* `/MERGE_LIST` (for merge commits only):
5961+
5962The list of commits that are being integrated into the destination
5963branch by submitting the merge commit.
5964
Gal Paikin3edc1422020-03-19 12:04:52 +01005965* `/PATCHSET_LEVEL`:
5966+
5967This file path is used exclusively for posting and indicating
5968patchset-level comments, thus not relevant for other use-cases.
5969
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005970[[fix-id]]
5971=== \{fix-id\}
5972UUID of a suggested fix.
5973
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005974[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005975=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005976Identifier that uniquely identifies one revision of a change.
5977
5978This can be:
5979
Shawn Pearce9c0722a2013-03-02 15:30:31 -08005980* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005981* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
5982* an abbreviated commit ID that uniquely identifies one revision of the
5983 change ("674ac754"), at least 4 digits are required
5984* a legacy numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02005985* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005986
Edwin Kempine3446292013-02-19 16:40:14 +01005987[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005988== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01005989
Edwin Kempined5364b2013-02-22 10:39:33 +01005990[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005991=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01005992The `AbandonInput` entity contains information for abandoning a change.
5993
David Pursehouseae367192014-11-25 17:24:47 +09005994[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005995|=============================
5996|Field Name ||Description
5997|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01005998Message to be added as review comment to the change when abandoning the
5999change.
Edwin Kempincd07df42016-12-01 09:10:09 +01006000|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07006001Notify handling that defines to whom email notifications should be sent after
6002the change is abandoned. +
6003Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6004If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006005|`notify_details`|optional|
6006Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006007of link:user-notify.html#recipient-types[recipient type] to
6008link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01006009|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01006010
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006011[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006012=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006013The `ActionInfo` entity describes a REST API call the client can
6014make to manipulate a resource. These are frequently implemented by
6015plugins and may be discovered at runtime.
6016
David Pursehouseae367192014-11-25 17:24:47 +09006017[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006018|====================================
6019|Field Name ||Description
6020|`method` |optional|
6021HTTP method to use with the action. Most actions use `POST`, `PUT`
6022or `DELETE` to cause state changes.
6023|`label` |optional|
6024Short title to display to a user describing the action. In the
6025Gerrit web interface the label is used as the text on the button
6026presented in the UI.
6027|`title` |optional|
6028Longer text to display describing the action. In a web UI this
6029should be the title attribute of the element, displaying when
6030the user hovers the mouse.
6031|`enabled` |optional|
6032If true the action is permitted at this time and the caller is
6033likely allowed to execute it. This may change if state is updated
6034at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006035|====================================
6036
Edwin Kempin392328e2013-02-25 12:50:03 +01006037[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006038=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01006039The `AddReviewerResult` entity describes the result of adding a
6040reviewer to a change.
6041
David Pursehouseae367192014-11-25 17:24:47 +09006042[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01006043|===========================
6044|Field Name ||Description
Logan Hanks23e70282016-07-06 14:31:56 -07006045|`input` ||
6046Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
6047set while adding the reviewer.
Edwin Kempin392328e2013-02-25 12:50:03 +01006048|`reviewers` |optional|
6049The newly added reviewers as a list of link:#reviewer-info[
6050ReviewerInfo] entities.
Logan Hanksee0a4182016-07-06 14:39:26 -07006051|`ccs` |optional|
6052The newly CCed accounts as a list of link:#reviewer-info[
6053ReviewerInfo] entities. This field will only appear if the requested
6054`state` for the reviewer was `CC` *and* NoteDb is enabled on the
6055server.
Edwin Kempin392328e2013-02-25 12:50:03 +01006056|`error` |optional|
6057Error message explaining why the reviewer could not be added. +
6058If a group was specified in the input and an error is returned, it
6059means that none of the members were added as reviewer.
6060|`confirm` |`false` if not set|
6061Whether adding the reviewer requires confirmation.
6062|===========================
6063
Edwin Kempine3446292013-02-19 16:40:14 +01006064[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006065=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006066The `ApprovalInfo` entity contains information about an approval from a
6067user for a label on a change.
6068
Edwin Kempin963dfd02013-02-27 12:39:32 +01006069`ApprovalInfo` has the same fields as
6070link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01006071In addition `ApprovalInfo` has the following fields:
6072
David Pursehouseae367192014-11-25 17:24:47 +09006073[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006074|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006075|Field Name ||Description
6076|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07006077The vote that the user has given for the label. If present and zero, the
6078user is permitted to vote on the label. If absent, the user is not
6079permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006080|`permitted_voting_range` |optional|
6081The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
6082on that label. If present, the user is permitted to vote on the label
6083regarding the range values. If absent, the user is not permitted to vote
6084on that label.
6085|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01006086The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006087|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006088Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006089while posting the review. Votes/comments that contain `tag` with
6090'autogenerated:' prefix can be filtered out in the web UI.
6091NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006092invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04006093|`post_submit` |not set if `false`|
6094If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01006095|===========================
6096
Sven Selberg273a4aa2016-09-21 16:28:10 +02006097[[assignee-input]]
6098=== AssigneeInput
6099The `AssigneeInput` entity contains the identity of the user to be set as assignee.
6100
6101[options="header",cols="1,^1,5"]
6102|===========================
6103|Field Name ||Description
6104|`assignee` ||
6105The link:rest-api-accounts.html#account-id[ID] of one account that
6106should be added as assignee.
6107|===========================
6108
Gal Paikinc326de42020-06-16 18:49:00 +03006109[[attention-set-info]]
6110=== AttentionSetInfo
6111The `AttentionSetInfo` entity contains details of users that are in
6112the link:#attention-set[attention set].
6113
6114[options="header",cols="1,^1,5"]
6115|===========================
6116|Field Name ||Description
6117|`account` || link:rest-api-accounts.html#account-info[AccountInfo] entity.
6118|`last_update` || The link:rest-api.html#timestamp[timestamp] of the last update.
Gal Paikinf2b1b332020-07-06 16:34:36 +03006119|`reason` || The reason of for adding or removing the user.
Gal Paikinc326de42020-06-16 18:49:00 +03006120
6121|===========================
6122[[attention-set-input]]
6123=== AttentionSetInput
6124The `AttentionSetInput` entity contains details for adding users to the
6125link:#attention-set[attention set] and removing them from it.
6126
6127[options="header",cols="1,^1,5"]
6128|===========================
Gal Paikinf2b1b332020-07-06 16:34:36 +03006129|Field Name ||Description
6130|`user` |optional| link:rest-api-accounts.html#account-id[ID]
Gal Paikinc326de42020-06-16 18:49:00 +03006131of the account that should be added to the attention set. For removals,
6132this field should be empty or the same as the field in the request header.
Gal Paikinf2b1b332020-07-06 16:34:36 +03006133|`reason` || The reason of for adding or removing the user.
6134|`notify` |optional|
6135Notify handling that defines to whom email notifications should be sent
6136after the change is created. +
6137Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6138If not set, the default is `OWNER`.
6139|`notify_details` |optional|
6140Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03006141as a map of link:user-notify.html#recipient-types[recipient type] to
6142link:#notify-info[NotifyInfo] entity.
Gal Paikinc326de42020-06-16 18:49:00 +03006143|===========================
6144
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006145[[blame-info]]
6146=== BlameInfo
6147The `BlameInfo` entity stores the commit metadata with the row coordinates where
6148it applies.
6149
6150[options="header",cols="1,6"]
6151|===========================
6152|Field Name | Description
6153|`author` | The author of the commit.
6154|`id` | The id of the commit.
6155|`time` | Commit time.
6156|`commit_msg` | The commit message.
6157|`ranges` |
6158The blame row coordinates as link:#range-info[RangeInfo] entities.
6159|===========================
6160
Edwin Kempin521c1242015-01-23 12:44:44 +01006161[[change-edit-input]]
6162=== ChangeEditInput
6163The `ChangeEditInput` entity contains information for restoring a
6164path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02006165
Edwin Kempin521c1242015-01-23 12:44:44 +01006166[options="header",cols="1,^1,5"]
6167|===========================
6168|Field Name ||Description
6169|`restore_path`|optional|Path to file to restore.
6170|`old_path` |optional|Old path to file to rename.
6171|`new_path` |optional|New path to file to rename.
6172|===========================
6173
6174[[change-edit-message-input]]
6175=== ChangeEditMessageInput
6176The `ChangeEditMessageInput` entity contains information for changing
6177the commit message within a change edit.
6178
6179[options="header",cols="1,^1,5"]
6180|===========================
6181|Field Name ||Description
6182|`message` ||New commit message.
6183|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02006184
Edwin Kempine3446292013-02-19 16:40:14 +01006185[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006186=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006187The `ChangeInfo` entity contains information about a change.
6188
David Pursehouseae367192014-11-25 17:24:47 +09006189[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006190|==================================
6191|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006192|`id` ||
6193The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05006194where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01006195`refs/heads/` prefix is omitted.
6196|`project` ||The name of the project.
6197|`branch` ||
6198The name of the target branch. +
6199The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01006200|`topic` |optional|The topic to which this change belongs.
Gal Paikinc326de42020-06-16 18:49:00 +03006201|`attention_set` |optional|
6202The map that maps link:rest-api-accounts.html#account-id[account IDs]
6203to link:#attention-set-info[AttentionSetInfo] of that account.
Edwin Kempin93b74fb2017-08-25 10:42:56 +02006204|`assignee` |optional|
6205The assignee of the change as an link:rest-api-accounts.html#account-info[
6206AccountInfo] entity.
6207|`hashtags` |optional|
6208List of hashtags that are set on the change (only populated when NoteDb
6209is enabled).
Edwin Kempine3446292013-02-19 16:40:14 +01006210|`change_id` ||The Change-Id of the change.
6211|`subject` ||
6212The subject of the change (header line of the commit message).
6213|`status` ||
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01006214The status of the change (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempine3446292013-02-19 16:40:14 +01006215|`created` ||
6216The link:rest-api.html#timestamp[timestamp] of when the change was
6217created.
6218|`updated` ||
6219The link:rest-api.html#timestamp[timestamp] of when the change was last
6220updated.
Khai Do96a7caf2016-01-07 14:07:54 -08006221|`submitted` |only set for merged changes|
6222The link:rest-api.html#timestamp[timestamp] of when the change was
6223submitted.
Dave Borowitz8ec31f92017-08-23 10:28:34 -04006224|`submitter` |only set for merged changes|
6225The user who submitted the change, as an
6226link:rest-api-accounts.html#account-info[ AccountInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01006227|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02006228Whether the calling user has starred this change with the default label.
6229|`stars` |optional|
6230A list of star labels that are applied by the calling user to this
6231change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01006232|`reviewed` |not set if `false`|
6233Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07006234Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05006235|`submit_type` |optional|
Changcheng Xiao21885982019-01-15 18:16:51 +01006236The link:config-project-config.html#submit-type[submit type] of the change. +
Dave Borowitzace32102015-12-17 13:08:25 -05006237Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01006238|`mergeable` |optional|
6239Whether the change is mergeable. +
Patrick Hiesela4824db2019-12-20 10:55:26 +01006240Only set for open changes if
6241link:config-gerrit.html#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior]
6242is `API_REF_UPDATED_AND_CHANGE_REINDEX`.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07006243|`submittable` |optional|
6244Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07006245Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01006246|`insertions` ||
6247Number of inserted lines.
6248|`deletions` ||
6249Number of deleted lines.
Dave Borowitzc001f322018-10-31 14:31:08 -07006250|`total_comment_count` |optional|
6251Total number of inline comments across all patch sets. Not set if the current
6252change index doesn't have the data.
Changcheng Xiao81c48092017-02-08 13:04:07 +01006253|`unresolved_comment_count` |optional|
Dave Borowitzc001f322018-10-31 14:31:08 -07006254Number of unresolved inline comment threads across all patch sets. Not set if
6255the current change index doesn't have the data.
Edwin Kempine3446292013-02-19 16:40:14 +01006256|`_number` ||The legacy numeric ID of the change.
6257|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01006258The owner of the change as an link:rest-api-accounts.html#account-info[
6259AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07006260|`actions` |optional|
6261Actions the caller might be able to perform on this revision. The
6262information is a map of view name to link:#action-info[ActionInfo]
6263entities.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01006264|`requirements` |optional|
6265List of the link:rest-api-changes.html#requirement[requirements] to be met before this change
6266can be submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01006267|`labels` |optional|
6268The labels of the change as a map that maps the label names to
6269link:#label-info[LabelInfo] entries. +
6270Only set if link:#labels[labels] or link:#detailed-labels[detailed
6271labels] are requested.
6272|`permitted_labels` |optional|
6273A map of the permitted labels that maps a label name to the list of
6274values that are allowed for that label. +
6275Only set if link:#detailed-labels[detailed labels] are requested.
6276|`removable_reviewers`|optional|
6277The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01006278link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01006279Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07006280|`reviewers` |optional|
Edwin Kempin66af3d82015-11-10 17:38:40 -08006281The reviewers as a map that maps a reviewer state to a list of
6282link:rest-api-accounts.html#account-info[AccountInfo] entities.
6283Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
6284`REVIEWER`: Users with at least one non-zero vote on the change. +
6285`CC`: Users that were added to the change, but have not voted. +
6286`REMOVED`: Users that were previously reviewers on the change, but have
6287been removed. +
6288Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07006289|`pending_reviewers` |optional|
6290Updates to `reviewers` that have been made while the change was in the
6291WIP state. Only present on WIP changes and only if there are pending
6292reviewer updates to report. These are reviewers who have not yet been
6293notified about being added to or removed from the change. +
6294Only set if link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07006295|`reviewer_updates`|optional|
6296Updates to reviewers set for the change as
6297link:#review-update-info[ReviewerUpdateInfo] entities.
Han-Wen Nienhuys3c670be2020-06-30 19:17:07 +02006298Only set if link:#reviewer-updates[reviewer updates] are requested.
John Spurlock74a70cc2013-03-23 16:41:50 -04006299|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07006300Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04006301link:#change-message-info[ChangeMessageInfo] entities. +
6302Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006303|`current_revision` |optional|
6304The commit ID of the current patch set of this change. +
6305Only set if link:#current-revision[the current revision] is requested
6306or if link:#all-revisions[all revisions] are requested.
6307|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05006308All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01006309patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08006310Only set if link:#current-revision[the current revision] is requested
6311(in which case it will only contain a key for the current revision) or
6312if link:#all-revisions[all revisions] are requested.
Makson Lee3568a932017-08-28 17:12:03 +08006313|`tracking_ids` |optional|
6314A list of link:#tracking-id-info[TrackingIdInfo] entities describing
6315references to external tracking systems. Only set if
6316link:#tracking-ids[tracking ids] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006317|`_more_changes` |optional, not set if `false`|
6318Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08006319Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05006320|`problems` |optional|
6321A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08006322problems with this change. Only set if link:#check[CHECK] is set.
David Ostrovskycb19cec2017-04-28 11:55:45 +02006323|`is_private` |optional, not set if `false`|
6324When present, change is marked as private.
David Ostrovsky258849b2017-03-09 23:21:03 +01006325|`work_in_progress` |optional, not set if `false`|
6326When present, change is marked as Work In Progress.
Logan Hanks724b24c2017-07-14 10:01:05 -07006327|`has_review_started` |optional, not set if `false`|
Logan Hanks296cd892017-05-03 15:14:41 -07006328When present, change has been marked Ready at some point in time.
Patrick Hiesel828f3222017-07-13 14:18:38 +02006329|`revert_of` |optional|
6330The numeric Change-Id of the change that this change reverts.
Gal Paikinf57225a2019-11-13 12:39:12 -08006331|`submission_id` |optional|
6332ID of the submission of this change. Only set if the status is `MERGED`.
Gal Paikindd31db92019-12-06 14:43:35 +01006333This ID is equal to the numeric ID of the change that triggered the submission.
6334If the change that triggered the submission also has a topic, it will be
6335"<id>-<topic>" of the change that triggered the submission.
6336The callers must not rely on the format of the submission ID.
Edwin Kempinaab27d32020-01-29 13:17:04 +01006337|`cherry_pick_of_change` |optional|
Kaushik Lingarkar73bcb412020-01-29 13:00:46 -08006338The numeric Change-Id of the change that this change was cherry-picked from.
Edwin Kempinaab27d32020-01-29 13:17:04 +01006339|`cherry_pick_of_patch_set`|optional|
Kaushik Lingarkar73bcb412020-01-29 13:00:46 -08006340The patchset number of the change that this change was cherry-picked from.
Edwin Kempinaab27d32020-01-29 13:17:04 +01006341|`contains_git_conflicts` |optional, not set if `false`|
6342Whether the change contains conflicts. +
6343If `true`, some of the file contents of the change contain git conflict
6344markers to indicate the conflicts. +
6345Only set if this change info is returned in response to a request that
6346creates a new change or patch set and conflicts are allowed. In
6347particular this field is only populated if the change info is returned
6348by one of the following REST endpoints: link:#create-change[Create
6349Change], link:#create-merge-patch-set-for-change[Create Merge Patch Set
6350For Change], link:#cherry-pick[Cherry Pick Revision],
6351link:rest-api-project.html#cherry-pick-commit[Cherry Pick Commit]
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006352|==================================
6353
6354[[change-input]]
6355=== ChangeInput
6356The `ChangeInput` entity contains information about creating a new change.
6357
6358[options="header",cols="1,^1,5"]
6359|==================================
6360|Field Name ||Description
6361|`project` ||The name of the project.
6362|`branch` ||
6363The name of the target branch. +
6364The `refs/heads/` prefix is omitted.
6365|`subject` ||
Edwin Kempinba8388c2020-03-06 08:46:59 +01006366The commit message of the change. Comment lines (beginning with `#`)
6367will be removed. If the commit message contains a Change-Id (as a
6368"Change-Id: I..." footer) that Change-Id will be used for the newly
6369created changed. If a change with this Change-Id already exists for
6370same repository and branch, the request is rejected since Change-Ids
6371must be unique per repository and branch. If the commit message doesn't
6372contain a Change-Id, a newly generated Change-Id is automatically
6373inserted into the commit message.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006374|`topic` |optional|The topic to which this change belongs.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02006375Topic can't contain quotation marks.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006376|`status` |optional, default to `NEW`|
David Ostrovsky4b44bdc2017-07-27 08:05:43 +02006377The status of the change (only `NEW` accepted here).
Edwin Kempin14d50ed2017-05-03 13:26:30 +02006378|`is_private` |optional, default to `false`|
6379Whether the new change should be marked as private.
6380|`work_in_progress` |optional, default to `false`|
6381Whether the new change should be set to work in progress.
David Ostrovsky9d8ec422014-12-24 00:52:09 +01006382|`base_change` |optional|
6383A link:#change-id[\{change-id\}] that identifies the base change for a create
Aaron Gablee8e73282018-04-26 11:09:30 -07006384change operation. Mutually exclusive with `base_commit`.
6385|`base_commit` |optional|
6386A 40-digit hex SHA-1 of the commit which will be the parent commit of the newly
6387created change. If set, it must be a merged commit on the destination branch.
6388Mutually exclusive with `base_change`.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006389|`new_branch` |optional, default to `false`|
Edwin Kempine94bb872019-10-08 13:47:41 +02006390Allow creating a new branch when set to `true`. Using this option is
6391only possible for non-merge commits (if the `merge` field is not set).
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006392|`merge` |optional|
6393The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempine94bb872019-10-08 13:47:41 +02006394If set, the target branch (see `branch` field) must exist (it is not
6395possible to create it automatically by setting the `new_branch` field
6396to `true`.
Han-Wen Nienhuys2a1029e2020-01-30 18:52:45 +01006397|`author` |optional|
6398An link:rest-api-accounts.html#account-input[AccountInput] entity
6399that will set the author of the commit to create. The author must be
6400specified as name/email combination.
6401The caller needs "Forge Author" permission when using this field.
6402This field does not affect the owner of the change, which will
6403continue to use the identity of the caller.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01006404|`notify` |optional|
6405Notify handling that defines to whom email notifications should be sent
6406after the change is created. +
6407Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6408If not set, the default is `ALL`.
6409|`notify_details` |optional|
6410Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03006411as a map of link:user-notify.html#recipient-types[recipient type] to
6412link:#notify-info[NotifyInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01006413|==================================
6414
John Spurlock74a70cc2013-03-23 16:41:50 -04006415[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006416=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04006417The `ChangeMessageInfo` entity contains information about a message
6418attached to a change.
6419
David Pursehouseae367192014-11-25 17:24:47 +09006420[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04006421|==================================
6422|Field Name ||Description
6423|`id` ||The ID of the message.
6424|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07006425Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04006426link:rest-api-accounts.html#account-info[AccountInfo] entity. +
6427Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01006428|`real_author` |optional|
6429Real author of the message as an
6430link:rest-api-accounts.html#account-info[AccountInfo] entity. +
6431Set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04006432|`date` ||
6433The link:rest-api.html#timestamp[timestamp] this message was posted.
6434|`message` ||The text left by the user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006435|`tag` |optional|
6436Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006437while posting the review. Votes/comments that contain `tag` with
6438'autogenerated:' prefix can be filtered out in the web UI.
6439NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006440invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04006441|`_revision_number` |optional|
6442Which patchset (if any) generated this message.
6443|==================================
6444
Gustaf Lundh019fb262012-11-28 14:20:22 +01006445[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006446=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01006447The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
6448
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006449[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01006450|===========================
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006451|Field Name ||Description
Edwin Kempin159804b2019-09-23 11:09:39 +02006452|`message` |optional|
6453Commit message for the cherry-pick change. If not set, the commit message of
6454the cherry-picked commit is used.
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006455|`destination` ||Destination branch
Changcheng Xiaoe3332582017-05-26 15:29:41 +02006456|`base` |optional|
645740-hex digit SHA-1 of the commit which will be the parent commit of the newly created change.
6458If set, it must be a merged commit or a change revision on the destination branch.
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006459|`parent` |optional, defaults to 1|
6460Number of the parent relative to which the cherry-pick should be considered.
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02006461|`notify` |optional|
6462Notify handling that defines to whom email notifications should be sent
6463after the cherry-pick. +
6464Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Saša Živkov357e2bd2020-06-12 12:06:07 +02006465If not set, the default is `ALL`.
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02006466|`notify_details` |optional|
6467Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006468of link:user-notify.html#recipient-types[recipient type] to
6469link:#notify-info[NotifyInfo] entity.
Aaron Gable54bc9832017-07-05 14:44:36 -07006470|`keep_reviewers` |optional, defaults to false|
Edwin Kempin5ac370d2018-10-05 13:39:34 +02006471If `true`, carries reviewers and ccs over from original change to newly created one.
6472|`allow_conflicts` |optional, defaults to false|
6473If `true`, the cherry-pick uses content merge and succeeds also if
6474there are conflicts. If there are conflicts the file contents of the
6475created change contain git conflict markers to indicate the conflicts.
6476Callers can find out if there were conflicts by checking the
Edwin Kempinaab27d32020-01-29 13:17:04 +01006477`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. If
6478there are conflicts the cherry-pick change is marked as
Edwin Kempin3c4113a2018-10-12 10:49:33 +02006479work-in-progress.
Gal Paikinf3abd3c2020-03-24 16:39:20 +01006480|`topic` |optional|
6481The topic of the created cherry-picked change. If not set, the default depends
6482on the source. If the source is a change with a topic, the resulting topic
6483of the cherry-picked change will be {source_change_topic}-{destination_branch}.
6484Otherwise, if the source change has no topic, or the source is a commit,
6485the created change will have no topic.
Gal Paikin1f83c202020-03-31 16:23:41 +02006486If the change already exists, the topic will not change if not set. If set, the
6487topic will be overridden.
Gal Paikin626abe02020-04-07 12:21:26 +02006488|`allow_empty` |optional, defaults to false|
6489If `true`, the cherry-pick succeeds also if the created commit will be empty.
6490If `false`, a cherry-pick that would create an empty commit fails without creating
6491the commit.
Gustaf Lundh019fb262012-11-28 14:20:22 +01006492|===========================
6493
Edwin Kempincb6724a2013-02-26 16:58:51 +01006494[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006495=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05006496The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006497
David Pursehouseae367192014-11-25 17:24:47 +09006498[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01006499|===========================
6500|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07006501|`patch_set` |optional|
6502The patch set number for the comment; only set in contexts where +
6503comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04006504|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006505|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01006506link:#file-id[The file path] for which the inline comment was done. +
Edwin Kempincb6724a2013-02-26 16:58:51 +01006507Not set if returned in a map where the key is the file path.
6508|`side` |optional|
6509The side on which the comment was added. +
6510Allowed values are `REVISION` and `PARENT`. +
6511If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01006512|`parent` |optional|
6513The 1-based parent number. Used only for merge commits when `side == PARENT`.
6514When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006515|`line` |optional|
6516The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04006517If range is set, this equals the end line of the range. +
6518If neither line nor range is set, it's a file comment.
6519|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09006520The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04006521entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006522|`in_reply_to` |optional|
6523The URL encoded UUID of the comment to which this comment is a reply.
6524|`message` |optional|The comment message.
6525|`updated` ||
6526The link:rest-api.html#timestamp[timestamp] of when this comment was
6527written.
John Spurlock5e402f02013-03-24 11:35:04 -04006528|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09006529The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04006530link:rest-api-accounts.html#account-info[AccountInfo] entity. +
6531Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006532|`tag` |optional|
6533Value of the `tag` field from link:#review-input[ReviewInput] set
6534while posting the review.
Sven Selberg1a6728d2018-09-28 12:30:12 +02006535NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006536invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08006537|`unresolved` |optional|
6538Whether or not the comment must be addressed by the user. The state of
6539resolution of a comment thread is stored in the last comment in that thread
6540chronologically.
Youssef Elghareeb7fdfa442020-02-03 12:00:52 +01006541|`change_message_id` |optional|
Youssef Elghareeb5bd4e4e2020-08-13 17:09:42 +02006542Available with the link:#list-change-comments[list change comments] endpoint.
6543Contains the link:rest-api-changes.html#change-message-info[id] of the change
6544message that this comment is linked to.
Youssef Elghareebb5e42082020-07-09 15:24:01 +02006545|`commit_id` |optional|
6546Hex commit SHA1 (40 characters string) of the commit of the patchset to which
6547this comment applies.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006548|===========================
6549
Edwin Kempin67498de2013-02-25 16:15:34 +01006550[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006551=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03006552The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01006553comment.
6554
David Pursehouseae367192014-11-25 17:24:47 +09006555[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006556|===========================
6557|Field Name ||Description
6558|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01006559The URL encoded UUID of the comment if an existing draft comment should
6560be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01006561|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01006562link:#file-id[The file path] for which the inline comment should be added. +
Edwin Kempin7faf41e2013-02-27 08:17:02 +01006563Doesn't need to be set if contained in a map where the key is the file
6564path.
Edwin Kempin67498de2013-02-25 16:15:34 +01006565|`side` |optional|
6566The side on which the comment should be added. +
6567Allowed values are `REVISION` and `PARENT`. +
6568If not set, the default is `REVISION`.
6569|`line` |optional|
6570The number of the line for which the comment should be added. +
6571`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04006572If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09006573If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04006574|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09006575The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04006576entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01006577|`in_reply_to` |optional|
6578The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01006579|`updated` |optional|
6580The link:rest-api.html#timestamp[timestamp] of this comment. +
6581Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01006582|`message` |optional|
6583The comment message. +
6584If not set and an existing draft comment is updated, the existing draft
6585comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04006586|`tag` |optional, drafts only|
6587Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
6588inputs; for published comments, use the `tag` field in +
Gal Paikinb2b81f22020-02-26 13:14:08 +01006589link:#review-input[ReviewInput]. Votes/comments that contain `tag` with
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006590'autogenerated:' prefix can be filtered out in the web UI.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08006591|`unresolved` |optional|
6592Whether or not the comment must be addressed by the user. This value will
6593default to false if the comment is an orphan, or the value of the `in_reply_to`
6594comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01006595|===========================
6596
Michael Zhou596c7682013-08-25 05:43:34 -04006597[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006598=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04006599The `CommentRange` entity describes the range of an inline comment.
6600
Quinten Yearsley31786712018-07-16 13:44:33 -07006601The comment range is a range from the start position, specified by `start_line`
6602and `start_character`, to the end position, specified by `end_line` and
6603`end_character`. The start position is *inclusive* and the end position is
6604*exclusive*.
6605
6606So, a range over part of a line will have `start_line` equal to
6607`end_line`; however a range with `end_line` set to 5 and `end_character` equal
6608to 0 will not include any characters on line 5,
6609
David Pursehouseae367192014-11-25 17:24:47 +09006610[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04006611|===========================
Quinten Yearsley31786712018-07-16 13:44:33 -07006612|Field Name ||Description
6613|`start_line` ||The start line number of the range. (1-based)
6614|`start_character` ||The character position in the start line. (0-based)
6615|`end_line` ||The end line number of the range. (1-based)
6616|`end_character` ||The character position in the end line. (0-based)
Michael Zhou596c7682013-08-25 05:43:34 -04006617|===========================
6618
Edwin Kempine3446292013-02-19 16:40:14 +01006619[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006620=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006621The `CommitInfo` entity contains information about a commit.
6622
Edwin Kempinf0c57152015-07-15 18:18:24 +02006623[options="header",cols="1,^1,5"]
6624|===========================
6625|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02006626|`commit` |Optional|
6627The commit ID. Not set if included in a link:#revision-info[
6628RevisionInfo] entity that is contained in a map which has the commit ID
6629as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006630|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01006631The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02006632link:#commit-info[CommitInfo] entities. In each parent
6633only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006634|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01006635link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006636|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01006637link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006638|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01006639The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02006640|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01006641|`web_links` |optional|
6642Links to the commit in external sites as a list of
6643link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006644|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01006645
Patrick Hieselfda96452017-06-14 16:44:54 +02006646[[commit-message-input]]
6647=== CommitMessageInput
6648The `CommitMessageInput` entity contains information for changing
6649the commit message of a change.
6650
6651[options="header",cols="1,^1,5"]
6652|=============================
6653|Field Name ||Description
6654|`message` ||New commit message.
6655|`notify` |optional|
6656Notify handling that defines to whom email notifications should be sent
6657after the commit message was updated. +
6658Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Logan Hanksa1e68dc2017-06-29 15:13:27 -07006659If not set, the default is `OWNER` for WIP changes and `ALL` otherwise.
Patrick Hieselfda96452017-06-14 16:44:54 +02006660|`notify_details`|optional|
6661Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006662of link:user-notify.html#recipient-types[recipient type] to
6663link:#notify-info[NotifyInfo] entity.
Patrick Hieselfda96452017-06-14 16:44:54 +02006664|=============================
6665
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02006666[[delete-change-message-input]]
6667=== DeleteChangeMessageInput
6668The `DeleteChangeMessageInput` entity contains the options for deleting a change message.
6669
6670[options="header",cols="1,^1,5"]
6671|=============================
6672|Field Name ||Description
6673|`reason` |optional|
6674The reason why the change message should be deleted. +
6675If set, the change message will be replaced with
6676"Change message removed by: `name`\nReason: `reason`",
6677or just "Change message removed by: `name`." if not set.
6678|=============================
6679
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01006680[[delete-comment-input]]
6681=== DeleteCommentInput
6682The `DeleteCommentInput` entity contains the option for deleting a comment.
6683
6684[options="header",cols="1,^1,5"]
6685|=============================
6686|Field Name ||Description
6687|`reason` |optional|
6688The reason why the comment should be deleted. +
6689If set, the comment's message will be replaced with
6690"Comment removed by: `name`; Reason: `reason`",
6691or just "Comment removed by: `name`." if not set.
6692|=============================
6693
Edwin Kempin407fca32016-08-29 12:01:00 +02006694[[delete-reviewer-input]]
6695=== DeleteReviewerInput
6696The `DeleteReviewerInput` entity contains options for the deletion of a
6697reviewer.
6698
6699[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006700|=============================
6701|Field Name ||Description
6702|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02006703Notify handling that defines to whom email notifications should be sent
6704after the reviewer is deleted. +
6705Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6706If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006707|`notify_details`|optional|
6708Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006709of link:user-notify.html#recipient-types[recipient type] to
6710link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01006711|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02006712
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006713[[delete-vote-input]]
6714=== DeleteVoteInput
6715The `DeleteVoteInput` entity contains options for the deletion of a
6716vote.
6717
6718[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006719|=============================
6720|Field Name ||Description
6721|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006722The label for which the vote should be deleted. +
6723If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01006724|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006725Notify handling that defines to whom email notifications should be sent
6726after the vote is deleted. +
6727Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6728If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006729|`notify_details`|optional|
6730Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006731of link:user-notify.html#recipient-types[recipient type] to
6732link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01006733|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02006734
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08006735[[description-input]]
6736=== DescriptionInput
6737The `DescriptionInput` entity contains information for setting a description.
6738
6739[options="header",cols="1,6"]
6740|===========================
6741|Field Name |Description
6742|`description` |The description text.
6743|===========================
6744
David Pursehouse882aef22013-06-05 10:56:37 +09006745[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006746=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09006747The `DiffContent` entity contains information about the content differences
6748in a file.
6749
David Pursehouseae367192014-11-25 17:24:47 +09006750[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006751|==========================
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006752|Field Name ||Description
6753|`a` |optional|Content only in the file on side A (deleted in B).
6754|`b` |optional|Content only in the file on side B (added in B).
6755|`ab` |optional|Content in the file on both sides (unchanged).
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02006756|`edit_a` |only present when the `intraline` parameter is set and the
6757DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09006758Text sections deleted from side A as a
6759link:#diff-intraline-info[DiffIntralineInfo] entity.
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02006760|`edit_b` |only present when the `intraline` parameter is set and the
6761DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09006762Text sections inserted in side B as a
6763link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006764|`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a
6765rebase.
6766|`skip` |optional|count of lines skipped on both sides when the file is
David Pursehouse882aef22013-06-05 10:56:37 +09006767too large to include all common lines.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006768|`common` |optional|Set to `true` if the region is common according
Shawn Pearce425a2be2014-01-02 16:00:58 -08006769to the requested ignore-whitespace parameter, but a and b contain
6770differing amounts of whitespace. When present and true a and b are
6771used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09006772|==========================
6773
6774[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006775=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006776The `DiffFileMetaInfo` entity contains meta information about a file diff.
6777
David Pursehouseae367192014-11-25 17:24:47 +09006778[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006779|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006780|Field Name ||Description
6781|`name` ||The name of the file.
6782|`content_type`||The content type of the file.
6783|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01006784|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006785Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07006786link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09006787|==========================
6788
6789[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006790=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006791The `DiffInfo` entity contains information about the diff of a file
6792in a revision.
6793
Edwin Kempin8cdce502014-12-06 10:55:38 +01006794If the link:#weblinks-only[weblinks-only] parameter is specified, only
6795the `web_links` field is set.
6796
David Pursehouseae367192014-11-25 17:24:47 +09006797[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006798|==========================
6799|Field Name ||Description
6800|`meta_a` |not present when the file is added|
6801Meta information about the file on side A as a
6802link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6803|`meta_b` |not present when the file is deleted|
6804Meta information about the file on side B as a
6805link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6806|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
6807`COPIED`, `REWRITE`).
6808|`intraline_status`|only set when the `intraline` parameter was specified in the request|
6809Intraline status (`OK`, `ERROR`, `TIMEOUT`).
6810|`diff_header` ||A list of strings representing the patch set diff header.
6811|`content` ||The content differences in the file as a list of
6812link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01006813|`web_links` |optional|
6814Links to the file diff in external sites as a list of
6815link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01006816|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09006817|==========================
6818
6819[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006820=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006821The `DiffIntralineInfo` entity contains information about intraline edits in a
6822file.
6823
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02006824The information consists of a list of `<skip length, edit length>` pairs, where
David Pursehouse31203f52013-06-08 17:05:45 +09006825the skip length is the number of characters between the end of the previous edit
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02006826and the start of this edit, and the edit length is the number of edited characters
David Pursehouse31203f52013-06-08 17:05:45 +09006827following the skip. The start of the edits is from the beginning of the related
Tao Zhou42430482019-09-13 11:26:01 +02006828diff content lines. If the list is empty, the entire DiffContent should be considered
6829as unedited.
David Pursehouse882aef22013-06-05 10:56:37 +09006830
David Pursehouse31203f52013-06-08 17:05:45 +09006831Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07006832the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09006833
Edwin Kempin8cdce502014-12-06 10:55:38 +01006834[[diff-web-link-info]]
6835=== DiffWebLinkInfo
6836The `DiffWebLinkInfo` entity describes a link on a diff screen to an
6837external site.
6838
6839[options="header",cols="1,6"]
6840|=======================
6841|Field Name|Description
6842|`name` |The link name.
6843|`url` |The link URL.
6844|`image_url`|URL to the icon of the link.
6845|show_on_side_by_side_diff_view|
6846Whether the web link should be shown on the side-by-side diff screen.
6847|show_on_unified_diff_view|
6848Whether the web link should be shown on the unified diff screen.
6849|=======================
6850
David Ostrovsky9ea9c112015-01-25 00:12:38 +01006851[[edit-file-info]]
6852=== EditFileInfo
6853The `EditFileInfo` entity contains additional information
6854of a file within a change edit.
6855
6856[options="header",cols="1,^1,5"]
6857|===========================
6858|Field Name ||Description
6859|`web_links` |optional|
6860Links to the diff info in external sites as a list of
6861link:#web-link-info[WebLinkInfo] entities.
6862|===========================
6863
Edwin Kempin521c1242015-01-23 12:44:44 +01006864[[edit-info]]
6865=== EditInfo
6866The `EditInfo` entity contains information about a change edit.
6867
6868[options="header",cols="1,^1,5"]
6869|===========================
David Pursehouse5934d3f2019-01-07 15:23:49 +09006870|Field Name ||Description
6871|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01006872link:#commit-info[CommitInfo] entity.
David Pursehouse5934d3f2019-01-07 15:23:49 +09006873|`base_patch_set_number`||The patch set number of the patch set the change edit is based on.
6874|`base_revision` ||The revision of the patch set the change edit is based on.
David Pursehouse1bb55ff2019-01-07 15:28:22 +09006875|`ref` ||The ref of the change edit.
David Pursehouse5934d3f2019-01-07 15:23:49 +09006876|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006877Information about how to fetch this patch set. The fetch information is
6878provided as a map that maps the protocol name ("`git`", "`http`",
6879"`ssh`") to link:#fetch-info[FetchInfo] entities.
David Pursehouse5934d3f2019-01-07 15:23:49 +09006880|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006881The files of the change edit as a map that maps the file names to
6882link:#file-info[FileInfo] entities.
6883|===========================
6884
Edwin Kempine3446292013-02-19 16:40:14 +01006885[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006886=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006887The `FetchInfo` entity contains information about how to fetch a patch
6888set via a certain protocol.
6889
David Pursehouseae367192014-11-25 17:24:47 +09006890[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006891|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02006892|Field Name ||Description
6893|`url` ||The URL of the project.
6894|`ref` ||The ref of the patch set.
6895|`commands` |optional|
6896The download commands for this patch set as a map that maps the command
6897names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09006898Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006899|==========================
6900
6901[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006902=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006903The `FileInfo` entity contains information about a file in a patch set.
6904
David Pursehouseae367192014-11-25 17:24:47 +09006905[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006906|=============================
6907|Field Name ||Description
6908|`status` |optional|
6909The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
6910"`C`"=Copied, "`W`"=Rewritten). +
6911Not set if the file was Modified ("`M`").
6912|`binary` |not set if `false`|Whether the file is binary.
6913|`old_path` |optional|
6914The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05006915Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01006916|`lines_inserted`|optional|
6917Number of inserted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02006918Not set for binary files or if no lines were inserted. +
6919An empty last line is not included in the count and hence this number can
6920differ by one from details provided in <<#diff-info,DiffInfo>>.
Edwin Kempine3446292013-02-19 16:40:14 +01006921|`lines_deleted` |optional|
6922Number of deleted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02006923Not set for binary files or if no lines were deleted. +
6924An empty last line is not included in the count and hence this number can
6925differ by one from details provided in <<#diff-info,DiffInfo>>.
Edwin Kempin640f9842015-10-08 15:53:20 +02006926|`size_delta` ||
6927Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01006928|`size` ||
6929File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01006930|=============================
6931
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006932[[fix-input]]
6933=== FixInput
6934The `FixInput` entity contains options for fixing commits using the
6935link:#fix-change[fix change] endpoint.
6936
6937[options="header",cols="1,6"]
6938|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006939|Field Name |Description
6940|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006941database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006942|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07006943merged into the destination branch as this exact SHA-1. If not, insert
6944a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006945|==========================
6946
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006947[[fix-suggestion-info]]
6948=== FixSuggestionInfo
6949The `FixSuggestionInfo` entity represents a suggested fix.
6950
6951[options="header",cols="1,^1,5"]
6952|==========================
6953|Field Name ||Description
6954|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
6955fix. It will be generated automatically and hence will be ignored if it's set
6956for input objects.
6957|`description` ||A description of the suggested fix.
6958|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006959entities indicating how the content of one or several files should be modified.
6960Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006961|==========================
6962
6963[[fix-replacement-info]]
6964=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01006965The `FixReplacementInfo` entity describes how the content of a file should be
6966replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006967
6968[options="header",cols="1,6"]
6969|==========================
6970|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006971|`path` |The path of the file which should be modified. Any file in
6972the repository may be modified.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006973|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01006974of the file should be replaced. Lines in the file are assumed to be separated
6975by the line feed character, the carriage return character, the carriage return
6976followed by the line feed character, or one of the other Unicode linebreak
6977sequences supported by Java.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006978|`replacement` |The content which should be used instead of the current one.
6979|==========================
6980
Edwin Kempine3446292013-02-19 16:40:14 +01006981[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006982=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006983The `GitPersonInfo` entity contains information about the
6984author/committer of a commit.
6985
David Pursehouseae367192014-11-25 17:24:47 +09006986[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01006987|==========================
6988|Field Name |Description
6989|`name` |The name of the author/committer.
6990|`email` |The email address of the author/committer.
6991|`date` |The link:rest-api.html#timestamp[timestamp] of when
6992this identity was constructed.
6993|`tz` |The timezone offset from UTC of when this identity was
6994constructed.
6995|==========================
6996
Edwin Kempin521c1242015-01-23 12:44:44 +01006997[[group-base-info]]
6998=== GroupBaseInfo
6999The `GroupBaseInfo` entity contains base information about the group.
7000
7001[options="header",cols="1,6"]
7002|==========================
7003|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01007004|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01007005|`name` |The name of the group.
7006|==========================
7007
David Pursehoused9dac372016-11-24 19:41:10 +09007008[[hashtags-input]]
7009=== HashtagsInput
7010
7011The `HashtagsInput` entity contains information about hashtags to add to,
7012and/or remove from, a change.
7013
7014[options="header",cols="1,^1,5"]
7015|=======================
7016|Field Name||Description
7017|`add` |optional|The list of hashtags to be added to the change.
7018|`remove |optional|The list of hashtags to be removed from the change.
7019|=======================
7020
Edwin Kempin521c1242015-01-23 12:44:44 +01007021[[included-in-info]]
7022=== IncludedInInfo
7023The `IncludedInInfo` entity contains information about the branches a
7024change was merged into and tags it was tagged with.
7025
Edwin Kempin78279ba2015-05-22 15:22:41 +02007026[options="header",cols="1,^1,5"]
7027|=======================
7028|Field Name||Description
7029|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01007030Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007031|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01007032Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007033|`external`|optional|A map that maps a name to a list of external
7034systems that include this change, e.g. a list of servers on which this
7035change is deployed.
7036|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01007037
Edwin Kempine3446292013-02-19 16:40:14 +01007038[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007039=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07007040The `LabelInfo` entity contains information about a label on a change, always
7041corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01007042
Dave Borowitz88159512013-06-14 14:21:50 -07007043There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07007044link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07007045
7046* For a quick summary of the state of labels, use `LABELS`.
7047* For detailed information about labels, including exact numeric votes for all
7048 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
7049
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007050==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09007051[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007052|===========================
7053|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01007054|`optional` |not set if `false`|
7055Whether the label is optional. Optional means the label may be set, but
7056it's neither necessary for submission nor does it block submission if
7057set.
Dave Borowitz88159512013-06-14 14:21:50 -07007058|===========================
7059
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007060==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09007061[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07007062|===========================
7063|Field Name ||Description
7064|`approved` |optional|One user who approved this label on the change
7065(voted the maximum value) as an
7066link:rest-api-accounts.html#account-info[AccountInfo] entity.
7067|`rejected` |optional|One user who rejected this label on the change
7068(voted the minimum value) as an
7069link:rest-api-accounts.html#account-info[AccountInfo] entity.
7070|`recommended` |optional|One user who recommended this label on the
7071change (voted positively, but not the maximum value) as an
7072link:rest-api-accounts.html#account-info[AccountInfo] entity.
7073|`disliked` |optional|One user who disliked this label on the change
7074(voted negatively, but not the minimum value) as an
7075link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01007076|`blocking` |optional|If `true`, the label blocks submit operation.
7077If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07007078|`value` |optional|The voting value of the user who
7079recommended/disliked this label on the change if it is not
7080"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07007081|`default_value`|optional|The default voting value for the label.
7082This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07007083|===========================
7084
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007085==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09007086[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07007087|===========================
7088|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01007089|`all` |optional|List of all approvals for this label as a list
Aaron Gableea8a2112017-04-25 14:18:16 -07007090of link:#approval-info[ApprovalInfo] entities. Items in this list may
7091not represent actual votes cast by users; if a user votes on any label,
7092a corresponding ApprovalInfo will appear in this list for all labels.
Edwin Kempine3446292013-02-19 16:40:14 +01007093|`values` |optional|A map of all values that are allowed for this
7094label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07007095to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01007096|===========================
7097
Saša Živkov499873f2014-05-05 13:34:18 +02007098[[mergeable-info]]
7099=== MergeableInfo
7100The `MergeableInfo` entity contains information about the mergeability of a
7101change.
7102
David Pursehouseae367192014-11-25 17:24:47 +09007103[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02007104|============================
Saša Živkov697cab22014-04-29 16:46:50 +02007105|Field Name ||Description
7106|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02007107Submit type used for this change, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02007108`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Saša Živkov499873f2014-05-05 13:34:18 +02007109`CHERRY_PICK`.
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007110|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007111The strategy of the merge, can be `recursive`, `resolve`,
7112`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02007113|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02007114`true` if this change is cleanly mergeable, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007115|`commit_merged` |optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07007116`true` if this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007117|`content_merged`|optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07007118`true` if the content of this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007119|`conflicts` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007120A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02007121|`mergeable_into`|optional|
7122A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02007123|============================
Dave Borowitz88159512013-06-14 14:21:50 -07007124
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007125[[merge-input]]
7126=== MergeInput
7127The `MergeInput` entity contains information about the merge
7128
7129[options="header",cols="1,^1,5"]
Edwin Kempinaab27d32020-01-29 13:17:04 +01007130|==============================
7131|Field Name ||Description
7132|`source` ||
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007133The source to merge from, e.g. a complete or abbreviated commit SHA-1,
David Pursehouse4abaef932018-03-18 15:05:08 +09007134a complete reference name, a short reference name under `refs/heads`, `refs/tags`,
7135or `refs/remotes` namespace, etc.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007136|`source_branch` |optional|
Han-Wen Nienhuys9ec1f6a2020-01-07 17:32:08 +01007137A branch from which `source` is reachable. If specified,
7138`source` is checked for visibility and reachability against only this
7139branch. This speeds up the operation, especially for large repos with
7140many branches.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007141|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007142The strategy of the merge, can be `recursive`, `resolve`,
7143`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007144|`allow_conflicts`|optional, defaults to false|
7145If `true`, creating the merge succeeds also if there are conflicts. +
7146If there are conflicts the file contents of the created change contain
7147git conflict markers to indicate the conflicts. +
7148Callers can find out whether there were conflicts by checking the
7149`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. +
7150If there are conflicts the change is marked as work-in-progress. +
7151This option is not supported for all merge strategies (e.g. it's
7152supported for `recursive` and `resolve`, but not for
7153`simple-two-way-in-core`).
7154|==============================
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007155
Zhen Chenb1e07e52016-09-23 12:59:48 -07007156[[merge-patch-set-input]]
7157=== MergePatchSetInput
7158The `MergePatchSetInput` entity contains information about updating a new
7159change by creating a new merge commit.
7160
7161[options="header",cols="1,^1,5"]
7162|==================================
7163|Field Name ||Description
7164|`subject` |optional|
7165The new subject for the change, if not specified, will reuse the current patch
7166set's subject
Han-Wen Nienhuysbd2af0c2020-01-09 16:39:26 +01007167|`inherit_parent` |optional, default to `false`|
Zhen Chenb1e07e52016-09-23 12:59:48 -07007168Use the current patch set's first parent as the merge tip when set to `true`.
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02007169|`base_change` |optional|
Han-Wen Nienhuys69917fe2020-01-09 16:39:26 +01007170A link:#change-id[\{change-id\}] that identifies a change. When `inherit_parent`
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02007171is `false`, the merge tip will be the current patch set of the `base_change` if
7172it's set. Otherwise, the current branch tip of the destination branch will be used.
Zhen Chenb1e07e52016-09-23 12:59:48 -07007173|`merge` ||
7174The detail of the source commit for merge as a link:#merge-input[MergeInput]
7175entity.
7176|==================================
7177
Raviteja Sunkara791f3392015-11-03 13:24:50 +05307178[[move-input]]
7179=== MoveInput
7180The `MoveInput` entity contains information for moving a change to a new branch.
7181
7182[options="header",cols="1,^1,5"]
7183|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04007184|Field Name ||Description
7185|`destination_branch`||Destination branch
7186|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05307187A message to be posted in this change's comments
7188|===========================
7189
Edwin Kempincd07df42016-12-01 09:10:09 +01007190[[notify-info]]
7191=== NotifyInfo
7192The `NotifyInfo` entity contains detailed information about who should
7193be notified about an update. These notifications are sent out even if a
7194`notify` option in the request input disables normal notifications.
7195`NotifyInfo` entities are normally contained in a `notify_details` map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007196in the request input where the key is the
7197link:user-notify.html#recipient-types[recipient type].
Edwin Kempincd07df42016-12-01 09:10:09 +01007198
7199[options="header",cols="1,^1,5"]
7200|=======================
7201|Field Name||Description
7202|`accounts`|optional|
7203A list of link:rest-api-accounts.html#account-id[account IDs] that
7204identify the accounts that should be should be notified.
7205|=======================
7206
Edwin Kempin364a86b2017-04-27 12:34:00 +02007207[[private-input]]
7208=== PrivateInput
7209The `PrivateInput` entity contains information for changing the private
7210flag on a change.
7211
7212[options="header",cols="1,^1,5"]
7213|=======================
7214|Field Name||Description
7215|`message` |optional|Message describing why the private flag was changed.
7216|=======================
7217
Edwin Kempin521c1242015-01-23 12:44:44 +01007218[[problem-info]]
7219=== ProblemInfo
7220The `ProblemInfo` entity contains a description of a potential consistency problem
7221with a change. These are not related to the code review process, but rather
7222indicate some inconsistency in Gerrit's database or repository metadata related
7223to the enclosing change.
7224
7225[options="header",cols="1,^1,5"]
7226|===========================
7227|Field Name||Description
7228|`message` ||Plaintext message describing the problem with the change.
7229|`status` |optional|
7230The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
7231fix was attempted.
7232|`outcome` |optional|
7233If `status` is set, an additional plaintext message describing the
7234outcome of the fix.
7235|===========================
7236
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02007237[[publish-change-edit-input]]
7238=== PublishChangeEditInput
7239The `PublishChangeEditInput` entity contains options for the publishing of
7240change edit.
7241
7242[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007243|=============================
7244|Field Name ||Description
7245|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02007246Notify handling that defines to whom email notifications should be sent
7247after the change edit is published. +
7248Allowed values are `NONE` and `ALL`. +
7249If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007250|`notify_details`|optional|
7251Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007252of link:user-notify.html#recipient-types[recipient type] to
7253link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007254|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02007255
Patrick Hieselbb84fd72017-08-23 11:11:22 +02007256[[pure-revert-info]]
7257=== PureRevertInfo
7258The `PureRevertInfo` entity describes the result of a pure revert check.
7259
7260[options="header",cols="1,6"]
7261|======================
7262|Field Name |Description
7263|`is_pure_revert` |Outcome of the check as boolean.
7264|======================
7265
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04007266[[push-certificate-info]]
7267=== PushCertificateInfo
7268The `PushCertificateInfo` entity contains information about a push
7269certificate provided when the user pushed for review with `git push
7270--signed HEAD:refs/for/<branch>`. Only used when signed push is
7271link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
7272
7273[options="header",cols="1,6"]
7274|===========================
7275|Field Name|Description
7276|`certificate`|Signed certificate payload and GPG signature block.
7277|`key` |
7278Information about the key that signed the push, along with any problems
7279found while checking the signature or the key itself, as a
7280link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
7281|===========================
7282
Gabor Somossyb72d4c62015-10-20 23:40:07 +01007283[[range-info]]
7284=== RangeInfo
7285The `RangeInfo` entity stores the coordinates of a range.
7286
7287[options="header",cols="1,6"]
7288|===========================
7289|Field Name | Description
7290|`start` | First index.
7291|`end` | Last index.
7292|===========================
7293
Zalan Blenessy874aed72015-01-12 13:26:18 +01007294[[rebase-input]]
7295=== RebaseInput
7296The `RebaseInput` entity contains information for changing parent when rebasing.
7297
7298[options="header",width="50%",cols="1,^1,5"]
7299|===========================
7300|Field Name ||Description
7301|`base` |optional|
7302The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
7303Alternatively, a change number can be specified, in which case the current
7304patch set is inferred. +
7305Empty string is used for rebasing directly on top of the target branch,
7306which effectively breaks dependency towards a parent change.
7307|===========================
7308
Edwin Kempin521c1242015-01-23 12:44:44 +01007309[[related-change-and-commit-info]]
7310=== RelatedChangeAndCommitInfo
7311
7312The `RelatedChangeAndCommitInfo` entity contains information about
7313a related change and commit.
7314
7315[options="header",cols="1,^1,5"]
7316|===========================
7317|Field Name ||Description
Patrick Hieselcab63512017-07-28 10:25:42 +02007318|`project` ||The project of the change or commit.
Edwin Kempin521c1242015-01-23 12:44:44 +01007319|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01007320|`commit` ||The commit as a
7321link:#commit-info[CommitInfo] entity.
7322|`_change_number` |optional|The change number.
7323|`_revision_number` |optional|The revision number.
7324|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07007325|`status` |optional|The status of the change. The status of
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01007326the change is one of (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempin521c1242015-01-23 12:44:44 +01007327|===========================
7328
7329[[related-changes-info]]
7330=== RelatedChangesInfo
7331The `RelatedChangesInfo` entity contains information about related
7332changes.
7333
7334[options="header",cols="1,6"]
7335|===========================
7336|Field Name |Description
7337|`changes` |A list of
7338link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
7339describing the related changes. Sorted by git commit order, newest to
7340oldest. Empty if there are no related changes.
7341|===========================
7342
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01007343
7344[[requirement]]
7345=== Requirement
7346The `Requirement` entity contains information about a requirement relative to a change.
7347
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01007348[options="header",cols="1,^1,5"]
7349|===========================
7350|Field Name | |Description
7351|`status` | | Status of the requirement. Can be either `OK`, `NOT_READY` or `RULE_ERROR`.
7352|`fallbackText` | | A human readable reason
7353|`type` | |
7354Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it
7355was triggered. Can be seen as a class: requirements sharing the same type were created for a similar
7356reason, and the data structure will follow one set of rules.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01007357|===========================
7358
7359
Edwin Kempined5364b2013-02-22 10:39:33 +01007360[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007361=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01007362The `RestoreInput` entity contains information for restoring a change.
7363
David Pursehouseae367192014-11-25 17:24:47 +09007364[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01007365|===========================
7366|Field Name ||Description
7367|`message` |optional|
7368Message to be added as review comment to the change when restoring the
7369change.
7370|===========================
7371
Edwin Kempind2ec4152013-02-22 12:17:19 +01007372[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007373=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01007374The `RevertInput` entity contains information for reverting a change.
7375
David Pursehouseae367192014-11-25 17:24:47 +09007376[options="header",cols="1,^1,5"]
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01007377|=============================
7378|Field Name ||Description
7379|`message` |optional|
Edwin Kempind2ec4152013-02-22 12:17:19 +01007380Message to be added as review comment to the change when reverting the
7381change.
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01007382|`notify` |optional|
7383Notify handling that defines to whom email notifications should be sent
7384for reverting the change. +
7385Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7386If not set, the default is `ALL`.
7387|`notify_details`|optional|
7388Additional information about whom to notify about the revert as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007389of link:user-notify.html#recipient-types[recipient type] to
7390link:#notify-info[NotifyInfo] entity.
Gal Paikincc93c562019-10-09 13:24:12 +02007391|`topic` |optional|
Gal Paikinb81f56c2019-10-16 14:39:24 +02007392Name of the topic for the revert change. If not set, the default for Revert
7393endpoint is the topic of the change being reverted, and the default for the
7394RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02007395Topic can't contain quotation marks.
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02007396|=============================
Gal Paikinb81f56c2019-10-16 14:39:24 +02007397
7398[[revert-submission-info]]
7399=== RevertSubmissionInfo
Gal Paikin64777c72019-12-18 14:11:13 +01007400The `RevertSubmissionInfo` entity describes the revert changes.
Gal Paikinb81f56c2019-10-16 14:39:24 +02007401
7402[options="header",cols="1,6"]
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02007403|==============================
Gal Paikinb81f56c2019-10-16 14:39:24 +02007404|Field Name | Description
7405|`revert_changes` |
Edwin Kempin6e7fb4e2019-10-24 17:20:51 +02007406A list of link:#change-info[ChangeInfo] that describes the revert changes. Each
7407entity in that list is a revert change that was created in that revert
7408submission.
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02007409|==============================
Edwin Kempind2ec4152013-02-22 12:17:19 +01007410
Edwin Kempin67498de2013-02-25 16:15:34 +01007411[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007412=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01007413The `ReviewInfo` entity contains information about a review.
7414
David Pursehouseae367192014-11-25 17:24:47 +09007415[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01007416|===========================
7417|Field Name |Description
7418|`labels` |
7419The labels of the review as a map that maps the label names to the
7420voting values.
7421|===========================
7422
Viktar Donich316bf7a2016-07-06 11:29:01 -07007423[[review-update-info]]
7424=== ReviewerUpdateInfo
7425The `ReviewerUpdateInfo` entity contains information about updates to
7426change's reviewers set.
7427
7428[options="header",cols="1,6"]
7429|===========================
7430|Field Name |Description
7431|`updated`|
7432Timestamp of the update.
7433|`updated_by`|
7434The account which modified state of the reviewer in question as
7435link:rest-api-accounts.html#account-info[AccountInfo] entity.
7436|`reviewer`|
7437The reviewer account added or removed from the change as an
7438link:rest-api-accounts.html#account-info[AccountInfo] entity.
7439|`state`|
7440The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
7441|===========================
7442
Edwin Kempin67498de2013-02-25 16:15:34 +01007443[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007444=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01007445The `ReviewInput` entity contains information for adding a review to a
7446revision.
7447
David Pursehouseae367192014-11-25 17:24:47 +09007448[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01007449|============================
Gal Paikin3e984c22020-07-03 16:44:40 +03007450|Field Name ||Description
7451|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007452The message to be added as review comment.
Gal Paikin3e984c22020-07-03 16:44:40 +03007453|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007454Apply this tag to the review comment message, votes, and inline
7455comments. Tags may be used by CI or other automated systems to
Vitaliy Lotorevea882812018-06-28 20:16:39 +00007456distinguish them from human reviews. Votes/comments that contain `tag` with
7457'autogenerated:' prefix can be filtered out in the web UI.
Gal Paikin3e984c22020-07-03 16:44:40 +03007458|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007459The votes that should be added to the revision as a map that maps the
7460label names to the voting values.
Gal Paikin3e984c22020-07-03 16:44:40 +03007461|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007462The comments that should be added as a map that maps a file path to a
7463list of link:#comment-input[CommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03007464|`robot_comments` |optional|
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007465The robot comments that should be added as a map that maps a file path
7466to a list of link:#robot-comment-input[RobotCommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03007467|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007468Draft handling that defines how draft comments are handled that are
7469already in the database but that were not also described in this
7470input. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05007471Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values
7472except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04007473Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05007474If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value
7475besides `KEEP` is allowed.
Gal Paikin3e984c22020-07-03 16:44:40 +03007476|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007477Notify handling that defines to whom email notifications should be sent
7478after the review is stored. +
7479Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7480If not set, the default is `ALL`.
Gal Paikin3e984c22020-07-03 16:44:40 +03007481|`notify_details` |optional|
Edwin Kempincd07df42016-12-01 09:10:09 +01007482Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007483of link:user-notify.html#recipient-types[recipient type] to
7484link:#notify-info[NotifyInfo] entity.
Gal Paikin3e984c22020-07-03 16:44:40 +03007485|`omit_duplicate_comments` |optional|
Bill Wendling692b4ec2015-10-19 15:40:57 -07007486If `true`, comments with the same content at the same place will be omitted.
Gal Paikin3e984c22020-07-03 16:44:40 +03007487|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07007488link:rest-api-accounts.html#account-id[\{account-id\}] the review
7489should be posted on behalf of. To use this option the caller must
7490have been granted `labelAs-NAME` permission for all keys of labels.
Gal Paikin3e984c22020-07-03 16:44:40 +03007491|`reviewers` |optional|
Patrick Hieselcf6d9352017-04-13 10:15:42 +02007492A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
7493representing reviewers that should be added to the change.
Gal Paikin3e984c22020-07-03 16:44:40 +03007494|`ready` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07007495If true, and if the change is work in progress, then start review.
7496It is an error for both `ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03007497|`work_in_progress` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07007498If true, mark the change as work in progress. It is an error for both
7499`ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03007500|`add_to_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03007501list of link:#attention-set-input[AttentionSetInput] entities to add
7502to the link:#attention-set[attention set].
Gal Paikin3e984c22020-07-03 16:44:40 +03007503|`remove_from_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03007504list of link:#attention-set-input[AttentionSetInput] entities to remove
7505from the link:#attention-set[attention set].
Gal Paikin3e984c22020-07-03 16:44:40 +03007506|`ignore_automatic_attention_set_rules`|optional|
7507If set to true, ignore all automatic attention set rules described in the
Gal Paikinc326de42020-06-16 18:49:00 +03007508link:#attention-set[attention set]. Updates in add_to_attention_set
7509and remove_from_attention_set are not ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01007510|============================
7511
Aaron Gable843b0c12017-04-21 08:25:27 -07007512[[review-result]]
7513=== ReviewResult
7514The `ReviewResult` entity contains information regarding the updates
7515that were made to a review.
7516
7517[options="header",cols="1,^1,5"]
7518|============================
7519|Field Name ||Description
7520|`labels` |optional|
7521Map of labels to values after the review was posted. Null if any reviewer
7522additions were rejected.
7523|`reviewers` |optional|
7524Map of account or group identifier to
7525link:rest-api-changes.html#add-reviewer-result[AddReviewerResult]
7526representing the outcome of adding as a reviewer.
7527Absent if no reviewer additions were requested.
Logan Hankse81ad8e2017-07-18 09:45:46 -07007528|`ready` |optional|
7529If true, the change was moved from WIP to ready for review as a result of this
7530action. Not set if false.
Aaron Gable843b0c12017-04-21 08:25:27 -07007531|============================
7532
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007533[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007534=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007535The `ReviewerInfo` entity contains information about a reviewer and its
7536votes on a change.
7537
Edwin Kempin963dfd02013-02-27 12:39:32 +01007538`ReviewerInfo` has the same fields as
7539link:rest-api-accounts.html#account-info[AccountInfo] and includes
7540link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007541In addition `ReviewerInfo` has the following fields:
7542
David Pursehouseae367192014-11-25 17:24:47 +09007543[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007544|==========================
7545|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007546|`approvals` |
7547The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09007548approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01007549|`_account_id` |
7550This field is inherited from `AccountInfo` but is optional here if an
7551unregistered reviewer was added by email. See
7552link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007553|==========================
7554
Edwin Kempin392328e2013-02-25 12:50:03 +01007555[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007556=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01007557The `ReviewerInput` entity contains information for adding a reviewer
7558to a change.
7559
David Pursehouseae367192014-11-25 17:24:47 +09007560[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007561|=============================
7562|Field Name ||Description
7563|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01007564The link:rest-api-accounts.html#account-id[ID] of one account that
7565should be added as reviewer or the link:rest-api-groups.html#group-id[
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01007566ID] of one internal group for which all members should be added as reviewers. +
Edwin Kempin392328e2013-02-25 12:50:03 +01007567If an ID identifies both an account and a group, only the account is
7568added as reviewer to the change.
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01007569External groups, such as LDAP groups, will be silently omitted from a
7570link:#set-review[set-review] or
7571link:rest-api-changes.html#add-reviewer[add-reviewer] call.
Edwin Kempincd07df42016-12-01 09:10:09 +01007572|`state` |optional|
Logan Hanksee0a4182016-07-06 14:39:26 -07007573Add reviewer in this state. Possible reviewer states are `REVIEWER`
7574and `CC`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007575|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01007576Whether adding the reviewer is confirmed. +
7577The Gerrit server may be configured to
7578link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
7579confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01007580|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02007581Notify handling that defines to whom email notifications should be sent
7582after the reviewer is added. +
7583Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7584If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007585|`notify_details`|optional|
7586Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007587of link:user-notify.html#recipient-types[recipient type] to
7588link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007589|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01007590
Edwin Kempine3446292013-02-19 16:40:14 +01007591[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007592=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007593The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07007594Not all fields are returned by default. Additional fields can
7595be obtained by adding `o` parameters as described in
7596link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01007597
David Pursehouseae367192014-11-25 17:24:47 +09007598[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007599|===========================
7600|Field Name ||Description
David Pursehouse4de41112016-06-28 09:24:08 +09007601|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
7602`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Kasper Nilssonbe3616d2018-01-23 14:10:36 -08007603|`_number` ||The patch set number, or `edit` if the patch set is an edit.
Edwin Kempin04cbd342015-02-19 16:31:22 +01007604|`created` ||
7605The link:rest-api.html#timestamp[timestamp] of when the patch set was
7606created.
7607|`uploader` ||
7608The uploader of the patch set as an
7609link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01007610|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01007611|`fetch` ||
7612Information about how to fetch this patch set. The fetch information is
7613provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07007614"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
7615only included if a plugin implementing the
7616link:intro-project-owner.html#download-commands[download commands]
7617interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07007618|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01007619link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07007620|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01007621The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07007622link:#file-info[FileInfo] entities. Only set if
7623link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
7624option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07007625|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07007626Actions the caller might be able to perform on this revision. The
7627information is a map of view name to link:#action-info[ActionInfo]
7628entities.
Khai Dob3139b7532014-09-19 15:13:04 -07007629|`reviewed` |optional|
7630Indicates whether the caller is authenticated and has commented on the
7631current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Quinten Yearsley28cd2122019-06-10 14:41:13 -07007632|`commit_with_footers` |optional|
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07007633If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
7634this is the current patch set, contains the full commit message with
7635Gerrit-specific commit footers, as if this revision were submitted
7636using the link:project-configuration.html#cherry_pick[Cherry Pick]
7637submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04007638|`push_certificate` |optional|
7639If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
7640contains the push certificate provided by the user when uploading this
7641patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
7642This field is always set if the option is requested; if no push
7643certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07007644|`description` |optional|
7645The description of this patchset, as displayed in the patchset
7646selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01007647|===========================
7648
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007649[[robot-comment-info]]
7650=== RobotCommentInfo
7651The `RobotCommentInfo` entity contains information about a robot inline
7652comment.
7653
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01007654`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007655In addition `RobotCommentInfo` has the following fields:
7656
7657[options="header",cols="1,^1,5"]
7658|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007659|Field Name ||Description
7660|`robot_id` ||The ID of the robot that generated this comment.
7661|`robot_run_id` ||An ID of the run of the robot.
7662|`url` |optional|URL to more information.
7663|`properties` |optional|Robot specific properties as map that maps arbitrary
7664keys to values.
7665|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
7666<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007667|===========================
7668
7669[[robot-comment-input]]
7670=== RobotCommentInput
7671The `RobotCommentInput` entity contains information for creating an inline
7672robot comment.
7673
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01007674`RobotCommentInput` has the same fields as
7675<<robot-comment-info,RobotCommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007676
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007677[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007678=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007679The `RuleInput` entity contains information to test a Prolog rule.
7680
David Pursehouseae367192014-11-25 17:24:47 +09007681[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007682|===========================
7683|Field Name ||Description
7684|`rule`||
7685Prolog code to execute instead of the code in `refs/meta/config`.
7686|`filters`|`RUN` if not set|
7687When `RUN` filter rules in the parent projects are called to
7688post-process the results of the project specific rule. This
7689behavior matches how the rule will execute if installed. +
7690If `SKIP` the parent filters are not called, allowing the test
7691to return results from the input rule.
7692|===========================
7693
Edwin Kempin14b58112013-02-26 16:30:19 +01007694[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007695=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01007696The `SubmitInfo` entity contains information about the change status
7697after submitting.
7698
Stefan Bellere4785b42015-06-18 12:31:03 -07007699[options="header",cols="1,^1,5"]
Edwin Kempin14b58112013-02-26 16:30:19 +01007700|==========================
Stefan Bellere4785b42015-06-18 12:31:03 -07007701|Field Name ||Description
7702|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07007703The status of the change after submitting is `MERGED`.
David Ostrovsky868e3412014-01-30 19:50:57 +01007704|`on_behalf_of`|optional|
7705The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
7706whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09007707have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
7708The user named by `on_behalf_of` does not need to be granted the `Submit`
7709permission. This feature is aimed for CI solutions: the CI account can be
David Pursehousea61ee502016-09-06 16:27:09 +09007710granted both permissions, so individual users don't need `Submit` permission
7711themselves. Still the changes can be submitted on behalf of real users and
David Pursehouse22bd6f92014-02-20 21:11:01 +09007712not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01007713|==========================
7714
Edwin Kempin0eddba02013-02-22 15:30:12 +01007715[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007716=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01007717The `SubmitInput` entity contains information for submitting a change.
7718
David Pursehouseae367192014-11-25 17:24:47 +09007719[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007720|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01007721|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01007722|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05007723If set, submit the change on behalf of the given user. The value may take any
7724format link:rest-api-accounts.html#account-id[accepted by the accounts REST
7725API]. Using this option requires
7726link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
7727permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01007728|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07007729Notify handling that defines to whom email notifications should be sent after
7730the change is submitted. +
7731Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7732If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007733|`notify_details`|optional|
7734Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007735of link:user-notify.html#recipient-types[recipient type] to
7736link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007737|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01007738
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007739[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007740=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007741The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02007742Fields in this entity roughly correspond to the fields set by `LABELS`
7743in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007744
David Pursehouseae367192014-11-25 17:24:47 +09007745[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007746|===========================
7747|Field Name ||Description
7748|`status`||
7749`OK`, the change can be submitted. +
7750`NOT_READY`, additional labels are required before submit. +
7751`CLOSED`, closed changes cannot be submitted. +
7752`RULE_ERROR`, rule code failed with an error.
7753|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01007754Map of labels that are approved; an
7755link:rest-api-accounts.html#account-info[AccountInfo] identifies the
7756voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007757|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01007758Map of labels that are preventing submit;
7759link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007760|`need`|optional|
7761Map of labels that need to be given to submit. The value is
7762currently an empty object.
7763|`may`|optional|
7764Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01007765link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
7766if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08007767|`impossible`|optional|
7768Map of labels that should have been in `need` but cannot be
7769used by any user because of access restrictions. The value
7770is currently an empty object.
7771|`error_message`|optional|
7772When status is RULE_ERROR this message provides some text describing
7773the failure of the rule predicate.
7774|===========================
7775
Jonathan Nieder2a629b02016-06-16 15:15:25 -07007776[[submitted-together-info]]
7777=== SubmittedTogetherInfo
7778The `SubmittedTogetherInfo` entity contains information about a
7779collection of changes that would be submitted together.
7780
7781[options="header",cols="1,6"]
7782|===========================
7783|Field Name |Description
7784|`changes` |
7785A list of ChangeInfo entities representing the changes to be submitted together.
7786|`non_visible_changes`|
7787The number of changes to be submitted together that the current user
7788cannot see. (This count includes changes that are visible to the
7789current user when their reason for being submitted together involves
7790changes the user cannot see.)
7791|===========================
7792
Edwin Kempin521c1242015-01-23 12:44:44 +01007793[[suggested-reviewer-info]]
7794=== SuggestedReviewerInfo
7795The `SuggestedReviewerInfo` entity contains information about a reviewer
7796that can be added to a change (an account or a group).
7797
7798`SuggestedReviewerInfo` has either the `account` field that contains
7799the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
7800the `group` field that contains the
7801link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
7802
Logan Hanksab3c81e2016-07-20 15:42:52 -07007803[options="header",cols="1,^1,5"]
7804|===========================
7805|Field Name ||Description
7806|`account` |optional|
7807An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
7808suggestion is an account.
7809|`group` |optional|
7810A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
7811suggestion is a group.
7812|`count` ||
7813The total number of accounts in the suggestion. This is `1` if `account` is
7814present. If `group` is present, the total number of accounts that are
7815members of the group is returned (this count includes members of nested
7816groups).
7817|`confirm` |optional|
7818True if `group` is present and `count` is above the threshold where the
7819`confirmed` flag must be passed to add the group as a reviewer.
7820|===========================
7821
Edwin Kempin64006bb2013-02-22 08:17:04 +01007822[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007823=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01007824The `TopicInput` entity contains information for setting a topic.
7825
David Pursehouseae367192014-11-25 17:24:47 +09007826[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01007827|===========================
7828|Field Name ||Description
7829|`topic` |optional|The topic. +
7830The topic will be deleted if not set.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02007831Topic can't contain quotation marks.
Edwin Kempin64006bb2013-02-22 08:17:04 +01007832|===========================
7833
Makson Lee3568a932017-08-28 17:12:03 +08007834[[tracking-id-info]]
7835=== TrackingIdInfo
7836The `TrackingIdInfo` entity describes a reference to an external tracking system.
7837
7838[options="header",cols="1,6"]
7839|======================
7840|Field Name|Description
7841|`system` |The name of the external tracking system.
7842|`id` |The tracking id.
7843|======================
7844
Oleg Aravinbf313bb2016-10-24 12:28:56 -07007845[[voting-range-info]]
7846=== VotingRangeInfo
7847The `VotingRangeInfo` entity describes the continuous voting range from min
7848to max values.
7849
7850[options="header",cols="1,6"]
7851|======================
7852|Field Name|Description
7853|`min` |The minimum voting value.
7854|`max` |The maximum voting value.
7855|======================
7856
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007857[[web-link-info]]
7858=== WebLinkInfo
7859The `WebLinkInfo` entity describes a link to an external site.
7860
David Pursehouseae367192014-11-25 17:24:47 +09007861[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007862|======================
7863|Field Name|Description
7864|`name` |The link name.
7865|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02007866|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02007867|======================
7868
Alan Tokaev392cfca2017-04-28 11:11:31 +02007869[[work-in-progress-input]]
7870=== WorkInProgressInput
7871The `WorkInProgressInput` entity contains additional information for a change
7872set to WorkInProgress/ReadyForReview.
7873
7874[options="header",cols="1,^1,5"]
7875|=============================
7876|Field Name ||Description
7877|`message` |optional|
7878Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview.
7879|=============================
7880
Edwin Kempind0a63922013-01-23 16:32:59 +01007881GERRIT
7882------
7883Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07007884
7885SEARCHBOX
7886---------