blob: 0c5ea40d227dd24dd8c82700ab1a2329667ce47d [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
Han-Wen Nienhuys0a241322021-02-15 18:01:48 +010017The change input link:#change-input[ChangeInput] entity must be
18provided in the request body. It is not allowed to create changes
19under `refs/tags/` or Gerrit internal ref namespaces such as
20`refs/changes/`, `refs/meta/external-ids/`, and `refs/users/`. The
21request would fail with `400 Bad Request` in this case.
David Ostrovsky837c0ee2014-04-27 12:54:20 +020022
Edwin Kempin088eeb9a2018-01-25 08:39:41 +010023To create a change the calling user must be allowed to
24link:access-control.html#category_push_review[upload to code review].
25
David Ostrovsky837c0ee2014-04-27 12:54:20 +020026.Request
27----
Paladox none4bac1952017-08-03 00:09:25 +000028 POST /changes/ HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +090029 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020030
31 {
32 "project" : "myProject",
33 "subject" : "Let's support 100% Gerrit workflow direct in browser",
34 "branch" : "master",
35 "topic" : "create-change-in-browser",
David Ostrovsky6ffb7d92017-02-13 21:16:58 +010036 "status" : "NEW"
David Ostrovsky837c0ee2014-04-27 12:54:20 +020037 }
38----
39
40As response a link:#change-info[ChangeInfo] entity is returned that describes
41the resulting change.
42
43.Response
44----
Paladox none4bac1952017-08-03 00:09:25 +000045 HTTP/1.1 201 OK
David Ostrovsky837c0ee2014-04-27 12:54:20 +020046 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090047 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020048
49 )]}'
50 {
David Ostrovsky837c0ee2014-04-27 12:54:20 +020051 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
52 "project": "myProject",
53 "branch": "master",
54 "topic": "create-change-in-browser",
55 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
56 "subject": "Let's support 100% Gerrit workflow direct in browser",
David Ostrovsky6ffb7d92017-02-13 21:16:58 +010057 "status": "NEW",
David Ostrovsky837c0ee2014-04-27 12:54:20 +020058 "created": "2014-05-05 07:15:44.639000000",
59 "updated": "2014-05-05 07:15:44.639000000",
60 "mergeable": true,
61 "insertions": 0,
62 "deletions": 0,
David Ostrovsky837c0ee2014-04-27 12:54:20 +020063 "_number": 4711,
64 "owner": {
65 "name": "John Doe"
66 }
67 }
68----
69
Edwin Kempin76202742013-02-15 13:51:50 +010070[[list-changes]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080071=== Query Changes
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080072--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010073'GET /changes/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080074--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010075
Saša Živkovdd804022014-06-23 16:44:03 +020076Queries changes visible to the caller. The
77link:user-search.html#_search_operators[query string] must be provided
78by the `q` parameter. The `n` parameter can be used to limit the
Patrick Hieseld6afdcf2020-01-07 15:03:28 +010079returned results. The `no-limit` parameter can be used remove the default
80limit on queries and return all results. This might not be supported by
81all index backends.
Edwin Kempind0a63922013-01-23 16:32:59 +010082
Edwin Kempine3446292013-02-19 16:40:14 +010083As result a list of link:#change-info[ChangeInfo] entries is returned.
84The change output is sorted by the last update time, most recently
85updated to oldest updated.
86
Edwin Kempind0a63922013-01-23 16:32:59 +010087Query for open changes of watched projects:
Edwin Kempin37440832013-02-06 11:36:00 +010088
89.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010090----
Edwin Kempin2091edb2013-01-23 19:07:38 +010091 GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010092----
Edwin Kempind0a63922013-01-23 16:32:59 +010093
Edwin Kempin37440832013-02-06 11:36:00 +010094.Response
95----
Edwin Kempind0a63922013-01-23 16:32:59 +010096 HTTP/1.1 200 OK
97 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090098 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010099
100 )]}'
John Spurlockd25fad12013-03-09 11:48:49 -0500101 [
102 {
John Spurlockd25fad12013-03-09 11:48:49 -0500103 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
104 "project": "demo",
105 "branch": "master",
Gal Paikinc326de42020-06-16 18:49:00 +0300106 "attention_set": [
107 {
108 "account": {
109 "name": "John Doe"
110 },
111 "last_update": "2012-07-17 07:19:27.766000000",
112 "reason": "reviewer or cc replied"
113 }
114 ]
John Spurlockd25fad12013-03-09 11:48:49 -0500115 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
116 "subject": "One change",
117 "status": "NEW",
118 "created": "2012-07-17 07:18:30.854000000",
119 "updated": "2012-07-17 07:19:27.766000000",
John Spurlockd25fad12013-03-09 11:48:49 -0500120 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100121 "insertions": 26,
122 "deletions": 10,
John Spurlockd25fad12013-03-09 11:48:49 -0500123 "_number": 1756,
124 "owner": {
125 "name": "John Doe"
126 },
Edwin Kempind0a63922013-01-23 16:32:59 +0100127 },
John Spurlockd25fad12013-03-09 11:48:49 -0500128 {
John Spurlockd25fad12013-03-09 11:48:49 -0500129 "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501",
130 "project": "demo",
131 "branch": "master",
132 "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501",
133 "subject": "Another change",
134 "status": "NEW",
135 "created": "2012-07-17 07:18:30.884000000",
136 "updated": "2012-07-17 07:18:30.885000000",
137 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100138 "insertions": 12,
139 "deletions": 18,
John Spurlockd25fad12013-03-09 11:48:49 -0500140 "_number": 1757,
141 "owner": {
142 "name": "John Doe"
143 },
144 "_more_changes": true
145 }
146 ]
Edwin Kempind0a63922013-01-23 16:32:59 +0100147----
148
Sebastian Schuberth02bafe02016-01-20 21:38:11 +0100149If the number of changes matching the query exceeds either the internal
150limit or a supplied `n` query parameter, the last change object has a
David Pursehouse025ea3e2014-09-03 10:47:34 +0900151`_more_changes: true` JSON field set.
152
153The `S` or `start` query parameter can be supplied to skip a number
154of changes from the list.
Edwin Kempind0a63922013-01-23 16:32:59 +0100155
Matthias Sohn0b2bf612020-12-24 00:15:32 +0100156Administrators can use the `skip-visibility` query parameter to skip visibility filtering.
157This can be used to ensure that no changes are missed e.g. when querying for changes which
158need to be reindexed. Without this parameter query results the user has no permission to read
159are filtered out. REST requests with the skip-visibility option are rejected when the current
160user doesn't have the ADMINISTRATE_SERVER capability.
161
Edwin Kempind0a63922013-01-23 16:32:59 +0100162Clients are allowed to specify more than one query by setting the `q`
163parameter multiple times. In this case the result is an array of
164arrays, one per query in the same order the queries were given in.
165
Edwin Kempina64c4b92013-01-23 11:30:40 +0100166.Query for the 25 most recent open changes of the projects that you watch
167****
168get::/changes/?q=status:open+is:watched&n=25
169****
170
Edwin Kempind0a63922013-01-23 16:32:59 +0100171Query that retrieves changes for a user's dashboard:
Edwin Kempin37440832013-02-06 11:36:00 +0100172
173.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100174----
175 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 +0100176----
Edwin Kempind0a63922013-01-23 16:32:59 +0100177
Edwin Kempin37440832013-02-06 11:36:00 +0100178.Response
179----
Edwin Kempind0a63922013-01-23 16:32:59 +0100180 HTTP/1.1 200 OK
181 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900182 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100183
184 )]}'
185 [
186 [
187 {
Edwin Kempind0a63922013-01-23 16:32:59 +0100188 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
189 "project": "demo",
190 "branch": "master",
191 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
192 "subject": "One change",
193 "status": "NEW",
194 "created": "2012-07-17 07:18:30.854000000",
195 "updated": "2012-07-17 07:19:27.766000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100196 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100197 "insertions": 4,
198 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100199 "_number": 1756,
200 "owner": {
201 "name": "John Doe"
202 },
203 "labels": {
204 "Verified": {},
205 "Code-Review": {}
206 }
207 }
208 ],
209 [],
210 []
211 ]
212----
213
Edwin Kempina64c4b92013-01-23 11:30:40 +0100214.Query the changes for your user dashboard
215****
216get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS
217****
218
David Pursehouse2cf28432016-08-21 23:20:08 +0900219[[query-options]]
Edwin Kempind0a63922013-01-23 16:32:59 +0100220Additional fields can be obtained by adding `o` parameters, each
221option requires more database lookups and slows down the query
222response time to the client so they are generally disabled by
223default. Optional fields are:
224
Edwin Kempine3446292013-02-19 16:40:14 +0100225[[labels]]
226--
Edwin Kempind0a63922013-01-23 16:32:59 +0100227* `LABELS`: a summary of each label required for submit, and
Patrick Hieselae92ad82020-11-17 11:09:05 +0100228 approvers that have granted (or rejected) with that label
229 as well as all reviewers by state, and reviewers that may
230 be removed by the current user.
Edwin Kempine3446292013-02-19 16:40:14 +0100231--
Edwin Kempind0a63922013-01-23 16:32:59 +0100232
Edwin Kempine3446292013-02-19 16:40:14 +0100233[[detailed-labels]]
234--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800235* `DETAILED_LABELS`: detailed label information, including numeric
Dave Borowitz992ddd72013-02-13 11:53:17 -0800236 values of all existing approvals, recognized label values, values
Patrick Hieselae92ad82020-11-17 11:09:05 +0100237 permitted to be set by any reviewer and the change owner, all
238 reviewers by state, and reviewers that may be removed by the
239 current user.
Edwin Kempine3446292013-02-19 16:40:14 +0100240--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800241
Youssef Elghareeb79f473622021-05-26 18:58:40 +0200242[[submit-requirements]]
243--
244* `SUBMIT_REQUIREMENTS`: detailed result of the evaluated submit requirements
245 for this change.
246--
247
Edwin Kempine3446292013-02-19 16:40:14 +0100248[[current-revision]]
249--
Edwin Kempind0a63922013-01-23 16:32:59 +0100250* `CURRENT_REVISION`: describe the current revision (patch set)
251 of the change, including the commit SHA-1 and URLs to fetch from.
Edwin Kempine3446292013-02-19 16:40:14 +0100252--
Edwin Kempind0a63922013-01-23 16:32:59 +0100253
Edwin Kempine3446292013-02-19 16:40:14 +0100254[[all-revisions]]
255--
Edwin Kempind0a63922013-01-23 16:32:59 +0100256* `ALL_REVISIONS`: describe all revisions, not just current.
Edwin Kempine3446292013-02-19 16:40:14 +0100257--
Edwin Kempind0a63922013-01-23 16:32:59 +0100258
David Pursehouse025c1af2015-11-20 17:02:50 +0900259[[download-commands]]
Edwin Kempinea621482013-10-16 12:58:24 +0200260--
261* `DOWNLOAD_COMMANDS`: include the `commands` field in the
262 link:#fetch-info[FetchInfo] for revisions. Only valid when the
263 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
264--
265
Edwin Kempine3446292013-02-19 16:40:14 +0100266[[current-commit]]
267--
Edwin Kempind0a63922013-01-23 16:32:59 +0100268* `CURRENT_COMMIT`: parse and output all header fields from the
David Pursehouse98006e82013-10-02 10:15:52 +0900269 commit object, including message. Only valid when the
270 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100271--
Edwin Kempind0a63922013-01-23 16:32:59 +0100272
Edwin Kempine3446292013-02-19 16:40:14 +0100273[[all-commits]]
274--
Edwin Kempind0a63922013-01-23 16:32:59 +0100275* `ALL_COMMITS`: parse and output all header fields from the
276 output revisions. If only `CURRENT_REVISION` was requested
277 then only the current revision's commit data will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100278--
Edwin Kempind0a63922013-01-23 16:32:59 +0100279
Edwin Kempine3446292013-02-19 16:40:14 +0100280[[current-files]]
281--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100282* `CURRENT_FILES`: list files modified by the commit and magic files,
283 including basic line counts inserted/deleted per file. Only valid
284 when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100285--
Edwin Kempind0a63922013-01-23 16:32:59 +0100286
Edwin Kempine3446292013-02-19 16:40:14 +0100287[[all-files]]
288--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100289* `ALL_FILES`: list files modified by the commit and magic files,
290 including basic line counts inserted/deleted per file. If only the
291 `CURRENT_REVISION` was requested then only that commit's modified
292 files will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100293--
Edwin Kempind0a63922013-01-23 16:32:59 +0100294
Edwin Kempine3446292013-02-19 16:40:14 +0100295[[detailed-accounts]]
296--
Edwin Kempin4a00e222013-10-16 14:34:24 +0200297* `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username`
298 fields when referencing accounts.
Edwin Kempine3446292013-02-19 16:40:14 +0100299--
Dave Borowitz8926a882013-02-01 14:32:48 -0800300
Viktar Donich316bf7a2016-07-06 11:29:01 -0700301[[reviewer-updates]]
302--
303* `REVIEWER_UPDATES`: include updates to reviewers set as
304 link:#review-update-info[ReviewerUpdateInfo] entities.
305--
306
John Spurlock74a70cc2013-03-23 16:41:50 -0400307[[messages]]
308--
309* `MESSAGES`: include messages associated with the change.
310--
311
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700312[[actions]]
313--
314* `CURRENT_ACTIONS`: include information on available actions
Stefan Beller09cd95d2015-02-12 13:40:23 -0800315 for the change and its current revision. Ignored if the caller
316 is not authenticated.
317--
318
319[[change-actions]]
320--
321* `CHANGE_ACTIONS`: include information on available
322 change actions for the change. Ignored if the caller
323 is not authenticated.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700324--
325
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700326[[reviewed]]
327--
Dave Borowitz86669b32015-05-27 14:56:10 -0700328* `REVIEWED`: include the `reviewed` field if all of the following are
329 true:
Ardo Septama505f9ad2016-12-06 16:28:00 +0100330 - the change is open
331 - the caller is authenticated
332 - the caller has commented on the change more recently than the last update
Dave Borowitz86669b32015-05-27 14:56:10 -0700333 from the change owner, i.e. this change would show up in the results of
334 link:user-search.html#reviewedby[reviewedby:self].
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700335--
Gal Paikin3a2aa012019-06-21 18:30:01 +0200336[[skip_diffstat]]
337--
338* `SKIP_DIFFSTAT`: skip the 'insertions' and 'deletions' field in link:#change-info[ChangeInfo].
339 For large trees, their computation may be expensive.
340--
Han-Wen Nienhuys19de6cd2018-01-16 13:15:38 +0100341
Jonathan Niedercb51d742016-09-23 11:37:57 -0700342[[submittable]]
343--
Jonathan Niederad5240f2016-10-04 11:03:23 -0700344* `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo],
Jonathan Niedercb51d742016-09-23 11:37:57 -0700345 which can be used to tell if the change is reviewed and ready for submit.
346--
347
Khai Do2a23ec82014-09-19 16:33:02 -0700348[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100349--
Sven Selbergd26bd542014-11-21 16:28:10 +0100350* `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo],
351 therefore only valid in combination with `CURRENT_COMMIT` or
352 `ALL_COMMITS`.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100353--
354
Dave Borowitz4c46c242014-12-03 16:46:45 -0800355[[check]]
356--
357* `CHECK`: include potential problems with the change.
358--
359
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700360[[commit-footers]]
361--
362* `COMMIT_FOOTERS`: include the full commit message with
363 Gerrit-specific commit footers in the
364 link:#revision-info[RevisionInfo].
Yuxuan 'fishy' Wang16baf212015-05-05 16:49:55 -0700365--
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700366
Dave Borowitz6f58dbe2015-09-14 12:34:31 -0400367[[push-certificates]]
368--
369* `PUSH_CERTIFICATES`: include push certificate information in the
370 link:#revision-info[RevisionInfo]. Ignored if signed push is not
371 link:config-gerrit.html#receive.enableSignedPush[enabled] on the
372 server.
373--
374
Makson Lee3568a932017-08-28 17:12:03 +0800375[[tracking-ids]]
376--
377* `TRACKING_IDS`: include references to external tracking systems
378 as link:#tracking-id-info[TrackingIdInfo].
379--
380
Edwin Kempin37440832013-02-06 11:36:00 +0100381.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100382----
Edwin Kempinea621482013-10-16 12:58:24 +0200383 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 +0100384----
Edwin Kempind0a63922013-01-23 16:32:59 +0100385
Edwin Kempin37440832013-02-06 11:36:00 +0100386.Response
387----
Edwin Kempind0a63922013-01-23 16:32:59 +0100388 HTTP/1.1 200 OK
389 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900390 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100391
392 )]}'
393 [
394 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900395 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100396 "project": "gerrit",
397 "branch": "master",
398 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
399 "subject": "Use an EventBus to manage star icons",
400 "status": "NEW",
401 "created": "2012-04-25 00:52:25.580000000",
402 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100403 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100404 "insertions": 16,
405 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100406 "_number": 97,
407 "owner": {
408 "name": "Shawn Pearce"
409 },
410 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
411 "revisions": {
412 "184ebe53805e102605d11f6b143486d15c23a09c": {
David Pursehouse4de41112016-06-28 09:24:08 +0900413 "kind": "REWORK",
Edwin Kempind0a63922013-01-23 16:32:59 +0100414 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100415 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100416 "fetch": {
417 "git": {
418 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200419 "ref": "refs/changes/97/97/1",
420 "commands": {
421 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
422 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
423 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
424 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
425 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100426 },
427 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200428 "url": "http://myuser@127.0.0.1:8080/gerrit",
429 "ref": "refs/changes/97/97/1",
430 "commands": {
431 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
432 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
433 "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",
434 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
435 }
436 },
437 "ssh": {
438 "url": "ssh://myuser@*:29418/gerrit",
439 "ref": "refs/changes/97/97/1",
440 "commands": {
441 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
442 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
443 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
444 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
445 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100446 }
447 },
448 "commit": {
449 "parents": [
450 {
451 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
452 "subject": "Migrate contributor agreements to All-Projects."
453 }
454 ],
455 "author": {
456 "name": "Shawn O. Pearce",
457 "email": "sop@google.com",
458 "date": "2012-04-24 18:08:08.000000000",
459 "tz": -420
460 },
461 "committer": {
462 "name": "Shawn O. Pearce",
463 "email": "sop@google.com",
464 "date": "2012-04-24 18:08:08.000000000",
465 "tz": -420
466 },
467 "subject": "Use an EventBus to manage star icons",
468 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
469 },
470 "files": {
471 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200472 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100473 "size_delta": -412,
474 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100475 },
476 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200477 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100478 "size_delta": 23,
479 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100480 },
481 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
482 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200483 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100484 "size_delta": -298,
485 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100486 },
487 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
488 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200489 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100490 "size_delta": 132,
491 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100492 },
493 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
494 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200495 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100496 "size_delta": -5512,
497 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100498 },
499 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
500 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200501 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100502 "size_delta": 8345,
503 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100504 },
505 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200506 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100507 "size_delta": -343,
508 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100509 }
510 }
511 }
512 }
513 }
514 ]
515----
516
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100517[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800518=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800519--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100520'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800521--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100522
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100523Retrieves a change.
524
Dave Borowitz0314f732013-10-03 09:34:30 -0700525Additional fields can be obtained by adding `o` parameters, each
526option requires more database lookups and slows down the query
527response time to the client so they are generally disabled by
528default. Fields are described in link:#list-changes[Query Changes].
529
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100530.Request
531----
532 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
533----
534
535As response a link:#change-info[ChangeInfo] entity is returned that
536describes the change.
537
538.Response
539----
540 HTTP/1.1 200 OK
541 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900542 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100543
544 )]}'
545 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100546 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
547 "project": "myProject",
548 "branch": "master",
Gal Paikinc326de42020-06-16 18:49:00 +0300549 "attention_set": [
550 {
551 "account": {
552 "name": "John Doe"
553 },
554 "last_update": "2013-02-21 11:16:36.775000000",
555 "reason": "reviewer or cc replied"
556 }
557 ]
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100558 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
559 "subject": "Implementing Feature X",
560 "status": "NEW",
561 "created": "2013-02-01 09:59:32.126000000",
562 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100563 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100564 "insertions": 34,
565 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100566 "_number": 3965,
567 "owner": {
568 "name": "John Doe"
569 }
570 }
571----
572
Han-Wen Nienhuys63b81f22021-02-17 10:31:01 +0100573Historical state of the change can be retrieved by specifying the
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200574`meta=SHA-1` parameter. This will use a historical NoteDb snapshot to
575populate ChangeInfo. If the SHA-1 is not reachable as a NoteDb state,
Han-Wen Nienhuys63b81f22021-02-17 10:31:01 +0100576status code 412 is returned.
577
Alex Spradlinb65494f2021-03-03 11:22:27 -0800578[[get-meta-diff]]
579=== Get Meta Diff
580--
Han-Wen Nienhuys524317a2021-04-08 12:12:35 +0200581'GET /changes/link:#change-id[\{change-id\}]/meta_diff?old=SHA-1&meta=SHA-1'
Alex Spradlinb65494f2021-03-03 11:22:27 -0800582--
583
584Retrieves the difference between two historical states of a change
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200585by specifying the `old=SHA-1` and the `meta=SHA-1` parameters.
Alex Spradlinb65494f2021-03-03 11:22:27 -0800586
587If the `old` parameter is not provided, the parent of the `meta`
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200588SHA-1 is used. If the `meta` parameter is not provided, the current
Alex Spradlinb65494f2021-03-03 11:22:27 -0800589state of the change is used. If neither are provided, the
590difference between the current state of the change and its previous
591state is returned.
592
593Additional fields can be obtained by adding `o` parameters, analogous
594to link:#get-change[Get Change], and the same concerns for Get Change hold for
595this endpoint too. Fields are described in link:#list-changes[Query Changes].
596
597.Request
598----
599 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/meta_diff?old=b083abc34eb6dbdb9e154ba092fc198000e997b4&meta=63b81f2bde703ae07787a940e8fdf9a1828605b1 HTTP/1.0
600----
601
602As a response, two link:#change-info[ChangeInfo] entities are returned
603that describe information added and removed from the `old` change state.
604Only fields that differ between the change's two states are returned.
605
606.Response
607----
608 HTTP/1.1 200 OK
609 Content-Disposition: attachment
610 Content-Type: application/json; charset=UTF-8
611
612 )]}'
613 {
614 "added": {
615 "attention_set": [
616 {
617 "account": {
618 "name": "John Doe"
619 },
620 "last_update": "2013-02-21 11:16:36.775000000",
621 "reason": "reviewer or cc replied"
622 }
623 ]
624 "updated": "2013-02-21 11:16:36.775000000",
625 "topic": "new-topic"
626 },
627 "removed": {
628 "updated": "2013-02-20 12:05:34.111000000",
629 "topic": "old-topic"
630 }
631 }
632----
633
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200634If the provided SHA-1 for `meta` is not reachable as a NoteDb
635state, the status code 412 is returned. If the SHA-1 for `old`
Alex Spradlinb65494f2021-03-03 11:22:27 -0800636is not reachable, the difference between the change at state
637`meta` and an empty change is returned.
Han-Wen Nienhuys63b81f22021-02-17 10:31:01 +0100638
Edwin Kempin8e492202013-02-21 15:38:25 +0100639[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800640=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800641--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100642'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800643--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100644
Edwin Kempin8e492202013-02-21 15:38:25 +0100645Retrieves a change with link:#labels[labels], link:#detailed-labels[
Viktar Donich316bf7a2016-07-06 11:29:01 -0700646detailed labels], link:#detailed-accounts[detailed accounts],
647link:#reviewer-updates[reviewer updates], and link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100648
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700649Additional fields can be obtained by adding `o` parameters, each
650option requires more database lookups and slows down the query
651response time to the client so they are generally disabled by
652default. Fields are described in link:#list-changes[Query Changes].
653
Edwin Kempin8e492202013-02-21 15:38:25 +0100654.Request
655----
656 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
657----
658
659As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700660describes the change. This response will contain all votes for each
661label and include one combined vote. The combined label vote is
662calculated in the following order (from highest to lowest):
663REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100664
665.Response
666----
667 HTTP/1.1 200 OK
668 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900669 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100670
671 )]}'
672 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100673 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
674 "project": "myProject",
675 "branch": "master",
Gal Paikinc326de42020-06-16 18:49:00 +0300676 "attention_set": [
677 {
678 "account": {
679 "_account_id": 1000096,
680 "name": "John Doe",
681 "email": "john.doe@example.com",
682 "username": "jdoe"
683 },
684 "last_update": "2013-02-21 11:16:36.775000000",
685 "reason": "reviewer or cc replied"
686 }
687 ]
Edwin Kempin8e492202013-02-21 15:38:25 +0100688 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
689 "subject": "Implementing Feature X",
690 "status": "NEW",
691 "created": "2013-02-01 09:59:32.126000000",
692 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100693 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100694 "insertions": 126,
695 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100696 "_number": 3965,
697 "owner": {
698 "_account_id": 1000096,
699 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200700 "email": "john.doe@example.com",
701 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100702 },
703 "labels": {
704 "Verified": {
705 "all": [
706 {
707 "value": 0,
708 "_account_id": 1000096,
709 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200710 "email": "john.doe@example.com",
711 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100712 },
713 {
714 "value": 0,
715 "_account_id": 1000097,
716 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200717 "email": "jane.roe@example.com",
718 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100719 }
720 ],
721 "values": {
722 "-1": "Fails",
723 " 0": "No score",
724 "+1": "Verified"
725 }
726 },
727 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100728 "disliked": {
729 "_account_id": 1000096,
730 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200731 "email": "john.doe@example.com",
732 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100733 },
734 "all": [
735 {
736 "value": -1,
737 "_account_id": 1000096,
738 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200739 "email": "john.doe@example.com",
740 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100741 },
742 {
743 "value": 1,
744 "_account_id": 1000097,
745 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200746 "email": "jane.roe@example.com",
747 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100748 }
749 ]
750 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +0400751 "-2": "This shall not be merged",
752 "-1": "I would prefer this is not merged as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100753 " 0": "No score",
754 "+1": "Looks good to me, but someone else must approve",
755 "+2": "Looks good to me, approved"
756 }
757 }
758 },
759 "permitted_labels": {
760 "Verified": [
761 "-1",
762 " 0",
763 "+1"
764 ],
765 "Code-Review": [
766 "-2",
767 "-1",
768 " 0",
769 "+1",
770 "+2"
771 ]
772 },
773 "removable_reviewers": [
774 {
775 "_account_id": 1000096,
776 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200777 "email": "john.doe@example.com",
778 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100779 },
780 {
781 "_account_id": 1000097,
782 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200783 "email": "jane.roe@example.com",
784 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100785 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400786 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800787 "reviewers": {
788 "REVIEWER": [
789 {
790 "_account_id": 1000096,
791 "name": "John Doe",
792 "email": "john.doe@example.com",
793 "username": "jdoe"
794 },
795 {
796 "_account_id": 1000097,
797 "name": "Jane Roe",
798 "email": "jane.roe@example.com",
799 "username": "jroe"
800 }
801 ]
802 },
Viktar Donich316bf7a2016-07-06 11:29:01 -0700803 "reviewer_updates": [
804 {
805 "state": "REVIEWER",
806 "reviewer": {
807 "_account_id": 1000096,
808 "name": "John Doe",
809 "email": "john.doe@example.com",
810 "username": "jdoe"
811 },
812 "updated_by": {
813 "_account_id": 1000096,
814 "name": "John Doe",
815 "email": "john.doe@example.com",
816 "username": "jdoe"
817 },
818 "updated": "2016-07-21 20:12:39.000000000"
819 },
820 {
821 "state": "REMOVED",
822 "reviewer": {
823 "_account_id": 1000096,
824 "name": "John Doe",
825 "email": "john.doe@example.com",
826 "username": "jdoe"
827 },
828 "updated_by": {
829 "_account_id": 1000096,
830 "name": "John Doe",
831 "email": "john.doe@example.com",
832 "username": "jdoe"
833 },
834 "updated": "2016-07-21 20:12:33.000000000"
835 },
836 {
837 "state": "CC",
838 "reviewer": {
839 "_account_id": 1000096,
840 "name": "John Doe",
841 "email": "john.doe@example.com",
842 "username": "jdoe"
843 },
844 "updated_by": {
845 "_account_id": 1000096,
846 "name": "John Doe",
847 "email": "john.doe@example.com",
848 "username": "jdoe"
849 },
850 "updated": "2016-03-23 21:34:02.419000000",
851 },
852 ],
John Spurlock74a70cc2013-03-23 16:41:50 -0400853 "messages": [
854 {
855 "id": "YH-egE",
856 "author": {
857 "_account_id": 1000096,
858 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200859 "email": "john.doe@example.com",
860 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400861 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100862 "date": "2013-03-23 21:34:02.419000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400863 "message": "Patch Set 1:\n\nThis is the first message.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100864 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400865 },
866 {
867 "id": "WEEdhU",
868 "author": {
869 "_account_id": 1000097,
870 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200871 "email": "jane.roe@example.com",
872 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400873 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100874 "date": "2013-03-23 21:36:52.332000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400875 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100876 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400877 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100878 ]
879 }
880----
881
Aaron Gable9b413072017-08-24 13:15:21 -0700882[[create-merge-patch-set-for-change]]
883=== Create Merge Patch Set For Change
884--
885'POST /changes/link:#change-id[\{change-id\}]/merge'
886--
887
888Update an existing change by using a
889link:#merge-patch-set-input[MergePatchSetInput] entity.
890
891Gerrit will create a merge commit based on the information of
892MergePatchSetInput and add a new patch set to the change corresponding
893to the new merge commit.
894
895.Request
896----
897 POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0
898 Content-Type: application/json; charset=UTF-8
899
900 {
901 "subject": "Merge dev_branch into master",
902 "merge": {
David Pursehousef4fb1042018-03-18 23:03:46 +0900903 "source": "refs/changes/34/1234/1"
Aaron Gable9b413072017-08-24 13:15:21 -0700904 }
905 }
906----
907
908As response a link:#change-info[ChangeInfo] entity with current revision is
909returned that describes the resulting change.
910
911.Response
912----
913 HTTP/1.1 200 OK
914 Content-Disposition: attachment
915 Content-Type: application/json; charset=UTF-8
916
917 )]}'
918 {
919 "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc",
920 "project": "test",
921 "branch": "master",
922 "hashtags": [],
923 "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc",
924 "subject": "Merge dev_branch into master",
925 "status": "NEW",
926 "created": "2016-09-23 18:08:53.238000000",
927 "updated": "2016-09-23 18:09:25.934000000",
928 "submit_type": "MERGE_IF_NECESSARY",
929 "mergeable": true,
930 "insertions": 5,
931 "deletions": 0,
932 "_number": 72,
933 "owner": {
934 "_account_id": 1000000
935 },
936 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822"
937 }
938----
939
940[[set-message]]
941=== Set Commit Message
942--
943'PUT /changes/link:#change-id[\{change-id\}]/message'
944--
945
946Creates a new patch set with a new commit message.
947
948The new commit message must be provided in the request body inside a
Han-Wen Nienhuys098580a2019-07-24 20:17:41 +0200949link:#commit-message-input[CommitMessageInput] entity. If a Change-Id
950footer is specified, it must match the current Change-Id footer. If
951the Change-Id footer is absent, the current Change-Id is added to the
952message.
Aaron Gable9b413072017-08-24 13:15:21 -0700953
954.Request
955----
956 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0
957 Content-Type: application/json; charset=UTF-8
958
959 {
960 "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n"
961 }
962----
963
964.Notifications
965
966An email will be sent using the "newpatchset" template.
967
968[options="header",cols="1,1"]
969|=============================
970|WIP State |Default
971|Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers
972|Work in progress|owner
973|=============================
974
Edwin Kempin64006bb2013-02-22 08:17:04 +0100975[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800976=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800977--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100978'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800979--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100980
Edwin Kempin64006bb2013-02-22 08:17:04 +0100981Retrieves the topic of a change.
982
983.Request
984----
985 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
986----
987
988.Response
989----
990 HTTP/1.1 200 OK
991 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900992 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100993
994 )]}'
995 "Documentation"
996----
997
998If the change does not have a topic an empty string is returned.
999
1000[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001001=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001002--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001003'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001004--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001005
Edwin Kempin64006bb2013-02-22 08:17:04 +01001006Sets the topic of a change.
1007
1008The new topic must be provided in the request body inside a
Patrick Hiesel4aa14562018-06-19 15:07:50 +02001009link:#topic-input[TopicInput] entity. Any leading or trailing whitespace
1010in the topic name will be removed.
Edwin Kempin64006bb2013-02-22 08:17:04 +01001011
1012.Request
1013----
1014 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001015 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001016
1017 {
1018 "topic": "Documentation"
1019 }
1020----
1021
1022As response the new topic is returned.
1023
1024.Response
1025----
1026 HTTP/1.1 200 OK
1027 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001028 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001029
1030 )]}'
1031 "Documentation"
1032----
1033
1034If the topic was deleted the response is "`204 No Content`".
1035
1036[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001037=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001038--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001039'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001040--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001041
Edwin Kempin64006bb2013-02-22 08:17:04 +01001042Deletes the topic of a change.
1043
Edwin Kempin64006bb2013-02-22 08:17:04 +01001044.Request
1045----
1046 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
1047----
1048
1049.Response
1050----
1051 HTTP/1.1 204 No Content
1052----
1053
Sven Selberg273a4aa2016-09-21 16:28:10 +02001054[[get-assignee]]
1055=== Get Assignee
1056--
1057'GET /changes/link:#change-id[\{change-id\}]/assignee'
1058--
1059
1060Retrieves the account of the user assigned to a change.
1061
1062.Request
1063----
1064 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1065----
1066
1067As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1068describing the assigned account is returned.
1069
1070.Response
1071----
1072 HTTP/1.1 200 OK
1073 Content-Disposition: attachment
1074 Content-Type: application/json; charset=UTF-8
1075
1076 )]}'
1077 {
1078 "_account_id": 1000096,
1079 "name": "John Doe",
1080 "email": "john.doe@example.com",
1081 "username": "jdoe"
1082 }
1083----
1084
1085If the change has no assignee the response is "`204 No Content`".
1086
1087[[get-past-assignees]]
1088=== Get Past Assignees
1089--
1090'GET /changes/link:#change-id[\{change-id\}]/past_assignees'
1091--
1092
1093Returns a list of every user ever assigned to a change, in the order in which
1094they were first assigned.
1095
1096.Request
1097----
1098 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/past_assignees HTTP/1.0
1099----
1100
1101As a response a list of link:rest-api-accounts.html#account-info[AccountInfo]
1102entities is returned.
1103
1104.Response
1105----
1106 HTTP/1.1 200 OK
1107 Content-Disposition: attachment
1108 Content-Type: application/json; charset=UTF-8
1109
1110 )]}'
1111 [
1112 {
1113 "_account_id": 1000051,
1114 "name": "Jane Doe",
1115 "email": "jane.doe@example.com",
1116 "username": "janed"
1117 },
1118 {
1119 "_account_id": 1000096,
1120 "name": "John Doe",
1121 "email": "john.doe@example.com",
1122 "username": "jdoe"
1123 }
1124 ]
1125
1126----
1127
1128
1129[[set-assignee]]
1130=== Set Assignee
1131--
1132'PUT /changes/link:#change-id[\{change-id\}]/assignee'
1133--
1134
1135Sets the assignee of a change.
1136
1137The new assignee must be provided in the request body inside a
1138link:#assignee-input[AssigneeInput] entity.
1139
1140.Request
1141----
1142 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1143 Content-Type: application/json; charset=UTF-8
1144
1145 {
1146 "assignee": "jdoe"
1147 }
1148----
1149
1150As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1151describing the assigned account is returned.
1152
1153.Response
1154----
1155 HTTP/1.1 200 OK
1156 Content-Disposition: attachment
1157 Content-Type: application/json; charset=UTF-8
1158
1159 )]}'
1160 {
1161 "_account_id": 1000096,
1162 "name": "John Doe",
1163 "email": "john.doe@example.com",
1164 "username": "jdoe"
1165 }
1166----
1167
1168[[delete-assignee]]
1169=== Delete Assignee
1170--
1171'DELETE /changes/link:#change-id[\{change-id\}]/assignee'
1172--
1173
1174Deletes the assignee of a change.
1175
1176
1177.Request
1178----
1179 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1180----
1181
1182As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1183describing the account of the deleted assignee is returned.
1184
1185.Response
1186----
1187 HTTP/1.1 200 OK
1188 Content-Disposition: attachment
1189 Content-Type: application/json; charset=UTF-8
1190
1191 )]}'
1192 {
1193 "_account_id": 1000096,
1194 "name": "John Doe",
1195 "email": "john.doe@example.com",
1196 "username": "jdoe"
1197 }
1198----
1199
1200If the change had no assignee the response is "`204 No Content`".
1201
Patrick Hieselbb84fd72017-08-23 11:11:22 +02001202[[get-pure-revert]]
1203=== Get Pure Revert
1204--
1205'GET /changes/link:#change-id[\{change-id\}]/pure_revert'
1206--
1207
1208Check if the given change is a pure revert of the change it references in `revertOf`.
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02001209Optionally, the query parameter `o` can be passed in to specify a commit (SHA-1 in
Patrick Hieselbb84fd72017-08-23 11:11:22 +0200121040 digit hex representation) to check against. It takes precedence over `revertOf`.
1211If the change has no reference in `revertOf`, the parameter is mandatory.
1212
1213As response a link:#pure-revert-info[PureRevertInfo] entity is returned.
1214
1215.Request
1216----
1217 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0
1218----
1219
1220.Response
1221----
1222 HTTP/1.1 200 OK
1223 Content-Disposition: attachment
1224 Content-Type: application/json; charset=UTF-8
1225
1226 )]}'
1227 {
1228 "is_pure_revert" : false
1229 }
1230----
1231
Edwin Kempined5364b2013-02-22 10:39:33 +01001232[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001233=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001234--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001235'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001236--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001237
Edwin Kempined5364b2013-02-22 10:39:33 +01001238Abandons a change.
1239
1240The request body does not need to include a link:#abandon-input[
1241AbandonInput] entity if no review comment is added.
1242
Gal Paikinc326de42020-06-16 18:49:00 +03001243Abandoning a change also removes all users from the link:#attention-set[attention set].
1244
Edwin Kempined5364b2013-02-22 10:39:33 +01001245.Request
1246----
1247 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
1248----
1249
1250As response a link:#change-info[ChangeInfo] entity is returned that
1251describes the abandoned change.
1252
1253.Response
1254----
1255 HTTP/1.1 200 OK
1256 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001257 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001258
1259 )]}'
1260 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001261 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1262 "project": "myProject",
1263 "branch": "master",
1264 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1265 "subject": "Implementing Feature X",
1266 "status": "ABANDONED",
1267 "created": "2013-02-01 09:59:32.126000000",
1268 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001269 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001270 "insertions": 3,
1271 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +01001272 "_number": 3965,
1273 "owner": {
1274 "name": "John Doe"
1275 }
1276 }
1277----
1278
1279If the change cannot be abandoned because the change state doesn't
1280allow abandoning of the change, the response is "`409 Conflict`" and
1281the error message is contained in the response body.
1282
1283.Response
1284----
1285 HTTP/1.1 409 Conflict
1286 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001287 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001288
1289 change is merged
1290----
1291
Logan Hankse43b68e2017-05-23 13:16:22 -07001292.Notifications
1293
1294An email will be sent using the "abandon" template. The notify handling is ALL.
1295Notifications are suppressed on WIP changes that have never started review.
1296
Logan Hanks87607412017-05-30 13:49:04 -07001297[options="header",cols="1,2"]
Logan Hankse43b68e2017-05-23 13:16:22 -07001298|=============================
Logan Hanks87607412017-05-30 13:49:04 -07001299|WIP State |notify=ALL
Logan Hankse43b68e2017-05-23 13:16:22 -07001300|Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1301|Work in progress|not sent
1302|Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1303|=============================
1304
Edwin Kempined5364b2013-02-22 10:39:33 +01001305[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001306=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001307--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001308'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001309--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001310
Edwin Kempined5364b2013-02-22 10:39:33 +01001311Restores a change.
1312
1313The request body does not need to include a link:#restore-input[
1314RestoreInput] entity if no review comment is added.
1315
1316.Request
1317----
1318 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1319----
1320
1321As response a link:#change-info[ChangeInfo] entity is returned that
1322describes the restored change.
1323
1324.Response
1325----
1326 HTTP/1.1 200 OK
1327 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001328 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001329
1330 )]}'
1331 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001332 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1333 "project": "myProject",
1334 "branch": "master",
1335 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1336 "subject": "Implementing Feature X",
1337 "status": "NEW",
1338 "created": "2013-02-01 09:59:32.126000000",
1339 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001340 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001341 "insertions": 2,
1342 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001343 "_number": 3965,
1344 "owner": {
1345 "name": "John Doe"
1346 }
1347 }
1348----
1349
1350If the change cannot be restored because the change state doesn't
1351allow restoring the change, the response is "`409 Conflict`" and
1352the error message is contained in the response body.
1353
1354.Response
1355----
1356 HTTP/1.1 409 Conflict
1357 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001358 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001359
1360 change is new
1361----
1362
Edwin Kempincdae63b2013-03-15 15:06:59 +01001363[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001364=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001365--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001366'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001367--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001368
1369Rebases a change.
1370
Zalan Blenessy874aed72015-01-12 13:26:18 +01001371Optionally, the parent revision can be changed to another patch set through the
1372link:#rebase-input[RebaseInput] entity.
1373
Edwin Kempincdae63b2013-03-15 15:06:59 +01001374.Request
1375----
1376 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001377 Content-Type: application/json;charset=UTF-8
1378
1379 {
1380 "base" : "1234",
1381 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001382----
1383
1384As response a link:#change-info[ChangeInfo] entity is returned that
1385describes the rebased change. Information about the current patch set
1386is included.
1387
1388.Response
1389----
1390 HTTP/1.1 200 OK
1391 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001392 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001393
1394 )]}'
1395 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001396 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1397 "project": "myProject",
1398 "branch": "master",
1399 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1400 "subject": "Implement Feature X",
1401 "status": "NEW",
1402 "created": "2013-02-01 09:59:32.126000000",
1403 "updated": "2013-02-21 11:16:36.775000000",
1404 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001405 "insertions": 33,
1406 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001407 "_number": 4799,
1408 "owner": {
1409 "name": "John Doe"
1410 },
1411 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1412 "revisions": {
1413 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001414 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001415 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001416 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001417 "fetch": {
1418 "http": {
1419 "url": "http://gerrit:8080/myProject",
1420 "ref": "refs/changes/99/4799/2"
1421 }
1422 },
1423 "commit": {
1424 "parents": [
1425 {
1426 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1427 "subject": "Implement Feature A"
1428 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001429 ],
1430 "author": {
1431 "name": "John Doe",
1432 "email": "john.doe@example.com",
1433 "date": "2013-05-07 15:21:27.000000000",
1434 "tz": 120
1435 },
1436 "committer": {
1437 "name": "Gerrit Code Review",
1438 "email": "gerrit-server@example.com",
1439 "date": "2013-05-07 15:35:43.000000000",
1440 "tz": 120
1441 },
1442 "subject": "Implement Feature X",
1443 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001444 }
1445 }
1446 }
1447----
1448
1449If the change cannot be rebased, e.g. due to conflicts, the response is
1450"`409 Conflict`" and the error message is contained in the response
1451body.
1452
1453.Response
1454----
1455 HTTP/1.1 409 Conflict
1456 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001457 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001458
1459 The change could not be rebased due to a path conflict during merge.
1460----
1461
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301462[[move-change]]
1463=== Move Change
1464--
1465'POST /changes/link:#change-id[\{change-id\}]/move'
1466--
1467
1468Move a change.
1469
1470The destination branch must be provided in the request body inside a
1471link:#move-input[MoveInput] entity.
Marija Savtchoukcee6a8f2020-12-03 12:58:04 +00001472Only veto votes that are blocking the change from submission are moved to
1473the destination branch by default.
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301474
1475.Request
1476----
1477 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1478 Content-Type: application/json; charset=UTF-8
1479
1480 {
1481 "destination_branch" : "release-branch"
1482 }
1483
1484----
1485
1486As response a link:#change-info[ChangeInfo] entity is returned that
1487describes the moved change.
1488
1489.Response
1490----
1491 HTTP/1.1 200 OK
1492 Content-Disposition: attachment
1493 Content-Type: application/json; charset=UTF-8
1494
1495 )]}'
1496 {
1497 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1498 "project": "myProject",
1499 "branch": "release-branch",
1500 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1501 "subject": "Implementing Feature X",
1502 "status": "NEW",
1503 "created": "2013-02-01 09:59:32.126000000",
1504 "updated": "2013-02-21 11:16:36.775000000",
1505 "mergeable": true,
1506 "insertions": 2,
1507 "deletions": 13,
1508 "_number": 3965,
1509 "owner": {
1510 "name": "John Doe"
1511 }
1512 }
1513----
1514
Changcheng Xiao6dc90422017-08-09 10:21:58 +02001515Note that this endpoint will not update the change's parents, which is
1516different from the link:#cherry-pick[cherry-pick] endpoint.
1517
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301518If the change cannot be moved because the change state doesn't
1519allow moving the change, the response is "`409 Conflict`" and
1520the error message is contained in the response body.
1521
1522.Response
1523----
1524 HTTP/1.1 409 Conflict
1525 Content-Disposition: attachment
1526 Content-Type: text/plain; charset=UTF-8
1527
1528 change is merged
1529----
1530
1531If the change cannot be moved because the user doesn't have
1532abandon permission on the change or upload permission on the destination,
1533the response is "`409 Conflict`" and the error message is contained in the
1534response body.
1535
1536.Response
1537----
1538 HTTP/1.1 409 Conflict
1539 Content-Disposition: attachment
1540 Content-Type: text/plain; charset=UTF-8
1541
1542 move not permitted
1543----
1544
Edwin Kempind2ec4152013-02-22 12:17:19 +01001545[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001546=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001547--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001548'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001549--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001550
Edwin Kempind2ec4152013-02-22 12:17:19 +01001551Reverts a change.
1552
Gal Paikin006d52b2019-12-19 11:22:09 +01001553The subject of the newly created change will be
1554'Revert "<subject-of-reverted-change>"'. If the subject of the change reverted is
1555above 63 characters, it will be cut down to 59 characters with "..." in the end.
1556
Edwin Kempind2ec4152013-02-22 12:17:19 +01001557The request body does not need to include a link:#revert-input[
1558RevertInput] entity if no review comment is added.
1559
1560.Request
1561----
Michael Zhou10270492016-03-24 22:35:40 -04001562 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001563----
1564
1565As response a link:#change-info[ChangeInfo] entity is returned that
1566describes the reverting change.
1567
1568.Response
1569----
1570 HTTP/1.1 200 OK
1571 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001572 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001573
1574 )]}'
1575 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001576 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1577 "project": "myProject",
1578 "branch": "master",
1579 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1580 "subject": "Revert \"Implementing Feature X\"",
1581 "status": "NEW",
1582 "created": "2013-02-01 09:59:32.126000000",
1583 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001584 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001585 "insertions": 6,
1586 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001587 "_number": 3965,
1588 "owner": {
1589 "name": "John Doe"
1590 }
1591 }
1592----
1593
Gal Paikin6c9ed952020-01-22 10:36:35 +01001594If the user doesn't have revert permission on the change or upload permission on
1595the destination branch, the response is "`403 Forbidden`", and the error message is
1596contained in the response body.
1597
Edwin Kempind2ec4152013-02-22 12:17:19 +01001598If the change cannot be reverted because the change state doesn't
Gal Paikin6c9ed952020-01-22 10:36:35 +01001599allow reverting the change the response is "`409 Conflict`", and the error
1600message is contained in the response body.
Edwin Kempind2ec4152013-02-22 12:17:19 +01001601
1602.Response
1603----
1604 HTTP/1.1 409 Conflict
1605 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001606 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001607
1608 change is new
1609----
1610
Gal Paikinb81f56c2019-10-16 14:39:24 +02001611[[revert-submission]]
1612=== Revert Submission
1613--
1614'POST /changes/link:#change-id[\{change-id\}]/revert_submission'
1615--
1616
1617Creates open revert changes for all of the changes of a certain submission.
1618
Gal Paikin006d52b2019-12-19 11:22:09 +01001619The subject of each revert change will be 'Revert "<subject-of-reverted-change"'.
Gal Paikin100bf602019-12-23 14:50:41 +01001620If the subject is above 60 characters, the subject will be cut to 56 characters
1621with "..." in the end. However, whenever reverting the submission of a revert
1622submission, the subject will be shortened from
1623'Revert "Revert "<subject-of-reverted-change""' to
1624'Revert^2 "<subject-of-reverted-change"'. Also, for every future revert submission,
1625the only difference in the subject will be the number of the revert (instead of
1626Revert^2 the subject will change to Revert^3 and so on).
1627There are no guarantees about the subjects if the users change the default subjects.
Gal Paikinaffd0242019-12-18 18:10:08 +01001628
Gal Paikinb81f56c2019-10-16 14:39:24 +02001629Details for the revert can be specified in the request body inside a link:#revert-input[
1630RevertInput] The topic of all created revert changes will be
1631`revert-{submission_id}-{random_string_of_size_10}`.
1632
1633The changes will not be rebased on onto the destination branch so the users may still
1634have to manually rebase them to resolve conflicts and make them submittable.
1635
Gal Paikin653a8522019-11-25 11:40:10 +01001636However, the changes that have the same project and branch will be rebased on top
1637of each other. E.g, the first revert change will have the original change as a
1638parent, and the second revert change will have the first revert change as a
1639parent.
1640
1641There is one special case that involves merge commits; if a user has multiple
1642changes in the same project and branch, but not in the same change series, those
1643changes can still get submitted together if they have the same topic and
1644link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] in
1645gerrit.config is set to true. In the case, Gerrit may create merge commits on
1646submit (depending on the link:config-project-config.html#submit-type[submit types]
1647of the project).
1648The first parent for the reverts will be the most recent merge commit that was
1649created by Gerrit to merge the different change series into the target branch.
1650
Gal Paikinb81f56c2019-10-16 14:39:24 +02001651.Request
1652----
1653 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0
1654----
1655
1656As response link:#revert-submission-info[RevertSubmissionInfo] entity
1657is returned. That entity describes the revert changes.
1658
1659.Response
1660----
1661 HTTP/1.1 200 OK
1662 Content-Disposition: attachment
1663 Content-Type: application/json; charset=UTF-8
1664
1665 )]}'
1666 "revert_changes":
1667 [
1668 {
1669 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1670 "project": "myProject",
1671 "branch": "master",
1672 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1673 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1674 "subject": "Revert \"Implementing Feature X\"",
1675 "status": "NEW",
1676 "created": "2013-02-01 09:59:32.126000000",
1677 "updated": "2013-02-21 11:16:36.775000000",
1678 "mergeable": true,
1679 "insertions": 6,
1680 "deletions": 4,
1681 "_number": 3965,
1682 "owner": {
1683 "name": "John Doe"
1684 }
1685 },
1686 {
1687 "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646",
1688 "project": "anyProject",
1689 "branch": "master",
1690 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1691 "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646",
1692 "subject": "Revert \"Implementing Feature Y\"",
1693 "status": "NEW",
1694 "created": "2013-02-04 09:59:33.126000000",
1695 "updated": "2013-02-21 11:16:37.775000000",
1696 "mergeable": true,
1697 "insertions": 62,
1698 "deletions": 11,
1699 "_number": 3966,
1700 "owner": {
1701 "name": "Jane Doe"
1702 }
1703 }
1704 ]
1705----
1706
Gal Paikin6c9ed952020-01-22 10:36:35 +01001707If the user doesn't have revert permission on the change or upload permission on
1708the destination, the response is "`403 Forbidden`", and the error message is
1709contained in the response body.
1710
1711If the change cannot be reverted because the change state doesn't
1712allow reverting the change the response is "`409 Conflict`", and the error
1713message is contained in the response body.
Gal Paikinb81f56c2019-10-16 14:39:24 +02001714
1715.Response
1716----
1717 HTTP/1.1 409 Conflict
1718 Content-Disposition: attachment
1719 Content-Type: text/plain; charset=UTF-8
1720
1721 change is new
1722----
1723
Edwin Kempin0eddba02013-02-22 15:30:12 +01001724[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001725=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001726--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001727'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001728--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001729
Edwin Kempin0eddba02013-02-22 15:30:12 +01001730Submits a change.
1731
1732The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001733SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001734
Gal Paikinc326de42020-06-16 18:49:00 +03001735Submitting a change also removes all users from the link:#attention-set[attention set].
1736
Edwin Kempin0eddba02013-02-22 15:30:12 +01001737.Request
1738----
1739 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001740 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001741
1742 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001743 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001744 }
1745----
1746
1747As response a link:#change-info[ChangeInfo] entity is returned that
1748describes the submitted/merged change.
1749
Gal Paikine2849a82021-04-19 13:41:10 +02001750Submission may submit multiple changes, but we still only return one ChangeInfo
1751object. To query for all submitted changes, please use the submission_id that is
1752part of the response.
1753
1754Changes that will also be submitted:
17551. All changes of the same topic if
1756link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1757configuration is set to true.
17582. All dependent changes.
17593. The closure of the above (e.g if a dependent change has a topic, all changes
1760of *that* topic will also be submitted).
1761
Edwin Kempin0eddba02013-02-22 15:30:12 +01001762.Response
1763----
1764 HTTP/1.1 200 OK
1765 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001766 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001767
1768 )]}'
1769 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001770 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1771 "project": "myProject",
1772 "branch": "master",
1773 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1774 "subject": "Implementing Feature X",
1775 "status": "MERGED",
1776 "created": "2013-02-01 09:59:32.126000000",
1777 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001778 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001779 "_number": 3965,
1780 "owner": {
1781 "name": "John Doe"
1782 }
1783 }
1784----
1785
1786If the change cannot be submitted because the submit rule doesn't allow
1787submitting the change, the response is "`409 Conflict`" and the error
1788message is contained in the response body.
1789
1790.Response
1791----
1792 HTTP/1.1 409 Conflict
1793 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001794 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001795
1796 blocked by Verified
1797----
1798
David Pursehouse025c1af2015-11-20 17:02:50 +09001799[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001800=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07001801--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001802'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001803--
1804
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001805Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001806link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07001807including the current change itself.
1808
Stefan Bellera7ad6612015-06-26 10:05:43 -07001809The list consists of:
1810
1811* The given change.
1812* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1813 is enabled, include all open changes with the same topic.
1814* For each change whose submit type is not CHERRY_PICK, include unmerged
1815 ancestors targeting the same branch.
1816
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001817As a special case, the list is empty if this change would be
1818submitted by itself (without other changes).
1819
1820.Request
1821----
1822 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
1823 Content-Type: application/json; charset=UTF-8
1824----
1825
1826As a response a link:#submitted-together-info[SubmittedTogetherInfo]
1827entity is returned that describes what would happen if the change were
1828submitted. This response contains a list of changes and a count of
1829changes that are not visible to the caller that are part of the set of
1830changes to be merged.
1831
1832The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001833link:#list-changes[Query Changes] with the
1834link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Patrick Hiesel6fbbdaa2018-04-05 15:10:13 +02001835link:#current-revision[`CURRENT_REVISION`],and
Jonathan Niedercb51d742016-09-23 11:37:57 -07001836link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001837
Shawn Pearce8080c3d2016-09-19 19:15:04 -07001838Standard link:#query-options[formatting options] can be specified
1839with the `o` parameter, as well as the `submitted_together` specific
1840option `NON_VISIBLE_CHANGES`.
1841
Stefan Bellera7ad6612015-06-26 10:05:43 -07001842.Response
1843----
1844 HTTP/1.1 200 OK
1845 Content-Disposition: attachment
1846 Content-Type: application/json; charset=UTF-8
1847
1848)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001849{
1850 "changes": [
1851 {
1852 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1853 "project": "gerrit",
1854 "branch": "master",
1855 "hashtags": [],
1856 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1857 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1858 "status": "NEW",
1859 "created": "2015-05-01 15:39:57.979000000",
1860 "updated": "2015-05-20 19:25:21.592000000",
1861 "mergeable": true,
1862 "insertions": 303,
1863 "deletions": 210,
1864 "_number": 1779,
1865 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001866 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001867 },
1868 "labels": {
1869 "Code-Review": {
1870 "approved": {
1871 "_account_id": 1000000
1872 },
1873 "all": [
1874 {
1875 "value": 2,
1876 "date": "2015-05-20 19:25:21.592000000",
1877 "_account_id": 1000000
1878 }
1879 ],
1880 "values": {
1881 "-2": "This shall not be merged",
1882 "-1": "I would prefer this is not merged as is",
1883 " 0": "No score",
1884 "+1": "Looks good to me, but someone else must approve",
1885 "+2": "Looks good to me, approved"
1886 },
1887 "default_value": 0
1888 },
1889 "Verified": {
1890 "approved": {
1891 "_account_id": 1000000
1892 },
1893 "all": [
1894 {
1895 "value": 1,
1896 "date": "2015-05-20 19:25:21.592000000",
1897 "_account_id": 1000000
1898 }
1899 ],
1900 "values": {
1901 "-1": "Fails",
1902 " 0": "No score",
1903 "+1": "Verified"
1904 },
1905 "default_value": 0
1906 }
1907 },
1908 "permitted_labels": {
1909 "Code-Review": [
1910 "-2",
1911 "-1",
1912 " 0",
1913 "+1",
1914 "+2"
1915 ],
1916 "Verified": [
1917 "-1",
1918 " 0",
1919 "+1"
1920 ]
1921 },
1922 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001923 {
1924 "_account_id": 1000000
1925 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001926 ],
1927 "reviewers": {
1928 "REVIEWER": [
1929 {
1930 "_account_id": 1000000
1931 }
1932 ]
1933 },
1934 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1935 "revisions": {
1936 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09001937 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001938 "_number": 1,
1939 "created": "2015-05-01 15:39:57.979000000",
1940 "uploader": {
1941 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001942 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001943 "ref": "refs/changes/79/1779/1",
1944 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07001945 }
1946 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001947 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001948 {
1949 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
1950 "project": "gerrit",
1951 "branch": "master",
1952 "hashtags": [],
1953 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
1954 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1955 "status": "NEW",
1956 "created": "2015-05-01 15:39:57.979000000",
1957 "updated": "2015-05-20 19:25:21.546000000",
1958 "mergeable": true,
1959 "insertions": 15,
1960 "deletions": 6,
1961 "_number": 1780,
1962 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001963 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001964 },
1965 "labels": {
1966 "Code-Review": {
1967 "approved": {
1968 "_account_id": 1000000
1969 },
1970 "all": [
1971 {
1972 "value": 2,
1973 "date": "2015-05-20 19:25:21.546000000",
1974 "_account_id": 1000000
1975 }
1976 ],
1977 "values": {
1978 "-2": "This shall not be merged",
1979 "-1": "I would prefer this is not merged as is",
1980 " 0": "No score",
1981 "+1": "Looks good to me, but someone else must approve",
1982 "+2": "Looks good to me, approved"
1983 },
1984 "default_value": 0
1985 },
1986 "Verified": {
1987 "approved": {
1988 "_account_id": 1000000
1989 },
1990 "all": [
1991 {
1992 "value": 1,
1993 "date": "2015-05-20 19:25:21.546000000",
1994 "_account_id": 1000000
1995 }
1996 ],
1997 "values": {
1998 "-1": "Fails",
1999 " 0": "No score",
2000 "+1": "Verified"
2001 },
2002 "default_value": 0
2003 }
2004 },
2005 "permitted_labels": {
2006 "Code-Review": [
2007 "-2",
2008 "-1",
2009 " 0",
2010 "+1",
2011 "+2"
2012 ],
2013 "Verified": [
2014 "-1",
2015 " 0",
2016 "+1"
2017 ]
2018 },
2019 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08002020 {
2021 "_account_id": 1000000
2022 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002023 ],
2024 "reviewers": {
2025 "REVIEWER": [
2026 {
2027 "_account_id": 1000000
2028 }
2029 ]
2030 },
2031 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
2032 "revisions": {
2033 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09002034 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002035 "_number": 1,
2036 "created": "2015-05-01 15:39:57.979000000",
2037 "uploader": {
2038 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07002039 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002040 "ref": "refs/changes/80/1780/1",
2041 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07002042 }
2043 }
2044 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002045 ],
2046 "non_visible_changes": 0
2047}
Stefan Bellera7ad6612015-06-26 10:05:43 -07002048----
2049
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002050If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
2051instead of a link:#submitted-together-info[SubmittedTogetherInfo]
2052entity, the response is a list of changes, or a 403 response with a
2053message if the set of changes to be submitted with this change
2054includes changes the caller cannot read.
2055
Stefan Bellera7ad6612015-06-26 10:05:43 -07002056
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02002057[[delete-change]]
2058=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002059--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002060'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002061--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002062
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02002063Deletes a change.
2064
Paladox none580ae0e2017-02-12 18:15:48 +00002065New or abandoned changes can be deleted by their owner if the user is granted
2066the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
2067otherwise only by administrators.
2068
David Ostrovsky0d69c232013-09-10 23:10:23 +02002069.Request
2070----
2071 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002072 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02002073----
2074
2075.Response
2076----
2077 HTTP/1.1 204 No Content
2078----
2079
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002080[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002081=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002082--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002083'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002084--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002085
2086Retrieves the branches and tags in which a change is included. As result
2087an link:#included-in-info[IncludedInInfo] entity is returned.
2088
2089.Request
2090----
2091 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
2092----
2093
2094.Response
2095----
2096 HTTP/1.1 200 OK
2097 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002098 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002099
2100 )]}'
2101 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002102 "branches": [
2103 "master"
2104 ],
2105 "tags": []
2106 }
2107----
2108
David Pursehouse4e38b972014-05-30 10:36:40 +09002109[[index-change]]
2110=== Index Change
2111--
2112'POST /changes/link:#change-id[\{change-id\}]/index'
2113--
2114
2115Adds or updates the change in the secondary index.
2116
2117.Request
2118----
2119 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
2120----
2121
2122.Response
2123----
2124 HTTP/1.1 204 No Content
2125----
2126
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002127[[list-change-comments]]
2128=== List Change Comments
2129--
2130'GET /changes/link:#change-id[\{change-id\}]/comments'
2131--
2132
2133Lists the published comments of all revisions of the change.
2134
2135Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2136entries. The entries in the map are sorted by file path, and the
2137comments for each path are sorted by patch set number. Each comment has
2138the `patch_set` and `author` fields set.
2139
Youssef Elghareeb68e87b62021-01-11 13:20:03 +01002140If the `enable-context` request parameter is set to true, the comment entries
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02002141will contain a list of link:#context-line[ContextLine] containing the lines of
2142the source file where the comment was written.
2143
Youssef Elghareeb87b74502021-02-05 18:53:05 +01002144The `context-padding` request parameter can be used to specify an extra number
2145of context lines to be added before and after the comment range. This parameter
2146only works if `enable-context` is set to true.
2147
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002148.Request
2149----
2150 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
2151----
2152
2153.Response
2154----
2155 HTTP/1.1 200 OK
2156 Content-Disposition: attachment
2157 Content-Type: application/json; charset=UTF-8
2158
2159 )]}'
2160 {
2161 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2162 {
2163 "patch_set": 1,
2164 "id": "TvcXrmjM",
2165 "line": 23,
2166 "message": "[nit] trailing whitespace",
2167 "updated": "2013-02-26 15:40:43.986000000"
2168 "author": {
2169 "_account_id": 1000096,
2170 "name": "John Doe",
2171 "email": "john.doe@example.com"
2172 }
2173 },
2174 {
2175 "patch_set": 2,
2176 "id": "TveXwFiA",
2177 "line": 49,
2178 "in_reply_to": "TfYX-Iuo",
2179 "message": "Done",
2180 "updated": "2013-02-26 15:40:45.328000000"
2181 "author": {
2182 "_account_id": 1000097,
2183 "name": "Jane Roe",
2184 "email": "jane.roe@example.com"
2185 }
2186 }
2187 ]
2188 }
2189----
2190
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002191[[list-change-robot-comments]]
2192=== List Change Robot Comments
2193--
2194'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
2195--
2196
2197Lists the robot comments of all revisions of the change.
2198
2199Return a map that maps the file path to a list of
2200link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
2201map are sorted by file path.
2202
2203.Request
2204----
2205 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
2206----
2207
2208.Response
2209----
2210 HTTP/1.1 200 OK
2211 Content-Disposition: attachment
2212 Content-Type: application/json; charset=UTF-8
2213
2214 )]}'
2215 {
2216 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2217 {
2218 "id": "TvcXrmjM",
2219 "line": 23,
2220 "message": "unused import",
2221 "updated": "2016-02-26 15:40:43.986000000",
2222 "author": {
2223 "_account_id": 1000110,
2224 "name": "Code Analyzer",
2225 "email": "code.analyzer@example.com"
2226 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002227 "robot_id": "importChecker",
2228 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002229 },
2230 {
2231 "id": "TveXwFiA",
2232 "line": 49,
2233 "message": "wrong indention",
2234 "updated": "2016-02-26 15:40:45.328000000",
2235 "author": {
2236 "_account_id": 1000110,
2237 "name": "Code Analyzer",
2238 "email": "code.analyzer@example.com"
2239 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002240 "robot_id": "styleChecker",
2241 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002242 }
2243 ]
2244 }
2245----
2246
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002247[[list-change-drafts]]
2248=== List Change Drafts
2249--
2250'GET /changes/link:#change-id[\{change-id\}]/drafts'
2251--
2252
2253Lists the draft comments of all revisions of the change that belong to
2254the calling user.
2255
2256Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2257entries. The entries in the map are sorted by file path, and the
2258comments for each path are sorted by patch set number. Each comment has
2259the `patch_set` field set, and no `author`.
2260
Youssef Elghareeb59580cb2021-03-17 15:02:49 +01002261The `enable-context` and `context-padding` request parameters can be used to
2262request comment context. See link:#list-change-comments[List Change Comments]
2263for more details.
2264
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002265.Request
2266----
2267 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
2268----
2269
2270.Response
2271----
2272 HTTP/1.1 200 OK
2273 Content-Disposition: attachment
2274 Content-Type: application/json; charset=UTF-8
2275
2276 )]}'
2277 {
2278 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2279 {
2280 "patch_set": 1,
2281 "id": "TvcXrmjM",
2282 "line": 23,
2283 "message": "[nit] trailing whitespace",
2284 "updated": "2013-02-26 15:40:43.986000000"
2285 },
2286 {
2287 "patch_set": 2,
2288 "id": "TveXwFiA",
2289 "line": 49,
2290 "in_reply_to": "TfYX-Iuo",
2291 "message": "Done",
2292 "updated": "2013-02-26 15:40:45.328000000"
2293 }
2294 ]
2295 }
2296----
2297
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002298[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002299=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002300--
2301'GET /changes/link:#change-id[\{change-id\}]/check'
2302--
2303
2304Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002305link:#change-info[ChangeInfo] entity with the `problems` field set to a
2306list of link:#problem-info[ProblemInfo] entities.
2307
2308Depending on the type of problem, some fields not marked optional may be
2309missing from the result. At least `id`, `project`, `branch`, and
2310`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002311
2312.Request
2313----
2314 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2315----
2316
2317.Response
2318----
2319 HTTP/1.1 200 OK
2320 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002321 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002322
2323 )]}'
2324 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002325 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2326 "project": "myProject",
2327 "branch": "master",
2328 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2329 "subject": "Implementing Feature X",
2330 "status": "NEW",
2331 "created": "2013-02-01 09:59:32.126000000",
2332 "updated": "2013-02-21 11:16:36.775000000",
2333 "mergeable": true,
2334 "insertions": 34,
2335 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002336 "_number": 3965,
2337 "owner": {
2338 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002339 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002340 "problems": [
2341 {
2342 "message": "Current patch set 1 not found"
2343 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002344 ]
2345 }
2346----
2347
Dave Borowitz3be39d02014-12-03 17:57:38 -08002348[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002349=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002350--
2351'POST /changes/link:#change-id[\{change-id\}]/check'
2352--
2353
2354Performs consistency checks on the change as with link:#check-change[GET
2355/check], and additionally fixes any problems that can be fixed
2356automatically. The returned field values reflect any fixes.
2357
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002358Some fixes have options controlling their behavior, which can be set in the
2359link:#fix-input[FixInput] entity body.
2360
Dave Borowitz3be39d02014-12-03 17:57:38 -08002361Only the change owner, a project owner, or an administrator may fix changes.
2362
2363.Request
2364----
2365 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2366----
2367
2368.Response
2369----
2370 HTTP/1.1 200 OK
2371 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002372 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002373
2374 )]}'
2375 {
2376 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2377 "project": "myProject",
2378 "branch": "master",
2379 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2380 "subject": "Implementing Feature X",
2381 "status": "MERGED",
2382 "created": "2013-02-01 09:59:32.126000000",
2383 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002384 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002385 "mergeable": true,
2386 "insertions": 34,
2387 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002388 "_number": 3965,
2389 "owner": {
2390 "name": "John Doe"
2391 },
2392 "problems": [
2393 {
2394 "message": "Current patch set 2 not found"
2395 },
2396 {
2397 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2398 "status": FIXED,
2399 "outcome": "Marked change as merged"
2400 }
2401 ]
2402 }
2403----
2404
Alan Tokaev392cfca2017-04-28 11:11:31 +02002405[[set-work-in-pogress]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002406=== Set Work-In-Progress
Alan Tokaev392cfca2017-04-28 11:11:31 +02002407--
2408'POST /changes/link:#change-id[\{change-id\}]/wip'
2409--
2410
David Ostrovsky44242452018-06-09 20:25:13 +02002411Marks the change as not ready for review yet. Changes may only be marked not
2412ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002413
2414The request body does not need to include a
2415link:#work-in-progress-input[WorkInProgressInput] entity if no review comment
2416is added. Actions that create a new patch set in a WIP change default to
2417notifying *OWNER* instead of *ALL*.
2418
Gal Paikinc326de42020-06-16 18:49:00 +03002419Marking a change work in progress also removes all users from the
2420link:#attention-set[attention set].
2421
Alan Tokaev392cfca2017-04-28 11:11:31 +02002422.Request
2423----
2424 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0
2425 Content-Type: application/json; charset=UTF-8
2426
2427 {
2428 "message": "Refactoring needs to be done before we can proceed here."
2429 }
2430----
2431
2432.Response
2433----
2434 HTTP/1.1 200 OK
2435----
2436
2437[[set-ready-for-review]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002438=== Set Ready-For-Review
Alan Tokaev392cfca2017-04-28 11:11:31 +02002439--
2440'POST /changes/link:#change-id[\{change-id\}]/ready'
2441--
2442
David Ostrovsky44242452018-06-09 20:25:13 +02002443Marks the change as ready for review (set WIP property to false). Changes may
2444only be marked ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002445
2446Activates notifications of reviewer. The request body does not need
2447to include a link:#work-in-progress-input[WorkInProgressInput] entity
2448if no review comment is added.
2449
Gal Paikinc326de42020-06-16 18:49:00 +03002450Marking a change ready for review also adds all of the reviewers of the change
2451to the link:#attention-set[attention set].
2452
Alan Tokaev392cfca2017-04-28 11:11:31 +02002453.Request
2454----
2455 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0
2456 Content-Type: application/json;charset=UTF-8
2457
2458 {
2459 "message": "Refactoring is done."
2460 }
2461
2462----
2463
2464.Response
2465----
2466 HTTP/1.1 200 OK
2467----
2468
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002469[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002470=== Mark Private
2471--
Edwin Kempin364a86b2017-04-27 12:34:00 +02002472'POST /changes/link:#change-id[\{change-id\}]/private'
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002473--
2474
Patrick Hiesel707e61a2019-02-13 18:28:48 +01002475Marks the change to be private. Only open changes can be marked private.
2476Changes may only be marked private by the owner or site administrators.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002477
Edwin Kempin364a86b2017-04-27 12:34:00 +02002478A message can be specified in the request body inside a
2479link:#private-input[PrivateInput] entity.
2480
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002481.Request
2482----
Edwin Kempin364a86b2017-04-27 12:34:00 +02002483 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2484 Content-Type: application/json; charset=UTF-8
2485
2486 {
2487 "message": "After this security fix has been released we can make it public now."
2488 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002489----
2490
2491.Response
2492----
2493 HTTP/1.1 201 Created
2494----
2495
2496If the change was already private the response is "`200 OK`".
2497
2498[[unmark-private]]
2499=== Unmark Private
2500--
2501'DELETE /changes/link:#change-id[\{change-id\}]/private'
2502--
2503
2504Marks the change to be non-private. Note users can only unmark own private
2505changes.
2506
2507.Request
2508----
2509 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2510----
2511
2512.Response
2513----
2514 HTTP/1.1 204 No Content
2515----
2516
2517If the change was already not private, the response is "`409 Conflict`".
2518
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002519A message can be specified in the request body inside a
2520link:#private-input[PrivateInput] entity. Historically, this method allowed
2521a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01002522link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002523In this case, use a POST request instead:
Edwin Kempin364a86b2017-04-27 12:34:00 +02002524
2525.Request
2526----
2527 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0
2528 Content-Type: application/json; charset=UTF-8
2529
2530 {
2531 "message": "This is a security fix that must not be public."
2532 }
2533----
2534
David Pursehoused656fa82017-04-28 06:51:26 +02002535[[ignore]]
2536=== Ignore
2537--
2538'PUT /changes/link:#change-id[\{change-id\}]/ignore'
2539--
2540
2541Marks a change as ignored. The change will not be shown in the incoming
David Pursehouseaa51cba2018-07-09 11:02:17 +09002542reviews dashboard, and email notifications will be suppressed. Ignoring
2543a change does not cause the change's "updated" timestamp to be modified,
2544and the owner is not notified.
David Pursehoused656fa82017-04-28 06:51:26 +02002545
2546.Request
2547----
2548 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ignore HTTP/1.0
2549----
2550
2551[[unignore]]
2552=== Unignore
2553--
2554'PUT /changes/link:#change-id[\{change-id\}]/unignore'
2555--
2556
2557Un-marks a change as ignored.
2558
2559.Request
2560----
2561 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unignore HTTP/1.0
2562----
2563
Edwin Kempinceb673e2017-10-01 12:29:05 +02002564[[mark-as-reviewed]]
2565=== Mark as Reviewed
2566--
2567'PUT /changes/link:#change-id[\{change-id\}]/reviewed'
2568--
2569
2570Marks a change as reviewed.
2571
2572This allows users to "de-highlight" changes in their dashboard until a new
2573patch set is uploaded.
2574
2575This differs from the link:#ignore[ignore] endpoint, which will mute
2576emails and hide the change from dashboard completely until it is
2577link:#unignore[unignored] again.
2578
2579
2580.Request
2581----
2582 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewed HTTP/1.0
2583----
2584
2585[[mark-as-unreviewed]]
2586=== Mark as Unreviewed
2587--
2588'PUT /changes/link:#change-id[\{change-id\}]/unreviewed'
2589--
2590
2591Marks a change as unreviewed.
2592
2593This allows users to "highlight" changes in their dashboard
2594
2595.Request
2596----
2597 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unreviewed HTTP/1.0
2598----
2599
David Pursehouse7c79b682017-08-25 13:18:32 +09002600[[get-hashtags]]
2601=== Get Hashtags
2602--
2603'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2604--
2605
2606Gets the hashtags associated with a change.
2607
David Pursehouse7c79b682017-08-25 13:18:32 +09002608.Request
2609----
2610 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2611----
2612
2613As response the change's hashtags are returned as a list of strings.
2614
2615.Response
2616----
2617 HTTP/1.1 200 OK
2618 Content-Disposition: attachment
2619 Content-Type: application/json; charset=UTF-8
2620
2621 )]}'
2622 [
2623 "hashtag1",
2624 "hashtag2"
2625 ]
2626----
2627
2628[[set-hashtags]]
2629=== Set Hashtags
2630--
2631'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2632--
2633
2634Adds and/or removes hashtags from a change.
2635
David Pursehouse7c79b682017-08-25 13:18:32 +09002636The hashtags to add or remove must be provided in the request body inside a
2637link:#hashtags-input[HashtagsInput] entity.
2638
2639.Request
2640----
2641 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2642 Content-Type: application/json; charset=UTF-8
2643
2644 {
2645 "add" : [
2646 "hashtag3"
2647 ],
2648 "remove" : [
2649 "hashtag2"
2650 ]
2651 }
2652----
2653
2654As response the change's hashtags are returned as a list of strings.
2655
2656.Response
2657----
2658 HTTP/1.1 200 OK
2659 Content-Disposition: attachment
2660 Content-Type: application/json; charset=UTF-8
2661
2662 )]}'
2663 [
2664 "hashtag1",
2665 "hashtag3"
2666 ]
2667----
2668
Changcheng Xiao7fb73292018-04-25 11:43:19 +02002669[[list-change-messages]]
2670=== List Change Messages
2671--
2672'GET /changes/link:#change-id[\{change-id\}]/messages'
2673--
2674
2675Lists all the messages of a change including link:#detailed-accounts[detailed account information].
2676
2677.Request
2678----
2679 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages
2680----
2681
2682As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned.
2683
2684.Response
2685----
2686 HTTP/1.1 200 OK
2687 Content-Disposition: attachment
2688 Content-Type: application/json; charset=UTF-8
2689
2690 )]}'
2691 [
2692 {
2693 "id": "YH-egE",
2694 "author": {
2695 "_account_id": 1000096,
2696 "name": "John Doe",
2697 "email": "john.doe@example.com",
2698 "username": "jdoe"
2699 },
2700 "date": "2013-03-23 21:34:02.419000000",
2701 "message": "Patch Set 1:\n\nThis is the first message.",
2702 "_revision_number": 1
2703 },
2704 {
2705 "id": "WEEdhU",
2706 "author": {
2707 "_account_id": 1000097,
2708 "name": "Jane Roe",
2709 "email": "jane.roe@example.com",
2710 "username": "jroe"
2711 },
2712 "date": "2013-03-23 21:36:52.332000000",
2713 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
2714 "_revision_number": 1
2715 }
2716 ]
2717----
David Pursehousec32050d2017-08-25 16:27:47 +09002718
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002719[[get-change-message]]
2720=== Get Change Message
2721
2722Retrieves a change message including link:#detailed-accounts[detailed account information].
2723
2724--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002725'GET /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]'
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002726--
2727
2728As response a link:#change-message-info[ChangeMessageInfo] entity is returned.
2729
2730.Response
2731----
2732 HTTP/1.1 200 OK
2733 Content-Disposition: attachment
2734 Content-Type: application/json; charset=UTF-8
2735
2736 )]}'
2737 {
2738 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
2739 "author": {
2740 "_account_id": 1000096,
2741 "name": "John Doe",
2742 "email": "john.doe@example.com",
2743 "username": "jdoe"
2744 },
2745 "date": "2013-03-23 21:34:02.419000000",
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002746 "message": "a change message",
2747 "_revision_number": 1
2748 }
2749----
2750
2751[[delete-change-message]]
2752=== Delete Change Message
2753--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002754'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' +
2755'POST /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]/delete'
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002756--
2757
2758Deletes a change message by replacing the change message with a new message,
2759which contains the name of the user who deleted the change message and the
2760reason why it was deleted. The reason can be provided in the request body as a
2761link:#delete-change-message-input[DeleteChangeMessageInput] entity.
2762
2763Note that only users with the
2764link:access-control.html#capability_administrateServer[Administrate Server]
2765global capability are permitted to delete a change message.
2766
2767To delete a change message, send a DELETE request:
2768
2769.Request
2770----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002771 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002772----
2773
2774To provide a reason for the deletion, use a POST request:
2775
2776.Request
2777----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002778 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002779 Content-Type: application/json; charset=UTF-8
2780
2781 {
2782 "reason": "spam"
2783 }
2784----
2785
2786As response a link:#change-message-info[ChangeMessageInfo] entity is returned that
2787describes the updated change message.
2788
2789.Response
2790----
2791 HTTP/1.1 200 OK
2792 Content-Disposition: attachment
2793 Content-Type: application/json; charset=UTF-8
2794
2795 )]}'
2796 {
2797 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
2798 "author": {
2799 "_account_id": 1000096,
2800 "name": "John Doe",
2801 "email": "john.doe@example.com",
2802 "username": "jdoe"
2803 },
2804 "date": "2013-03-23 21:34:02.419000000",
2805 "message": "Change message removed by: Administrator\nReason: spam",
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002806 "_revision_number": 1
2807 }
2808----
Gustaf Lundhe8647c62017-04-28 06:51:26 +02002809
David Ostrovsky1a49f622014-07-29 00:40:02 +02002810[[edit-endpoints]]
2811== Change Edit Endpoints
2812
David Ostrovsky1a49f622014-07-29 00:40:02 +02002813[[get-edit-detail]]
2814=== Get Change Edit Details
2815--
2816'GET /changes/link:#change-id[\{change-id\}]/edit
2817--
2818
2819Retrieves a change edit details.
2820
2821.Request
2822----
2823 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2824----
2825
2826As response an link:#edit-info[EditInfo] entity is returned that
2827describes the change edit, or "`204 No Content`" when change edit doesn't
2828exist for this change. Change edits are stored on special branches and there
2829can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02002830When request parameter `list` is provided the response also includes the file
2831list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02002832against this base revision. When request parameter `download-commands` is
2833provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02002834
2835.Response
2836----
2837 HTTP/1.1 200 OK
2838 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002839 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02002840
2841 )]}'
2842 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01002843 "commit": {
2844 "parents": [
David Ostrovsky1a49f622014-07-29 00:40:02 +02002845 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01002846 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
David Ostrovsky1a49f622014-07-29 00:40:02 +02002847 }
2848 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01002849 "author": {
2850 "name": "Shawn O. Pearce",
2851 "email": "sop@google.com",
2852 "date": "2012-04-24 18:08:08.000000000",
2853 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02002854 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01002855 "committer": {
2856 "name": "Shawn O. Pearce",
2857 "email": "sop@google.com",
2858 "date": "2012-04-24 18:08:08.000000000",
2859 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02002860 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01002861 "subject": "Use an EventBus to manage star icons",
2862 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
David Ostrovsky1a49f622014-07-29 00:40:02 +02002863 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01002864 "base_patch_set_number": 1,
2865 "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3",
2866 "ref": "refs/users/01/1000001/edit-76482/1"
David Ostrovsky1a49f622014-07-29 00:40:02 +02002867 }
2868----
David Pursehouse4e38b972014-05-30 10:36:40 +09002869
David Ostrovskya5ab8292014-08-01 02:11:39 +02002870[[put-edit-file]]
2871=== Change file content in Change Edit
2872--
2873'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2874--
2875
2876Put content of a file to a change edit.
2877
2878.Request
2879----
2880 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2881----
2882
Paladox none28920b42020-02-22 19:28:21 +00002883To upload a file as binary data in the request body:
2884
2885.Request
2886----
2887 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2888 Content-Type: application/json; charset=UTF-8
2889
2890 {
2891 "binary_content": "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="
2892 }
2893----
2894
2895Note that it must be base-64 encoded data uri.
2896
David Ostrovskya5ab8292014-08-01 02:11:39 +02002897When change edit doesn't exist for this change yet it is created. When file
2898content isn't provided, it is wiped out for that file. As response
2899"`204 No Content`" is returned.
2900
2901.Response
2902----
2903 HTTP/1.1 204 No Content
2904----
2905
Gal Paikin68d217b2019-10-07 21:01:22 +02002906When the change edit is a no-op, for example when providing the same file
2907content that the file already has, '409 no changes were made' is returned.
2908
2909.Response
2910----
2911 HTTP/1.1 409 no changes were made
2912----
2913
David Ostrovsky138edb42014-08-15 21:31:43 +02002914[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01002915=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02002916--
2917'POST /changes/link:#change-id[\{change-id\}]/edit
2918--
2919
David Ostrovskya00c9532015-01-21 00:17:49 +01002920Creates empty change edit, restores file content or renames files in change
2921edit. The request body needs to include a
2922link:#change-edit-input[ChangeEditInput] entity when a file within change
2923edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02002924
2925.Request
2926----
2927 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002928 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02002929
2930 {
David Ostrovskybd12e172014-08-21 23:08:15 +02002931 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02002932 }
2933----
2934
David Ostrovskya00c9532015-01-21 00:17:49 +01002935or for rename:
2936
2937.Request
2938----
2939 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2940 Content-Type: application/json; charset=UTF-8
2941
2942 {
2943 "old_path": "foo",
2944 "new_path": "bar"
2945 }
2946----
2947
David Ostrovsky138edb42014-08-15 21:31:43 +02002948When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01002949and restore flag are provided in request body, this file is restored. When
2950old and new file names are provided, the file is renamed. As response
2951"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02002952
2953.Response
2954----
2955 HTTP/1.1 204 No Content
2956----
2957
David Ostrovskyc967e152014-10-24 17:36:16 +02002958[[put-change-edit-message]]
2959=== Change commit message in Change Edit
2960--
2961'PUT /changes/link:#change-id[\{change-id\}]/edit:message
2962--
2963
2964Modify commit message. The request body needs to include a
2965link:#change-edit-message-input[ChangeEditMessageInput]
2966entity.
2967
2968.Request
2969----
2970 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002971 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02002972
2973 {
2974 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
2975 }
2976----
2977
2978If a change edit doesn't exist for this change yet, it is created. As
2979response "`204 No Content`" is returned.
2980
2981.Response
2982----
2983 HTTP/1.1 204 No Content
2984----
2985
David Ostrovsky2830c292014-08-01 02:24:31 +02002986[[delete-edit-file]]
2987=== Delete file in Change Edit
2988--
2989'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
2990--
2991
2992Deletes a file from a change edit. This deletes the file from the repository
2993completely. This is not the same as reverting or restoring a file to its
2994previous contents.
2995
2996.Request
2997----
2998 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2999----
3000
3001When change edit doesn't exist for this change yet it is created.
3002
3003.Response
3004----
3005 HTTP/1.1 204 No Content
3006----
3007
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003008[[get-edit-file]]
3009=== Retrieve file content from Change Edit
3010--
3011'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
3012--
3013
3014Retrieves content of a file from a change edit.
3015
3016.Request
3017----
3018 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3019----
3020
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003021The content of the file is returned as text encoded inside base64.
3022The Content-Type header will always be `text/plain` reflecting the
3023outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
3024can be examined to find the server detected content type of the file.
3025
3026When the specified file was deleted in the change edit
3027"`204 No Content`" is returned.
3028
3029If only the content type is required, callers should use HEAD to
3030avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003031
Michael Zhou551ad0c2016-04-26 01:21:42 -04003032If the `base` parameter is set to true, the returned content is from the
3033revision that the edit is based on.
3034
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003035.Response
3036----
3037 HTTP/1.1 200 OK
3038 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003039 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003040 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003041 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003042
3043 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
3044----
3045
David Ostrovskyd0078672015-02-06 21:51:04 +01003046Alternatively, if the only value of the Accept request header is
3047`application/json` the content is returned as JSON string and
3048`X-FYI-Content-Encoding` is set to `json`.
3049
David Ostrovsky9ea9c112015-01-25 00:12:38 +01003050[[get-edit-meta-data]]
3051=== Retrieve meta data of a file from Change Edit
3052--
3053'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
3054--
3055
3056Retrieves meta data of a file from a change edit. Currently only
3057web links are returned.
3058
3059.Request
3060----
3061 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
3062----
3063
3064This REST endpoint retrieves additional information for a file in a
3065change edit. As result an link:#edit-file-info[EditFileInfo] entity is
3066returned.
3067
3068.Response
3069----
3070 HTTP/1.1 200 OK
3071 Content-Disposition: attachment
3072 Content-Type: application/json; charset=UTF-8
3073
3074 )]}'
3075 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003076 "web_links": [
David Ostrovsky9ea9c112015-01-25 00:12:38 +01003077 {
3078 "show_on_side_by_side_diff_view": true,
3079 "name": "side-by-side preview diff",
3080 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
3081 "url": "#/x/xdocs/c/42/1..0/README.md",
3082 "target": "_self"
3083 },
3084 {
3085 "show_on_unified_diff_view": true,
3086 "name": "unified preview diff",
3087 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
3088 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
3089 "target": "_self"
3090 }
3091 ]}
3092----
3093
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003094[[get-edit-message]]
3095=== Retrieve commit message from Change Edit or current patch set of the change
3096--
3097'GET /changes/link:#change-id[\{change-id\}]/edit:message
3098--
3099
David Ostrovsky25ad15e2014-12-15 21:18:59 +01003100Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003101
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02003102If the `base` parameter is set to true, the returned message is from the
3103revision that the edit is based on.
3104
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003105.Request
3106----
3107 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
3108----
3109
3110The commit message is returned as base64 encoded string.
3111
3112.Response
3113----
3114 HTTP/1.1 200 OK
3115
3116 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
3117M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
3118----
3119
David Ostrovskyd0078672015-02-06 21:51:04 +01003120Alternatively, if the only value of the Accept request header is
3121`application/json` the commit message is returned as JSON string:
3122
3123.Response
3124----
3125 HTTP/1.1 200 OK
3126
3127)]}'
3128"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
3129----
3130
3131
David Ostrovskye9988f92014-08-01 09:56:34 +02003132[[publish-edit]]
3133=== Publish Change Edit
3134--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003135'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02003136--
3137
3138Promotes change edit to a regular patch set.
3139
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003140Options can be provided in the request body as a
3141link:#publish-change-edit-input[PublishChangeEditInput] entity.
3142
David Ostrovskye9988f92014-08-01 09:56:34 +02003143.Request
3144----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003145 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003146 Content-Type: application/json; charset=UTF-8
3147
3148 {
3149 "notify": "NONE"
3150 }
David Ostrovskye9988f92014-08-01 09:56:34 +02003151----
3152
3153As response "`204 No Content`" is returned.
3154
3155.Response
3156----
3157 HTTP/1.1 204 No Content
3158----
3159
David Ostrovsky46999d22014-08-16 02:19:13 +02003160[[rebase-edit]]
3161=== Rebase Change Edit
3162--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003163'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02003164--
3165
3166Rebases change edit on top of latest patch set.
3167
3168.Request
3169----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003170 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02003171----
3172
3173When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09003174"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02003175based on top of the latest patch set, the response
3176"`409 Conflict`" is returned.
3177
3178.Response
3179----
3180 HTTP/1.1 204 No Content
3181----
3182
David Ostrovsky8e75f502014-08-10 00:36:31 +02003183[[delete-edit]]
3184=== Delete Change Edit
3185--
3186'DELETE /changes/link:#change-id[\{change-id\}]/edit'
3187--
3188
3189Deletes change edit.
3190
3191.Request
3192----
3193 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3194----
3195
3196As response "`204 No Content`" is returned.
3197
3198.Response
3199----
3200 HTTP/1.1 204 No Content
3201----
3202
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01003203
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003204[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003205== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003206
3207[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003208=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003209--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003210'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003211--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003212
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003213Lists the reviewers of a change.
3214
3215As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
3216
3217.Request
3218----
3219 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ 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 Kempin1dbe19e2013-02-22 16:18:58 +01003227
3228 )]}'
3229 [
3230 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003231 "approvals": {
3232 "Verified": "+1",
3233 "Code-Review": "+2"
3234 },
3235 "_account_id": 1000096,
3236 "name": "John Doe",
3237 "email": "john.doe@example.com"
3238 },
3239 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003240 "approvals": {
3241 "Verified": " 0",
3242 "Code-Review": "-1"
3243 },
3244 "_account_id": 1000097,
3245 "name": "Jane Roe",
3246 "email": "jane.roe@example.com"
3247 }
3248 ]
3249----
3250
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003251[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003252=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003253--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003254'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003255--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003256
3257Suggest the reviewers for a given query `q` and result limit `n`. If result
3258limit is not passed, then the default 10 is used.
3259
Edwin Kempin2639eaa2019-08-27 09:47:27 +02003260This REST endpoint only suggests accounts that
3261
3262* are active
3263* can see the change
3264* are visible to the calling user
3265* are not already reviewer on the change
3266* don't own the change
3267
Edwin Kempinec02a552019-08-27 09:30:15 +02003268Groups can be excluded from the results by specifying the 'exclude-groups'
3269request parameter:
3270
3271--
3272'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups'
3273--
Patrick Hieselc79ae0e2017-06-28 14:50:53 +02003274
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003275As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
3276
3277.Request
3278----
3279 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
3280----
3281
3282.Response
3283----
3284 HTTP/1.1 200 OK
3285 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003286 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003287
3288 )]}'
3289 [
3290 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003291 "account": {
3292 "_account_id": 1000097,
3293 "name": "Jane Roe",
3294 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003295 },
3296 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003297 },
3298 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003299 "group": {
3300 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
3301 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003302 },
3303 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003304 }
3305 ]
3306----
3307
Edwin Kempin0ca3f722019-08-27 09:43:31 +02003308To suggest CCs `reviewer-state=CC` can be specified as additional URL
3309parameter. This includes existing reviewers in the result, but excludes
3310existing CCs.
3311
3312--
3313'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC'
3314--
3315
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003316[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003317=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003318--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003319'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 -08003320--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003321
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003322Retrieves a reviewer of a change.
3323
3324As response a link:#reviewer-info[ReviewerInfo] entity is returned that
3325describes the reviewer.
3326
3327.Request
3328----
3329 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
3330----
3331
3332.Response
3333----
3334 HTTP/1.1 200 OK
3335 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003336 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003337
3338 )]}'
3339 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003340 "approvals": {
3341 "Verified": "+1",
3342 "Code-Review": "+2"
3343 },
3344 "_account_id": 1000096,
3345 "name": "John Doe",
3346 "email": "john.doe@example.com"
3347 }
3348----
3349
Edwin Kempin392328e2013-02-25 12:50:03 +01003350[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003351=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003352--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003353'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003354--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003355
Edwin Kempin392328e2013-02-25 12:50:03 +01003356Adds one user or all members of one group as reviewer to the change.
3357
3358The reviewer to be added to the change must be provided in the request
3359body as a link:#reviewer-input[ReviewerInput] entity.
3360
Edwin Kempinf9f19412019-08-28 09:28:51 +02003361Users can be moved from reviewer to CC and vice versa. This means if a
3362user is added as CC that is already a reviewer on the change, the
3363reviewer state of that user is updated to CC. If a user that is already
3364a CC on the change is added as reviewer, the reviewer state of that
3365user is updated to reviewer.
3366
Gal Paikinc326de42020-06-16 18:49:00 +03003367Adding a new reviewer also adds that reviewer to the attention set, unless
3368the change is work in progress.
3369Also, moving a reviewer to CC removes that user from the attention set.
3370
Edwin Kempin392328e2013-02-25 12:50:03 +01003371.Request
3372----
3373 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003374 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003375
3376 {
3377 "reviewer": "john.doe@example.com"
3378 }
3379----
3380
Gal Paikin721a40b2021-04-15 09:30:00 +02003381As response an link:#reviewer-result[ReviewerResult] entity is
Edwin Kempin392328e2013-02-25 12:50:03 +01003382returned that describes the newly added reviewers.
3383
3384.Response
3385----
3386 HTTP/1.1 200 OK
3387 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003388 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003389
3390 )]}'
3391 {
Aaron Gable8c650212017-04-25 12:03:37 -07003392 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01003393 "reviewers": [
3394 {
Aaron Gable8c650212017-04-25 12:03:37 -07003395 "_account_id": 1000096,
3396 "name": "John Doe",
3397 "email": "john.doe@example.com"
Edwin Kempin392328e2013-02-25 12:50:03 +01003398 "approvals": {
3399 "Verified": " 0",
3400 "Code-Review": " 0"
3401 },
Edwin Kempin392328e2013-02-25 12:50:03 +01003402 }
3403 ]
3404 }
3405----
3406
3407If a group is specified, adding the group members as reviewers is an
3408atomic operation. This means if an error is returned, none of the
3409members are added as reviewer.
3410
3411If a group with many members is added as reviewer a confirmation may be
3412required.
3413
Edwin Kempinf9f19412019-08-28 09:28:51 +02003414If a group is added as CC and members of this group are already
3415reviewers on the change, these members stay reviewers on the change
3416(they are not downgraded to CC). However if a group is added as
3417reviewer, all group members become reviewer of the change, even if they
3418have been added as CC before.
3419
Edwin Kempin392328e2013-02-25 12:50:03 +01003420.Request
3421----
3422 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003423 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003424
3425 {
3426 "reviewer": "MyProjectVerifiers"
3427 }
3428----
3429
3430.Response
3431----
3432 HTTP/1.1 200 OK
3433 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003434 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003435
3436 )]}'
3437 {
Logan Hanks23e70282016-07-06 14:31:56 -07003438 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01003439 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3440 "confirm": true
3441 }
3442----
3443
3444To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01003445`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01003446
3447.Request
3448----
3449 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003450 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003451
3452 {
Logan Hanks23e70282016-07-06 14:31:56 -07003453 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01003454 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01003455 }
3456----
3457
Patrick Hiesel11873ef2017-03-17 17:36:05 +01003458If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
3459for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
3460an email address of a reviewer or CC then, they will be added to the change even if they
3461don't have a Gerrit account.
3462
3463If this option is disabled, the request would fail with `400 Bad Request` if the email
3464address can't be resolved to an active Gerrit account.
3465
3466Note that the name is optional so both "un.registered@reviewer.com" and
3467"John Doe <un.registered@reviewer.com>" are valid inputs.
3468
3469Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
3470
3471.Request
3472----
3473 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
3474 Content-Type: application/json; charset=UTF-8
3475
3476 {
3477 "reviewer": "John Doe <un.registered@reviewer.com>"
3478 }
3479----
3480
3481.Response
3482----
3483 HTTP/1.1 200 OK
3484 Content-Disposition: attachment
3485 Content-Type: application/json; charset=UTF-8
3486
3487 )]}'
3488 {
3489 "input": "John Doe <un.registered@reviewer.com>"
3490 }
3491----
3492
Logan Hanksf03040e2017-05-03 09:40:56 -07003493.Notifications
3494
3495An email will be sent using the "newchange" template.
3496
3497[options="header",cols="1,1,1"]
3498|=============================
3499|WIP State |Default|notify=ALL
3500|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3501|Work in progress|not sent|owner, reviewers, CCs
3502|=============================
3503
Edwin Kempin53301072013-02-25 12:57:07 +01003504[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003505=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003506--
Edwin Kempin407fca32016-08-29 12:01:00 +02003507'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
3508'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 -08003509--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003510
Edwin Kempin53301072013-02-25 12:57:07 +01003511Deletes a reviewer from a change.
Gal Paikinc326de42020-06-16 18:49:00 +03003512Deleting a reviewer also removes that user from the attention set.
Edwin Kempin53301072013-02-25 12:57:07 +01003513
3514.Request
3515----
3516 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02003517 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3518----
3519
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003520Options can be provided in the request body as a
3521link:#delete-reviewer-input[DeleteReviewerInput] entity.
3522Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003523link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003524In this case, use a POST request instead:
Edwin Kempin407fca32016-08-29 12:01:00 +02003525
3526.Request
3527----
3528 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3529 Content-Type: application/json; charset=UTF-8
3530
3531 {
3532 "notify": "NONE"
3533 }
Edwin Kempin53301072013-02-25 12:57:07 +01003534----
3535
3536.Response
3537----
3538 HTTP/1.1 204 No Content
3539----
3540
Logan Hanks87607412017-05-30 13:49:04 -07003541.Notifications
3542
3543An email will be sent using the "deleteReviewer" template. If deleting the
3544reviewer resulted in one or more approvals being removed, then the deleted
3545reviewer will also receive a notification (unless notify=NONE).
3546
3547[options="header",cols="1,5"]
3548|=============================
3549|WIP State |Default Recipients
3550|Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers
3551|Work in progress|notify=NONE: deleted reviewer (if voted)
3552|=============================
3553
David Ostrovskybeb0b842014-12-13 00:24:29 +01003554[[list-votes]]
3555=== List Votes
3556--
3557'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
3558--
3559
3560Lists the votes for a specific reviewer of the change.
3561
3562.Request
3563----
Edwin Kempin314f10a2016-07-11 11:39:05 +02003564 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01003565----
3566
3567As result a map is returned that maps the label name to the label value.
3568The entries in the map are sorted by label name.
3569
3570.Response
3571----
3572 HTTP/1.1 200 OK
3573 Content-Disposition: attachment
3574 Content-Type: application/json;charset=UTF-8
3575
3576 )]}'
3577 {
3578 "Code-Review": -1,
3579 "Verified": 1
3580 "Work-In-Progress": 1,
3581 }
3582----
3583
3584[[delete-vote]]
3585=== Delete Vote
3586--
Edwin Kempin5488dc12016-08-29 11:13:31 +02003587'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 +02003588'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 +01003589--
3590
3591Deletes a single vote from a change. Note, that even when the last vote of
3592a reviewer is removed the reviewer itself is still listed on the change.
3593
Gal Paikin6ce56dc2021-03-29 12:28:43 +02003594If another user removed a user's vote, the user with the deleted vote will be
3595added to the attention set.
3596
David Ostrovskybeb0b842014-12-13 00:24:29 +01003597.Request
3598----
3599 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003600 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3601----
3602
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003603Options can be provided in the request body as a
3604link:#delete-vote-input[DeleteVoteInput] entity.
3605Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003606link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003607In this case, use a POST request instead:
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003608
3609.Request
3610----
3611 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3612 Content-Type: application/json; charset=UTF-8
3613
3614 {
3615 "notify": "NONE"
3616 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01003617----
3618
3619.Response
3620----
3621 HTTP/1.1 204 No Content
3622----
3623
Logan Hanksa1e68dc2017-06-29 15:13:27 -07003624
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003625[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003626== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003627
Shawn Pearce728ba882013-07-08 23:13:08 -07003628[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003629=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003630--
Shawn Pearce728ba882013-07-08 23:13:08 -07003631'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003632--
Shawn Pearce728ba882013-07-08 23:13:08 -07003633
3634Retrieves a parsed commit of a revision.
3635
3636.Request
3637----
3638 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
3639----
3640
3641As response a link:#commit-info[CommitInfo] entity is returned that
3642describes the revision.
3643
3644.Response
3645----
3646 HTTP/1.1 200 OK
3647 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003648 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07003649
3650 )]}'
3651 {
Edwin Kempinc8237402015-07-15 18:27:55 +02003652 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07003653 "parents": [
3654 {
3655 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3656 "subject": "Migrate contributor agreements to All-Projects."
3657 }
3658 ],
3659 "author": {
3660 "name": "Shawn O. Pearce",
3661 "email": "sop@google.com",
3662 "date": "2012-04-24 18:08:08.000000000",
3663 "tz": -420
3664 },
3665 "committer": {
3666 "name": "Shawn O. Pearce",
3667 "email": "sop@google.com",
3668 "date": "2012-04-24 18:08:08.000000000",
3669 "tz": -420
3670 },
3671 "subject": "Use an EventBus to manage star icons",
3672 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3673 }
3674----
3675
Sven Selbergd26bd542014-11-21 16:28:10 +01003676Adding query parameter `links` (for example `/changes/.../commit?links`)
3677returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07003678
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08003679[[get-description]]
3680=== Get Description
3681--
3682'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3683--
3684
3685Retrieves the description of a patch set.
3686
3687.Request
3688----
3689 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3690----
3691
3692.Response
3693----
3694 HTTP/1.1 200 OK
3695 Content-Disposition: attachment
3696 Content-Type: application/json; charset=UTF-8
3697
3698 )]}'
3699 "Added Documentation"
3700----
3701
3702If the patch set does not have a description an empty string is returned.
3703
3704[[set-description]]
3705=== Set Description
3706--
3707'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3708--
3709
3710Sets the description of a patch set.
3711
3712The new description must be provided in the request body inside a
3713link:#description-input[DescriptionInput] entity.
3714
3715.Request
3716----
3717 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3718 Content-Type: application/json; charset=UTF-8
3719
3720 {
3721 "description": "Added Documentation"
3722 }
3723----
3724
3725As response the new description is returned.
3726
3727.Response
3728----
3729 HTTP/1.1 200 OK
3730 Content-Disposition: attachment
3731 Content-Type: application/json; charset=UTF-8
3732
3733 )]}'
3734 "Added Documentation"
3735----
3736
Edwin Kempin0f229442016-09-09 13:06:12 +02003737[[get-merge-list]]
3738=== Get Merge List
3739--
3740'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
3741--
3742
3743Returns the list of commits that are being integrated into a target
3744branch by a merge commit. By default the first parent is assumed to be
3745uninteresting. By using the `parent` option another parent can be set
3746as uninteresting (parents are 1-based).
3747
3748The list of commits is returned as a list of
3749link:#commit-info[CommitInfo] entities. Web links are only included if
3750the `links` option was set.
3751
3752.Request
3753----
3754 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
3755----
3756
3757.Response
3758----
3759HTTP/1.1 200 OK
3760 Content-Disposition: attachment
3761 Content-Type: application/json; charset=UTF-8
3762
3763 )]}'
3764 [
3765 {
3766 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
3767 "parents": [
3768 {
3769 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3770 "subject": "Migrate contributor agreements to All-Projects."
3771 }
3772 ],
3773 "author": {
3774 "name": "Shawn O. Pearce",
3775 "email": "sop@google.com",
3776 "date": "2012-04-24 18:08:08.000000000",
3777 "tz": -420
3778 },
3779 "committer": {
3780 "name": "Shawn O. Pearce",
3781 "email": "sop@google.com",
3782 "date": "2012-04-24 18:08:08.000000000",
3783 "tz": -420
3784 },
3785 "subject": "Use an EventBus to manage star icons",
3786 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3787 }
3788 ]
3789----
3790
Stefan Bellerc7259662015-02-12 17:23:05 -08003791[[get-revision-actions]]
3792=== Get Revision Actions
3793--
3794'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
3795--
3796
3797Retrieves revision link:#action-info[actions] of the revision of a change.
3798
3799.Request
3800----
3801 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
3802----
3803
3804.Response
3805----
3806 HTTP/1.1 200 OK
3807 Content-Disposition: attachment
3808 Content-Type: application/json; charset=UTF-8
3809
3810 )]}'
3811
3812{
3813 "submit": {
3814 "method": "POST",
3815 "label": "Submit",
3816 "title": "Submit patch set 1 into master",
3817 "enabled": true
3818 },
3819 "cherrypick": {
3820 "method": "POST",
3821 "label": "Cherry Pick",
3822 "title": "Cherry pick change to a different branch",
3823 "enabled": true
3824 }
3825}
3826----
3827
3828The response is a flat map of possible revision actions mapped to their
3829link:#action-info[ActionInfo].
3830
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003831[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003832=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003833--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003834'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003835--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003836
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003837Retrieves a review of a revision.
3838
3839.Request
3840----
3841 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3842----
3843
3844As response a link:#change-info[ChangeInfo] entity with
3845link:#detailed-labels[detailed labels] and link:#detailed-accounts[
3846detailed accounts] is returned that describes the review of the
3847revision. The revision for which the review is retrieved is contained
3848in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05003849set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003850revision of the change. Please note that the returned labels are always
3851for the current patch set.
3852
3853.Response
3854----
3855 HTTP/1.1 200 OK
3856 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003857 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003858
3859 )]}'
3860 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003861 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
3862 "project": "myProject",
3863 "branch": "master",
3864 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
3865 "subject": "Implementing Feature X",
3866 "status": "NEW",
3867 "created": "2013-02-01 09:59:32.126000000",
3868 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003869 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003870 "insertions": 34,
3871 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003872 "_number": 3965,
3873 "owner": {
3874 "_account_id": 1000096,
3875 "name": "John Doe",
3876 "email": "john.doe@example.com"
3877 },
3878 "labels": {
3879 "Verified": {
3880 "all": [
3881 {
3882 "value": 0,
3883 "_account_id": 1000096,
3884 "name": "John Doe",
3885 "email": "john.doe@example.com"
3886 },
3887 {
3888 "value": 0,
3889 "_account_id": 1000097,
3890 "name": "Jane Roe",
3891 "email": "jane.roe@example.com"
3892 }
3893 ],
3894 "values": {
3895 "-1": "Fails",
3896 " 0": "No score",
3897 "+1": "Verified"
3898 }
3899 },
3900 "Code-Review": {
3901 "all": [
3902 {
3903 "value": -1,
3904 "_account_id": 1000096,
3905 "name": "John Doe",
3906 "email": "john.doe@example.com"
3907 },
3908 {
3909 "value": 1,
3910 "_account_id": 1000097,
3911 "name": "Jane Roe",
3912 "email": "jane.roe@example.com"
3913 }
3914 ]
3915 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04003916 "-2": "This shall not be merged",
3917 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003918 " 0": "No score",
3919 "+1": "Looks good to me, but someone else must approve",
3920 "+2": "Looks good to me, approved"
3921 }
3922 }
3923 },
3924 "permitted_labels": {
3925 "Verified": [
3926 "-1",
3927 " 0",
3928 "+1"
3929 ],
3930 "Code-Review": [
3931 "-2",
3932 "-1",
3933 " 0",
3934 "+1",
3935 "+2"
3936 ]
3937 },
3938 "removable_reviewers": [
3939 {
3940 "_account_id": 1000096,
3941 "name": "John Doe",
3942 "email": "john.doe@example.com"
3943 },
3944 {
3945 "_account_id": 1000097,
3946 "name": "Jane Roe",
3947 "email": "jane.roe@example.com"
3948 }
3949 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08003950 "reviewers": {
3951 "REVIEWER": [
3952 {
3953 "_account_id": 1000096,
3954 "name": "John Doe",
3955 "email": "john.doe@example.com"
3956 },
3957 {
3958 "_account_id": 1000097,
3959 "name": "Jane Roe",
3960 "email": "jane.roe@example.com"
3961 }
3962 ]
3963 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003964 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
3965 "revisions": {
3966 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09003967 "kind": "REWORK",
3968 "_number": 2,
3969 "ref": "refs/changes/65/3965/2",
3970 "fetch": {
3971 "http": {
3972 "url": "http://gerrit/myProject",
3973 "ref": "refs/changes/65/3965/2"
3974 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003975 }
3976 }
3977 }
3978 }
3979----
3980
David Pursehouse669f2512014-07-18 11:41:42 +09003981[[get-related-changes]]
3982=== Get Related Changes
3983--
3984'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
3985--
3986
3987Retrieves related changes of a revision. Related changes are changes that either
3988depend on, or are dependencies of the revision.
3989
3990.Request
3991----
3992 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
3993----
3994
3995As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
3996describing the related changes.
3997
3998.Response
3999----
4000 HTTP/1.1 200 OK
4001 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004002 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09004003
4004 )]}'
4005 {
4006 "changes": [
4007 {
Patrick Hieselcab63512017-07-28 10:25:42 +02004008 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09004009 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
4010 "commit": {
4011 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
4012 "parents": [
4013 {
4014 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
4015 }
4016 ],
4017 "author": {
4018 "name": "David Ostrovsky",
4019 "email": "david@ostrovsky.org",
4020 "date": "2014-07-12 15:04:24.000000000",
4021 "tz": 120
4022 },
4023 "subject": "Remove Solr"
4024 },
4025 "_change_number": 58478,
4026 "_revision_number": 2,
4027 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07004028 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09004029 },
4030 {
Patrick Hieselcab63512017-07-28 10:25:42 +02004031 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09004032 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
4033 "commit": {
4034 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
4035 "parents": [
4036 {
4037 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
4038 }
4039 ],
4040 "author": {
4041 "name": "David Pursehouse",
4042 "email": "david.pursehouse@sonymobile.com",
4043 "date": "2014-06-24 02:01:28.000000000",
4044 "tz": 540
4045 },
4046 "subject": "Add support for secondary index with Elasticsearch"
4047 },
4048 "_change_number": 58081,
4049 "_revision_number": 10,
4050 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07004051 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09004052 }
4053 ]
4054 }
4055----
4056
4057
Edwin Kempin67498de2013-02-25 16:15:34 +01004058[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004059=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004060--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004061'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004062--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004063
Logan Hanksf03040e2017-05-03 09:40:56 -07004064Sets a review on a revision, optionally also publishing draft comments, setting
Logan Hanks53c36012017-06-30 13:47:54 -07004065labels, adding reviewers or CCs, and modifying the work in progress property.
Edwin Kempin67498de2013-02-25 16:15:34 +01004066
4067The review must be provided in the request body as a
4068link:#review-input[ReviewInput] entity.
4069
Youssef Elghareeb12add162019-12-18 18:43:23 +01004070If the labels are set, the user sending the request will automatically be
4071added as a reviewer, otherwise (if they only commented) they are added to
4072the CC list.
4073
Gal Paikinc326de42020-06-16 18:49:00 +03004074Some updates to the attention set occur here. If more than one update should
4075occur, only the first update in the order of the below documentation occurs:
4076
4077If a user is part of remove_from_attention_set, the user will be explicitly
4078removed from the attention set.
4079
4080If a user is part of add_to_attention_set, the user will be explicitly
4081added to the attention set.
4082
4083If the boolean ignore_default_attention_set_rules is set to true, all
4084other rules below will be ignored:
4085
4086The user who created the review is removed from the attention set.
4087
4088If the change is ready for review, the following also apply:
4089
4090When the uploader replies, the owner is added to the attention set.
4091
4092When the owner or uploader replies, all the reviewers are added to
4093the attention set.
4094
4095When neither the owner nor the uploader replies, add the owner and the
4096uploader to the attention set.
4097
4098Then, new reviewers are added to the attention set, and removed reviewers
4099(by becoming CC) are removed from the attention set.
4100
Aaron Gable8c650212017-04-25 12:03:37 -07004101A review cannot be set on a change edit. Trying to post a review for a
4102change edit fails with `409 Conflict`.
4103
Logan Hanksf03040e2017-05-03 09:40:56 -07004104Here is an example of using this method to set labels:
Aaron Gable8c650212017-04-25 12:03:37 -07004105
Edwin Kempin67498de2013-02-25 16:15:34 +01004106.Request
4107----
4108 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004109 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01004110
4111 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004112 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01004113 "message": "Some nits need to be fixed.",
4114 "labels": {
4115 "Code-Review": -1
4116 },
4117 "comments": {
4118 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4119 {
4120 "line": 23,
4121 "message": "[nit] trailing whitespace"
4122 },
4123 {
4124 "line": 49,
4125 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09004126 },
4127 {
4128 "range": {
4129 "start_line": 50,
4130 "start_character": 0,
4131 "end_line": 55,
4132 "end_character": 20
4133 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09004134 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01004135 }
4136 ]
4137 }
4138 }
4139----
4140
Aaron Gable843b0c12017-04-21 08:25:27 -07004141As response a link:#review-result[ReviewResult] entity is returned that
Aaron Gable8c650212017-04-25 12:03:37 -07004142describes the applied labels and any added reviewers (e.g. yourself,
4143if you set a label but weren't previously a reviewer on this CL).
Edwin Kempin67498de2013-02-25 16:15:34 +01004144
4145.Response
4146----
4147 HTTP/1.1 200 OK
4148 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004149 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01004150
4151 )]}'
4152 {
4153 "labels": {
4154 "Code-Review": -1
4155 }
4156 }
4157----
4158
Aaron Gable8c650212017-04-25 12:03:37 -07004159It is also possible to add one or more reviewers or CCs
Logan Hanksf03040e2017-05-03 09:40:56 -07004160to a change simultaneously with a review:
Logan Hanks5f1c7592016-07-06 14:39:33 -07004161
4162.Request
4163----
4164 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
4165 Content-Type: application/json; charset=UTF-8
4166
4167 {
Aaron Gable8c650212017-04-25 12:03:37 -07004168 "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 -07004169 "reviewers": [
4170 {
4171 "reviewer": "jane.roe@example.com"
4172 },
4173 {
Aaron Gable8c650212017-04-25 12:03:37 -07004174 "reviewer": "john.doe@example.com",
4175 "state": "CC"
4176 }
4177 {
4178 "reviewer": "MyProjectVerifiers",
Logan Hanks5f1c7592016-07-06 14:39:33 -07004179 }
4180 ]
4181 }
4182----
4183
4184Each element of the `reviewers` list is an instance of
4185link:#reviewer-input[ReviewerInput]. The corresponding result of
Aaron Gable8c650212017-04-25 12:03:37 -07004186adding each reviewer will be returned in a map of inputs to
Gal Paikin721a40b2021-04-15 09:30:00 +02004187link:#reviewer-result[ReviewerResult]s.
Logan Hanks5f1c7592016-07-06 14:39:33 -07004188
4189.Response
4190----
4191 HTTP/1.1 200 OK
4192 Content-Disposition: attachment
4193 Content-Type: application/json; charset=UTF-8
4194
4195 )]}'
4196 {
Aaron Gable8c650212017-04-25 12:03:37 -07004197 "reviewers": {
4198 "jane.roe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004199 "input": "jane.roe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004200 "reviewers": [
4201 {
4202 "_account_id": 1000097,
4203 "name": "Jane Roe",
4204 "email": "jane.roe@example.com"
4205 "approvals": {
4206 "Verified": " 0",
4207 "Code-Review": " 0"
4208 },
4209 },
4210 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004211 },
Aaron Gable8c650212017-04-25 12:03:37 -07004212 "john.doe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004213 "input": "john.doe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004214 "ccs": [
4215 {
4216 "_account_id": 1000096,
4217 "name": "John Doe",
4218 "email": "john.doe@example.com"
4219 "approvals": {
4220 "Verified": " 0",
4221 "Code-Review": " 0"
4222 },
4223 }
4224 ]
4225 },
4226 "MyProjectVerifiers": {
4227 "input": "MyProjectVerifiers",
4228 "reviewers": [
4229 {
4230 "_account_id": 1000098,
4231 "name": "Alice Ansel",
4232 "email": "alice.ansel@example.com"
4233 "approvals": {
4234 "Verified": " 0",
4235 "Code-Review": " 0"
4236 },
4237 },
4238 {
4239 "_account_id": 1000099,
4240 "name": "Bob Bollard",
4241 "email": "bob.bollard@example.com"
4242 "approvals": {
4243 "Verified": " 0",
4244 "Code-Review": " 0"
4245 },
4246 },
4247 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004248 }
Aaron Gable8c650212017-04-25 12:03:37 -07004249 }
Logan Hanks5f1c7592016-07-06 14:39:33 -07004250 }
4251----
4252
Logan Hankse2aacef2016-07-22 15:54:52 -07004253If there are any errors returned for reviewers, the entire review request will
Aaron Gable8c650212017-04-25 12:03:37 -07004254be rejected with `400 Bad Request`. None of the entries will have the
4255`reviewers` or `ccs` field set, and those which specifically failed will have
4256the `errors` field set containing details of why they failed.
Logan Hankse2aacef2016-07-22 15:54:52 -07004257
4258.Error Response
4259----
4260 HTTP/1.1 400 Bad Request
4261 Content-Disposition: attachment
4262 Content-Type: application/json; charset=UTF-8
4263
4264 )]}'
4265 {
4266 "reviewers": {
Aaron Gable8c650212017-04-25 12:03:37 -07004267 "jane.roe@example.com": {
4268 "input": "jane.roe@example.com",
4269 "error": "Account of jane.roe@example.com is inactive."
4270 },
4271 "john.doe@example.com": {
4272 "input": "john.doe@example.com"
4273 },
Logan Hankse2aacef2016-07-22 15:54:52 -07004274 "MyProjectVerifiers": {
4275 "input": "MyProjectVerifiers",
4276 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
4277 "confirm": true
4278 }
4279 }
4280 }
4281----
4282
Dave Borowitzd2e41452017-10-26 08:06:23 -04004283[[set-review-notifications]]
Logan Hanksfc055962017-06-12 14:20:53 -07004284.Notifications
4285
4286An email will be sent using the "comment" template.
4287
4288If the top-level notify property is null or not set, then notification behavior
4289depends on whether the change is WIP, whether it has started review, and whether
4290the tag property is null.
4291
4292NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*.
4293Use the notify property of the top-level link:#review-input[ReviewInput] instead.
4294
4295For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS
4296watchers*.
4297
Logan Hanksea3e3b72017-06-12 14:21:47 -07004298[options="header",cols="2,1,1,2,2"]
Logan Hanksfc055962017-06-12 14:20:53 -07004299|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004300|WIP State |Review Started|Tag Given|Default |notify=ALL
4301|Ready for review|N/A |N/A |everyone|everyone
4302|Work in progress|no |no |not sent|everyone
4303|Work in progress|no |yes |owner |everyone
4304|Work in progress|yes |no |everyone|everyone
4305|Work in progress|yes |yes |owner |everyone
4306
Logan Hanksfc055962017-06-12 14:20:53 -07004307|=============================
4308
4309If reviewers are added, then a second email will be sent using the "newchange"
4310template. The notification logic for this email is the same as for
4311link:#add-reviewer[Add Reviewer].
4312
Logan Hanksea3e3b72017-06-12 14:21:47 -07004313[options="header",cols="1,1,1"]
Logan Hanksfc055962017-06-12 14:20:53 -07004314|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004315|WIP State |Default |notify=ALL
4316|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
4317|Work in progress|not sent |owner, reviewers, CCs
Logan Hanksfc055962017-06-12 14:20:53 -07004318|=============================
4319
4320
Edwin Kempincdae63b2013-03-15 15:06:59 +01004321[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004322=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004323--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004324'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004325--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004326
4327Rebases a revision.
4328
Zalan Blenessy874aed72015-01-12 13:26:18 +01004329Optionally, the parent revision can be changed to another patch set through the
4330link:#rebase-input[RebaseInput] entity.
4331
Edwin Kempincdae63b2013-03-15 15:06:59 +01004332.Request
4333----
4334 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01004335 Content-Type: application/json;charset=UTF-8
4336
4337 {
4338 "base" : "1234",
4339 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01004340----
4341
4342As response a link:#change-info[ChangeInfo] entity is returned that
4343describes the rebased change. Information about the current patch set
4344is included.
4345
4346.Response
4347----
4348 HTTP/1.1 200 OK
4349 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004350 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004351
4352 )]}'
4353 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01004354 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4355 "project": "myProject",
4356 "branch": "master",
4357 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4358 "subject": "Implement Feature X",
4359 "status": "NEW",
4360 "created": "2013-02-01 09:59:32.126000000",
4361 "updated": "2013-02-21 11:16:36.775000000",
4362 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004363 "insertions": 21,
4364 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01004365 "_number": 4799,
4366 "owner": {
4367 "name": "John Doe"
4368 },
4369 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
4370 "revisions": {
4371 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09004372 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004373 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01004374 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004375 "fetch": {
4376 "http": {
4377 "url": "http://gerrit:8080/myProject",
4378 "ref": "refs/changes/99/4799/2"
4379 }
4380 },
4381 "commit": {
4382 "parents": [
4383 {
4384 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
4385 "subject": "Implement Feature A"
4386 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00004387 ],
4388 "author": {
4389 "name": "John Doe",
4390 "email": "john.doe@example.com",
4391 "date": "2013-05-07 15:21:27.000000000",
4392 "tz": 120
4393 },
4394 "committer": {
4395 "name": "Gerrit Code Review",
4396 "email": "gerrit-server@example.com",
4397 "date": "2013-05-07 15:35:43.000000000",
4398 "tz": 120
4399 },
4400 "subject": "Implement Feature X",
4401 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01004402 }
4403 }
4404 }
4405----
4406
4407If the revision cannot be rebased, e.g. due to conflicts, the response is
4408"`409 Conflict`" and the error message is contained in the response
4409body.
4410
4411.Response
4412----
4413 HTTP/1.1 409 Conflict
4414 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004415 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004416
4417 The change could not be rebased due to a path conflict during merge.
4418----
4419
Edwin Kempin14b58112013-02-26 16:30:19 +01004420[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004421=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004422--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004423'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004424--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004425
Edwin Kempin14b58112013-02-26 16:30:19 +01004426Submits a revision.
Gal Paikinc85d3522021-04-19 13:34:54 +02004427Submitting a change also removes all users from the link:#attention-set[attention set].
Edwin Kempin14b58112013-02-26 16:30:19 +01004428
Edwin Kempin14b58112013-02-26 16:30:19 +01004429.Request
4430----
4431 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
Edwin Kempin14b58112013-02-26 16:30:19 +01004432----
4433
Gal Paikin3d6cdec2021-04-19 13:32:13 +02004434As response a link:#change-info[ChangeInfo] entity is returned that
4435describes the submitted/merged change.
4436
Gal Paikine2849a82021-04-19 13:41:10 +02004437Submission may submit multiple changes, but we still only return one ChangeInfo
4438object. To query for all submitted changes, please use the submission_id that is
4439part of the response.
4440
4441Changes that will also be submitted:
44421. All changes of the same topic if
4443link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
4444configuration is set to true.
44452. All dependent changes.
44463. The closure of the above (e.g if a dependent change has a topic, all changes
4447of *that* topic will also be submitted).
4448
Gal Paikin3d6cdec2021-04-19 13:32:13 +02004449.Response
4450----
4451 HTTP/1.1 200 OK
4452 Content-Disposition: attachment
4453 Content-Type: application/json; charset=UTF-8
4454
4455 )]}'
4456 {
4457 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
4458 "project": "myProject",
4459 "branch": "master",
4460 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
4461 "subject": "Implementing Feature X",
4462 "status": "MERGED",
4463 "created": "2013-02-01 09:59:32.126000000",
4464 "updated": "2013-02-21 11:16:36.775000000",
4465 "submitted": "2013-02-21 11:16:36.615000000",
4466 "_number": 3965,
4467 "owner": {
4468 "name": "John Doe"
4469 }
4470 }
4471----
4472
Edwin Kempin14b58112013-02-26 16:30:19 +01004473If the revision cannot be submitted, e.g. because the submit rule
4474doesn't allow submitting the revision or the revision is not the
4475current revision, the response is "`409 Conflict`" and the error
4476message is contained in the response body.
4477
4478.Response
4479----
4480 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004481 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004482
4483 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
4484----
4485
Edwin Kempin257d70f2013-03-28 14:31:14 +01004486[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004487=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004488--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004489'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004490--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004491
4492Gets the formatted patch for one revision.
4493
4494.Request
4495----
4496 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
4497----
4498
Shawn Pearce98361f72013-05-10 16:27:36 -07004499The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01004500
4501.Response
4502----
4503 HTTP/1.1 200 OK
4504 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004505 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07004506 X-FYI-Content-Encoding: base64
4507 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01004508
Shawn Pearce98361f72013-05-10 16:27:36 -07004509 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01004510----
4511
David Ostrovsky973f38b2013-08-22 00:24:51 -07004512Adding query parameter `zip` (for example `/changes/.../patch?zip`)
4513returns the patch as a single file inside of a ZIP archive. Clients
4514can expand the ZIP to obtain the plain text patch, avoiding the
4515need for a base64 decoding step. This option implies `download`.
4516
4517Query parameter `download` (e.g. `/changes/.../patch?download`)
4518will suggest the browser save the patch as `commitsha1.diff.base64`,
4519for later processing by command line tools.
4520
Kasper Nilsson81448072016-10-17 15:04:33 -07004521If the `path` parameter is set, the returned content is a diff of the single
4522file that the path refers to.
4523
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004524[[submit-preview]]
Edwin Kempin807eb4b2016-10-18 15:49:41 +02004525=== Submit Preview
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004526--
4527'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit'
4528--
4529Gets a file containing thin bundles of all modified projects if this
4530change was submitted. The bundles are named `${ProjectName}.git`.
4531Each thin bundle contains enough to construct the state in which a project would
4532be in if this change were submitted. The base of the thin bundles are the
4533current target branches, so to make use of this call in a non-racy way, first
4534get the bundles and then fetch all projects contained in the bundle.
4535(This assumes no non-fastforward pushes).
4536
4537You need to give a parameter '?format=zip' or '?format=tar' to specify the
Stefan Beller3e586742016-10-05 15:23:22 -07004538format for the outer container. It is always possible to use tgz, even if
4539tgz is not in the list of allowed archive formats.
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004540
4541To make good use of this call, you would roughly need code as found at:
4542----
4543 $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh
4544----
4545.Request
4546----
4547 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0
4548----
4549
4550.Response
4551----
4552 HTTP/1.1 200 OK
4553 Date: Tue, 13 Sep 2016 19:13:46 GMT
4554 Content-Disposition: attachment; filename="submit-preview-147.zip"
4555 X-Content-Type-Options: nosniff
4556 Cache-Control: no-cache, no-store, max-age=0, must-revalidate
4557 Pragma: no-cache
4558 Expires: Mon, 01 Jan 1990 00:00:00 GMT
4559 Content-Type: application/x-zip
4560 Transfer-Encoding: chunked
4561
4562 [binary stuff]
4563----
4564
4565In case of an error, the response is not a zip file but a regular json response,
4566containing only the error message:
4567
4568.Response
4569----
4570 HTTP/1.1 200 OK
4571 Content-Disposition: attachment
4572 Content-Type: application/json; charset=UTF-8
4573
4574 )]}'
4575 "Anonymous users cannot submit"
4576----
4577
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004578[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004579=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004580--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004581'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004582--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004583
4584Gets the method the server will use to submit (merge) the change and
4585an indicator if the change is currently mergeable.
4586
4587.Request
4588----
4589 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
4590----
4591
Saša Živkov499873f2014-05-05 13:34:18 +02004592As response a link:#mergeable-info[MergeableInfo] entity is returned.
4593
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004594.Response
4595----
4596 HTTP/1.1 200 OK
4597 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004598 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004599
4600 )]}'
4601 {
4602 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004603 strategy: "recursive",
4604 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004605 }
4606----
4607
Saša Živkov697cab22014-04-29 16:46:50 +02004608If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08004609checked for all other branches which are listed in the
4610link:config-project-config.html#branchOrder-section[branchOrder] section in the
4611project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02004612
4613.Request
4614----
4615 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
4616----
4617
4618The response will then contain a list of all other branches where this changes
4619could merge cleanly.
4620
4621.Response
4622----
4623 HTTP/1.1 200 OK
4624 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004625 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02004626
4627 )]}'
4628 {
4629 submit_type: "MERGE_IF_NECESSARY",
4630 mergeable: true,
4631 mergeable_into: [
4632 "refs/heads/stable-2.7",
4633 "refs/heads/stable-2.8",
4634 ]
4635 }
4636----
4637
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004638[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004639=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004640--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004641'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004642--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004643
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004644Gets the method the server will use to submit (merge) the change.
4645
4646.Request
4647----
4648 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
4649----
4650
4651.Response
4652----
4653 HTTP/1.1 200 OK
4654 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004655 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004656
4657 )]}'
4658 "MERGE_IF_NECESSARY"
4659----
4660
4661[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004662=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004663--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004664'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004665--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004666
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004667Tests the submit_type Prolog rule in the project, or the one given.
4668
4669Request body may be either the Prolog code as `text/plain` or a
4670link:#rule-input[RuleInput] object. The query parameter `filters`
4671may be set to `SKIP` to bypass parent project filters while testing
4672a project-specific rule.
4673
4674.Request
4675----
4676 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09004677 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004678
4679 submit_type(cherry_pick).
4680----
4681
4682.Response
4683----
4684 HTTP/1.1 200 OK
4685 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004686 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004687
4688 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07004689 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004690----
4691
4692[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004693=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004694--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004695'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004696--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004697
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004698Tests the submit_rule Prolog rule in the project, or the one given.
4699
4700Request body may be either the Prolog code as `text/plain` or a
4701link:#rule-input[RuleInput] object. The query parameter `filters`
4702may be set to `SKIP` to bypass parent project filters while testing
4703a project-specific rule.
4704
4705.Request
4706----
Shawn Pearcea3cce712014-03-21 08:16:11 -07004707 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09004708 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004709
4710 submit_rule(submit(R)) :-
4711 R = label('Any-Label-Name', reject(_)).
4712----
4713
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004714The response is a link:#submit-record[SubmitRecord] describing the
4715permutations that satisfy the tested submit rule.
4716
David Pursehouse87a3fb02019-10-29 16:01:27 +09004717If the submit rule was a no-op, the response is "`204 No Content`".
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004718
4719.Response
4720----
4721 HTTP/1.1 200 OK
4722 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004723 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004724
4725 )]}'
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004726 {
4727 "status": "NOT_READY",
4728 "reject": {
4729 "Any-Label-Name": {}
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004730 }
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004731 }
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004732----
4733
Shawn Pearceb42e3032015-04-02 10:28:10 -07004734When testing with the `curl` command line client the
4735`--data-binary @rules.pl` flag should be used to ensure
4736all LFs are included in the Prolog code:
4737
4738----
4739 curl -X POST \
4740 -H 'Content-Type: text/plain; charset=UTF-8' \
4741 --data-binary @rules.pl \
4742 http://.../test.submit_rule
4743----
4744
Edwin Kempincb6724a2013-02-26 16:58:51 +01004745[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004746=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004747--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004748'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004749--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004750
Edwin Kempin3ca57192013-02-27 07:44:01 +01004751Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01004752user.
4753
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004754Returns a map of file paths to lists of link:#comment-info[CommentInfo]
4755entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004756
4757.Request
4758----
4759 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
4760----
4761
4762.Response
4763----
4764 HTTP/1.1 200 OK
4765 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004766 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01004767
4768 )]}'
4769 {
4770 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4771 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004772 "id": "TvcXrmjM",
4773 "line": 23,
4774 "message": "[nit] trailing whitespace",
4775 "updated": "2013-02-26 15:40:43.986000000"
4776 },
4777 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004778 "id": "TveXwFiA",
4779 "line": 49,
4780 "in_reply_to": "TfYX-Iuo",
4781 "message": "Done",
4782 "updated": "2013-02-26 15:40:45.328000000"
4783 }
4784 ]
4785 }
4786----
4787
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004788[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004789=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004790--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004791'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004792--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004793
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004794Creates a draft comment on a revision.
4795
4796The new draft comment must be provided in the request body inside a
4797link:#comment-input[CommentInput] entity.
4798
4799.Request
4800----
4801 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004802 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004803
4804 {
4805 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4806 "line": 23,
4807 "message": "[nit] trailing whitespace"
4808 }
4809----
4810
4811As response a link:#comment-info[CommentInfo] entity is returned that
4812describes the draft comment.
4813
4814.Response
4815----
4816 HTTP/1.1 200 OK
4817 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004818 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004819
4820 )]}'
4821 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004822 "id": "TvcXrmjM",
4823 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4824 "line": 23,
4825 "message": "[nit] trailing whitespace",
4826 "updated": "2013-02-26 15:40:43.986000000"
4827 }
4828----
4829
Edwin Kempin3ca57192013-02-27 07:44:01 +01004830[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004831=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004832--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004833'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 -08004834--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004835
Edwin Kempin3ca57192013-02-27 07:44:01 +01004836Retrieves a draft comment of a revision that belongs to the calling
4837user.
4838
4839.Request
4840----
4841 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4842----
4843
4844As response a link:#comment-info[CommentInfo] entity is returned that
4845describes the draft comment.
4846
4847.Response
4848----
4849 HTTP/1.1 200 OK
4850 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004851 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01004852
4853 )]}'
4854 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01004855 "id": "TvcXrmjM",
4856 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4857 "line": 23,
4858 "message": "[nit] trailing whitespace",
4859 "updated": "2013-02-26 15:40:43.986000000"
4860 }
4861----
4862
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004863[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004864=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004865--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004866'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 -08004867--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004868
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004869Updates a draft comment on a revision.
4870
4871The new draft comment must be provided in the request body inside a
4872link:#comment-input[CommentInput] entity.
4873
4874.Request
4875----
4876 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004877 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004878
4879 {
4880 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4881 "line": 23,
4882 "message": "[nit] trailing whitespace"
4883 }
4884----
4885
4886As response a link:#comment-info[CommentInfo] entity is returned that
4887describes the draft comment.
4888
4889.Response
4890----
4891 HTTP/1.1 200 OK
4892 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004893 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004894
4895 )]}'
4896 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004897 "id": "TvcXrmjM",
4898 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4899 "line": 23,
4900 "message": "[nit] trailing whitespace",
4901 "updated": "2013-02-26 15:40:43.986000000"
4902 }
4903----
4904
4905[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004906=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004907--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004908'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 -08004909--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004910
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004911Deletes a draft comment from a revision.
4912
4913.Request
4914----
4915 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4916----
4917
4918.Response
4919----
4920 HTTP/1.1 204 No Content
4921----
4922
John Spurlock5e402f02013-03-24 11:35:04 -04004923[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004924=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004925--
John Spurlock5e402f02013-03-24 11:35:04 -04004926'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004927--
John Spurlock5e402f02013-03-24 11:35:04 -04004928
4929Lists the published comments of a revision.
4930
4931As result a map is returned that maps the file path to a list of
4932link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07004933sorted by file path and only include file (or inline) comments. Use
4934the link:#get-change-detail[Get Change Detail] endpoint to retrieve
4935the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04004936
4937.Request
4938----
4939 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
4940----
4941
4942.Response
4943----
4944 HTTP/1.1 200 OK
4945 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004946 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004947
4948 )]}'
4949 {
4950 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4951 {
John Spurlock5e402f02013-03-24 11:35:04 -04004952 "id": "TvcXrmjM",
4953 "line": 23,
4954 "message": "[nit] trailing whitespace",
4955 "updated": "2013-02-26 15:40:43.986000000",
4956 "author": {
4957 "_account_id": 1000096,
4958 "name": "John Doe",
4959 "email": "john.doe@example.com"
4960 }
4961 },
4962 {
John Spurlock5e402f02013-03-24 11:35:04 -04004963 "id": "TveXwFiA",
4964 "line": 49,
4965 "in_reply_to": "TfYX-Iuo",
4966 "message": "Done",
4967 "updated": "2013-02-26 15:40:45.328000000",
4968 "author": {
4969 "_account_id": 1000097,
4970 "name": "Jane Roe",
4971 "email": "jane.roe@example.com"
4972 }
4973 }
4974 ]
4975 }
4976----
4977
4978[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004979=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004980--
John Spurlock5e402f02013-03-24 11:35:04 -04004981'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 -08004982--
John Spurlock5e402f02013-03-24 11:35:04 -04004983
4984Retrieves a published comment of a revision.
4985
4986.Request
4987----
4988 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
4989----
4990
4991As response a link:#comment-info[CommentInfo] entity is returned that
4992describes the published comment.
4993
4994.Response
4995----
4996 HTTP/1.1 200 OK
4997 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004998 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004999
5000 )]}'
5001 {
John Spurlock5e402f02013-03-24 11:35:04 -04005002 "id": "TvcXrmjM",
5003 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5004 "line": 23,
5005 "message": "[nit] trailing whitespace",
5006 "updated": "2013-02-26 15:40:43.986000000",
5007 "author": {
5008 "_account_id": 1000096,
5009 "name": "John Doe",
5010 "email": "john.doe@example.com"
5011 }
5012 }
5013----
5014
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005015[[delete-comment]]
5016=== Delete Comment
5017--
5018'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' +
5019'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete'
5020--
5021
5022Deletes a published comment of a revision. Instead of deleting the
5023whole comment, this endpoint just replaces the comment's message
5024with a new message, which contains the name of the user who deletes
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005025the comment and the reason why it's deleted.
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005026
5027Note that only users with the
5028link:access-control.html#capability_administrateServer[Administrate Server]
5029global capability are permitted to delete a comment.
5030
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005031Deletion reason can be provided in the request body as a
5032link:#delete-comment-input[DeleteCommentInput] entity.
5033Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01005034link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005035In this case, use a POST request instead:
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005036
5037.Request
5038----
5039 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0
5040 Content-Type: application/json; charset=UTF-8
5041
5042 {
5043 "reason": "contains confidential information"
5044 }
5045----
5046
5047As response a link:#comment-info[CommentInfo] entity is returned that
5048describes the updated comment.
5049
5050.Response
5051----
5052 HTTP/1.1 200 OK
5053 Content-Disposition: attachment
5054 Content-Type: application/json; charset=UTF-8
5055
5056 )]}'
5057 {
5058 "id": "TvcXrmjM",
5059 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5060 "line": 23,
5061 "message": "Comment removed by: Administrator; Reason: contains confidential information",
5062 "updated": "2013-02-26 15:40:43.986000000",
5063 "author": {
5064 "_account_id": 1000096,
5065 "name": "John Doe",
5066 "email": "john.doe@example.com"
5067 }
5068 }
5069----
5070
Edwin Kempinb050a482016-12-01 09:11:19 +01005071[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005072=== List Robot Comments
5073--
5074'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
5075--
5076
5077Lists the link:config-robot-comments.html[robot comments] of a
5078revision.
5079
5080As result a map is returned that maps the file path to a list of
5081link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
5082map are sorted by file path.
5083
5084.Request
5085----
5086 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
5087----
5088
5089.Response
5090----
5091 HTTP/1.1 200 OK
5092 Content-Disposition: attachment
5093 Content-Type: application/json; charset=UTF-8
5094
5095 )]}'
5096 {
5097 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5098 {
5099 "id": "TvcXrmjM",
5100 "line": 23,
5101 "message": "unused import",
5102 "updated": "2016-02-26 15:40:43.986000000",
5103 "author": {
5104 "_account_id": 1000110,
5105 "name": "Code Analyzer",
5106 "email": "code.analyzer@example.com"
5107 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005108 "robot_id": "importChecker",
5109 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005110 },
5111 {
5112 "id": "TveXwFiA",
5113 "line": 49,
5114 "message": "wrong indention",
5115 "updated": "2016-02-26 15:40:45.328000000",
5116 "author": {
5117 "_account_id": 1000110,
5118 "name": "Code Analyzer",
5119 "email": "code.analyzer@example.com"
5120 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005121 "robot_id": "styleChecker",
5122 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005123 }
5124 ]
5125 }
5126----
5127
5128[[get-robot-comment]]
5129=== Get Robot Comment
5130--
5131'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
5132--
5133
5134Retrieves a link:config-robot-comments.html[robot comment] of a
5135revision.
5136
5137.Request
5138----
5139 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
5140----
5141
5142As response a link:#robot-comment-info[RobotCommentInfo] entity is
5143returned that describes the robot comment.
5144
5145.Response
5146----
5147 HTTP/1.1 200 OK
5148 Content-Disposition: attachment
5149 Content-Type: application/json; charset=UTF-8
5150
5151 )]}'
5152 {
5153 "id": "TvcXrmjM",
5154 "line": 23,
5155 "message": "unused import",
5156 "updated": "2016-02-26 15:40:43.986000000",
5157 "author": {
5158 "_account_id": 1000110,
5159 "name": "Code Analyzer",
5160 "email": "code.analyzer@example.com"
5161 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005162 "robot_id": "importChecker",
5163 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005164 }
5165----
5166
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005167[[get-ported-comments]]
5168=== Get Ported Comments
5169--
5170'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_comments'
5171--
5172
5173Ports comments of other revisions to the requested revision.
5174
5175Only comments added on earlier patchsets are ported. That set of comments is filtered even further
5176due to some additional rules. Callers of this endpoint shouldn't rely on the exact logic of which
5177comments are ported as that logic might change in the future. Instead, callers must be able to
5178handle any smaller/larger set of comments returned by this endpoint.
5179
5180Typically, a comment thread is returned fully or excluded fully. However, draft comments and
5181robot comments are ignored and not returned via this endpoint. Hence, it's possible to get ported
5182comments from this endpoint which are a reply to a non-ported robot comment. Callers must be
5183able to deal with this situation.
5184
5185The returned comments are organized in a map of file path to link:#comment-info[CommentInfo] entries
5186in the same fashion as for the link:#list-comments[List Revision Comments] endpoint.
5187The map is filled with the original comment attributes except for these attributes: `path`, `line`,
5188and `range` point to the computed position in the target revision. If the exactly correct position
5189can't be determined, those fields will be filled with the next best position. That can also mean
5190not filling the `line` or `range` attribute anymore and thus converting the comment to a file
5191comment (or even moving the comment to a different file or the patchset level). Callers of this
5192endpoint must be able to deal with this and not rely on the original comment position.
5193
5194It's possible that this endpoint returns different link:#comment-info[CommentInfo] entries with
5195the same comment UUID. This is not a bug but a feature. If a comment appears on a file which Gerrit
5196recognizes as copied between patchsets, the ported version of this comment consists of two ported
5197instances having the same UUID but different `file`/`line`/`range` positions. Callers must be able
5198to handle this situation.
5199
5200Repeated calls of this endpoint might produce different results. Internal errors during the
5201position computation are mapped to fallback locations for affected comments. Those errors might
5202have vanished on later calls, upon which this endpoint returns the actually mapped position. In
5203addition, comments can be deleted and draft comments can be published, upon which the set of ported
5204comments may change.
5205
5206.Request
5207----
5208 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/4/ported_comments/ HTTP/1.0
5209----
5210
5211.Response
5212----
5213 HTTP/1.1 200 OK
5214 Content-Disposition: attachment
5215 Content-Type: application/json; charset=UTF-8
5216
5217 )]}'
5218 {
5219 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5220 {
5221 "id": "TvcXrmjM",
5222 "patch_set": 2,
5223 "line": 23,
5224 "message": "[nit] trailing whitespace",
5225 "updated": "2013-02-26 15:40:43.986000000",
5226 "author": {
5227 "_account_id": 1000096,
5228 "name": "John Doe",
5229 "email": "john.doe@example.com"
5230 },
5231 "unresolved": true
5232 },
5233 {
5234 "id": "TveXwFiA",
5235 "patch_set": 2,
5236 "line": 23,
5237 "in_reply_to": "TvcXrmjM",
5238 "message": "Done",
5239 "updated": "2013-02-26 15:40:45.328000000",
5240 "author": {
5241 "_account_id": 1000097,
5242 "name": "Jane Roe",
5243 "email": "jane.roe@example.com"
5244 },
5245 "unresolved": true
5246 }
5247 ]
5248 }
5249----
5250
5251[[get-ported-drafts]]
5252=== Get Ported Drafts
5253--
5254'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_drafts'
5255--
5256
5257Ports draft comments of other revisions to the requested revision.
5258
5259This endpoint behaves similarly to the link:#get-ported-comments[Get Ported Comments] endpoint.
5260With this endpoint, only draft comments of the calling user are ported, though. If a draft comment
5261is a reply to a published comment, only the ported draft comment is returned.
5262
5263Depending on the filtering rules, it's possible that this endpoint returns a draft comment which is
5264a reply to a comment thread which is not returned by the
5265link:#get-ported-comments[Get Ported Comments] endpoint. That's intended behavior. Callers must be
5266able to handle this situation. The same holds for drafts which are a reply to a robot comment.
5267
5268Different than the link:#get-ported-comments[Get Ported Comments] endpoint, the `author` of the
5269returned comments is not filled for this endpoint as only comments of the calling user are returned.
5270
Patrick Hieselafd6c702020-11-06 10:21:47 +01005271This endpoint requires authentication.
5272
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005273.Request
5274----
5275 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/ported_drafts/ HTTP/1.0
5276----
5277
5278.Response
5279----
5280 HTTP/1.1 200 OK
5281 Content-Disposition: attachment
5282 Content-Type: application/json; charset=UTF-8
5283
5284 )]}'
5285 {
5286 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5287 {
5288 "id": "TveXwFiA",
5289 "patch_set": 2,
5290 "line": 23,
5291 "in_reply_to": "TvcXrmjM",
5292 "message": "Done",
5293 "updated": "2013-02-26 15:40:45.328000000",
5294 "unresolved": true
5295 }
5296 ]
5297 }
5298----
5299
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005300[[apply-fix]]
5301=== Apply Fix
5302--
5303'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
5304--
5305
5306Applies a suggested fix by creating a change edit which includes the
5307modifications indicated by the fix suggestion. If a change edit already exists,
5308it will be updated accordingly. A fix can only be applied if no change edit
5309exists and the fix refers to the current patch set, or the fix refers to the
5310patch set on which the change edit is based.
5311
5312.Request
5313----
5314 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
5315----
5316
5317If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
5318resulting change edit is returned.
5319
5320.Response
5321----
5322 HTTP/1.1 200 OK
5323 Content-Disposition: attachment
5324 Content-Type: application/json; charset=UTF-8
5325
5326 )]}'
5327 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005328 "commit": {
5329 "parents": [
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005330 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005331 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005332 }
5333 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01005334 "author": {
5335 "name": "John Doe",
5336 "email": "john.doe@example.com",
5337 "date": "2013-05-07 15:21:27.000000000",
5338 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005339 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005340 "committer": {
5341 "name": "Jane Doe",
5342 "email": "jane.doe@example.com",
5343 "date": "2013-05-07 15:35:43.000000000",
5344 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005345 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005346 "subject": "Implement feature X",
5347 "message": "Implement feature X\n\nWith this feature ..."
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005348 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005349 "base_patch_set_number": 1,
5350 "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1"
5351 "ref": "refs/users/01/1000001/edit-42622/1"
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005352 }
5353----
5354
5355If the application failed e.g. due to conflicts with an existing change edit,
5356the response "`409 Conflict`" including an error message in the response body
5357is returned.
5358
5359.Response
5360----
5361 HTTP/1.1 409 Conflict
5362 Content-Disposition: attachment
5363 Content-Type: text/plain; charset=UTF-8
5364
5365 The existing change edit could not be merged with another tree.
5366----
5367
Edwin Kempin682ac712013-05-14 13:40:46 +02005368[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005369=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005370--
Edwin Kempin682ac712013-05-14 13:40:46 +02005371'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005372--
Edwin Kempin682ac712013-05-14 13:40:46 +02005373
5374Lists the files that were modified, added or deleted in a revision.
5375
5376.Request
5377----
5378 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
5379----
5380
Makson Leefaf05c22018-07-26 22:42:59 +00005381As result a map is returned that maps the link:#file-id[file path] to a
5382link:#file-info[FileInfo] entry. The entries in the map are
Edwin Kempin682ac712013-05-14 13:40:46 +02005383sorted by file path.
5384
5385.Response
5386----
5387 HTTP/1.1 200 OK
5388 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005389 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02005390
5391 )]}'
5392 {
5393 "/COMMIT_MSG": {
5394 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02005395 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005396 "size_delta": 551,
5397 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02005398 },
5399 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
5400 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02005401 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005402 "size_delta": 98,
5403 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02005404 }
5405 }
5406----
5407
Shawn Pearce984747d2013-07-18 00:42:16 -07005408The request parameter `reviewed` changes the response to return a list
5409of the paths the caller has marked as reviewed. Clients that also
5410need the FileInfo should make two requests.
5411
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005412The request parameter `q` changes the response to return a list
5413of all files (modified or unmodified) that contain that substring
5414in the path name. This is useful to implement suggestion services
David Pursehousefcfb29d2019-08-01 12:55:16 +09005415finding a file by partial name. Clients that also need the FileInfo
5416should make two requests.
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005417
David Pursehouse89c00ca2019-08-03 13:47:29 +09005418For merge commits only, the integer-valued request parameter `parent`
5419changes the response to return a map of the files which are different
5420in this commit compared to the given parent commit. The value is the
Andrii Shyshkalov350a4512019-09-23 02:26:33 -070054211-based index of the parent's position in the commit object,
5422with the first parent always belonging to the target branch. If not
David Pursehouse89c00ca2019-08-03 13:47:29 +09005423specified, the response contains a map of the files different in the
5424auto merge result.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005425
David Pursehousefcfb29d2019-08-01 12:55:16 +09005426The request parameter `base` changes the response to return a map of the
5427files which are different in this commit compared to the given revision. The
5428revision must correspond to a patch set in the change.
5429
5430The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive.
5431That is, only one of them may be used at a time.
Shawn Pearce984747d2013-07-18 00:42:16 -07005432
5433.Request
5434----
5435 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
5436----
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005437
Shawn Pearce984747d2013-07-18 00:42:16 -07005438.Response
5439----
5440 HTTP/1.1 200 OK
5441 Content-Disposition: attachment
5442 Content-Type: application/json; charset=UTF-8
5443
5444 )]}'
5445 [
Edwin Kempinaef44b02013-05-07 16:15:55 +02005446 "/COMMIT_MSG",
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005447 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005448 ]
Edwin Kempinbea55a52013-05-14 13:53:39 +02005449----
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005450
Edwin Kempinaef44b02013-05-07 16:15:55 +02005451[[get-content]]
5452=== Get Content
5453--
5454'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
5455--
5456
5457Gets the content of a file from a certain revision.
5458
Patrick Hiesel38667d42017-05-02 13:12:48 +02005459The optional, integer-valued `parent` parameter can be specified to request
5460the named file from a parent commit of the specified revision. The value is
5461the 1-based index of the parent's position in the commit object. If the
5462parameter is omitted or the value is non-positive, the patch set is referenced.
5463
Edwin Kempinaef44b02013-05-07 16:15:55 +02005464.Request
5465----
5466 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
5467----
5468
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005469The content is returned as base64 encoded string. The HTTP response
5470Content-Type is always `text/plain`, reflecting the base64 wrapping.
5471A Gerrit-specific `X-FYI-Content-Type` header is returned describing
5472the server detected content type of the file.
5473
5474If only the content type is required, callers should use HEAD to
5475avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02005476
5477.Response
5478----
5479 HTTP/1.1 200 OK
5480 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005481 Content-Type: text/plain; charset=ISO-8859-1
5482 X-FYI-Content-Encoding: base64
5483 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02005484
5485 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
5486----
5487
David Ostrovskyd0078672015-02-06 21:51:04 +01005488Alternatively, if the only value of the Accept request header is
5489`application/json` the content is returned as JSON string and
5490`X-FYI-Content-Encoding` is set to `json`.
5491
David Pletcherd1efb452015-09-01 17:45:55 -07005492[[get-safe-content]]
5493=== Download Content
5494--
5495'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
5496--
5497
5498Downloads the content of a file from a certain revision, in a safe format
5499that poses no risk for inadvertent execution of untrusted code.
5500
5501If the content type is defined as safe, the binary file content is returned
5502verbatim. If the content type is not safe, the file is stored inside a ZIP
5503file, containing a single entry with a random, unpredictable name having the
5504same base and suffix as the true filename. The ZIP file is returned in
5505verbatim binary form.
5506
5507See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
5508for information about safe file type configuration.
5509
5510The HTTP resource Content-Type is dependent on the file type: the
5511applicable type for safe files, or "application/zip" for unsafe files.
5512
David Pletcherec622bf2015-09-18 14:30:05 -07005513The optional, integer-valued `parent` parameter can be specified to request
5514the named file from a parent commit of the specified revision. The value is
5515the 1-based index of the parent's position in the commit object. If the
5516parameter is omitted or the value non-positive, the patch set is referenced.
5517
5518Filenames are decorated with a suffix of `_new` for the current patch,
5519`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07005520
5521.Request
5522----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005523 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07005524----
5525
5526.Response
5527----
5528 HTTP/1.1 200 OK
5529 Content-Disposition: attachment; filename="logo.png"
5530 Content-Type: image/png
5531
5532 `[binary data for logo.png]`
5533----
5534
5535.Request
5536----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005537 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 -07005538----
5539
5540.Response
5541----
5542 HTTP/1.1 200 OK
5543 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
5544 Content-Type:application/zip
5545
5546 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
5547----
5548
David Pursehouse882aef22013-06-05 10:56:37 +09005549[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005550=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005551--
David Pursehouse882aef22013-06-05 10:56:37 +09005552'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 -08005553--
David Pursehouse882aef22013-06-05 10:56:37 +09005554
5555Gets the diff of a file from a certain revision.
5556
5557.Request
5558----
5559 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
5560----
5561
5562As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
5563
5564.Response
5565----
5566 HTTP/1.1 200 OK
5567 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005568 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005569
5570 )]
5571 {
5572 "meta_a": {
5573 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005574 "content_type": "text/x-java-source",
5575 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005576 },
5577 "meta_b": {
5578 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005579 "content_type": "text/x-java-source",
5580 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005581 },
5582 "change_type": "MODIFIED",
5583 "diff_header": [
5584 "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",
5585 "index 59b7670..9faf81c 100644",
5586 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5587 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5588 ],
5589 "content": [
5590 {
5591 "ab": [
5592 "// Copyright (C) 2010 The Android Open Source Project",
5593 "//",
5594 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
5595 "// you may not use this file except in compliance with the License.",
5596 "// You may obtain a copy of the License at",
5597 "//",
5598 "// http://www.apache.org/licenses/LICENSE-2.0",
5599 "//",
5600 "// Unless required by applicable law or agreed to in writing, software",
5601 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
5602 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
5603 "// See the License for the specific language governing permissions and",
5604 "// limitations under the License."
5605 ]
5606 },
5607 {
5608 "b": [
5609 "//",
5610 "// Add some more lines in the header."
5611 ]
5612 },
5613 {
5614 "ab": [
5615 "",
5616 "package com.google.gerrit.server.project;",
5617 "",
5618 "import com.google.common.collect.Maps;",
5619 ...
5620 ]
5621 }
5622 ...
5623 ]
5624 }
5625----
5626
5627If the `intraline` parameter is specified, intraline differences are included in the diff.
5628
5629.Request
5630----
5631 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
5632----
5633
5634.Response
5635----
5636 HTTP/1.1 200 OK
5637 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005638 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005639
5640 )]
5641 {
5642 "meta_a": {
5643 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005644 "content_type": "text/x-java-source",
5645 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005646 },
5647 "meta_b": {
5648 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005649 "content_type": "text/x-java-source",
5650 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005651 },
5652 "change_type": "MODIFIED",
5653 "diff_header": [
5654 "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",
5655 "index 59b7670..9faf81c 100644",
5656 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5657 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5658 ],
5659 "content": [
5660 ...
5661 {
5662 "a": [
5663 "/** Manages access control for Git references (aka branches, tags). */"
5664 ],
5665 "b": [
5666 "/** Manages access control for the Git references (aka branches, tags). */"
5667 ],
5668 "edit_a": [],
5669 "edit_b": [
5670 [
5671 31,
5672 4
5673 ]
5674 ]
5675 }
5676 ]
5677 }
5678----
5679
5680The `base` parameter can be specified to control the base patch set from which the diff should
5681be generated.
5682
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005683The integer-valued request parameter `parent` can be specified to control the
5684parent commit number against which the diff should be generated. This is useful
5685for supporting review of merge commits. The value is the 1-based index of the
5686parent's position in the commit object.
5687
David Pursehouse882aef22013-06-05 10:56:37 +09005688.Request
5689----
5690 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
5691----
5692
5693.Response
5694----
5695 HTTP/1.1 200 OK
5696 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005697 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005698
5699 )]
5700 {
5701 "meta_a": {
5702 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005703 "content_type": "text/x-java-source",
5704 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005705 },
5706 "meta_b": {
5707 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005708 "content_type": "text/x-java-source",
5709 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005710 },
5711 "change_type": "MODIFIED",
5712 "content": [
5713 {
5714 "skip": 578
5715 }
5716 ]
5717 }
5718----
5719
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01005720The `whitespace` parameter can be specified to control how whitespace
5721differences are reported in the result. Valid values are `IGNORE_NONE`,
5722`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09005723
Dmitrii Filippovbf3f08b2019-12-06 03:13:06 +01005724[[preview-fix]]
5725=== Preview fix
5726--
5727'GET /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/preview'
5728--
5729
5730Gets the diffs of all files for a certain <<fix-id,\{fix-id\}>>.
5731As response, a map of link:#diff-info[DiffInfo] entities is returned that describes the diffs.
5732
5733Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id and a virtual patch set with the applied fix.
5734
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005735[[get-blame]]
5736=== Get Blame
5737--
5738'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
5739--
5740
5741Gets the blame of a file from a certain revision.
5742
5743.Request
5744----
5745 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
5746----
5747
5748As response a link:#blame-info[BlameInfo] entity is returned that describes the
5749blame.
5750
5751.Response
5752----
5753 HTTP/1.1 200 OK
5754 Content-Disposition: attachment
5755 Content-Type: application/json; charset=UTF-8
5756
5757 )]
5758 {
5759 [
5760 {
5761 "author": "Joe Daw",
5762 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
5763 "time": 1421441349,
5764 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
5765 "ranges": [
5766 {
5767 "start": 1,
5768 "end": 10
5769 },
5770 {
5771 "start": 16,
5772 "end": 296
5773 }
5774 ]
5775 },
5776 {
5777 "author": "Jane Daw",
5778 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
5779 "time": 1421825421,
5780 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
5781 "ranges": [
5782 {
5783 "start": 13,
5784 "end": 13
5785 }
5786 ]
5787 }
5788 ]
5789 }
5790----
5791
5792The `base` parameter can be specified to control the base patch set from which
5793the blame should be generated.
5794
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005795[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005796=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005797--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005798'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 -08005799--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005800
Edwin Kempinbea55a52013-05-14 13:53:39 +02005801Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005802
5803.Request
5804----
5805 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5806----
5807
5808.Response
5809----
5810 HTTP/1.1 201 Created
5811----
5812
Edwin Kempinbea55a52013-05-14 13:53:39 +02005813If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005814response is "`200 OK`".
5815
5816[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005817=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005818--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005819'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 -08005820--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005821
Edwin Kempinbea55a52013-05-14 13:53:39 +02005822Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005823
5824.Request
5825----
5826 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5827----
5828
5829.Response
5830----
5831 HTTP/1.1 204 No Content
5832----
5833
Gustaf Lundh019fb262012-11-28 14:20:22 +01005834[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005835=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005836--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005837'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005838--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005839
5840Cherry picks a revision to a destination branch.
5841
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02005842To cherry pick a commit with no change-id associated with it, see
5843link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit].
5844
Gustaf Lundh019fb262012-11-28 14:20:22 +01005845The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02005846link:#cherrypick-input[CherryPickInput] entity. If the commit message
5847does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005848
Gal Paikin8dadd422021-05-07 10:21:54 +02005849When cherry-picking a change into a branch that already contains the Change-Id
5850that we want to cherry-pick, the cherry-pick will create a new patch-set on the
5851destination's branch's appropriate Change-Id. If the change is closed on the
5852destination branch, the cherry-pick will fail.
5853
Gustaf Lundh019fb262012-11-28 14:20:22 +01005854.Request
5855----
5856 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005857 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005858
5859 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01005860 "message" : "Implementing Feature X",
5861 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01005862 }
5863----
5864
Edwin Kempinaab27d32020-01-29 13:17:04 +01005865As response a link:#change-info[ChangeInfo] entity is returned that
5866describes the resulting cherry-pick change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005867
5868.Response
5869----
5870 HTTP/1.1 200 OK
5871 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005872 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005873
5874 )]}'
5875 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01005876 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
5877 "project": "myProject",
5878 "branch": "release-branch",
5879 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
5880 "subject": "Implementing Feature X",
5881 "status": "NEW",
5882 "created": "2013-02-01 09:59:32.126000000",
5883 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01005884 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005885 "insertions": 12,
5886 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01005887 "_number": 3965,
5888 "owner": {
5889 "name": "John Doe"
5890 }
5891 }
5892----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005893
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005894[[revision-reviewer-endpoints]]
5895== Revision Reviewer Endpoints
5896
5897[[list-revision-reviewers]]
5898=== List Revision Reviewers
5899--
5900'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
5901--
5902
5903Lists the reviewers of a revision.
5904
5905Please note that only the current revision is supported.
5906
5907As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
5908
5909.Request
5910----
5911 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
5912----
5913
5914.Response
5915----
5916 HTTP/1.1 200 OK
5917 Content-Disposition: attachment
5918 Content-Type: application/json; charset=UTF-8
5919
5920 )]}'
5921 [
5922 {
5923 "approvals": {
5924 "Verified": "+1",
5925 "Code-Review": "+2"
5926 },
5927 "_account_id": 1000096,
5928 "name": "John Doe",
5929 "email": "john.doe@example.com"
5930 },
5931 {
5932 "approvals": {
5933 "Verified": " 0",
5934 "Code-Review": "-1"
5935 },
5936 "_account_id": 1000097,
5937 "name": "Jane Roe",
5938 "email": "jane.roe@example.com"
5939 }
5940 ]
5941----
5942
5943[[list-revision-votes]]
5944=== List Revision Votes
5945--
5946'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
5947--
5948
5949Lists the votes for a specific reviewer of the revision.
5950
5951Please note that only the current revision is supported.
5952
5953.Request
5954----
5955 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
5956----
5957
5958As result a map is returned that maps the label name to the label value.
5959The entries in the map are sorted by label name.
5960
5961.Response
5962----
5963 HTTP/1.1 200 OK
5964 Content-Disposition: attachment
5965 Content-Type: application/json;charset=UTF-8
5966
5967 )]}'
5968 {
5969 "Code-Review": -1,
5970 "Verified": 1,
5971 "Work-In-Progress": 1
5972 }
5973----
5974
5975[[delete-revision-vote]]
5976=== Delete Revision Vote
5977--
5978'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5979/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
5980'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5981/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
5982--
5983
5984Deletes a single vote from a revision. The deletion will be possible only
5985if the revision is the current revision. By using this endpoint you can prevent
5986deleting the vote (with same label) from a newer patch set by mistake.
5987
5988Note, that even when the last vote of a reviewer is removed the reviewer itself
5989is still listed on the change.
5990
Gal Paikin6ce56dc2021-03-29 12:28:43 +02005991If another user removed a user's vote, the user with the deleted vote will be
5992added to the attention set.
5993
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005994.Request
5995----
5996 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
5997 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5998----
5999
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02006000Options can be provided in the request body as a
6001link:#delete-vote-input[DeleteVoteInput] entity.
6002Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01006003link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02006004In this case, use a POST request instead:
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006005
6006.Request
6007----
6008 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
6009 Content-Type: application/json; charset=UTF-8
6010
6011 {
6012 "notify": "NONE"
6013 }
6014----
6015
6016.Response
6017----
6018 HTTP/1.1 204 No Content
6019----
6020
Gal Paikinc326de42020-06-16 18:49:00 +03006021[[attention-set-endpoints]]
6022== Attention Set Endpoints
6023
6024[[get-attention-set]]
6025=== Get Attention Set
6026--
6027'GET /changes/link:#change-id[\{change-id\}]/attention'
6028--
6029
6030Returns all users that are currently in the attention set.
6031As response a list of link:#attention-set-info[AttentionSetInfo]
6032entity is returned.
6033
6034.Request
6035----
6036 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6037----
6038
6039.Response
6040----
6041 HTTP/1.1 200 OK
6042 Content-Disposition: attachment
6043 Content-Type: application/json; charset=UTF-8
6044
6045 )]}'
6046 [
6047 {
6048 "account": {
6049 "_account_id": 1000096,
6050 "name": "John Doe",
6051 "email": "john.doe@example.com",
6052 "username": "jdoe"
6053 },
6054 "last_update": "2013-02-01 09:59:32.126000000",
6055 "reason": "reviewer or cc replied"
6056 },
6057 {
6058 "account": {
6059 "_account_id": 1000097,
6060 "name": "Jane Doe",
6061 "email": "jane.doe@example.com",
6062 "username": "janedoe"
6063 },
6064 "last_update": "2013-02-01 09:59:32.126000000",
6065 "reason": "Reviewer was added"
6066 }
6067 ]
6068----
6069
6070[[add-to-attention-set]]
6071=== Add To Attention Set
6072--
6073'POST /changes/link:#change-id[\{change-id\}]/attention'
6074--
6075
6076Adds a single user to the attention set of a change.
6077
6078A user can only be added if they are not in the attention set.
6079If a user is added while already in the attention set, the
6080request is silently ignored.
6081
Gal Paikine631de22020-10-29 12:19:11 +01006082The user must be a reviewer, cc, uploader, or owner on the change.
6083
Gal Paikinc326de42020-06-16 18:49:00 +03006084.Request
6085----
6086 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6087----
6088
6089Details should be provided in the request body as an
6090link:#attention-set-input[AttentionSetInput] entity.
6091
6092.Request
6093----
6094 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6095 Content-Type: application/json; charset=UTF-8
6096
6097 {
6098 "user": "John Doe",
6099 "reason": "reason"
6100 }
6101----
6102
6103.Response
6104----
6105 HTTP/1.1 200 OK
6106 Content-Disposition: attachment
6107 Content-Type: application/json; charset=UTF-8
6108
6109 )]}'
6110 {
6111 "_account_id": 1000096,
6112 "name": "John Doe",
6113 "email": "john.doe@example.com",
6114 "username": "jdoe"
6115 }
6116----
6117
6118[[remove-from-attention-set]]
6119=== Remove from Attention Set
6120--
6121'DELETE /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]' +
6122'POST /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]/delete'
6123--
6124
6125Deletes a single user from the attention set of a change.
6126
6127A user can only be removed from the attention set if they
6128are currently in the attention set. Otherwise, the request
6129is silently ignored.
6130
6131.Request
6132----
6133 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe HTTP/1.0
6134 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
6135----
6136
6137Reason can be provided in the request body as an
6138link:#attention-set-input[AttentionSetInput] entity.
6139
6140User must be left empty, or the user must be exactly
6141the same user as in the request header.
6142
6143.Request
6144----
6145 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
6146 Content-Type: application/json; charset=UTF-8
6147
6148 {
6149 "reason": "reason"
6150 }
6151----
6152
6153.Response
6154----
6155 HTTP/1.1 204 No Content
6156----
6157
6158[[attention-set]]
6159== Attention Set
6160Attention Set is the set of users that should perform some action on the
6161change. E.g, reviewers should review the change, owner/uploader should
6162add a new patchset or respond to comments.
6163
6164Users are added to the attention set if one the following apply:
6165
6166* They are manually added in link:#review-input[ReviewInput] in
6167 add_to_attention_set.
6168* They are added as reviewers.
6169* The change is marked ready for review.
6170* As an owner/uploader, when someone replies on your change.
6171* As a reviewer, when the owner/uploader replies.
Gal Paikin6ce56dc2021-03-29 12:28:43 +02006172* When the user's vote is deleted by another user.
Gal Paikin102f6d82021-04-13 15:21:51 +02006173* The rules above (except manually adding to the attention set) don't apply
6174 for changes that are work in progress.
Gal Paikinc326de42020-06-16 18:49:00 +03006175
6176Users are removed from the attention set if one the following apply:
6177
6178* They are manually removed in link:#review-input[ReviewInput] in
6179 remove_from_attention_set.
6180* They are removed from reviewers.
6181* The change is marked work in progress, abandoned, or submitted.
6182* When the user replies on a change.
6183
6184If the ignore_default_attention_set_rules in link:#review-input[ReviewInput]
6185is set to true, no other changes to the attention set will occur during the
6186link:#set-review[set-review].
6187Also, users specified in the list will occur instead of any of the implicit
6188changes to the attention set. E.g, if a user is added by add_to_attention_set
6189in link:#review-input[ReviewInput], but also the change is marked work in
6190progress, the user will still be added.
6191
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006192[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006193== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006194
Edwin Kempina3d02ef2013-02-22 16:31:53 +01006195[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006196=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01006197--
6198--
6199
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006200[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006201=== \{change-id\}
Patrick Hiesel18da0452017-12-21 14:02:05 +01006202Identifier that uniquely identifies one change. It contains the URL-encoded
6203project name as well as the change number: "'$$<project>~<numericId>$$'"
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006204
David Pursehousea5923972020-02-26 09:39:38 +09006205Gerrit also supports the following identifiers:
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006206
6207* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
6208 where for the branch the `refs/heads/` prefix can be omitted
6209 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
6210* a Change-Id if it uniquely identifies one change
6211 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
Patrick Hiesel4d2dd182017-05-09 17:35:18 +02006212* a numeric change ID ("4247")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006213
Changcheng Xiaod61590f2018-04-30 10:59:14 +02006214[[change-message-id]]
6215=== \{change-message-id\}
6216ID of a change message returned in a link:#change-message-info[ChangeMessageInfo].
6217
John Spurlock5e402f02013-03-24 11:35:04 -04006218[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006219=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04006220UUID of a published comment.
6221
Edwin Kempin3ca57192013-02-27 07:44:01 +01006222[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006223=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01006224UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006225
David Ostrovskybeb0b842014-12-13 00:24:29 +01006226[[label-id]]
6227=== \{label-id\}
6228The name of the label.
6229
Edwin Kempinbea55a52013-05-14 13:53:39 +02006230[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09006231=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02006232The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006233
David Pursehouse11badbb2017-03-27 10:58:05 +09006234The following magic paths are supported:
6235
6236* `/COMMIT_MSG`:
6237+
6238The commit message and headers with the parent commit(s), the author
6239information and the committer information.
6240
6241* `/MERGE_LIST` (for merge commits only):
6242+
6243The list of commits that are being integrated into the destination
6244branch by submitting the merge commit.
6245
Gal Paikin3edc1422020-03-19 12:04:52 +01006246* `/PATCHSET_LEVEL`:
6247+
6248This file path is used exclusively for posting and indicating
6249patchset-level comments, thus not relevant for other use-cases.
6250
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006251[[fix-id]]
6252=== \{fix-id\}
6253UUID of a suggested fix.
6254
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006255[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006256=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006257Identifier that uniquely identifies one revision of a change.
6258
6259This can be:
6260
Shawn Pearce9c0722a2013-03-02 15:30:31 -08006261* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006262* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
6263* an abbreviated commit ID that uniquely identifies one revision of the
6264 change ("674ac754"), at least 4 digits are required
6265* a legacy numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02006266* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006267
Edwin Kempine3446292013-02-19 16:40:14 +01006268[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006269== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01006270
Edwin Kempined5364b2013-02-22 10:39:33 +01006271[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006272=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01006273The `AbandonInput` entity contains information for abandoning a change.
6274
David Pursehouseae367192014-11-25 17:24:47 +09006275[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006276|=============================
6277|Field Name ||Description
6278|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01006279Message to be added as review comment to the change when abandoning the
6280change.
Edwin Kempincd07df42016-12-01 09:10:09 +01006281|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07006282Notify handling that defines to whom email notifications should be sent after
6283the change is abandoned. +
6284Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6285If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006286|`notify_details`|optional|
6287Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006288of link:user-notify.html#recipient-types[recipient type] to
6289link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01006290|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01006291
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006292[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006293=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006294The `ActionInfo` entity describes a REST API call the client can
6295make to manipulate a resource. These are frequently implemented by
6296plugins and may be discovered at runtime.
6297
David Pursehouseae367192014-11-25 17:24:47 +09006298[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006299|====================================
6300|Field Name ||Description
6301|`method` |optional|
6302HTTP method to use with the action. Most actions use `POST`, `PUT`
6303or `DELETE` to cause state changes.
6304|`label` |optional|
6305Short title to display to a user describing the action. In the
6306Gerrit web interface the label is used as the text on the button
6307presented in the UI.
6308|`title` |optional|
6309Longer text to display describing the action. In a web UI this
6310should be the title attribute of the element, displaying when
6311the user hovers the mouse.
6312|`enabled` |optional|
6313If true the action is permitted at this time and the caller is
6314likely allowed to execute it. This may change if state is updated
6315at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006316|====================================
6317
Edwin Kempine3446292013-02-19 16:40:14 +01006318[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006319=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006320The `ApprovalInfo` entity contains information about an approval from a
6321user for a label on a change.
6322
Edwin Kempin963dfd02013-02-27 12:39:32 +01006323`ApprovalInfo` has the same fields as
6324link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01006325In addition `ApprovalInfo` has the following fields:
6326
David Pursehouseae367192014-11-25 17:24:47 +09006327[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006328|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006329|Field Name ||Description
6330|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07006331The vote that the user has given for the label. If present and zero, the
6332user is permitted to vote on the label. If absent, the user is not
6333permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006334|`permitted_voting_range` |optional|
6335The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
6336on that label. If present, the user is permitted to vote on the label
6337regarding the range values. If absent, the user is not permitted to vote
6338on that label.
6339|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01006340The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006341|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006342Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006343while posting the review. Votes/comments that contain `tag` with
6344'autogenerated:' prefix can be filtered out in the web UI.
6345NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006346invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04006347|`post_submit` |not set if `false`|
6348If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01006349|===========================
6350
Sven Selberg273a4aa2016-09-21 16:28:10 +02006351[[assignee-input]]
6352=== AssigneeInput
6353The `AssigneeInput` entity contains the identity of the user to be set as assignee.
6354
6355[options="header",cols="1,^1,5"]
6356|===========================
6357|Field Name ||Description
6358|`assignee` ||
6359The link:rest-api-accounts.html#account-id[ID] of one account that
6360should be added as assignee.
6361|===========================
6362
Gal Paikinc326de42020-06-16 18:49:00 +03006363[[attention-set-info]]
6364=== AttentionSetInfo
6365The `AttentionSetInfo` entity contains details of users that are in
6366the link:#attention-set[attention set].
6367
6368[options="header",cols="1,^1,5"]
6369|===========================
6370|Field Name ||Description
6371|`account` || link:rest-api-accounts.html#account-info[AccountInfo] entity.
6372|`last_update` || The link:rest-api.html#timestamp[timestamp] of the last update.
Gal Paikinf2b1b332020-07-06 16:34:36 +03006373|`reason` || The reason of for adding or removing the user.
Gal Paikinc326de42020-06-16 18:49:00 +03006374
6375|===========================
6376[[attention-set-input]]
6377=== AttentionSetInput
6378The `AttentionSetInput` entity contains details for adding users to the
6379link:#attention-set[attention set] and removing them from it.
6380
6381[options="header",cols="1,^1,5"]
6382|===========================
Gal Paikinf2b1b332020-07-06 16:34:36 +03006383|Field Name ||Description
6384|`user` |optional| link:rest-api-accounts.html#account-id[ID]
Gal Paikinc326de42020-06-16 18:49:00 +03006385of the account that should be added to the attention set. For removals,
6386this field should be empty or the same as the field in the request header.
Gal Paikinf2b1b332020-07-06 16:34:36 +03006387|`reason` || The reason of for adding or removing the user.
6388|`notify` |optional|
6389Notify handling that defines to whom email notifications should be sent
6390after the change is created. +
6391Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6392If not set, the default is `OWNER`.
6393|`notify_details` |optional|
6394Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03006395as a map of link:user-notify.html#recipient-types[recipient type] to
6396link:#notify-info[NotifyInfo] entity.
Gal Paikinc326de42020-06-16 18:49:00 +03006397|===========================
6398
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006399[[blame-info]]
6400=== BlameInfo
6401The `BlameInfo` entity stores the commit metadata with the row coordinates where
6402it applies.
6403
6404[options="header",cols="1,6"]
6405|===========================
6406|Field Name | Description
6407|`author` | The author of the commit.
6408|`id` | The id of the commit.
6409|`time` | Commit time.
6410|`commit_msg` | The commit message.
6411|`ranges` |
6412The blame row coordinates as link:#range-info[RangeInfo] entities.
6413|===========================
6414
Edwin Kempin521c1242015-01-23 12:44:44 +01006415[[change-edit-input]]
6416=== ChangeEditInput
6417The `ChangeEditInput` entity contains information for restoring a
6418path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02006419
Edwin Kempin521c1242015-01-23 12:44:44 +01006420[options="header",cols="1,^1,5"]
6421|===========================
6422|Field Name ||Description
6423|`restore_path`|optional|Path to file to restore.
6424|`old_path` |optional|Old path to file to rename.
6425|`new_path` |optional|New path to file to rename.
6426|===========================
6427
6428[[change-edit-message-input]]
6429=== ChangeEditMessageInput
6430The `ChangeEditMessageInput` entity contains information for changing
6431the commit message within a change edit.
6432
6433[options="header",cols="1,^1,5"]
6434|===========================
6435|Field Name ||Description
6436|`message` ||New commit message.
6437|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02006438
Edwin Kempine3446292013-02-19 16:40:14 +01006439[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006440=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006441The `ChangeInfo` entity contains information about a change.
6442
David Pursehouseae367192014-11-25 17:24:47 +09006443[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006444|==================================
6445|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006446|`id` ||
6447The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05006448where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01006449`refs/heads/` prefix is omitted.
6450|`project` ||The name of the project.
6451|`branch` ||
6452The name of the target branch. +
6453The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01006454|`topic` |optional|The topic to which this change belongs.
Gal Paikinc326de42020-06-16 18:49:00 +03006455|`attention_set` |optional|
6456The map that maps link:rest-api-accounts.html#account-id[account IDs]
6457to link:#attention-set-info[AttentionSetInfo] of that account.
Edwin Kempin93b74fb2017-08-25 10:42:56 +02006458|`assignee` |optional|
6459The assignee of the change as an link:rest-api-accounts.html#account-info[
6460AccountInfo] entity.
6461|`hashtags` |optional|
Gal Paikin07a580c2021-04-15 09:47:36 +02006462List of hashtags that are set on the change.
Edwin Kempine3446292013-02-19 16:40:14 +01006463|`change_id` ||The Change-Id of the change.
6464|`subject` ||
6465The subject of the change (header line of the commit message).
6466|`status` ||
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01006467The status of the change (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempine3446292013-02-19 16:40:14 +01006468|`created` ||
6469The link:rest-api.html#timestamp[timestamp] of when the change was
6470created.
6471|`updated` ||
6472The link:rest-api.html#timestamp[timestamp] of when the change was last
6473updated.
Khai Do96a7caf2016-01-07 14:07:54 -08006474|`submitted` |only set for merged changes|
6475The link:rest-api.html#timestamp[timestamp] of when the change was
6476submitted.
Dave Borowitz8ec31f92017-08-23 10:28:34 -04006477|`submitter` |only set for merged changes|
6478The user who submitted the change, as an
6479link:rest-api-accounts.html#account-info[ AccountInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01006480|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02006481Whether the calling user has starred this change with the default label.
6482|`stars` |optional|
6483A list of star labels that are applied by the calling user to this
6484change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01006485|`reviewed` |not set if `false`|
6486Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07006487Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05006488|`submit_type` |optional|
Changcheng Xiao21885982019-01-15 18:16:51 +01006489The link:config-project-config.html#submit-type[submit type] of the change. +
Dave Borowitzace32102015-12-17 13:08:25 -05006490Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01006491|`mergeable` |optional|
6492Whether the change is mergeable. +
Patrick Hiesela4824db2019-12-20 10:55:26 +01006493Only set for open changes if
6494link:config-gerrit.html#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior]
6495is `API_REF_UPDATED_AND_CHANGE_REINDEX`.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07006496|`submittable` |optional|
6497Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07006498Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01006499|`insertions` ||
6500Number of inserted lines.
6501|`deletions` ||
6502Number of deleted lines.
Dave Borowitzc001f322018-10-31 14:31:08 -07006503|`total_comment_count` |optional|
6504Total number of inline comments across all patch sets. Not set if the current
6505change index doesn't have the data.
Changcheng Xiao81c48092017-02-08 13:04:07 +01006506|`unresolved_comment_count` |optional|
Dave Borowitzc001f322018-10-31 14:31:08 -07006507Number of unresolved inline comment threads across all patch sets. Not set if
6508the current change index doesn't have the data.
Edwin Kempine3446292013-02-19 16:40:14 +01006509|`_number` ||The legacy numeric ID of the change.
6510|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01006511The owner of the change as an link:rest-api-accounts.html#account-info[
6512AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07006513|`actions` |optional|
6514Actions the caller might be able to perform on this revision. The
6515information is a map of view name to link:#action-info[ActionInfo]
6516entities.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01006517|`requirements` |optional|
6518List of the link:rest-api-changes.html#requirement[requirements] to be met before this change
Youssef Elghareeb79f473622021-05-26 18:58:40 +02006519can be submitted. This field is deprecated in favour of `submit_requirements`.
6520|`submit_requirements` |optional|
6521List of the link:#submit-requirement-result-info[SubmitRequirementResultInfo]
6522containing the evaluated submit requirements for the change.
6523Only set if link:#submit-requirements[`SUBMIT_REQUIREMENTS`] is requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006524|`labels` |optional|
6525The labels of the change as a map that maps the label names to
6526link:#label-info[LabelInfo] entries. +
6527Only set if link:#labels[labels] or link:#detailed-labels[detailed
6528labels] are requested.
6529|`permitted_labels` |optional|
6530A map of the permitted labels that maps a label name to the list of
6531values that are allowed for that label. +
6532Only set if link:#detailed-labels[detailed labels] are requested.
6533|`removable_reviewers`|optional|
6534The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01006535link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01006536Only set if link:#labels[labels] or
6537link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07006538|`reviewers` |optional|
Edwin Kempin66af3d82015-11-10 17:38:40 -08006539The reviewers as a map that maps a reviewer state to a list of
6540link:rest-api-accounts.html#account-info[AccountInfo] entities.
6541Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
6542`REVIEWER`: Users with at least one non-zero vote on the change. +
6543`CC`: Users that were added to the change, but have not voted. +
6544`REMOVED`: Users that were previously reviewers on the change, but have
6545been removed. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01006546Only set if link:#labels[labels] or
6547link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07006548|`pending_reviewers` |optional|
6549Updates to `reviewers` that have been made while the change was in the
6550WIP state. Only present on WIP changes and only if there are pending
6551reviewer updates to report. These are reviewers who have not yet been
6552notified about being added to or removed from the change. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01006553Only set if link:#labels[labels] or
6554link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07006555|`reviewer_updates`|optional|
6556Updates to reviewers set for the change as
6557link:#review-update-info[ReviewerUpdateInfo] entities.
Han-Wen Nienhuys3c670be2020-06-30 19:17:07 +02006558Only set if link:#reviewer-updates[reviewer updates] are requested.
John Spurlock74a70cc2013-03-23 16:41:50 -04006559|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07006560Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04006561link:#change-message-info[ChangeMessageInfo] entities. +
6562Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006563|`current_revision` |optional|
6564The commit ID of the current patch set of this change. +
6565Only set if link:#current-revision[the current revision] is requested
6566or if link:#all-revisions[all revisions] are requested.
6567|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05006568All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01006569patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08006570Only set if link:#current-revision[the current revision] is requested
6571(in which case it will only contain a key for the current revision) or
6572if link:#all-revisions[all revisions] are requested.
Han-Wen Nienhuys4ec526a2021-02-16 19:20:26 +01006573|`meta_rev_id` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02006574The SHA-1 of the NoteDb meta ref.
Makson Lee3568a932017-08-28 17:12:03 +08006575|`tracking_ids` |optional|
6576A list of link:#tracking-id-info[TrackingIdInfo] entities describing
6577references to external tracking systems. Only set if
6578link:#tracking-ids[tracking ids] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006579|`_more_changes` |optional, not set if `false`|
6580Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08006581Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05006582|`problems` |optional|
6583A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08006584problems with this change. Only set if link:#check[CHECK] is set.
David Ostrovskycb19cec2017-04-28 11:55:45 +02006585|`is_private` |optional, not set if `false`|
6586When present, change is marked as private.
David Ostrovsky258849b2017-03-09 23:21:03 +01006587|`work_in_progress` |optional, not set if `false`|
6588When present, change is marked as Work In Progress.
Logan Hanks724b24c2017-07-14 10:01:05 -07006589|`has_review_started` |optional, not set if `false`|
Logan Hanks296cd892017-05-03 15:14:41 -07006590When present, change has been marked Ready at some point in time.
Patrick Hiesel828f3222017-07-13 14:18:38 +02006591|`revert_of` |optional|
6592The numeric Change-Id of the change that this change reverts.
Gal Paikinf57225a2019-11-13 12:39:12 -08006593|`submission_id` |optional|
6594ID of the submission of this change. Only set if the status is `MERGED`.
Gal Paikindd31db92019-12-06 14:43:35 +01006595This ID is equal to the numeric ID of the change that triggered the submission.
6596If the change that triggered the submission also has a topic, it will be
6597"<id>-<topic>" of the change that triggered the submission.
6598The callers must not rely on the format of the submission ID.
Edwin Kempinaab27d32020-01-29 13:17:04 +01006599|`cherry_pick_of_change` |optional|
Kaushik Lingarkar73bcb412020-01-29 13:00:46 -08006600The numeric Change-Id of the change that this change was cherry-picked from.
Edwin Kempin4529d642021-02-01 13:03:08 +01006601Only set if the cherry-pick has been done through the Gerrit REST API (and
6602not if a cherry-picked commit was pushed).
Edwin Kempinaab27d32020-01-29 13:17:04 +01006603|`cherry_pick_of_patch_set`|optional|
Kaushik Lingarkar73bcb412020-01-29 13:00:46 -08006604The patchset number of the change that this change was cherry-picked from.
Edwin Kempin4529d642021-02-01 13:03:08 +01006605Only set if the cherry-pick has been done through the Gerrit REST API (and
6606not if a cherry-picked commit was pushed).
Edwin Kempinaab27d32020-01-29 13:17:04 +01006607|`contains_git_conflicts` |optional, not set if `false`|
6608Whether the change contains conflicts. +
6609If `true`, some of the file contents of the change contain git conflict
6610markers to indicate the conflicts. +
6611Only set if this change info is returned in response to a request that
6612creates a new change or patch set and conflicts are allowed. In
6613particular this field is only populated if the change info is returned
6614by one of the following REST endpoints: link:#create-change[Create
6615Change], link:#create-merge-patch-set-for-change[Create Merge Patch Set
6616For Change], link:#cherry-pick[Cherry Pick Revision],
6617link:rest-api-project.html#cherry-pick-commit[Cherry Pick Commit]
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006618|==================================
6619
6620[[change-input]]
6621=== ChangeInput
6622The `ChangeInput` entity contains information about creating a new change.
6623
6624[options="header",cols="1,^1,5"]
6625|==================================
6626|Field Name ||Description
6627|`project` ||The name of the project.
6628|`branch` ||
6629The name of the target branch. +
6630The `refs/heads/` prefix is omitted.
6631|`subject` ||
Edwin Kempinba8388c2020-03-06 08:46:59 +01006632The commit message of the change. Comment lines (beginning with `#`)
6633will be removed. If the commit message contains a Change-Id (as a
6634"Change-Id: I..." footer) that Change-Id will be used for the newly
6635created changed. If a change with this Change-Id already exists for
6636same repository and branch, the request is rejected since Change-Ids
6637must be unique per repository and branch. If the commit message doesn't
6638contain a Change-Id, a newly generated Change-Id is automatically
6639inserted into the commit message.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006640|`topic` |optional|The topic to which this change belongs.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02006641Topic can't contain quotation marks.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006642|`status` |optional, default to `NEW`|
David Ostrovsky4b44bdc2017-07-27 08:05:43 +02006643The status of the change (only `NEW` accepted here).
Edwin Kempin14d50ed2017-05-03 13:26:30 +02006644|`is_private` |optional, default to `false`|
6645Whether the new change should be marked as private.
6646|`work_in_progress` |optional, default to `false`|
6647Whether the new change should be set to work in progress.
David Ostrovsky9d8ec422014-12-24 00:52:09 +01006648|`base_change` |optional|
6649A link:#change-id[\{change-id\}] that identifies the base change for a create
Aaron Gablee8e73282018-04-26 11:09:30 -07006650change operation. Mutually exclusive with `base_commit`.
6651|`base_commit` |optional|
6652A 40-digit hex SHA-1 of the commit which will be the parent commit of the newly
6653created change. If set, it must be a merged commit on the destination branch.
6654Mutually exclusive with `base_change`.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08006655|`new_branch` |optional, default to `false`|
Edwin Kempine94bb872019-10-08 13:47:41 +02006656Allow creating a new branch when set to `true`. Using this option is
6657only possible for non-merge commits (if the `merge` field is not set).
Edwin Kempined8a6bf2021-06-15 14:00:31 +02006658|`validation_options` |optional|
6659Map with key-value pairs that are forwarded as options to the commit validation
6660listeners (e.g. can be used to skip certain validations). Which validation
6661options are supported depends on the installed commit validation listeners.
6662Gerrit core doesn't support any validation options, but commit validation
6663listeners that are implemented in plugins may. Please refer to the
6664documentation of the installed plugins to learn whether they support validation
6665options. Unknown validation options are silently ignored.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006666|`merge` |optional|
6667The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempine94bb872019-10-08 13:47:41 +02006668If set, the target branch (see `branch` field) must exist (it is not
6669possible to create it automatically by setting the `new_branch` field
6670to `true`.
Han-Wen Nienhuys2a1029e2020-01-30 18:52:45 +01006671|`author` |optional|
6672An link:rest-api-accounts.html#account-input[AccountInput] entity
6673that will set the author of the commit to create. The author must be
6674specified as name/email combination.
6675The caller needs "Forge Author" permission when using this field.
6676This field does not affect the owner of the change, which will
6677continue to use the identity of the caller.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01006678|`notify` |optional|
6679Notify handling that defines to whom email notifications should be sent
6680after the change is created. +
6681Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6682If not set, the default is `ALL`.
6683|`notify_details` |optional|
6684Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03006685as a map of link:user-notify.html#recipient-types[recipient type] to
6686link:#notify-info[NotifyInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01006687|==================================
6688
John Spurlock74a70cc2013-03-23 16:41:50 -04006689[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006690=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04006691The `ChangeMessageInfo` entity contains information about a message
6692attached to a change.
6693
David Pursehouseae367192014-11-25 17:24:47 +09006694[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04006695|==================================
6696|Field Name ||Description
6697|`id` ||The ID of the message.
6698|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07006699Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04006700link:rest-api-accounts.html#account-info[AccountInfo] entity. +
6701Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01006702|`real_author` |optional|
6703Real author of the message as an
6704link:rest-api-accounts.html#account-info[AccountInfo] entity. +
6705Set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04006706|`date` ||
6707The link:rest-api.html#timestamp[timestamp] this message was posted.
Marija Savtchouke40dc1a2021-04-07 09:56:12 +01006708|`message` ||
6709The text left by the user or Gerrit system. Accounts are served as account IDs
6710inlined in the text as `<GERRIT_ACCOUNT_18419>`.
6711All accounts, used in message, can be found in `accountsInMessage`
6712field.
6713|`accountsInMessage` ||Accounts, used in `message`.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006714|`tag` |optional|
6715Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006716while posting the review. Votes/comments that contain `tag` with
6717'autogenerated:' prefix can be filtered out in the web UI.
6718NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006719invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04006720|`_revision_number` |optional|
6721Which patchset (if any) generated this message.
6722|==================================
6723
Gustaf Lundh019fb262012-11-28 14:20:22 +01006724[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006725=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01006726The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
6727
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006728[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01006729|===========================
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006730|Field Name ||Description
Edwin Kempin159804b2019-09-23 11:09:39 +02006731|`message` |optional|
6732Commit message for the cherry-pick change. If not set, the commit message of
6733the cherry-picked commit is used.
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006734|`destination` ||Destination branch
Changcheng Xiaoe3332582017-05-26 15:29:41 +02006735|`base` |optional|
673640-hex digit SHA-1 of the commit which will be the parent commit of the newly created change.
6737If set, it must be a merged commit or a change revision on the destination branch.
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02006738|`parent` |optional, defaults to 1|
6739Number of the parent relative to which the cherry-pick should be considered.
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02006740|`notify` |optional|
6741Notify handling that defines to whom email notifications should be sent
6742after the cherry-pick. +
6743Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Saša Živkov357e2bd2020-06-12 12:06:07 +02006744If not set, the default is `ALL`.
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02006745|`notify_details` |optional|
6746Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006747of link:user-notify.html#recipient-types[recipient type] to
6748link:#notify-info[NotifyInfo] entity.
Aaron Gable54bc9832017-07-05 14:44:36 -07006749|`keep_reviewers` |optional, defaults to false|
Edwin Kempin5ac370d2018-10-05 13:39:34 +02006750If `true`, carries reviewers and ccs over from original change to newly created one.
6751|`allow_conflicts` |optional, defaults to false|
6752If `true`, the cherry-pick uses content merge and succeeds also if
6753there are conflicts. If there are conflicts the file contents of the
6754created change contain git conflict markers to indicate the conflicts.
6755Callers can find out if there were conflicts by checking the
Edwin Kempinaab27d32020-01-29 13:17:04 +01006756`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. If
6757there are conflicts the cherry-pick change is marked as
Edwin Kempin3c4113a2018-10-12 10:49:33 +02006758work-in-progress.
Gal Paikinf3abd3c2020-03-24 16:39:20 +01006759|`topic` |optional|
6760The topic of the created cherry-picked change. If not set, the default depends
6761on the source. If the source is a change with a topic, the resulting topic
6762of the cherry-picked change will be {source_change_topic}-{destination_branch}.
6763Otherwise, if the source change has no topic, or the source is a commit,
6764the created change will have no topic.
Gal Paikin1f83c202020-03-31 16:23:41 +02006765If the change already exists, the topic will not change if not set. If set, the
6766topic will be overridden.
Gal Paikin626abe02020-04-07 12:21:26 +02006767|`allow_empty` |optional, defaults to false|
6768If `true`, the cherry-pick succeeds also if the created commit will be empty.
6769If `false`, a cherry-pick that would create an empty commit fails without creating
6770the commit.
Gustaf Lundh019fb262012-11-28 14:20:22 +01006771|===========================
6772
Edwin Kempincb6724a2013-02-26 16:58:51 +01006773[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006774=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05006775The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006776
David Pursehouseae367192014-11-25 17:24:47 +09006777[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01006778|===========================
6779|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07006780|`patch_set` |optional|
6781The patch set number for the comment; only set in contexts where +
6782comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04006783|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006784|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01006785link:#file-id[The file path] for which the inline comment was done. +
Edwin Kempincb6724a2013-02-26 16:58:51 +01006786Not set if returned in a map where the key is the file path.
6787|`side` |optional|
6788The side on which the comment was added. +
6789Allowed values are `REVISION` and `PARENT`. +
6790If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01006791|`parent` |optional|
6792The 1-based parent number. Used only for merge commits when `side == PARENT`.
6793When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006794|`line` |optional|
6795The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04006796If range is set, this equals the end line of the range. +
6797If neither line nor range is set, it's a file comment.
6798|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09006799The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04006800entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01006801|`in_reply_to` |optional|
6802The URL encoded UUID of the comment to which this comment is a reply.
6803|`message` |optional|The comment message.
6804|`updated` ||
6805The link:rest-api.html#timestamp[timestamp] of when this comment was
6806written.
John Spurlock5e402f02013-03-24 11:35:04 -04006807|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09006808The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04006809link:rest-api-accounts.html#account-info[AccountInfo] entity. +
6810Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006811|`tag` |optional|
6812Value of the `tag` field from link:#review-input[ReviewInput] set
6813while posting the review.
Sven Selberg1a6728d2018-09-28 12:30:12 +02006814NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006815invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08006816|`unresolved` |optional|
6817Whether or not the comment must be addressed by the user. The state of
6818resolution of a comment thread is stored in the last comment in that thread
6819chronologically.
Youssef Elghareeb7fdfa442020-02-03 12:00:52 +01006820|`change_message_id` |optional|
Youssef Elghareeb5bd4e4e2020-08-13 17:09:42 +02006821Available with the link:#list-change-comments[list change comments] endpoint.
6822Contains the link:rest-api-changes.html#change-message-info[id] of the change
6823message that this comment is linked to.
Youssef Elghareebb5e42082020-07-09 15:24:01 +02006824|`commit_id` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02006825Hex commit SHA-1 (40 characters string) of the commit of the patchset to which
Youssef Elghareebb5e42082020-07-09 15:24:01 +02006826this comment applies.
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02006827|`context_lines` |optional|
6828A list of link:#context-line[ContextLine] containing the lines of the source
Youssef Elghareeb68e87b62021-01-11 13:20:03 +01006829file where the comment was written. Available only if the "enable-context"
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02006830parameter (see link:#list-change-comments[List Change Comments]) is set.
Youssef Elghareeb27d62012021-02-23 18:21:46 +01006831|`source_content_type` |optional|
6832Mime type of the file where the comment is written. Available only if the
6833"enable-context" parameter (see link:#list-change-comments[List Change Comments])
6834is set.
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02006835
Edwin Kempincb6724a2013-02-26 16:58:51 +01006836|===========================
6837
Edwin Kempin67498de2013-02-25 16:15:34 +01006838[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006839=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03006840The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01006841comment.
6842
David Pursehouseae367192014-11-25 17:24:47 +09006843[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006844|===========================
6845|Field Name ||Description
6846|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01006847The URL encoded UUID of the comment if an existing draft comment should
6848be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01006849|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01006850link:#file-id[The file path] for which the inline comment should be added. +
Edwin Kempin7faf41e2013-02-27 08:17:02 +01006851Doesn't need to be set if contained in a map where the key is the file
6852path.
Edwin Kempin67498de2013-02-25 16:15:34 +01006853|`side` |optional|
6854The side on which the comment should be added. +
6855Allowed values are `REVISION` and `PARENT`. +
6856If not set, the default is `REVISION`.
6857|`line` |optional|
6858The number of the line for which the comment should be added. +
6859`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04006860If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09006861If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04006862|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09006863The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04006864entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01006865|`in_reply_to` |optional|
6866The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01006867|`updated` |optional|
6868The link:rest-api.html#timestamp[timestamp] of this comment. +
6869Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01006870|`message` |optional|
6871The comment message. +
6872If not set and an existing draft comment is updated, the existing draft
6873comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04006874|`tag` |optional, drafts only|
6875Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
6876inputs; for published comments, use the `tag` field in +
Gal Paikinb2b81f22020-02-26 13:14:08 +01006877link:#review-input[ReviewInput]. Votes/comments that contain `tag` with
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006878'autogenerated:' prefix can be filtered out in the web UI.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08006879|`unresolved` |optional|
6880Whether or not the comment must be addressed by the user. This value will
6881default to false if the comment is an orphan, or the value of the `in_reply_to`
6882comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01006883|===========================
6884
Michael Zhou596c7682013-08-25 05:43:34 -04006885[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006886=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04006887The `CommentRange` entity describes the range of an inline comment.
6888
Quinten Yearsley31786712018-07-16 13:44:33 -07006889The comment range is a range from the start position, specified by `start_line`
6890and `start_character`, to the end position, specified by `end_line` and
6891`end_character`. The start position is *inclusive* and the end position is
6892*exclusive*.
6893
6894So, a range over part of a line will have `start_line` equal to
6895`end_line`; however a range with `end_line` set to 5 and `end_character` equal
6896to 0 will not include any characters on line 5,
6897
David Pursehouseae367192014-11-25 17:24:47 +09006898[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04006899|===========================
Quinten Yearsley31786712018-07-16 13:44:33 -07006900|Field Name ||Description
6901|`start_line` ||The start line number of the range. (1-based)
6902|`start_character` ||The character position in the start line. (0-based)
6903|`end_line` ||The end line number of the range. (1-based)
6904|`end_character` ||The character position in the end line. (0-based)
Michael Zhou596c7682013-08-25 05:43:34 -04006905|===========================
6906
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02006907[[context-line]]
6908=== ContextLine
6909The `ContextLine` entity contains the line number and line text of a single
6910line of the source file content.
6911
6912[options="header",cols="1,6"]
6913|===========================
6914|Field Name |Description
6915|`line_number` |The line number of the source line.
6916|`context_line` |String containing the line text.
6917|===========================
6918
Edwin Kempine3446292013-02-19 16:40:14 +01006919[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006920=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006921The `CommitInfo` entity contains information about a commit.
6922
Edwin Kempinf0c57152015-07-15 18:18:24 +02006923[options="header",cols="1,^1,5"]
6924|===========================
6925|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02006926|`commit` |Optional|
6927The commit ID. Not set if included in a link:#revision-info[
6928RevisionInfo] entity that is contained in a map which has the commit ID
6929as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006930|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01006931The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02006932link:#commit-info[CommitInfo] entities. In each parent
6933only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006934|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01006935link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006936|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01006937link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006938|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01006939The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02006940|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01006941|`web_links` |optional|
Frank Bordendf69edb2021-05-05 17:00:15 +02006942Links to the patch set in external sites as a list of
6943link:#web-link-info[WebLinkInfo] entities.
6944|`resolve_conflicts_web_links` |optional|
6945Links to the commit in external sites for resolving conflicts as a list of
Sven Selbergd26bd542014-11-21 16:28:10 +01006946link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02006947|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01006948
Patrick Hieselfda96452017-06-14 16:44:54 +02006949[[commit-message-input]]
6950=== CommitMessageInput
6951The `CommitMessageInput` entity contains information for changing
6952the commit message of a change.
6953
6954[options="header",cols="1,^1,5"]
6955|=============================
6956|Field Name ||Description
6957|`message` ||New commit message.
6958|`notify` |optional|
6959Notify handling that defines to whom email notifications should be sent
6960after the commit message was updated. +
6961Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Logan Hanksa1e68dc2017-06-29 15:13:27 -07006962If not set, the default is `OWNER` for WIP changes and `ALL` otherwise.
Patrick Hieselfda96452017-06-14 16:44:54 +02006963|`notify_details`|optional|
6964Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006965of link:user-notify.html#recipient-types[recipient type] to
6966link:#notify-info[NotifyInfo] entity.
Patrick Hieselfda96452017-06-14 16:44:54 +02006967|=============================
6968
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02006969[[delete-change-message-input]]
6970=== DeleteChangeMessageInput
6971The `DeleteChangeMessageInput` entity contains the options for deleting a change message.
6972
6973[options="header",cols="1,^1,5"]
6974|=============================
6975|Field Name ||Description
6976|`reason` |optional|
6977The reason why the change message should be deleted. +
6978If set, the change message will be replaced with
6979"Change message removed by: `name`\nReason: `reason`",
6980or just "Change message removed by: `name`." if not set.
6981|=============================
6982
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01006983[[delete-comment-input]]
6984=== DeleteCommentInput
6985The `DeleteCommentInput` entity contains the option for deleting a comment.
6986
6987[options="header",cols="1,^1,5"]
6988|=============================
6989|Field Name ||Description
6990|`reason` |optional|
6991The reason why the comment should be deleted. +
6992If set, the comment's message will be replaced with
6993"Comment removed by: `name`; Reason: `reason`",
6994or just "Comment removed by: `name`." if not set.
6995|=============================
6996
Edwin Kempin407fca32016-08-29 12:01:00 +02006997[[delete-reviewer-input]]
6998=== DeleteReviewerInput
6999The `DeleteReviewerInput` entity contains options for the deletion of a
7000reviewer.
7001
7002[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007003|=============================
7004|Field Name ||Description
7005|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02007006Notify handling that defines to whom email notifications should be sent
7007after the reviewer is deleted. +
7008Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7009If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007010|`notify_details`|optional|
7011Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007012of link:user-notify.html#recipient-types[recipient type] to
7013link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007014|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02007015
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007016[[delete-vote-input]]
7017=== DeleteVoteInput
7018The `DeleteVoteInput` entity contains options for the deletion of a
7019vote.
7020
7021[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007022|=============================
7023|Field Name ||Description
7024|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007025The label for which the vote should be deleted. +
7026If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01007027|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007028Notify handling that defines to whom email notifications should be sent
7029after the vote is deleted. +
7030Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7031If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007032|`notify_details`|optional|
7033Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007034of link:user-notify.html#recipient-types[recipient type] to
7035link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007036|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007037
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08007038[[description-input]]
7039=== DescriptionInput
7040The `DescriptionInput` entity contains information for setting a description.
7041
7042[options="header",cols="1,6"]
7043|===========================
7044|Field Name |Description
7045|`description` |The description text.
7046|===========================
7047
David Pursehouse882aef22013-06-05 10:56:37 +09007048[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007049=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09007050The `DiffContent` entity contains information about the content differences
7051in a file.
7052
David Pursehouseae367192014-11-25 17:24:47 +09007053[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007054|==========================
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007055|Field Name ||Description
7056|`a` |optional|Content only in the file on side A (deleted in B).
7057|`b` |optional|Content only in the file on side B (added in B).
7058|`ab` |optional|Content in the file on both sides (unchanged).
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007059|`edit_a` |only present when the `intraline` parameter is set and the
7060DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09007061Text sections deleted from side A as a
7062link:#diff-intraline-info[DiffIntralineInfo] entity.
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007063|`edit_b` |only present when the `intraline` parameter is set and the
7064DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09007065Text sections inserted in side B as a
7066link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007067|`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a
7068rebase.
Renan Oliveirac5077aa2020-09-25 18:11:54 +02007069|`due_to_move`|not set if `false`|Indicates whether this entry was introduced by a
7070move operation.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007071|`skip` |optional|count of lines skipped on both sides when the file is
David Pursehouse882aef22013-06-05 10:56:37 +09007072too large to include all common lines.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007073|`common` |optional|Set to `true` if the region is common according
Shawn Pearce425a2be2014-01-02 16:00:58 -08007074to the requested ignore-whitespace parameter, but a and b contain
7075differing amounts of whitespace. When present and true a and b are
7076used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09007077|==========================
7078
7079[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007080=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007081The `DiffFileMetaInfo` entity contains meta information about a file diff.
7082
David Pursehouseae367192014-11-25 17:24:47 +09007083[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007084|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007085|Field Name ||Description
7086|`name` ||The name of the file.
7087|`content_type`||The content type of the file.
7088|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01007089|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007090Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07007091link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09007092|==========================
7093
7094[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007095=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007096The `DiffInfo` entity contains information about the diff of a file
7097in a revision.
7098
Edwin Kempin8cdce502014-12-06 10:55:38 +01007099If the link:#weblinks-only[weblinks-only] parameter is specified, only
7100the `web_links` field is set.
7101
David Pursehouseae367192014-11-25 17:24:47 +09007102[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007103|==========================
7104|Field Name ||Description
7105|`meta_a` |not present when the file is added|
7106Meta information about the file on side A as a
7107link:#diff-file-meta-info[DiffFileMetaInfo] entity.
7108|`meta_b` |not present when the file is deleted|
7109Meta information about the file on side B as a
7110link:#diff-file-meta-info[DiffFileMetaInfo] entity.
7111|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
7112`COPIED`, `REWRITE`).
7113|`intraline_status`|only set when the `intraline` parameter was specified in the request|
7114Intraline status (`OK`, `ERROR`, `TIMEOUT`).
7115|`diff_header` ||A list of strings representing the patch set diff header.
7116|`content` ||The content differences in the file as a list of
7117link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01007118|`web_links` |optional|
7119Links to the file diff in external sites as a list of
7120link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
Frank Borden19524922021-05-04 11:40:44 +02007121|`edit_web_links` |optional|
7122Links to edit the file in external sites as a list of
7123link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01007124|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09007125|==========================
7126
7127[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007128=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007129The `DiffIntralineInfo` entity contains information about intraline edits in a
7130file.
7131
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007132The information consists of a list of `<skip length, edit length>` pairs, where
David Pursehouse31203f52013-06-08 17:05:45 +09007133the skip length is the number of characters between the end of the previous edit
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007134and the start of this edit, and the edit length is the number of edited characters
David Pursehouse31203f52013-06-08 17:05:45 +09007135following the skip. The start of the edits is from the beginning of the related
Tao Zhou42430482019-09-13 11:26:01 +02007136diff content lines. If the list is empty, the entire DiffContent should be considered
7137as unedited.
David Pursehouse882aef22013-06-05 10:56:37 +09007138
David Pursehouse31203f52013-06-08 17:05:45 +09007139Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07007140the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09007141
Edwin Kempin8cdce502014-12-06 10:55:38 +01007142[[diff-web-link-info]]
7143=== DiffWebLinkInfo
7144The `DiffWebLinkInfo` entity describes a link on a diff screen to an
7145external site.
7146
7147[options="header",cols="1,6"]
7148|=======================
7149|Field Name|Description
7150|`name` |The link name.
7151|`url` |The link URL.
7152|`image_url`|URL to the icon of the link.
7153|show_on_side_by_side_diff_view|
7154Whether the web link should be shown on the side-by-side diff screen.
7155|show_on_unified_diff_view|
7156Whether the web link should be shown on the unified diff screen.
7157|=======================
7158
David Ostrovsky9ea9c112015-01-25 00:12:38 +01007159[[edit-file-info]]
7160=== EditFileInfo
7161The `EditFileInfo` entity contains additional information
7162of a file within a change edit.
7163
7164[options="header",cols="1,^1,5"]
7165|===========================
7166|Field Name ||Description
7167|`web_links` |optional|
7168Links to the diff info in external sites as a list of
7169link:#web-link-info[WebLinkInfo] entities.
7170|===========================
7171
Edwin Kempin521c1242015-01-23 12:44:44 +01007172[[edit-info]]
7173=== EditInfo
7174The `EditInfo` entity contains information about a change edit.
7175
7176[options="header",cols="1,^1,5"]
7177|===========================
David Pursehouse5934d3f2019-01-07 15:23:49 +09007178|Field Name ||Description
7179|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01007180link:#commit-info[CommitInfo] entity.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007181|`base_patch_set_number`||The patch set number of the patch set the change edit is based on.
7182|`base_revision` ||The revision of the patch set the change edit is based on.
David Pursehouse1bb55ff2019-01-07 15:28:22 +09007183|`ref` ||The ref of the change edit.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007184|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01007185Information about how to fetch this patch set. The fetch information is
7186provided as a map that maps the protocol name ("`git`", "`http`",
7187"`ssh`") to link:#fetch-info[FetchInfo] entities.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007188|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01007189The files of the change edit as a map that maps the file names to
7190link:#file-info[FileInfo] entities.
7191|===========================
7192
Edwin Kempine3446292013-02-19 16:40:14 +01007193[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007194=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007195The `FetchInfo` entity contains information about how to fetch a patch
7196set via a certain protocol.
7197
David Pursehouseae367192014-11-25 17:24:47 +09007198[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007199|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02007200|Field Name ||Description
7201|`url` ||The URL of the project.
7202|`ref` ||The ref of the patch set.
7203|`commands` |optional|
7204The download commands for this patch set as a map that maps the command
7205names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09007206Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007207|==========================
7208
7209[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007210=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007211The `FileInfo` entity contains information about a file in a patch set.
7212
David Pursehouseae367192014-11-25 17:24:47 +09007213[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007214|=============================
7215|Field Name ||Description
7216|`status` |optional|
7217The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
7218"`C`"=Copied, "`W`"=Rewritten). +
7219Not set if the file was Modified ("`M`").
7220|`binary` |not set if `false`|Whether the file is binary.
7221|`old_path` |optional|
7222The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05007223Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01007224|`lines_inserted`|optional|
7225Number of inserted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02007226Not set for binary files or if no lines were inserted. +
7227An empty last line is not included in the count and hence this number can
7228differ by one from details provided in <<#diff-info,DiffInfo>>.
Edwin Kempine3446292013-02-19 16:40:14 +01007229|`lines_deleted` |optional|
7230Number of deleted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02007231Not set for binary files or if no lines were deleted. +
7232An empty last line is not included in the count and hence this number can
7233differ by one from details provided in <<#diff-info,DiffInfo>>.
Edwin Kempin640f9842015-10-08 15:53:20 +02007234|`size_delta` ||
7235Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01007236|`size` ||
7237File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01007238|=============================
7239
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007240[[fix-input]]
7241=== FixInput
7242The `FixInput` entity contains options for fixing commits using the
7243link:#fix-change[fix change] endpoint.
7244
7245[options="header",cols="1,6"]
7246|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07007247|Field Name |Description
7248|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007249database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07007250|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07007251merged into the destination branch as this exact SHA-1. If not, insert
7252a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007253|==========================
7254
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007255[[fix-suggestion-info]]
7256=== FixSuggestionInfo
7257The `FixSuggestionInfo` entity represents a suggested fix.
7258
7259[options="header",cols="1,^1,5"]
7260|==========================
7261|Field Name ||Description
7262|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
7263fix. It will be generated automatically and hence will be ignored if it's set
7264for input objects.
7265|`description` ||A description of the suggested fix.
7266|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01007267entities indicating how the content of one or several files should be modified.
7268Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007269|==========================
7270
7271[[fix-replacement-info]]
7272=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01007273The `FixReplacementInfo` entity describes how the content of a file should be
7274replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007275
7276[options="header",cols="1,6"]
7277|==========================
7278|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01007279|`path` |The path of the file which should be modified. Any file in
Alice Kober-Sotzek368547f2020-03-13 22:00:41 +01007280the repository may be modified. The commit message can be modified via the
7281magic file `/COMMIT_MSG` though only the part below the generated header of
7282that magic file can be modified. References to the header lines will result in
7283errors when the fix is applied.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007284|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01007285of the file should be replaced. Lines in the file are assumed to be separated
Alice Kober-Sotzekf0a3f342020-09-24 14:16:06 +02007286by the line feed character.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007287|`replacement` |The content which should be used instead of the current one.
7288|==========================
7289
Edwin Kempine3446292013-02-19 16:40:14 +01007290[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007291=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007292The `GitPersonInfo` entity contains information about the
7293author/committer of a commit.
7294
David Pursehouseae367192014-11-25 17:24:47 +09007295[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01007296|==========================
7297|Field Name |Description
7298|`name` |The name of the author/committer.
7299|`email` |The email address of the author/committer.
7300|`date` |The link:rest-api.html#timestamp[timestamp] of when
7301this identity was constructed.
7302|`tz` |The timezone offset from UTC of when this identity was
7303constructed.
7304|==========================
7305
Edwin Kempin521c1242015-01-23 12:44:44 +01007306[[group-base-info]]
7307=== GroupBaseInfo
7308The `GroupBaseInfo` entity contains base information about the group.
7309
7310[options="header",cols="1,6"]
7311|==========================
7312|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01007313|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01007314|`name` |The name of the group.
7315|==========================
7316
David Pursehoused9dac372016-11-24 19:41:10 +09007317[[hashtags-input]]
7318=== HashtagsInput
7319
7320The `HashtagsInput` entity contains information about hashtags to add to,
7321and/or remove from, a change.
7322
7323[options="header",cols="1,^1,5"]
7324|=======================
7325|Field Name||Description
7326|`add` |optional|The list of hashtags to be added to the change.
Mike Frysinger136ecbd2021-02-09 14:26:02 -05007327|`remove` |optional|The list of hashtags to be removed from the change.
David Pursehoused9dac372016-11-24 19:41:10 +09007328|=======================
7329
Edwin Kempin521c1242015-01-23 12:44:44 +01007330[[included-in-info]]
7331=== IncludedInInfo
7332The `IncludedInInfo` entity contains information about the branches a
7333change was merged into and tags it was tagged with.
7334
Edwin Kempin78279ba2015-05-22 15:22:41 +02007335[options="header",cols="1,^1,5"]
7336|=======================
7337|Field Name||Description
7338|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01007339Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007340|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01007341Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007342|`external`|optional|A map that maps a name to a list of external
7343systems that include this change, e.g. a list of servers on which this
7344change is deployed.
7345|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01007346
Edwin Kempine3446292013-02-19 16:40:14 +01007347[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007348=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07007349The `LabelInfo` entity contains information about a label on a change, always
7350corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01007351
Dave Borowitz88159512013-06-14 14:21:50 -07007352There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07007353link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07007354
7355* For a quick summary of the state of labels, use `LABELS`.
7356* For detailed information about labels, including exact numeric votes for all
7357 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
7358
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007359==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09007360[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007361|===========================
7362|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01007363|`optional` |not set if `false`|
7364Whether the label is optional. Optional means the label may be set, but
7365it's neither necessary for submission nor does it block submission if
7366set.
Dave Borowitz88159512013-06-14 14:21:50 -07007367|===========================
7368
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007369==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09007370[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07007371|===========================
7372|Field Name ||Description
7373|`approved` |optional|One user who approved this label on the change
7374(voted the maximum value) as an
7375link:rest-api-accounts.html#account-info[AccountInfo] entity.
7376|`rejected` |optional|One user who rejected this label on the change
7377(voted the minimum value) as an
7378link:rest-api-accounts.html#account-info[AccountInfo] entity.
7379|`recommended` |optional|One user who recommended this label on the
7380change (voted positively, but not the maximum value) as an
7381link:rest-api-accounts.html#account-info[AccountInfo] entity.
7382|`disliked` |optional|One user who disliked this label on the change
7383(voted negatively, but not the minimum value) as an
7384link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01007385|`blocking` |optional|If `true`, the label blocks submit operation.
7386If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07007387|`value` |optional|The voting value of the user who
7388recommended/disliked this label on the change if it is not
7389"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07007390|`default_value`|optional|The default voting value for the label.
7391This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07007392|===========================
7393
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007394==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09007395[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07007396|===========================
7397|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01007398|`all` |optional|List of all approvals for this label as a list
Aaron Gableea8a2112017-04-25 14:18:16 -07007399of link:#approval-info[ApprovalInfo] entities. Items in this list may
7400not represent actual votes cast by users; if a user votes on any label,
7401a corresponding ApprovalInfo will appear in this list for all labels.
Edwin Kempine3446292013-02-19 16:40:14 +01007402|`values` |optional|A map of all values that are allowed for this
7403label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07007404to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01007405|===========================
7406
Saša Živkov499873f2014-05-05 13:34:18 +02007407[[mergeable-info]]
7408=== MergeableInfo
7409The `MergeableInfo` entity contains information about the mergeability of a
7410change.
7411
David Pursehouseae367192014-11-25 17:24:47 +09007412[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02007413|============================
Saša Živkov697cab22014-04-29 16:46:50 +02007414|Field Name ||Description
7415|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02007416Submit type used for this change, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02007417`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Saša Živkov499873f2014-05-05 13:34:18 +02007418`CHERRY_PICK`.
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007419|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007420The strategy of the merge, can be `recursive`, `resolve`,
7421`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02007422|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02007423`true` if this change is cleanly mergeable, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007424|`commit_merged` |optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07007425`true` if this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007426|`content_merged`|optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07007427`true` if the content of this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007428|`conflicts` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007429A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02007430|`mergeable_into`|optional|
7431A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02007432|============================
Dave Borowitz88159512013-06-14 14:21:50 -07007433
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007434[[merge-input]]
7435=== MergeInput
7436The `MergeInput` entity contains information about the merge
7437
7438[options="header",cols="1,^1,5"]
Edwin Kempinaab27d32020-01-29 13:17:04 +01007439|==============================
7440|Field Name ||Description
7441|`source` ||
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007442The source to merge from, e.g. a complete or abbreviated commit SHA-1,
David Pursehouse4abaef932018-03-18 15:05:08 +09007443a complete reference name, a short reference name under `refs/heads`, `refs/tags`,
7444or `refs/remotes` namespace, etc.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007445|`source_branch` |optional|
Han-Wen Nienhuys9ec1f6a2020-01-07 17:32:08 +01007446A branch from which `source` is reachable. If specified,
7447`source` is checked for visibility and reachability against only this
7448branch. This speeds up the operation, especially for large repos with
7449many branches.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007450|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007451The strategy of the merge, can be `recursive`, `resolve`,
7452`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007453|`allow_conflicts`|optional, defaults to false|
7454If `true`, creating the merge succeeds also if there are conflicts. +
7455If there are conflicts the file contents of the created change contain
7456git conflict markers to indicate the conflicts. +
7457Callers can find out whether there were conflicts by checking the
7458`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. +
7459If there are conflicts the change is marked as work-in-progress. +
7460This option is not supported for all merge strategies (e.g. it's
7461supported for `recursive` and `resolve`, but not for
7462`simple-two-way-in-core`).
7463|==============================
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007464
Zhen Chenb1e07e52016-09-23 12:59:48 -07007465[[merge-patch-set-input]]
7466=== MergePatchSetInput
7467The `MergePatchSetInput` entity contains information about updating a new
7468change by creating a new merge commit.
7469
7470[options="header",cols="1,^1,5"]
7471|==================================
7472|Field Name ||Description
7473|`subject` |optional|
7474The new subject for the change, if not specified, will reuse the current patch
7475set's subject
Han-Wen Nienhuysbd2af0c2020-01-09 16:39:26 +01007476|`inherit_parent` |optional, default to `false`|
Zhen Chenb1e07e52016-09-23 12:59:48 -07007477Use the current patch set's first parent as the merge tip when set to `true`.
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02007478|`base_change` |optional|
Han-Wen Nienhuys69917fe2020-01-09 16:39:26 +01007479A link:#change-id[\{change-id\}] that identifies a change. When `inherit_parent`
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02007480is `false`, the merge tip will be the current patch set of the `base_change` if
7481it's set. Otherwise, the current branch tip of the destination branch will be used.
Zhen Chenb1e07e52016-09-23 12:59:48 -07007482|`merge` ||
7483The detail of the source commit for merge as a link:#merge-input[MergeInput]
7484entity.
Patrick Hiesele8fc7972020-10-06 13:22:07 +02007485|`author` |optional|
7486An link:rest-api-accounts.html#account-input[AccountInput] entity
7487that will set the author of the commit to create. The author must be
7488specified as name/email combination.
7489The caller needs "Forge Author" permission when using this field.
7490This field does not affect the owner of the change, which will
7491continue to use the identity of the caller.
Zhen Chenb1e07e52016-09-23 12:59:48 -07007492|==================================
7493
Raviteja Sunkara791f3392015-11-03 13:24:50 +05307494[[move-input]]
7495=== MoveInput
7496The `MoveInput` entity contains information for moving a change to a new branch.
7497
7498[options="header",cols="1,^1,5"]
7499|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04007500|Field Name ||Description
7501|`destination_branch`||Destination branch
7502|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05307503A message to be posted in this change's comments
Marija Savtchoukd89fefc2020-12-15 06:46:15 +00007504|`keep_all_votes` |optional, defaults to false|
Marija Savtchoukcee6a8f2020-12-03 12:58:04 +00007505By default, only veto votes that are blocking the change from submission are moved to
7506the destination branch. Using this option is only allowed for administrators,
7507because it can affect the submission behaviour of the change (depending on the label access
7508configuration and submissions rules).
Raviteja Sunkara791f3392015-11-03 13:24:50 +05307509|===========================
7510
Edwin Kempincd07df42016-12-01 09:10:09 +01007511[[notify-info]]
7512=== NotifyInfo
7513The `NotifyInfo` entity contains detailed information about who should
7514be notified about an update. These notifications are sent out even if a
7515`notify` option in the request input disables normal notifications.
7516`NotifyInfo` entities are normally contained in a `notify_details` map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007517in the request input where the key is the
7518link:user-notify.html#recipient-types[recipient type].
Edwin Kempincd07df42016-12-01 09:10:09 +01007519
7520[options="header",cols="1,^1,5"]
7521|=======================
7522|Field Name||Description
7523|`accounts`|optional|
7524A list of link:rest-api-accounts.html#account-id[account IDs] that
7525identify the accounts that should be should be notified.
7526|=======================
7527
Edwin Kempin364a86b2017-04-27 12:34:00 +02007528[[private-input]]
7529=== PrivateInput
7530The `PrivateInput` entity contains information for changing the private
7531flag on a change.
7532
7533[options="header",cols="1,^1,5"]
7534|=======================
7535|Field Name||Description
7536|`message` |optional|Message describing why the private flag was changed.
7537|=======================
7538
Edwin Kempin521c1242015-01-23 12:44:44 +01007539[[problem-info]]
7540=== ProblemInfo
7541The `ProblemInfo` entity contains a description of a potential consistency problem
7542with a change. These are not related to the code review process, but rather
7543indicate some inconsistency in Gerrit's database or repository metadata related
7544to the enclosing change.
7545
7546[options="header",cols="1,^1,5"]
7547|===========================
7548|Field Name||Description
7549|`message` ||Plaintext message describing the problem with the change.
7550|`status` |optional|
7551The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
7552fix was attempted.
7553|`outcome` |optional|
7554If `status` is set, an additional plaintext message describing the
7555outcome of the fix.
7556|===========================
7557
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02007558[[publish-change-edit-input]]
7559=== PublishChangeEditInput
7560The `PublishChangeEditInput` entity contains options for the publishing of
7561change edit.
7562
7563[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007564|=============================
7565|Field Name ||Description
7566|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02007567Notify handling that defines to whom email notifications should be sent
7568after the change edit is published. +
7569Allowed values are `NONE` and `ALL`. +
7570If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007571|`notify_details`|optional|
7572Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007573of link:user-notify.html#recipient-types[recipient type] to
7574link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007575|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02007576
Patrick Hieselbb84fd72017-08-23 11:11:22 +02007577[[pure-revert-info]]
7578=== PureRevertInfo
7579The `PureRevertInfo` entity describes the result of a pure revert check.
7580
7581[options="header",cols="1,6"]
7582|======================
7583|Field Name |Description
7584|`is_pure_revert` |Outcome of the check as boolean.
7585|======================
7586
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04007587[[push-certificate-info]]
7588=== PushCertificateInfo
7589The `PushCertificateInfo` entity contains information about a push
7590certificate provided when the user pushed for review with `git push
7591--signed HEAD:refs/for/<branch>`. Only used when signed push is
7592link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
7593
7594[options="header",cols="1,6"]
7595|===========================
7596|Field Name|Description
7597|`certificate`|Signed certificate payload and GPG signature block.
7598|`key` |
7599Information about the key that signed the push, along with any problems
7600found while checking the signature or the key itself, as a
7601link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
7602|===========================
7603
Gabor Somossyb72d4c62015-10-20 23:40:07 +01007604[[range-info]]
7605=== RangeInfo
7606The `RangeInfo` entity stores the coordinates of a range.
7607
7608[options="header",cols="1,6"]
7609|===========================
7610|Field Name | Description
7611|`start` | First index.
7612|`end` | Last index.
7613|===========================
7614
Zalan Blenessy874aed72015-01-12 13:26:18 +01007615[[rebase-input]]
7616=== RebaseInput
7617The `RebaseInput` entity contains information for changing parent when rebasing.
7618
7619[options="header",width="50%",cols="1,^1,5"]
7620|===========================
7621|Field Name ||Description
7622|`base` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02007623The new parent revision. This can be a ref or a SHA-1 to a concrete patchset. +
Zalan Blenessy874aed72015-01-12 13:26:18 +01007624Alternatively, a change number can be specified, in which case the current
7625patch set is inferred. +
7626Empty string is used for rebasing directly on top of the target branch,
7627which effectively breaks dependency towards a parent change.
Edwin Kempin9a6f0542021-01-13 13:51:42 +01007628|`allow_conflicts`|optional, defaults to false|
7629If `true`, the rebase also succeeds if there are conflicts. +
7630If there are conflicts the file contents of the rebased patch set contain
7631git conflict markers to indicate the conflicts. +
7632Callers can find out whether there were conflicts by checking the
7633`contains_git_conflicts` field in the returned link:#change-info[ChangeInfo]. +
7634If there are conflicts the change is marked as work-in-progress.
Zalan Blenessy874aed72015-01-12 13:26:18 +01007635|===========================
7636
Edwin Kempin521c1242015-01-23 12:44:44 +01007637[[related-change-and-commit-info]]
7638=== RelatedChangeAndCommitInfo
7639
7640The `RelatedChangeAndCommitInfo` entity contains information about
7641a related change and commit.
7642
7643[options="header",cols="1,^1,5"]
7644|===========================
7645|Field Name ||Description
Patrick Hieselcab63512017-07-28 10:25:42 +02007646|`project` ||The project of the change or commit.
Edwin Kempin521c1242015-01-23 12:44:44 +01007647|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01007648|`commit` ||The commit as a
7649link:#commit-info[CommitInfo] entity.
7650|`_change_number` |optional|The change number.
7651|`_revision_number` |optional|The revision number.
7652|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07007653|`status` |optional|The status of the change. The status of
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01007654the change is one of (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempin521c1242015-01-23 12:44:44 +01007655|===========================
7656
7657[[related-changes-info]]
7658=== RelatedChangesInfo
7659The `RelatedChangesInfo` entity contains information about related
7660changes.
7661
7662[options="header",cols="1,6"]
7663|===========================
7664|Field Name |Description
7665|`changes` |A list of
7666link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
7667describing the related changes. Sorted by git commit order, newest to
7668oldest. Empty if there are no related changes.
7669|===========================
7670
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01007671
7672[[requirement]]
7673=== Requirement
7674The `Requirement` entity contains information about a requirement relative to a change.
7675
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01007676[options="header",cols="1,^1,5"]
7677|===========================
7678|Field Name | |Description
7679|`status` | | Status of the requirement. Can be either `OK`, `NOT_READY` or `RULE_ERROR`.
Sven Selberge748e3f2020-09-24 13:44:56 +02007680|`fallback_text` | | A human readable reason
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01007681|`type` | |
7682Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it
7683was triggered. Can be seen as a class: requirements sharing the same type were created for a similar
7684reason, and the data structure will follow one set of rules.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01007685|===========================
7686
7687
Edwin Kempined5364b2013-02-22 10:39:33 +01007688[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007689=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01007690The `RestoreInput` entity contains information for restoring a change.
7691
David Pursehouseae367192014-11-25 17:24:47 +09007692[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01007693|===========================
7694|Field Name ||Description
7695|`message` |optional|
7696Message to be added as review comment to the change when restoring the
7697change.
7698|===========================
7699
Edwin Kempind2ec4152013-02-22 12:17:19 +01007700[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007701=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01007702The `RevertInput` entity contains information for reverting a change.
7703
David Pursehouseae367192014-11-25 17:24:47 +09007704[options="header",cols="1,^1,5"]
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01007705|=============================
7706|Field Name ||Description
7707|`message` |optional|
Edwin Kempind2ec4152013-02-22 12:17:19 +01007708Message to be added as review comment to the change when reverting the
7709change.
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01007710|`notify` |optional|
7711Notify handling that defines to whom email notifications should be sent
7712for reverting the change. +
7713Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7714If not set, the default is `ALL`.
7715|`notify_details`|optional|
7716Additional information about whom to notify about the revert as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007717of link:user-notify.html#recipient-types[recipient type] to
7718link:#notify-info[NotifyInfo] entity.
Gal Paikincc93c562019-10-09 13:24:12 +02007719|`topic` |optional|
Gal Paikinb81f56c2019-10-16 14:39:24 +02007720Name of the topic for the revert change. If not set, the default for Revert
7721endpoint is the topic of the change being reverted, and the default for the
7722RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02007723Topic can't contain quotation marks.
Youssef Elghareebfd02dae2020-09-03 21:56:30 +02007724|`work_in_progress` |optional|
7725When present, change is marked as Work In Progress. This will also override
7726the notify value to `OWNER`. +
7727If not set, the default is false.
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02007728|=============================
Gal Paikinb81f56c2019-10-16 14:39:24 +02007729
7730[[revert-submission-info]]
7731=== RevertSubmissionInfo
Gal Paikin64777c72019-12-18 14:11:13 +01007732The `RevertSubmissionInfo` entity describes the revert changes.
Gal Paikinb81f56c2019-10-16 14:39:24 +02007733
7734[options="header",cols="1,6"]
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02007735|==============================
Gal Paikinb81f56c2019-10-16 14:39:24 +02007736|Field Name | Description
7737|`revert_changes` |
Edwin Kempin6e7fb4e2019-10-24 17:20:51 +02007738A list of link:#change-info[ChangeInfo] that describes the revert changes. Each
7739entity in that list is a revert change that was created in that revert
7740submission.
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02007741|==============================
Edwin Kempind2ec4152013-02-22 12:17:19 +01007742
Edwin Kempin67498de2013-02-25 16:15:34 +01007743[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007744=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01007745The `ReviewInfo` entity contains information about a review.
7746
David Pursehouseae367192014-11-25 17:24:47 +09007747[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01007748|===========================
7749|Field Name |Description
7750|`labels` |
7751The labels of the review as a map that maps the label names to the
7752voting values.
7753|===========================
7754
Viktar Donich316bf7a2016-07-06 11:29:01 -07007755[[review-update-info]]
7756=== ReviewerUpdateInfo
7757The `ReviewerUpdateInfo` entity contains information about updates to
7758change's reviewers set.
7759
7760[options="header",cols="1,6"]
7761|===========================
7762|Field Name |Description
7763|`updated`|
7764Timestamp of the update.
7765|`updated_by`|
7766The account which modified state of the reviewer in question as
7767link:rest-api-accounts.html#account-info[AccountInfo] entity.
7768|`reviewer`|
7769The reviewer account added or removed from the change as an
7770link:rest-api-accounts.html#account-info[AccountInfo] entity.
7771|`state`|
7772The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
7773|===========================
7774
Edwin Kempin67498de2013-02-25 16:15:34 +01007775[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007776=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01007777The `ReviewInput` entity contains information for adding a review to a
7778revision.
7779
David Pursehouseae367192014-11-25 17:24:47 +09007780[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01007781|============================
Gal Paikin3e984c22020-07-03 16:44:40 +03007782|Field Name ||Description
7783|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007784The message to be added as review comment.
Gal Paikin3e984c22020-07-03 16:44:40 +03007785|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007786Apply this tag to the review comment message, votes, and inline
Ben Rohlfsd9be63f2021-02-04 09:01:46 +01007787comments. Tags with an 'autogenerated:' prefix may be used by CI or other
7788automated systems to distinguish them from human reviews. If another
7789message was posted on a newer patchset, but with the same tag, then the older
7790message will be hidden in the UI. Suffixes starting with `~` are not considered,
7791so `autogenerated:my-ci-system~trigger` and `autogenerated:my-ci-system~result`
7792will be considered being the same tag with regards to the hiding rule.
Gal Paikin3e984c22020-07-03 16:44:40 +03007793|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007794The votes that should be added to the revision as a map that maps the
7795label names to the voting values.
Gal Paikin3e984c22020-07-03 16:44:40 +03007796|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007797The comments that should be added as a map that maps a file path to a
7798list of link:#comment-input[CommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03007799|`robot_comments` |optional|
Edwin Kempin3fde7e42016-09-19 15:35:10 +02007800The robot comments that should be added as a map that maps a file path
7801to a list of link:#robot-comment-input[RobotCommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03007802|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007803Draft handling that defines how draft comments are handled that are
7804already in the database but that were not also described in this
7805input. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05007806Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values
7807except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04007808Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05007809If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value
7810besides `KEEP` is allowed.
Youssef Elghareeb3e4bf512021-05-12 18:40:27 +02007811|`draft_ids_to_publish` |optional|
7812List of draft IDs to be published. The draft IDs should belong to the current
7813user and be valid. If `drafts` is set to `PUBLISH`, then draft IDs should
7814contain drafts for the same revision that is requested for review. If `drafts`
7815is set to `KEEP`, then `draft_ids_to_publish` will be ignored and no draft
7816comments will be published. +
7817If not set, the default is to publish all drafts according to the `drafts` field.
Gal Paikin3e984c22020-07-03 16:44:40 +03007818|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01007819Notify handling that defines to whom email notifications should be sent
7820after the review is stored. +
7821Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7822If not set, the default is `ALL`.
Gal Paikin3e984c22020-07-03 16:44:40 +03007823|`notify_details` |optional|
Edwin Kempincd07df42016-12-01 09:10:09 +01007824Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007825of link:user-notify.html#recipient-types[recipient type] to
7826link:#notify-info[NotifyInfo] entity.
Gal Paikin3e984c22020-07-03 16:44:40 +03007827|`omit_duplicate_comments` |optional|
Bill Wendling692b4ec2015-10-19 15:40:57 -07007828If `true`, comments with the same content at the same place will be omitted.
Gal Paikin3e984c22020-07-03 16:44:40 +03007829|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07007830link:rest-api-accounts.html#account-id[\{account-id\}] the review
7831should be posted on behalf of. To use this option the caller must
7832have been granted `labelAs-NAME` permission for all keys of labels.
Gal Paikin3e984c22020-07-03 16:44:40 +03007833|`reviewers` |optional|
Patrick Hieselcf6d9352017-04-13 10:15:42 +02007834A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
Gal Paikin0184a2b2021-04-15 08:58:34 +02007835representing reviewers that should be added/removed to/from the change.
Gal Paikin3e984c22020-07-03 16:44:40 +03007836|`ready` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07007837If true, and if the change is work in progress, then start review.
7838It is an error for both `ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03007839|`work_in_progress` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07007840If true, mark the change as work in progress. It is an error for both
7841`ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03007842|`add_to_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03007843list of link:#attention-set-input[AttentionSetInput] entities to add
Gal Paikine631de22020-10-29 12:19:11 +01007844to the link:#attention-set[attention set]. Users that are not reviewers,
7845ccs, owner, or uploader are silently ignored.
Gal Paikin3e984c22020-07-03 16:44:40 +03007846|`remove_from_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03007847list of link:#attention-set-input[AttentionSetInput] entities to remove
7848from the link:#attention-set[attention set].
Gal Paikin3e984c22020-07-03 16:44:40 +03007849|`ignore_automatic_attention_set_rules`|optional|
7850If set to true, ignore all automatic attention set rules described in the
Gal Paikinc326de42020-06-16 18:49:00 +03007851link:#attention-set[attention set]. Updates in add_to_attention_set
7852and remove_from_attention_set are not ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01007853|============================
7854
Aaron Gable843b0c12017-04-21 08:25:27 -07007855[[review-result]]
7856=== ReviewResult
7857The `ReviewResult` entity contains information regarding the updates
7858that were made to a review.
7859
7860[options="header",cols="1,^1,5"]
7861|============================
7862|Field Name ||Description
7863|`labels` |optional|
7864Map of labels to values after the review was posted. Null if any reviewer
7865additions were rejected.
7866|`reviewers` |optional|
7867Map of account or group identifier to
Gal Paikin721a40b2021-04-15 09:30:00 +02007868link:rest-api-changes.html#reviewer-result[ReviewerResult]
Gal Paikin0184a2b2021-04-15 08:58:34 +02007869representing the outcome of adding/removing a reviewer.
Aaron Gable843b0c12017-04-21 08:25:27 -07007870Absent if no reviewer additions were requested.
Logan Hankse81ad8e2017-07-18 09:45:46 -07007871|`ready` |optional|
7872If true, the change was moved from WIP to ready for review as a result of this
7873action. Not set if false.
Aaron Gable843b0c12017-04-21 08:25:27 -07007874|============================
7875
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007876[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007877=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007878The `ReviewerInfo` entity contains information about a reviewer and its
7879votes on a change.
7880
Edwin Kempin963dfd02013-02-27 12:39:32 +01007881`ReviewerInfo` has the same fields as
7882link:rest-api-accounts.html#account-info[AccountInfo] and includes
7883link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007884In addition `ReviewerInfo` has the following fields:
7885
David Pursehouseae367192014-11-25 17:24:47 +09007886[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007887|==========================
7888|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007889|`approvals` |
7890The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09007891approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01007892|`_account_id` |
7893This field is inherited from `AccountInfo` but is optional here if an
7894unregistered reviewer was added by email. See
7895link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007896|==========================
7897
Edwin Kempin392328e2013-02-25 12:50:03 +01007898[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007899=== ReviewerInput
Gal Paikin0184a2b2021-04-15 08:58:34 +02007900The `ReviewerInput` entity contains information for adding or removing
7901reviewers to/from the change.
Edwin Kempin392328e2013-02-25 12:50:03 +01007902
David Pursehouseae367192014-11-25 17:24:47 +09007903[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007904|=============================
7905|Field Name ||Description
7906|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01007907The link:rest-api-accounts.html#account-id[ID] of one account that
Gal Paikin0184a2b2021-04-15 08:58:34 +02007908should be added/removed as reviewer or the link:rest-api-groups.html#group-id[
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01007909ID] of one internal group for which all members should be added as reviewers. +
Edwin Kempin392328e2013-02-25 12:50:03 +01007910If an ID identifies both an account and a group, only the account is
7911added as reviewer to the change.
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01007912External groups, such as LDAP groups, will be silently omitted from a
7913link:#set-review[set-review] or
Gal Paikin0184a2b2021-04-15 08:58:34 +02007914link:rest-api-changes.html#add-reviewer[add-reviewer] call. A group can only be
7915specified for adding reviewers, not for removing them.
Edwin Kempincd07df42016-12-01 09:10:09 +01007916|`state` |optional|
Gal Paikin0184a2b2021-04-15 08:58:34 +02007917Add reviewer in this state. Possible reviewer states are `REVIEWER`,
7918`CC` and `REMOVED`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007919|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01007920Whether adding the reviewer is confirmed. +
7921The Gerrit server may be configured to
7922link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
7923confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01007924|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02007925Notify handling that defines to whom email notifications should be sent
7926after the reviewer is added. +
7927Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7928If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007929|`notify_details`|optional|
7930Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007931of link:user-notify.html#recipient-types[recipient type] to
7932link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007933|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01007934
Gal Paikin721a40b2021-04-15 09:30:00 +02007935[[reviewer-result]]
7936=== ReviewerResult
Gal Paikin0184a2b2021-04-15 08:58:34 +02007937The `ReviewerResult` entity describes the result of modifying reviewers of
7938a change.
Gal Paikin721a40b2021-04-15 09:30:00 +02007939
7940[options="header",cols="1,^1,5"]
7941|===========================
7942|Field Name ||Description
7943|`input` ||
7944Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
7945set while adding the reviewer.
7946|`reviewers` |optional|
7947The newly added reviewers as a list of link:#reviewer-info[
7948ReviewerInfo] entities.
7949|`ccs` |optional|
Gal Paikinefb4ad52021-04-15 09:44:40 +02007950The newly CCed accounts as a list of
7951link:rest-api-accounts.html#account-info[AccountInfo] entities. This field will
Gal Paikin0184a2b2021-04-15 08:58:34 +02007952only appear if the requested `state` for the reviewer was `CC`.
7953|`removed` |optional|
7954The newly removed accounts as a list of
7955link:rest-api-accounts.html#account-info[AccountInfo] entities.
7956This field will only appear if the requested `state` for the reviewer was
7957`REMOVED`.
Gal Paikin721a40b2021-04-15 09:30:00 +02007958|`error` |optional|
7959Error message explaining why the reviewer could not be added. +
7960If a group was specified in the input and an error is returned, it
7961means that none of the members were added as reviewer.
7962|`confirm` |`false` if not set|
7963Whether adding the reviewer requires confirmation.
7964|===========================
7965
Edwin Kempine3446292013-02-19 16:40:14 +01007966[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007967=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007968The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07007969Not all fields are returned by default. Additional fields can
7970be obtained by adding `o` parameters as described in
7971link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01007972
David Pursehouseae367192014-11-25 17:24:47 +09007973[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007974|===========================
7975|Field Name ||Description
David Pursehouse4de41112016-06-28 09:24:08 +09007976|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
7977`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Kasper Nilssonbe3616d2018-01-23 14:10:36 -08007978|`_number` ||The patch set number, or `edit` if the patch set is an edit.
Edwin Kempin04cbd342015-02-19 16:31:22 +01007979|`created` ||
7980The link:rest-api.html#timestamp[timestamp] of when the patch set was
7981created.
7982|`uploader` ||
7983The uploader of the patch set as an
7984link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01007985|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01007986|`fetch` ||
7987Information about how to fetch this patch set. The fetch information is
7988provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07007989"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
7990only included if a plugin implementing the
7991link:intro-project-owner.html#download-commands[download commands]
7992interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07007993|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01007994link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07007995|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01007996The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07007997link:#file-info[FileInfo] entities. Only set if
7998link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
7999option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07008000|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07008001Actions the caller might be able to perform on this revision. The
8002information is a map of view name to link:#action-info[ActionInfo]
8003entities.
Khai Dob3139b7532014-09-19 15:13:04 -07008004|`reviewed` |optional|
8005Indicates whether the caller is authenticated and has commented on the
8006current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Quinten Yearsley28cd2122019-06-10 14:41:13 -07008007|`commit_with_footers` |optional|
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07008008If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
8009this is the current patch set, contains the full commit message with
8010Gerrit-specific commit footers, as if this revision were submitted
8011using the link:project-configuration.html#cherry_pick[Cherry Pick]
8012submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04008013|`push_certificate` |optional|
8014If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
8015contains the push certificate provided by the user when uploading this
8016patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
8017This field is always set if the option is requested; if no push
8018certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07008019|`description` |optional|
8020The description of this patchset, as displayed in the patchset
8021selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01008022|===========================
8023
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008024[[robot-comment-info]]
8025=== RobotCommentInfo
8026The `RobotCommentInfo` entity contains information about a robot inline
8027comment.
8028
Alice Kober-Sotzek7d890be2020-10-01 17:41:56 +02008029`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>
8030except for the `unresolved` field which doesn't exist for robot comments.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008031In addition `RobotCommentInfo` has the following fields:
8032
8033[options="header",cols="1,^1,5"]
8034|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01008035|Field Name ||Description
8036|`robot_id` ||The ID of the robot that generated this comment.
8037|`robot_run_id` ||An ID of the run of the robot.
8038|`url` |optional|URL to more information.
8039|`properties` |optional|Robot specific properties as map that maps arbitrary
8040keys to values.
8041|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
8042<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008043|===========================
8044
8045[[robot-comment-input]]
8046=== RobotCommentInput
8047The `RobotCommentInput` entity contains information for creating an inline
8048robot comment.
8049
Alice Kober-Sotzek7d890be2020-10-01 17:41:56 +02008050[options="header",cols="1,^1,5"]
8051|===========================
8052|Field Name ||Description
8053|`path` ||
8054link:#file-id[The file path] for which the inline comment should be added.
8055|`side` |optional|
8056The side on which the comment should be added. +
8057Allowed values are `REVISION` and `PARENT`. +
8058If not set, the default is `REVISION`.
8059|`line` |optional|
8060The number of the line for which the comment should be added. +
8061`0` if it is a file comment. +
8062If neither line nor range is set, a file comment is added. +
8063If range is set, this value is ignored in favor of the `end_line` of the range.
8064|`range` |optional|
8065The range of the comment as a link:#comment-range[CommentRange]
8066entity.
8067|`in_reply_to` |optional|
8068The URL encoded UUID of the comment to which this comment is a reply.
8069|`message` |optional|
8070The comment message.
8071|`robot_id` ||The ID of the robot that generated this comment.
8072|`robot_run_id` ||An ID of the run of the robot.
8073|`url` |optional|URL to more information.
8074|`properties` |optional|Robot specific properties as map that maps arbitrary
8075keys to values.
8076|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
8077<<fix-suggestion-info,FixSuggestionInfo>> entities.
8078|===========================
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008079
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008080[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008081=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008082The `RuleInput` entity contains information to test a Prolog rule.
8083
David Pursehouseae367192014-11-25 17:24:47 +09008084[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008085|===========================
8086|Field Name ||Description
8087|`rule`||
8088Prolog code to execute instead of the code in `refs/meta/config`.
8089|`filters`|`RUN` if not set|
8090When `RUN` filter rules in the parent projects are called to
8091post-process the results of the project specific rule. This
8092behavior matches how the rule will execute if installed. +
8093If `SKIP` the parent filters are not called, allowing the test
8094to return results from the input rule.
8095|===========================
8096
Edwin Kempin0eddba02013-02-22 15:30:12 +01008097[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008098=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01008099The `SubmitInput` entity contains information for submitting a change.
8100
David Pursehouseae367192014-11-25 17:24:47 +09008101[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008102|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01008103|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01008104|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05008105If set, submit the change on behalf of the given user. The value may take any
8106format link:rest-api-accounts.html#account-id[accepted by the accounts REST
8107API]. Using this option requires
8108link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
8109permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01008110|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07008111Notify handling that defines to whom email notifications should be sent after
8112the change is submitted. +
8113Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8114If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008115|`notify_details`|optional|
8116Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008117of link:user-notify.html#recipient-types[recipient type] to
8118link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008119|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01008120
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008121[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008122=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008123The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02008124Fields in this entity roughly correspond to the fields set by `LABELS`
8125in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008126
David Pursehouseae367192014-11-25 17:24:47 +09008127[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008128|===========================
8129|Field Name ||Description
8130|`status`||
8131`OK`, the change can be submitted. +
8132`NOT_READY`, additional labels are required before submit. +
8133`CLOSED`, closed changes cannot be submitted. +
8134`RULE_ERROR`, rule code failed with an error.
8135|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01008136Map of labels that are approved; an
8137link:rest-api-accounts.html#account-info[AccountInfo] identifies the
8138voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008139|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01008140Map of labels that are preventing submit;
8141link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008142|`need`|optional|
8143Map of labels that need to be given to submit. The value is
8144currently an empty object.
8145|`may`|optional|
8146Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01008147link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
8148if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008149|`impossible`|optional|
8150Map of labels that should have been in `need` but cannot be
8151used by any user because of access restrictions. The value
8152is currently an empty object.
8153|`error_message`|optional|
8154When status is RULE_ERROR this message provides some text describing
8155the failure of the rule predicate.
8156|===========================
8157
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008158[[submit-requirement-expression-info]]
8159=== SubmitRequirementExpressionInfo
8160The `SubmitRequirementExpressionInfo` describes the result of evaluating a
8161single submit requirement expression, for example `label:code-review=+2`.
8162
8163[options="header",cols="1,6"]
8164|===========================
8165|Field Name |Description
8166|`expression`|
8167The submit requirement expression as a string, for example
8168`branch:refs/heads/foo and label:verified=+1`.
8169|`fulfilled`|
8170True if the submit requirement is fulfilled for the change.
8171|`passing_atoms`|
8172A list of passing atoms as strings. For the above expression,
8173`passing_atoms` can contain ["branch:refs/heads/foo"] if the branch predicate is
8174fulfilled for the change.
8175|`failing_atoms`|
8176A list of failing atoms. This is similar to `passing_atoms` except that it
8177contains the list of predicates that are not fulfilled for the change.
8178|===========================
8179
8180[[submit-requirement-result-info]]
8181=== SubmitRequirementResultInfo
8182The `SubmitRequirementResultInfo` describes the result of evaluating a
8183submit requirement on a change.
8184
8185[options="header",cols="1,^1,5"]
8186|===========================
8187|Field Name ||Description
8188|`name`||
8189The submit requirement name.
8190|`description`|optional|
8191Description of the submit requirement.
8192|`status`||
8193Status describing the result of evaluating the submit requirement. The status
8194is one of (`SATISFIED`, `UNSATISFED`, `OVERRIDDEN`, `NOT_APPLICABLE`).
8195|`applicability_expression_result`|optional|
8196A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
8197containing the result of evaluating the applicability expression. Not set if the
8198submit requirement did not define an applicability expression.
8199|`submittability_expression_result`||
8200A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
8201containing the result of evaluating the submittability expression.
8202|`override_expression_result`|optional|
8203A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
8204containing the result of evaluating the override expression. Not set if the
8205submit requirement did not define an override expression.
8206|===========================
8207
Jonathan Nieder2a629b02016-06-16 15:15:25 -07008208[[submitted-together-info]]
8209=== SubmittedTogetherInfo
8210The `SubmittedTogetherInfo` entity contains information about a
8211collection of changes that would be submitted together.
8212
8213[options="header",cols="1,6"]
8214|===========================
8215|Field Name |Description
8216|`changes` |
8217A list of ChangeInfo entities representing the changes to be submitted together.
8218|`non_visible_changes`|
8219The number of changes to be submitted together that the current user
8220cannot see. (This count includes changes that are visible to the
8221current user when their reason for being submitted together involves
8222changes the user cannot see.)
8223|===========================
8224
Edwin Kempin521c1242015-01-23 12:44:44 +01008225[[suggested-reviewer-info]]
8226=== SuggestedReviewerInfo
8227The `SuggestedReviewerInfo` entity contains information about a reviewer
8228that can be added to a change (an account or a group).
8229
8230`SuggestedReviewerInfo` has either the `account` field that contains
8231the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
8232the `group` field that contains the
8233link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
8234
Logan Hanksab3c81e2016-07-20 15:42:52 -07008235[options="header",cols="1,^1,5"]
8236|===========================
8237|Field Name ||Description
8238|`account` |optional|
8239An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
8240suggestion is an account.
8241|`group` |optional|
8242A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
8243suggestion is a group.
8244|`count` ||
8245The total number of accounts in the suggestion. This is `1` if `account` is
8246present. If `group` is present, the total number of accounts that are
8247members of the group is returned (this count includes members of nested
8248groups).
8249|`confirm` |optional|
8250True if `group` is present and `count` is above the threshold where the
8251`confirmed` flag must be passed to add the group as a reviewer.
8252|===========================
8253
Edwin Kempin64006bb2013-02-22 08:17:04 +01008254[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008255=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01008256The `TopicInput` entity contains information for setting a topic.
8257
David Pursehouseae367192014-11-25 17:24:47 +09008258[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01008259|===========================
8260|Field Name ||Description
8261|`topic` |optional|The topic. +
8262The topic will be deleted if not set.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02008263Topic can't contain quotation marks.
Edwin Kempin64006bb2013-02-22 08:17:04 +01008264|===========================
8265
Makson Lee3568a932017-08-28 17:12:03 +08008266[[tracking-id-info]]
8267=== TrackingIdInfo
8268The `TrackingIdInfo` entity describes a reference to an external tracking system.
8269
8270[options="header",cols="1,6"]
8271|======================
8272|Field Name|Description
8273|`system` |The name of the external tracking system.
8274|`id` |The tracking id.
8275|======================
8276
Oleg Aravinbf313bb2016-10-24 12:28:56 -07008277[[voting-range-info]]
8278=== VotingRangeInfo
8279The `VotingRangeInfo` entity describes the continuous voting range from min
8280to max values.
8281
8282[options="header",cols="1,6"]
8283|======================
8284|Field Name|Description
8285|`min` |The minimum voting value.
8286|`max` |The maximum voting value.
8287|======================
8288
Edwin Kempinbd885ff2014-04-11 16:11:56 +02008289[[web-link-info]]
8290=== WebLinkInfo
8291The `WebLinkInfo` entity describes a link to an external site.
8292
Edwin Kempinaf35ce42021-01-29 13:50:04 +01008293[options="header",cols="1,^1,5"]
8294|========================
8295|Field Name ||Description
8296|`name` ||The link name.
8297|`url` ||The link URL.
8298|`image_url`|optional|URL to the icon of the link.
8299|`target` |optional|The target window in which the web link should be opened.
8300|========================
Edwin Kempinbd885ff2014-04-11 16:11:56 +02008301
Alan Tokaev392cfca2017-04-28 11:11:31 +02008302[[work-in-progress-input]]
8303=== WorkInProgressInput
8304The `WorkInProgressInput` entity contains additional information for a change
8305set to WorkInProgress/ReadyForReview.
8306
8307[options="header",cols="1,^1,5"]
8308|=============================
8309|Field Name ||Description
8310|`message` |optional|
8311Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview.
8312|=============================
8313
Edwin Kempind0a63922013-01-23 16:32:59 +01008314GERRIT
8315------
8316Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07008317
8318SEARCHBOX
8319---------