blob: 60f71c9978a3a024f9156fea9f7944b9240de5ae [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
Jacek Centkowski34a2d6b2022-03-04 11:07:15 +010080limit on queries and return all results (does not apply to anonymous requests).
81This might not be supported by all 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",
Edwin Kempin065e5a22022-12-19 13:34:10 +0100106 "attention_set": {
107 "1000096": {
Gal Paikinc326de42020-06-16 18:49:00 +0300108 "account": {
Edwin Kempin065e5a22022-12-19 13:34:10 +0100109 "_account_id": 1000096,
110 "name": "John Doe",
111 "email": "john.doe@example.com"
Gal Paikinc326de42020-06-16 18:49:00 +0300112 },
Edwin Kempin065e5a22022-12-19 13:34:10 +0100113 "last_update": "2012-07-17 07:19:27.766000000",
114 "reason": "reviewer or cc replied"
Gal Paikinc326de42020-06-16 18:49:00 +0300115 }
Edwin Kempin065e5a22022-12-19 13:34:10 +0100116 },
John Spurlockd25fad12013-03-09 11:48:49 -0500117 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
118 "subject": "One change",
119 "status": "NEW",
120 "created": "2012-07-17 07:18:30.854000000",
121 "updated": "2012-07-17 07:19:27.766000000",
John Spurlockd25fad12013-03-09 11:48:49 -0500122 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100123 "insertions": 26,
124 "deletions": 10,
John Spurlockd25fad12013-03-09 11:48:49 -0500125 "_number": 1756,
126 "owner": {
127 "name": "John Doe"
128 },
Edwin Kempind0a63922013-01-23 16:32:59 +0100129 },
John Spurlockd25fad12013-03-09 11:48:49 -0500130 {
John Spurlockd25fad12013-03-09 11:48:49 -0500131 "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501",
132 "project": "demo",
133 "branch": "master",
134 "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501",
135 "subject": "Another change",
136 "status": "NEW",
137 "created": "2012-07-17 07:18:30.884000000",
138 "updated": "2012-07-17 07:18:30.885000000",
139 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100140 "insertions": 12,
141 "deletions": 18,
John Spurlockd25fad12013-03-09 11:48:49 -0500142 "_number": 1757,
143 "owner": {
144 "name": "John Doe"
145 },
146 "_more_changes": true
147 }
148 ]
Edwin Kempind0a63922013-01-23 16:32:59 +0100149----
150
Sebastian Schuberth02bafe02016-01-20 21:38:11 +0100151If the number of changes matching the query exceeds either the internal
152limit or a supplied `n` query parameter, the last change object has a
David Pursehouse025ea3e2014-09-03 10:47:34 +0900153`_more_changes: true` JSON field set.
154
155The `S` or `start` query parameter can be supplied to skip a number
156of changes from the list.
Edwin Kempind0a63922013-01-23 16:32:59 +0100157
Matthias Sohn0b2bf612020-12-24 00:15:32 +0100158Administrators can use the `skip-visibility` query parameter to skip visibility filtering.
159This can be used to ensure that no changes are missed e.g. when querying for changes which
160need to be reindexed. Without this parameter query results the user has no permission to read
161are filtered out. REST requests with the skip-visibility option are rejected when the current
162user doesn't have the ADMINISTRATE_SERVER capability.
163
Edwin Kempind0a63922013-01-23 16:32:59 +0100164Clients are allowed to specify more than one query by setting the `q`
165parameter multiple times. In this case the result is an array of
166arrays, one per query in the same order the queries were given in.
167
Edwin Kempina64c4b92013-01-23 11:30:40 +0100168.Query for the 25 most recent open changes of the projects that you watch
169****
170get::/changes/?q=status:open+is:watched&n=25
171****
172
Edwin Kempind0a63922013-01-23 16:32:59 +0100173Query that retrieves changes for a user's dashboard:
Edwin Kempin37440832013-02-06 11:36:00 +0100174
175.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100176----
177 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 +0100178----
Edwin Kempind0a63922013-01-23 16:32:59 +0100179
Edwin Kempin37440832013-02-06 11:36:00 +0100180.Response
181----
Edwin Kempind0a63922013-01-23 16:32:59 +0100182 HTTP/1.1 200 OK
183 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900184 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100185
186 )]}'
187 [
188 [
189 {
Edwin Kempind0a63922013-01-23 16:32:59 +0100190 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
191 "project": "demo",
192 "branch": "master",
193 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
194 "subject": "One change",
195 "status": "NEW",
196 "created": "2012-07-17 07:18:30.854000000",
197 "updated": "2012-07-17 07:19:27.766000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100198 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100199 "insertions": 4,
200 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100201 "_number": 1756,
202 "owner": {
203 "name": "John Doe"
204 },
205 "labels": {
206 "Verified": {},
207 "Code-Review": {}
208 }
209 }
210 ],
211 [],
212 []
213 ]
214----
215
Edwin Kempina64c4b92013-01-23 11:30:40 +0100216.Query the changes for your user dashboard
217****
218get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS
219****
220
David Pursehouse2cf28432016-08-21 23:20:08 +0900221[[query-options]]
Edwin Kempind0a63922013-01-23 16:32:59 +0100222Additional fields can be obtained by adding `o` parameters, each
223option requires more database lookups and slows down the query
224response time to the client so they are generally disabled by
225default. Optional fields are:
226
Edwin Kempine3446292013-02-19 16:40:14 +0100227[[labels]]
228--
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +0100229* `LABELS`: Includes the `labels` field which contains all information about
230labels and approvers that have granted (or rejected) that label. Does not
231include the `permitted_voting_range` attribute with the list of
232link:#approval-info[ApprovalInfo] of the `all` attribute.
Edwin Kempine3446292013-02-19 16:40:14 +0100233--
Edwin Kempind0a63922013-01-23 16:32:59 +0100234
Edwin Kempine3446292013-02-19 16:40:14 +0100235[[detailed-labels]]
236--
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +0100237* `DETAILED_LABELS`: Includes the `labels` field which contains all information
238about labels and approvers that have granted (or rejected) that label, including
239the `permitted_voting_range` attribute with the list of
240link:#approval-info[ApprovalInfo] of the `all` attribute.
Edwin Kempine3446292013-02-19 16:40:14 +0100241--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800242
Youssef Elghareeb79f473622021-05-26 18:58:40 +0200243[[submit-requirements]]
244--
245* `SUBMIT_REQUIREMENTS`: detailed result of the evaluated submit requirements
246 for this change.
247--
248
Edwin Kempine3446292013-02-19 16:40:14 +0100249[[current-revision]]
250--
Edwin Kempind0a63922013-01-23 16:32:59 +0100251* `CURRENT_REVISION`: describe the current revision (patch set)
252 of the change, including the commit SHA-1 and URLs to fetch from.
Edwin Kempine3446292013-02-19 16:40:14 +0100253--
Edwin Kempind0a63922013-01-23 16:32:59 +0100254
Edwin Kempine3446292013-02-19 16:40:14 +0100255[[all-revisions]]
256--
Edwin Kempind0a63922013-01-23 16:32:59 +0100257* `ALL_REVISIONS`: describe all revisions, not just current.
Edwin Kempine3446292013-02-19 16:40:14 +0100258--
Edwin Kempind0a63922013-01-23 16:32:59 +0100259
David Pursehouse025c1af2015-11-20 17:02:50 +0900260[[download-commands]]
Edwin Kempinea621482013-10-16 12:58:24 +0200261--
262* `DOWNLOAD_COMMANDS`: include the `commands` field in the
263 link:#fetch-info[FetchInfo] for revisions. Only valid when the
264 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
265--
266
Edwin Kempine3446292013-02-19 16:40:14 +0100267[[current-commit]]
268--
Edwin Kempind0a63922013-01-23 16:32:59 +0100269* `CURRENT_COMMIT`: parse and output all header fields from the
David Pursehouse98006e82013-10-02 10:15:52 +0900270 commit object, including message. Only valid when the
271 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100272--
Edwin Kempind0a63922013-01-23 16:32:59 +0100273
Edwin Kempine3446292013-02-19 16:40:14 +0100274[[all-commits]]
275--
Edwin Kempind0a63922013-01-23 16:32:59 +0100276* `ALL_COMMITS`: parse and output all header fields from the
277 output revisions. If only `CURRENT_REVISION` was requested
278 then only the current revision's commit data will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100279--
Edwin Kempind0a63922013-01-23 16:32:59 +0100280
Edwin Kempine3446292013-02-19 16:40:14 +0100281[[current-files]]
282--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100283* `CURRENT_FILES`: list files modified by the commit and magic files,
284 including basic line counts inserted/deleted per file. Only valid
285 when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100286--
Edwin Kempind0a63922013-01-23 16:32:59 +0100287
Edwin Kempine3446292013-02-19 16:40:14 +0100288[[all-files]]
289--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100290* `ALL_FILES`: list files modified by the commit and magic files,
291 including basic line counts inserted/deleted per file. If only the
292 `CURRENT_REVISION` was requested then only that commit's modified
293 files will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100294--
Edwin Kempind0a63922013-01-23 16:32:59 +0100295
Edwin Kempine3446292013-02-19 16:40:14 +0100296[[detailed-accounts]]
297--
Edwin Kempin4a00e222013-10-16 14:34:24 +0200298* `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username`
299 fields when referencing accounts.
Edwin Kempine3446292013-02-19 16:40:14 +0100300--
Dave Borowitz8926a882013-02-01 14:32:48 -0800301
Viktar Donich316bf7a2016-07-06 11:29:01 -0700302[[reviewer-updates]]
303--
304* `REVIEWER_UPDATES`: include updates to reviewers set as
305 link:#review-update-info[ReviewerUpdateInfo] entities.
306--
307
John Spurlock74a70cc2013-03-23 16:41:50 -0400308[[messages]]
309--
310* `MESSAGES`: include messages associated with the change.
311--
312
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700313[[actions]]
314--
315* `CURRENT_ACTIONS`: include information on available actions
Stefan Beller09cd95d2015-02-12 13:40:23 -0800316 for the change and its current revision. Ignored if the caller
317 is not authenticated.
318--
319
320[[change-actions]]
321--
322* `CHANGE_ACTIONS`: include information on available
323 change actions for the change. Ignored if the caller
324 is not authenticated.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700325--
326
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700327[[reviewed]]
328--
Dave Borowitz86669b32015-05-27 14:56:10 -0700329* `REVIEWED`: include the `reviewed` field if all of the following are
330 true:
Ardo Septama505f9ad2016-12-06 16:28:00 +0100331 - the change is open
332 - the caller is authenticated
333 - the caller has commented on the change more recently than the last update
Dave Borowitz86669b32015-05-27 14:56:10 -0700334 from the change owner, i.e. this change would show up in the results of
335 link:user-search.html#reviewedby[reviewedby:self].
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700336--
Gal Paikin3a2aa012019-06-21 18:30:01 +0200337[[skip_diffstat]]
338--
339* `SKIP_DIFFSTAT`: skip the 'insertions' and 'deletions' field in link:#change-info[ChangeInfo].
340 For large trees, their computation may be expensive.
341--
Han-Wen Nienhuys19de6cd2018-01-16 13:15:38 +0100342
Jonathan Niedercb51d742016-09-23 11:37:57 -0700343[[submittable]]
344--
Jonathan Niederad5240f2016-10-04 11:03:23 -0700345* `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo],
Jonathan Niedercb51d742016-09-23 11:37:57 -0700346 which can be used to tell if the change is reviewed and ready for submit.
347--
348
Khai Do2a23ec82014-09-19 16:33:02 -0700349[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100350--
Sven Selbergd26bd542014-11-21 16:28:10 +0100351* `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo],
352 therefore only valid in combination with `CURRENT_COMMIT` or
353 `ALL_COMMITS`.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100354--
355
Dave Borowitz4c46c242014-12-03 16:46:45 -0800356[[check]]
357--
358* `CHECK`: include potential problems with the change.
359--
360
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700361[[commit-footers]]
362--
363* `COMMIT_FOOTERS`: include the full commit message with
364 Gerrit-specific commit footers in the
365 link:#revision-info[RevisionInfo].
Yuxuan 'fishy' Wang16baf212015-05-05 16:49:55 -0700366--
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700367
Dave Borowitz6f58dbe2015-09-14 12:34:31 -0400368[[push-certificates]]
369--
370* `PUSH_CERTIFICATES`: include push certificate information in the
371 link:#revision-info[RevisionInfo]. Ignored if signed push is not
372 link:config-gerrit.html#receive.enableSignedPush[enabled] on the
373 server.
374--
375
Makson Lee3568a932017-08-28 17:12:03 +0800376[[tracking-ids]]
377--
378* `TRACKING_IDS`: include references to external tracking systems
379 as link:#tracking-id-info[TrackingIdInfo].
380--
381
Chris Poucetc2962dc2023-03-07 17:19:25 +0100382[[custom-keyed-values]]
383--
384* `CUSTOM_KEYED_VALUES`: include the custom key-value map
Kamil Musin53382002023-05-04 10:18:14 +0200385--
Chris Poucetc2962dc2023-03-07 17:19:25 +0100386
Youssef Elghareebf4f49482023-04-26 18:02:33 +0200387[[star]]
388--
389* `STAR`: include the `starred` field in
390 link:#change-info[ChangeInfo], which indicates if the change is starred
391 by the current user or not.
392--
393
Youssef Elghareeba1121442023-06-14 14:53:59 +0200394[[parents-data]]
395--
396* `PARENTS`: include the `parents_data` field in
397 link:#revision-info[RevisionInfo], which provides information of whether the
398 parent commit of this revision, e.g. if it's merged in the target branch
399 and whether it points to a patch-set of another change.
400--
401
Edwin Kempin37440832013-02-06 11:36:00 +0100402.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100403----
Edwin Kempinea621482013-10-16 12:58:24 +0200404 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 +0100405----
Edwin Kempind0a63922013-01-23 16:32:59 +0100406
Edwin Kempin37440832013-02-06 11:36:00 +0100407.Response
408----
Edwin Kempind0a63922013-01-23 16:32:59 +0100409 HTTP/1.1 200 OK
410 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900411 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100412
413 )]}'
414 [
415 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900416 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100417 "project": "gerrit",
418 "branch": "master",
419 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
420 "subject": "Use an EventBus to manage star icons",
421 "status": "NEW",
422 "created": "2012-04-25 00:52:25.580000000",
423 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100424 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100425 "insertions": 16,
426 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100427 "_number": 97,
428 "owner": {
429 "name": "Shawn Pearce"
430 },
431 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
432 "revisions": {
433 "184ebe53805e102605d11f6b143486d15c23a09c": {
David Pursehouse4de41112016-06-28 09:24:08 +0900434 "kind": "REWORK",
Edwin Kempind0a63922013-01-23 16:32:59 +0100435 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100436 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100437 "fetch": {
438 "git": {
439 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200440 "ref": "refs/changes/97/97/1",
441 "commands": {
442 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
443 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
444 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
445 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
446 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100447 },
448 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200449 "url": "http://myuser@127.0.0.1:8080/gerrit",
450 "ref": "refs/changes/97/97/1",
451 "commands": {
452 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
453 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
454 "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",
455 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
456 }
457 },
458 "ssh": {
459 "url": "ssh://myuser@*:29418/gerrit",
460 "ref": "refs/changes/97/97/1",
461 "commands": {
462 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
463 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
464 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
465 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
466 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100467 }
468 },
469 "commit": {
470 "parents": [
471 {
472 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
473 "subject": "Migrate contributor agreements to All-Projects."
474 }
475 ],
476 "author": {
477 "name": "Shawn O. Pearce",
478 "email": "sop@google.com",
479 "date": "2012-04-24 18:08:08.000000000",
480 "tz": -420
481 },
482 "committer": {
483 "name": "Shawn O. Pearce",
484 "email": "sop@google.com",
485 "date": "2012-04-24 18:08:08.000000000",
486 "tz": -420
487 },
488 "subject": "Use an EventBus to manage star icons",
489 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
490 },
491 "files": {
492 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200493 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100494 "size_delta": -412,
495 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100496 },
497 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200498 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100499 "size_delta": 23,
500 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100501 },
502 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
503 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200504 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100505 "size_delta": -298,
506 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100507 },
508 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
509 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200510 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100511 "size_delta": 132,
512 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100513 },
514 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
515 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200516 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100517 "size_delta": -5512,
518 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100519 },
520 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
521 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200522 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100523 "size_delta": 8345,
524 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100525 },
526 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200527 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100528 "size_delta": -343,
529 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100530 }
531 }
532 }
533 }
534 }
535 ]
536----
537
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100538[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800539=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800540--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100541'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800542--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100543
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100544Retrieves a change.
545
Dave Borowitz0314f732013-10-03 09:34:30 -0700546Additional fields can be obtained by adding `o` parameters, each
547option requires more database lookups and slows down the query
548response time to the client so they are generally disabled by
549default. Fields are described in link:#list-changes[Query Changes].
550
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100551.Request
552----
553 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
554----
555
556As response a link:#change-info[ChangeInfo] entity is returned that
557describes the change.
558
559.Response
560----
561 HTTP/1.1 200 OK
562 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900563 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100564
565 )]}'
566 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100567 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
568 "project": "myProject",
569 "branch": "master",
Edwin Kempin065e5a22022-12-19 13:34:10 +0100570 "attention_set": {
571 "1000096": {
Gal Paikinc326de42020-06-16 18:49:00 +0300572 "account": {
Edwin Kempin065e5a22022-12-19 13:34:10 +0100573 "_account_id": 1000096,
574 "name": "John Doe",
575 "email": "john.doe@example.com"
Gal Paikinc326de42020-06-16 18:49:00 +0300576 },
Edwin Kempin065e5a22022-12-19 13:34:10 +0100577 "last_update": "2013-02-21 11:16:36.775000000",
578 "reason": "reviewer or cc replied"
Gal Paikinc326de42020-06-16 18:49:00 +0300579 }
Edwin Kempin065e5a22022-12-19 13:34:10 +0100580 },
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100581 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
582 "subject": "Implementing Feature X",
583 "status": "NEW",
584 "created": "2013-02-01 09:59:32.126000000",
585 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100586 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100587 "insertions": 34,
588 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100589 "_number": 3965,
590 "owner": {
591 "name": "John Doe"
592 }
593 }
594----
595
Han-Wen Nienhuys63b81f22021-02-17 10:31:01 +0100596Historical state of the change can be retrieved by specifying the
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200597`meta=SHA-1` parameter. This will use a historical NoteDb snapshot to
598populate ChangeInfo. If the SHA-1 is not reachable as a NoteDb state,
Han-Wen Nienhuys63b81f22021-02-17 10:31:01 +0100599status code 412 is returned.
600
Alex Spradlinb65494f2021-03-03 11:22:27 -0800601[[get-meta-diff]]
602=== Get Meta Diff
603--
Han-Wen Nienhuys524317a2021-04-08 12:12:35 +0200604'GET /changes/link:#change-id[\{change-id\}]/meta_diff?old=SHA-1&meta=SHA-1'
Alex Spradlinb65494f2021-03-03 11:22:27 -0800605--
606
607Retrieves the difference between two historical states of a change
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200608by specifying the `old=SHA-1` and the `meta=SHA-1` parameters.
Alex Spradlinb65494f2021-03-03 11:22:27 -0800609
610If the `old` parameter is not provided, the parent of the `meta`
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200611SHA-1 is used. If the `meta` parameter is not provided, the current
Alex Spradlinb65494f2021-03-03 11:22:27 -0800612state of the change is used. If neither are provided, the
613difference between the current state of the change and its previous
614state is returned.
615
616Additional fields can be obtained by adding `o` parameters, analogous
617to link:#get-change[Get Change], and the same concerns for Get Change hold for
618this endpoint too. Fields are described in link:#list-changes[Query Changes].
619
620.Request
621----
622 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/meta_diff?old=b083abc34eb6dbdb9e154ba092fc198000e997b4&meta=63b81f2bde703ae07787a940e8fdf9a1828605b1 HTTP/1.0
623----
624
625As a response, two link:#change-info[ChangeInfo] entities are returned
Alex Spradlin94099b62021-09-29 13:15:23 -0700626that describe information added and removed from the `old` change state, and
627the two link:#change-info[ChangeInfo] entities that generated the diff are
628returned. Only fields that differ between the change's two states are returned.
Alex Spradlinb65494f2021-03-03 11:22:27 -0800629
630.Response
631----
632 HTTP/1.1 200 OK
633 Content-Disposition: attachment
634 Content-Type: application/json; charset=UTF-8
635
636 )]}'
637 {
638 "added": {
Edwin Kempin065e5a22022-12-19 13:34:10 +0100639 "attention_set": {
640 "1000096": {
Alex Spradlinb65494f2021-03-03 11:22:27 -0800641 "account": {
Edwin Kempin065e5a22022-12-19 13:34:10 +0100642 "_account_id": 1000096,
643 "name": "John Doe",
644 "email": "john.doe@example.com"
Alex Spradlinb65494f2021-03-03 11:22:27 -0800645 },
Edwin Kempin065e5a22022-12-19 13:34:10 +0100646 "last_update": "2013-02-21 11:16:36.775000000",
647 "reason": "reviewer or cc replied"
Alex Spradlinb65494f2021-03-03 11:22:27 -0800648 }
Edwin Kempin065e5a22022-12-19 13:34:10 +0100649 },
Alex Spradlinb65494f2021-03-03 11:22:27 -0800650 "updated": "2013-02-21 11:16:36.775000000",
651 "topic": "new-topic"
652 },
653 "removed": {
Alex Spradlin94099b62021-09-29 13:15:23 -0700654 "updated": "2013-02-01 09:59:32.126000000",
Alex Spradlinb65494f2021-03-03 11:22:27 -0800655 "topic": "old-topic"
Alex Spradlin94099b62021-09-29 13:15:23 -0700656 },
657 "old_change_info": {
658 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
659 "project": "myProject",
660 "branch": "master",
661 "attention_set": [],
662 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
663 "subject": "Implementing Feature X",
664 "status": "NEW",
665 "topic": "old-topic",
666 "created": "2013-02-01 09:59:32.126000000",
667 "updated": "2013-02-01 09:59:32.126000000",
668 "mergeable": true,
669 "insertions": 34,
670 "deletions": 101,
671 "_number": 3965,
672 "owner": {
673 "name": "John Doe"
674 }
675 },
676 "new_change_info": {
677 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
678 "project": "myProject",
679 "branch": "master",
Edwin Kempin065e5a22022-12-19 13:34:10 +0100680 "attention_set": {
681 "1000096": {
Alex Spradlin94099b62021-09-29 13:15:23 -0700682 "account": {
Edwin Kempin065e5a22022-12-19 13:34:10 +0100683 "_account_id": 1000096,
684 "name": "John Doe",
685 "email": "john.doe@example.com"
Alex Spradlin94099b62021-09-29 13:15:23 -0700686 },
Edwin Kempin065e5a22022-12-19 13:34:10 +0100687 "last_update": "2013-02-21 11:16:36.775000000",
688 "reason": "reviewer or cc replied"
Alex Spradlin94099b62021-09-29 13:15:23 -0700689 }
Edwin Kempin065e5a22022-12-19 13:34:10 +0100690 },
Alex Spradlin94099b62021-09-29 13:15:23 -0700691 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
692 "subject": "Implementing Feature X",
693 "status": "NEW",
694 "topic": "new-topic",
695 "created": "2013-02-01 09:59:32.126000000",
696 "updated": "2013-02-21 11:16:36.775000000",
697 "mergeable": true,
698 "insertions": 34,
699 "deletions": 101,
700 "_number": 3965,
701 "owner": {
702 "name": "John Doe"
703 }
704 },
Alex Spradlinb65494f2021-03-03 11:22:27 -0800705 }
706----
707
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200708If the provided SHA-1 for `meta` is not reachable as a NoteDb
709state, the status code 412 is returned. If the SHA-1 for `old`
Alex Spradlinb65494f2021-03-03 11:22:27 -0800710is not reachable, the difference between the change at state
711`meta` and an empty change is returned.
Han-Wen Nienhuys63b81f22021-02-17 10:31:01 +0100712
Edwin Kempin8e492202013-02-21 15:38:25 +0100713[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800714=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800715--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100716'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800717--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100718
Edwin Kempin8e492202013-02-21 15:38:25 +0100719Retrieves a change with link:#labels[labels], link:#detailed-labels[
Viktar Donich316bf7a2016-07-06 11:29:01 -0700720detailed labels], link:#detailed-accounts[detailed accounts],
721link:#reviewer-updates[reviewer updates], and link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100722
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700723Additional fields can be obtained by adding `o` parameters, each
724option requires more database lookups and slows down the query
725response time to the client so they are generally disabled by
726default. Fields are described in link:#list-changes[Query Changes].
727
Edwin Kempin8e492202013-02-21 15:38:25 +0100728.Request
729----
730 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
731----
732
733As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700734describes the change. This response will contain all votes for each
735label and include one combined vote. The combined label vote is
736calculated in the following order (from highest to lowest):
737REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100738
739.Response
740----
741 HTTP/1.1 200 OK
742 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900743 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100744
745 )]}'
746 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100747 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
748 "project": "myProject",
749 "branch": "master",
Edwin Kempin065e5a22022-12-19 13:34:10 +0100750 "attention_set": {
751 "1000096": {
Gal Paikinc326de42020-06-16 18:49:00 +0300752 "account": {
753 "_account_id": 1000096,
754 "name": "John Doe",
755 "email": "john.doe@example.com",
756 "username": "jdoe"
757 },
Edwin Kempin065e5a22022-12-19 13:34:10 +0100758 "last_update": "2013-02-21 11:16:36.775000000",
759 "reason": "reviewer or cc replied"
Gal Paikinc326de42020-06-16 18:49:00 +0300760 }
Edwin Kempin065e5a22022-12-19 13:34:10 +0100761 },
Edwin Kempin8e492202013-02-21 15:38:25 +0100762 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
763 "subject": "Implementing Feature X",
764 "status": "NEW",
765 "created": "2013-02-01 09:59:32.126000000",
766 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100767 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100768 "insertions": 126,
769 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100770 "_number": 3965,
771 "owner": {
772 "_account_id": 1000096,
773 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200774 "email": "john.doe@example.com",
775 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100776 },
777 "labels": {
778 "Verified": {
779 "all": [
780 {
781 "value": 0,
782 "_account_id": 1000096,
783 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200784 "email": "john.doe@example.com",
785 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100786 },
787 {
788 "value": 0,
789 "_account_id": 1000097,
790 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200791 "email": "jane.roe@example.com",
792 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100793 }
794 ],
795 "values": {
796 "-1": "Fails",
797 " 0": "No score",
798 "+1": "Verified"
799 }
800 },
801 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100802 "disliked": {
803 "_account_id": 1000096,
804 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200805 "email": "john.doe@example.com",
806 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100807 },
808 "all": [
809 {
810 "value": -1,
811 "_account_id": 1000096,
812 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200813 "email": "john.doe@example.com",
814 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100815 },
816 {
817 "value": 1,
818 "_account_id": 1000097,
819 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200820 "email": "jane.roe@example.com",
821 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100822 }
823 ]
824 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +0100825 "-2": "This shall not be submitted",
826 "-1": "I would prefer this is not submitted as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100827 " 0": "No score",
828 "+1": "Looks good to me, but someone else must approve",
829 "+2": "Looks good to me, approved"
830 }
831 }
832 },
833 "permitted_labels": {
834 "Verified": [
835 "-1",
836 " 0",
837 "+1"
838 ],
839 "Code-Review": [
840 "-2",
841 "-1",
842 " 0",
843 "+1",
844 "+2"
845 ]
846 },
Nitzan Gur-Furmand1223572023-01-16 12:07:46 +0000847 "removable_labels": {
848 "Code-Review": {
849 "-1": [
850 {
851 "_account_id": 1000096,
852 "name": "John Doe",
853 "email": "john.doe@example.com",
854 "username": "jdoe"
855 }
856 ],
857 "+1": [
858 {
859 "_account_id": 1000097,
860 "name": "Jane Roe",
861 "email": "jane.roe@example.com",
862 "username": "jroe"
863 }
864 ]
865 }
866 },
Edwin Kempin8e492202013-02-21 15:38:25 +0100867 "removable_reviewers": [
868 {
869 "_account_id": 1000096,
870 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200871 "email": "john.doe@example.com",
872 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100873 },
874 {
875 "_account_id": 1000097,
876 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200877 "email": "jane.roe@example.com",
878 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100879 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400880 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800881 "reviewers": {
882 "REVIEWER": [
883 {
884 "_account_id": 1000096,
885 "name": "John Doe",
886 "email": "john.doe@example.com",
887 "username": "jdoe"
888 },
889 {
890 "_account_id": 1000097,
891 "name": "Jane Roe",
892 "email": "jane.roe@example.com",
893 "username": "jroe"
894 }
895 ]
896 },
Viktar Donich316bf7a2016-07-06 11:29:01 -0700897 "reviewer_updates": [
898 {
899 "state": "REVIEWER",
900 "reviewer": {
901 "_account_id": 1000096,
902 "name": "John Doe",
903 "email": "john.doe@example.com",
904 "username": "jdoe"
905 },
906 "updated_by": {
907 "_account_id": 1000096,
908 "name": "John Doe",
909 "email": "john.doe@example.com",
910 "username": "jdoe"
911 },
912 "updated": "2016-07-21 20:12:39.000000000"
913 },
914 {
915 "state": "REMOVED",
916 "reviewer": {
917 "_account_id": 1000096,
918 "name": "John Doe",
919 "email": "john.doe@example.com",
920 "username": "jdoe"
921 },
922 "updated_by": {
923 "_account_id": 1000096,
924 "name": "John Doe",
925 "email": "john.doe@example.com",
926 "username": "jdoe"
927 },
928 "updated": "2016-07-21 20:12:33.000000000"
929 },
930 {
931 "state": "CC",
932 "reviewer": {
933 "_account_id": 1000096,
934 "name": "John Doe",
935 "email": "john.doe@example.com",
936 "username": "jdoe"
937 },
938 "updated_by": {
939 "_account_id": 1000096,
940 "name": "John Doe",
941 "email": "john.doe@example.com",
942 "username": "jdoe"
943 },
944 "updated": "2016-03-23 21:34:02.419000000",
945 },
946 ],
John Spurlock74a70cc2013-03-23 16:41:50 -0400947 "messages": [
948 {
949 "id": "YH-egE",
950 "author": {
951 "_account_id": 1000096,
952 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200953 "email": "john.doe@example.com",
954 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400955 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100956 "date": "2013-03-23 21:34:02.419000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400957 "message": "Patch Set 1:\n\nThis is the first message.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100958 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400959 },
960 {
961 "id": "WEEdhU",
962 "author": {
963 "_account_id": 1000097,
964 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200965 "email": "jane.roe@example.com",
966 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400967 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100968 "date": "2013-03-23 21:36:52.332000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400969 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100970 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400971 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100972 ]
973 }
974----
975
Aaron Gable9b413072017-08-24 13:15:21 -0700976[[create-merge-patch-set-for-change]]
977=== Create Merge Patch Set For Change
978--
979'POST /changes/link:#change-id[\{change-id\}]/merge'
980--
981
982Update an existing change by using a
983link:#merge-patch-set-input[MergePatchSetInput] entity.
984
985Gerrit will create a merge commit based on the information of
986MergePatchSetInput and add a new patch set to the change corresponding
987to the new merge commit.
988
989.Request
990----
991 POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0
992 Content-Type: application/json; charset=UTF-8
993
994 {
995 "subject": "Merge dev_branch into master",
996 "merge": {
David Pursehousef4fb1042018-03-18 23:03:46 +0900997 "source": "refs/changes/34/1234/1"
Aaron Gable9b413072017-08-24 13:15:21 -0700998 }
999 }
1000----
1001
1002As response a link:#change-info[ChangeInfo] entity with current revision is
1003returned that describes the resulting change.
1004
1005.Response
1006----
1007 HTTP/1.1 200 OK
1008 Content-Disposition: attachment
1009 Content-Type: application/json; charset=UTF-8
1010
1011 )]}'
1012 {
1013 "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc",
1014 "project": "test",
1015 "branch": "master",
1016 "hashtags": [],
1017 "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc",
1018 "subject": "Merge dev_branch into master",
1019 "status": "NEW",
1020 "created": "2016-09-23 18:08:53.238000000",
1021 "updated": "2016-09-23 18:09:25.934000000",
1022 "submit_type": "MERGE_IF_NECESSARY",
1023 "mergeable": true,
1024 "insertions": 5,
1025 "deletions": 0,
1026 "_number": 72,
1027 "owner": {
1028 "_account_id": 1000000
1029 },
1030 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822"
1031 }
1032----
1033
1034[[set-message]]
1035=== Set Commit Message
1036--
1037'PUT /changes/link:#change-id[\{change-id\}]/message'
1038--
1039
1040Creates a new patch set with a new commit message.
1041
1042The new commit message must be provided in the request body inside a
Han-Wen Nienhuys098580a2019-07-24 20:17:41 +02001043link:#commit-message-input[CommitMessageInput] entity. If a Change-Id
1044footer is specified, it must match the current Change-Id footer. If
1045the Change-Id footer is absent, the current Change-Id is added to the
1046message.
Aaron Gable9b413072017-08-24 13:15:21 -07001047
1048.Request
1049----
1050 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0
1051 Content-Type: application/json; charset=UTF-8
1052
1053 {
1054 "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n"
1055 }
1056----
1057
1058.Notifications
1059
1060An email will be sent using the "newpatchset" template.
1061
1062[options="header",cols="1,1"]
1063|=============================
1064|WIP State |Default
1065|Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers
1066|Work in progress|owner
1067|=============================
1068
Edwin Kempin64006bb2013-02-22 08:17:04 +01001069[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001070=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001071--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001072'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001073--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001074
Edwin Kempin64006bb2013-02-22 08:17:04 +01001075Retrieves the topic of a change.
1076
1077.Request
1078----
1079 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
1080----
1081
1082.Response
1083----
1084 HTTP/1.1 200 OK
1085 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001086 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001087
1088 )]}'
1089 "Documentation"
1090----
1091
1092If the change does not have a topic an empty string is returned.
1093
1094[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001095=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001096--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001097'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001098--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001099
Edwin Kempin64006bb2013-02-22 08:17:04 +01001100Sets the topic of a change.
1101
1102The new topic must be provided in the request body inside a
Patrick Hiesel4aa14562018-06-19 15:07:50 +02001103link:#topic-input[TopicInput] entity. Any leading or trailing whitespace
1104in the topic name will be removed.
Edwin Kempin64006bb2013-02-22 08:17:04 +01001105
1106.Request
1107----
1108 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001109 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001110
1111 {
1112 "topic": "Documentation"
1113 }
1114----
1115
1116As response the new topic is returned.
1117
1118.Response
1119----
1120 HTTP/1.1 200 OK
1121 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001122 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001123
1124 )]}'
1125 "Documentation"
1126----
1127
1128If the topic was deleted the response is "`204 No Content`".
1129
1130[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001131=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001132--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001133'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001134--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001135
Edwin Kempin64006bb2013-02-22 08:17:04 +01001136Deletes the topic of a change.
1137
Edwin Kempin64006bb2013-02-22 08:17:04 +01001138.Request
1139----
1140 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
1141----
1142
1143.Response
1144----
1145 HTTP/1.1 204 No Content
1146----
1147
Patrick Hieselbb84fd72017-08-23 11:11:22 +02001148[[get-pure-revert]]
1149=== Get Pure Revert
1150--
1151'GET /changes/link:#change-id[\{change-id\}]/pure_revert'
1152--
1153
1154Check if the given change is a pure revert of the change it references in `revertOf`.
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02001155Optionally, the query parameter `o` can be passed in to specify a commit (SHA-1 in
Patrick Hieselbb84fd72017-08-23 11:11:22 +0200115640 digit hex representation) to check against. It takes precedence over `revertOf`.
1157If the change has no reference in `revertOf`, the parameter is mandatory.
1158
1159As response a link:#pure-revert-info[PureRevertInfo] entity is returned.
1160
1161.Request
1162----
1163 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0
1164----
1165
1166.Response
1167----
1168 HTTP/1.1 200 OK
1169 Content-Disposition: attachment
1170 Content-Type: application/json; charset=UTF-8
1171
1172 )]}'
1173 {
1174 "is_pure_revert" : false
1175 }
1176----
1177
Edwin Kempined5364b2013-02-22 10:39:33 +01001178[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001179=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001180--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001181'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001182--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001183
Edwin Kempined5364b2013-02-22 10:39:33 +01001184Abandons a change.
1185
1186The request body does not need to include a link:#abandon-input[
1187AbandonInput] entity if no review comment is added.
1188
Gal Paikinc326de42020-06-16 18:49:00 +03001189Abandoning a change also removes all users from the link:#attention-set[attention set].
1190
Edwin Kempined5364b2013-02-22 10:39:33 +01001191.Request
1192----
1193 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
1194----
1195
1196As response a link:#change-info[ChangeInfo] entity is returned that
1197describes the abandoned change.
1198
1199.Response
1200----
1201 HTTP/1.1 200 OK
1202 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001203 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001204
1205 )]}'
1206 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001207 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1208 "project": "myProject",
1209 "branch": "master",
1210 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1211 "subject": "Implementing Feature X",
1212 "status": "ABANDONED",
1213 "created": "2013-02-01 09:59:32.126000000",
1214 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001215 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001216 "insertions": 3,
1217 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +01001218 "_number": 3965,
1219 "owner": {
1220 "name": "John Doe"
1221 }
1222 }
1223----
1224
1225If the change cannot be abandoned because the change state doesn't
1226allow abandoning of the change, the response is "`409 Conflict`" and
1227the error message is contained in the response body.
1228
1229.Response
1230----
1231 HTTP/1.1 409 Conflict
1232 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001233 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001234
1235 change is merged
1236----
1237
Logan Hankse43b68e2017-05-23 13:16:22 -07001238.Notifications
1239
1240An email will be sent using the "abandon" template. The notify handling is ALL.
1241Notifications are suppressed on WIP changes that have never started review.
1242
Logan Hanks87607412017-05-30 13:49:04 -07001243[options="header",cols="1,2"]
Logan Hankse43b68e2017-05-23 13:16:22 -07001244|=============================
Logan Hanks87607412017-05-30 13:49:04 -07001245|WIP State |notify=ALL
Logan Hankse43b68e2017-05-23 13:16:22 -07001246|Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1247|Work in progress|not sent
1248|Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1249|=============================
1250
Edwin Kempined5364b2013-02-22 10:39:33 +01001251[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001252=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001253--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001254'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001255--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001256
Edwin Kempined5364b2013-02-22 10:39:33 +01001257Restores a change.
1258
1259The request body does not need to include a link:#restore-input[
1260RestoreInput] entity if no review comment is added.
1261
1262.Request
1263----
1264 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1265----
1266
1267As response a link:#change-info[ChangeInfo] entity is returned that
1268describes the restored change.
1269
1270.Response
1271----
1272 HTTP/1.1 200 OK
1273 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001274 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001275
1276 )]}'
1277 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001278 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1279 "project": "myProject",
1280 "branch": "master",
1281 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1282 "subject": "Implementing Feature X",
1283 "status": "NEW",
1284 "created": "2013-02-01 09:59:32.126000000",
1285 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001286 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001287 "insertions": 2,
1288 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001289 "_number": 3965,
1290 "owner": {
1291 "name": "John Doe"
1292 }
1293 }
1294----
1295
1296If the change cannot be restored because the change state doesn't
1297allow restoring the change, the response is "`409 Conflict`" and
1298the error message is contained in the response body.
1299
1300.Response
1301----
1302 HTTP/1.1 409 Conflict
1303 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001304 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001305
1306 change is new
1307----
1308
Edwin Kempincdae63b2013-03-15 15:06:59 +01001309[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001310=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001311--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001312'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001313--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001314
1315Rebases a change.
1316
Zalan Blenessy874aed72015-01-12 13:26:18 +01001317Optionally, the parent revision can be changed to another patch set through the
1318link:#rebase-input[RebaseInput] entity.
1319
Edwin Kempincdae63b2013-03-15 15:06:59 +01001320.Request
1321----
1322 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001323 Content-Type: application/json;charset=UTF-8
1324
1325 {
1326 "base" : "1234",
1327 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001328----
1329
1330As response a link:#change-info[ChangeInfo] entity is returned that
1331describes the rebased change. Information about the current patch set
1332is included.
1333
1334.Response
1335----
1336 HTTP/1.1 200 OK
1337 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001338 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001339
1340 )]}'
1341 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001342 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1343 "project": "myProject",
1344 "branch": "master",
1345 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1346 "subject": "Implement Feature X",
1347 "status": "NEW",
1348 "created": "2013-02-01 09:59:32.126000000",
1349 "updated": "2013-02-21 11:16:36.775000000",
1350 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001351 "insertions": 33,
1352 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001353 "_number": 4799,
1354 "owner": {
1355 "name": "John Doe"
1356 },
1357 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1358 "revisions": {
1359 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001360 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001361 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001362 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001363 "fetch": {
1364 "http": {
1365 "url": "http://gerrit:8080/myProject",
1366 "ref": "refs/changes/99/4799/2"
1367 }
1368 },
1369 "commit": {
1370 "parents": [
1371 {
1372 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1373 "subject": "Implement Feature A"
1374 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001375 ],
1376 "author": {
1377 "name": "John Doe",
1378 "email": "john.doe@example.com",
1379 "date": "2013-05-07 15:21:27.000000000",
1380 "tz": 120
1381 },
1382 "committer": {
1383 "name": "Gerrit Code Review",
1384 "email": "gerrit-server@example.com",
1385 "date": "2013-05-07 15:35:43.000000000",
1386 "tz": 120
1387 },
1388 "subject": "Implement Feature X",
1389 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001390 }
1391 }
1392 }
1393----
1394
1395If the change cannot be rebased, e.g. due to conflicts, the response is
1396"`409 Conflict`" and the error message is contained in the response
1397body.
1398
1399.Response
1400----
1401 HTTP/1.1 409 Conflict
1402 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001403 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001404
1405 The change could not be rebased due to a path conflict during merge.
1406----
1407
Edwin Kempin8b2ff7f2023-03-24 12:14:44 +01001408Rebasing a change is allowed for the change owner, users with the
1409link:access-control.html#category_rebase[Rebase] permission and users
1410with the link:access-control.html#category_submit[Submit] permission.
1411
1412In addition, the rebaser or the original uploader, if rebasing is done
1413on behalf of the uploader (see `rebase_on_behalf_of_uploader` option in
1414link:#rebase-input[RebaseInput]), needs to have all permissions that
1415are required to create the new patch set:
1416
1417* the link:access-control.html#category_push[Push] permission
1418* the link:access-control.html#category_add_patch_set[Add Patch Set]
1419 permission (only if the user is not the change owner)
1420* the link:access-control.html#category_forge_author[Forge Author]
1421 permission (only if the commit author is forged)
1422* the link:access-control.html#category_forge_server[Forge Server]
1423 permission (only if the commit author is the server identity)
1424
1425The same permissions were required for the upload of the original patch
1426set. This means if the rebase is done on behalf of the uploader these
1427permission checks should just pass, unless the uploader lost
1428permissions after the upload of the original patch set. In this case
1429rebasing on behalf of the uploader is not possible and a normal rebase
1430(on behalf of the rebaser) must be done, which means that the rebaser
1431becomes the uploader and takes over the change. If self approvals are
1432disallowed, this means that the rebaser can no longer approve the
1433change (as approvals of the uploader are ignored).
1434
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01001435[[rebase-chain]]
1436=== Rebase Chain
1437--
1438'POST /changes/link:#change-id[\{change-id\}]/rebase:chain'
1439--
1440
1441Rebases an ancestry chain of changes.
1442
1443The operated change is treated as the chain tip. All unsubmitted ancestors are rebased.
1444
1445Requires a linear ancestry relation (single parenting throughout the chain).
1446
1447Optionally, the parent revision (of the oldest ancestor to be rebased) can be changed to another
1448change, revision or branch through the link:#rebase-input[RebaseInput] entity.
1449
1450If the chain is outdated, i.e., there's a change that depends on an old revision of its parent, the
1451result is the same as individually rebasing all outdated changes on top of their parent's latest
1452revision before running the rebase chain action.
1453
1454.Request
1455----
1456 POST /changes/myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f/rebase:chain HTTP/1.0
1457 Content-Type: application/json;charset=UTF-8
1458
1459 {
1460 "base" : "1234",
1461 }
1462----
1463
1464As response a link:#rebase-chain-info[RebaseChainInfo] entity is returned that
1465describes the rebased changes. Information about the current patch sets
1466are included.
1467
1468.Response
1469----
1470 HTTP/1.1 200 OK
1471 Content-Disposition: attachment
1472 Content-Type: application/json; charset=UTF-8
1473
1474 )]}'
1475 {
1476 "rebased_changes": [
1477 {
1478 "id": "myProject~master~I0e534de9d7f0d6f35b71f7d726acf835b2110c66",
1479 "project": "myProject",
1480 "branch": "master",
1481 "hashtags": [
1482
1483 ],
1484 "change_id": "I0e534de9d7f0d6f35b71f7d726acf835b2110c66",
1485 "subject": "456",
1486 "status": "NEW",
1487 "created": "2022-11-21 20: 51: 31.000000000",
1488 "updated": "2022-11-21 20: 56: 49.000000000",
1489 "submit_type": "MERGE_IF_NECESSARY",
1490 "insertions": 0,
1491 "deletions": 0,
1492 "total_comment_count": 0,
1493 "unresolved_comment_count": 0,
1494 "has_review_started": true,
1495 "meta_rev_id": "a2a6692213f546e1045ecf4647439fac8d6d8faa",
1496 "_number": 21,
1497 "owner": {
1498 "_account_id": 1000000
1499 },
1500 "current_revision": "c3b2ba222d42a56e05c90f88d4509a124620517d",
1501 "revisions": {
1502 "c3b2ba222d42a56e05c90f88d4509a124620517d": {
1503 "kind": "NO_CHANGE",
1504 "_number": 2,
1505 "created": "2022-11-21 20: 56: 49.000000000",
1506 "uploader": {
1507 "_account_id": 1000000
1508 },
1509 "ref": "refs/changes/21/21/2",
1510 "fetch": {
1511
1512 },
1513 "commit": {
1514 "parents": [
1515 {
1516 "commit": "7803f427dd7c4a2441466e4d740a1850dcee1af4",
1517 "subject": "123"
1518 }
1519 ],
1520 "author": {
1521 "name": "Nitzan Gur-Furman",
1522 "email": "nitzan@google.com",
1523 "date": "2022-11-21 20: 49: 39.000000000",
1524 "tz": 60
1525 },
1526 "committer": {
1527 "name": "Administrator",
1528 "email": "admin@example.com",
1529 "date": "2022-11-21 20: 56: 49.000000000",
1530 "tz": 60
1531 },
1532 "subject": "456",
1533 "message": "456\n"
1534 },
1535 "description": "Rebase"
1536 }
1537 },
1538 "requirements": [
1539
1540 ],
1541 "submit_records": [
1542 {
1543 "rule_name": "gerrit~DefaultSubmitRule",
1544 "status": "NOT_READY",
1545 "labels": [
1546 {
1547 "label": "Code-Review",
1548 "status": "NEED"
1549 }
1550 ]
1551 }
1552 ]
1553 },
1554 {
1555 "id": "myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f",
1556 "project": "myProject",
1557 "branch": "master",
1558 "hashtags": [
1559
1560 ],
1561 "change_id": "I08a021fb07b83fe845140a2c11508b3bdd93b48f",
1562 "subject": "789",
1563 "status": "NEW",
1564 "created": "2022-11-21 20: 51: 31.000000000",
1565 "updated": "2022-11-21 20: 56: 49.000000000",
1566 "submit_type": "MERGE_IF_NECESSARY",
1567 "insertions": 0,
1568 "deletions": 0,
1569 "total_comment_count": 0,
1570 "unresolved_comment_count": 0,
1571 "has_review_started": true,
1572 "meta_rev_id": "3bfb843fea471f96e16b9199c3a30fff0285bc45",
1573 "_number": 22,
1574 "owner": {
1575 "_account_id": 1000000
1576 },
1577 "current_revision": "77eb17a9501a5c21963bc6af56085e60f281acbb",
1578 "revisions": {
1579 "77eb17a9501a5c21963bc6af56085e60f281acbb": {
1580 "kind": "NO_CHANGE",
1581 "_number": 2,
1582 "created": "2022-11-21 20: 56: 49.000000000",
1583 "uploader": {
1584 "_account_id": 1000000
1585 },
1586 "ref": "refs/changes/22/22/2",
1587 "fetch": {
1588
1589 },
1590 "commit": {
1591 "parents": [
1592 {
1593 "commit": "c3b2ba222d42a56e05c90f88d4509a124620517d",
1594 "subject": "456"
1595 }
1596 ],
1597 "author": {
1598 "name": "Nitzan Gur-Furman",
1599 "email": "nitzan@google.com",
1600 "date": "2022-11-21 20: 51: 07.000000000",
1601 "tz": 60
1602 },
1603 "committer": {
1604 "name": "Administrator",
1605 "email": "admin@example.com",
1606 "date": "2022-11-21 20: 56: 49.000000000",
1607 "tz": 60
1608 },
1609 "subject": "789",
1610 "message": "789\n"
1611 },
1612 "description": "Rebase"
1613 }
1614 },
1615 "requirements": [
1616
1617 ],
1618 "submit_records": [
1619 {
1620 "rule_name": "gerrit~DefaultSubmitRule",
1621 "status": "NOT_READY",
1622 "labels": [
1623 {
1624 "label": "Code-Review",
1625 "status": "NEED"
1626 }
1627 ]
1628 }
1629 ]
1630 }
1631 ],
1632 }
1633----
1634
1635If the change cannot be rebased, e.g. due to conflicts, the response is
1636"`409 Conflict`" and the error message is contained in the response
1637body.
1638
1639.Response
1640----
1641 HTTP/1.1 409 Conflict
1642 Content-Disposition: attachment
1643 Content-Type: text/plain; charset=UTF-8
1644
1645 Change I0e534de9d7f0d6f35b71f7d726acf835b2110c66 could not be rebased due to a conflict during
1646 merge.
1647
1648 merge conflict(s):
1649 a.txt
1650----
1651
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301652[[move-change]]
1653=== Move Change
1654--
1655'POST /changes/link:#change-id[\{change-id\}]/move'
1656--
1657
1658Move a change.
1659
1660The destination branch must be provided in the request body inside a
1661link:#move-input[MoveInput] entity.
Marija Savtchoukcee6a8f2020-12-03 12:58:04 +00001662Only veto votes that are blocking the change from submission are moved to
1663the destination branch by default.
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301664
1665.Request
1666----
1667 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1668 Content-Type: application/json; charset=UTF-8
1669
1670 {
1671 "destination_branch" : "release-branch"
1672 }
1673
1674----
1675
1676As response a link:#change-info[ChangeInfo] entity is returned that
1677describes the moved change.
1678
1679.Response
1680----
1681 HTTP/1.1 200 OK
1682 Content-Disposition: attachment
1683 Content-Type: application/json; charset=UTF-8
1684
1685 )]}'
1686 {
1687 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1688 "project": "myProject",
1689 "branch": "release-branch",
1690 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1691 "subject": "Implementing Feature X",
1692 "status": "NEW",
1693 "created": "2013-02-01 09:59:32.126000000",
1694 "updated": "2013-02-21 11:16:36.775000000",
1695 "mergeable": true,
1696 "insertions": 2,
1697 "deletions": 13,
1698 "_number": 3965,
1699 "owner": {
1700 "name": "John Doe"
1701 }
1702 }
1703----
1704
Changcheng Xiao6dc90422017-08-09 10:21:58 +02001705Note that this endpoint will not update the change's parents, which is
1706different from the link:#cherry-pick[cherry-pick] endpoint.
1707
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301708If the change cannot be moved because the change state doesn't
1709allow moving the change, the response is "`409 Conflict`" and
1710the error message is contained in the response body.
1711
1712.Response
1713----
1714 HTTP/1.1 409 Conflict
1715 Content-Disposition: attachment
1716 Content-Type: text/plain; charset=UTF-8
1717
1718 change is merged
1719----
1720
1721If the change cannot be moved because the user doesn't have
1722abandon permission on the change or upload permission on the destination,
1723the response is "`409 Conflict`" and the error message is contained in the
1724response body.
1725
1726.Response
1727----
1728 HTTP/1.1 409 Conflict
1729 Content-Disposition: attachment
1730 Content-Type: text/plain; charset=UTF-8
1731
1732 move not permitted
1733----
1734
Edwin Kempind2ec4152013-02-22 12:17:19 +01001735[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001736=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001737--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001738'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001739--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001740
Edwin Kempind2ec4152013-02-22 12:17:19 +01001741Reverts a change.
1742
Gal Paikin006d52b2019-12-19 11:22:09 +01001743The subject of the newly created change will be
1744'Revert "<subject-of-reverted-change>"'. If the subject of the change reverted is
1745above 63 characters, it will be cut down to 59 characters with "..." in the end.
1746
Edwin Kempind2ec4152013-02-22 12:17:19 +01001747The request body does not need to include a link:#revert-input[
1748RevertInput] entity if no review comment is added.
1749
1750.Request
1751----
Michael Zhou10270492016-03-24 22:35:40 -04001752 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001753----
1754
1755As response a link:#change-info[ChangeInfo] entity is returned that
1756describes the reverting change.
1757
1758.Response
1759----
1760 HTTP/1.1 200 OK
1761 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001762 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001763
1764 )]}'
1765 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001766 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1767 "project": "myProject",
1768 "branch": "master",
1769 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1770 "subject": "Revert \"Implementing Feature X\"",
1771 "status": "NEW",
1772 "created": "2013-02-01 09:59:32.126000000",
1773 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001774 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001775 "insertions": 6,
1776 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001777 "_number": 3965,
1778 "owner": {
1779 "name": "John Doe"
1780 }
1781 }
1782----
1783
Gal Paikin6c9ed952020-01-22 10:36:35 +01001784If the user doesn't have revert permission on the change or upload permission on
1785the destination branch, the response is "`403 Forbidden`", and the error message is
1786contained in the response body.
1787
Edwin Kempind2ec4152013-02-22 12:17:19 +01001788If the change cannot be reverted because the change state doesn't
Gal Paikin6c9ed952020-01-22 10:36:35 +01001789allow reverting the change the response is "`409 Conflict`", and the error
1790message is contained in the response body.
Edwin Kempind2ec4152013-02-22 12:17:19 +01001791
1792.Response
1793----
1794 HTTP/1.1 409 Conflict
1795 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001796 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001797
1798 change is new
1799----
1800
Gal Paikinb81f56c2019-10-16 14:39:24 +02001801[[revert-submission]]
1802=== Revert Submission
1803--
1804'POST /changes/link:#change-id[\{change-id\}]/revert_submission'
1805--
1806
1807Creates open revert changes for all of the changes of a certain submission.
1808
Gal Paikin006d52b2019-12-19 11:22:09 +01001809The subject of each revert change will be 'Revert "<subject-of-reverted-change"'.
Gal Paikin100bf602019-12-23 14:50:41 +01001810If the subject is above 60 characters, the subject will be cut to 56 characters
1811with "..." in the end. However, whenever reverting the submission of a revert
1812submission, the subject will be shortened from
1813'Revert "Revert "<subject-of-reverted-change""' to
1814'Revert^2 "<subject-of-reverted-change"'. Also, for every future revert submission,
1815the only difference in the subject will be the number of the revert (instead of
1816Revert^2 the subject will change to Revert^3 and so on).
1817There are no guarantees about the subjects if the users change the default subjects.
Gal Paikinaffd0242019-12-18 18:10:08 +01001818
Gal Paikinb81f56c2019-10-16 14:39:24 +02001819Details for the revert can be specified in the request body inside a link:#revert-input[
1820RevertInput] The topic of all created revert changes will be
1821`revert-{submission_id}-{random_string_of_size_10}`.
1822
1823The changes will not be rebased on onto the destination branch so the users may still
1824have to manually rebase them to resolve conflicts and make them submittable.
1825
Gal Paikin653a8522019-11-25 11:40:10 +01001826However, the changes that have the same project and branch will be rebased on top
1827of each other. E.g, the first revert change will have the original change as a
1828parent, and the second revert change will have the first revert change as a
1829parent.
1830
1831There is one special case that involves merge commits; if a user has multiple
1832changes in the same project and branch, but not in the same change series, those
1833changes can still get submitted together if they have the same topic and
1834link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] in
1835gerrit.config is set to true. In the case, Gerrit may create merge commits on
1836submit (depending on the link:config-project-config.html#submit-type[submit types]
1837of the project).
1838The first parent for the reverts will be the most recent merge commit that was
1839created by Gerrit to merge the different change series into the target branch.
1840
Gal Paikinb81f56c2019-10-16 14:39:24 +02001841.Request
1842----
1843 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0
1844----
1845
1846As response link:#revert-submission-info[RevertSubmissionInfo] entity
1847is returned. That entity describes the revert changes.
1848
1849.Response
1850----
1851 HTTP/1.1 200 OK
1852 Content-Disposition: attachment
1853 Content-Type: application/json; charset=UTF-8
1854
1855 )]}'
1856 "revert_changes":
1857 [
1858 {
1859 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1860 "project": "myProject",
1861 "branch": "master",
1862 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1863 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1864 "subject": "Revert \"Implementing Feature X\"",
1865 "status": "NEW",
1866 "created": "2013-02-01 09:59:32.126000000",
1867 "updated": "2013-02-21 11:16:36.775000000",
1868 "mergeable": true,
1869 "insertions": 6,
1870 "deletions": 4,
1871 "_number": 3965,
1872 "owner": {
1873 "name": "John Doe"
1874 }
1875 },
1876 {
1877 "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646",
1878 "project": "anyProject",
1879 "branch": "master",
1880 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1881 "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646",
1882 "subject": "Revert \"Implementing Feature Y\"",
1883 "status": "NEW",
1884 "created": "2013-02-04 09:59:33.126000000",
1885 "updated": "2013-02-21 11:16:37.775000000",
1886 "mergeable": true,
1887 "insertions": 62,
1888 "deletions": 11,
1889 "_number": 3966,
1890 "owner": {
1891 "name": "Jane Doe"
1892 }
1893 }
1894 ]
1895----
1896
Gal Paikin6c9ed952020-01-22 10:36:35 +01001897If the user doesn't have revert permission on the change or upload permission on
1898the destination, the response is "`403 Forbidden`", and the error message is
1899contained in the response body.
1900
1901If the change cannot be reverted because the change state doesn't
1902allow reverting the change the response is "`409 Conflict`", and the error
1903message is contained in the response body.
Gal Paikinb81f56c2019-10-16 14:39:24 +02001904
1905.Response
1906----
1907 HTTP/1.1 409 Conflict
1908 Content-Disposition: attachment
1909 Content-Type: text/plain; charset=UTF-8
1910
1911 change is new
1912----
1913
Edwin Kempin0eddba02013-02-22 15:30:12 +01001914[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001915=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001916--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001917'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001918--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001919
Edwin Kempin0eddba02013-02-22 15:30:12 +01001920Submits a change.
1921
1922The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001923SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001924
Gal Paikinc326de42020-06-16 18:49:00 +03001925Submitting a change also removes all users from the link:#attention-set[attention set].
1926
Edwin Kempin0eddba02013-02-22 15:30:12 +01001927.Request
1928----
1929 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001930 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001931
1932 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001933 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001934 }
1935----
1936
1937As response a link:#change-info[ChangeInfo] entity is returned that
1938describes the submitted/merged change.
1939
Gal Paikine2849a82021-04-19 13:41:10 +02001940Submission may submit multiple changes, but we still only return one ChangeInfo
1941object. To query for all submitted changes, please use the submission_id that is
1942part of the response.
1943
1944Changes that will also be submitted:
19451. All changes of the same topic if
1946link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1947configuration is set to true.
19482. All dependent changes.
19493. The closure of the above (e.g if a dependent change has a topic, all changes
1950of *that* topic will also be submitted).
1951
Edwin Kempin0eddba02013-02-22 15:30:12 +01001952.Response
1953----
1954 HTTP/1.1 200 OK
1955 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001956 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001957
1958 )]}'
1959 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001960 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1961 "project": "myProject",
1962 "branch": "master",
1963 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1964 "subject": "Implementing Feature X",
1965 "status": "MERGED",
1966 "created": "2013-02-01 09:59:32.126000000",
1967 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001968 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001969 "_number": 3965,
1970 "owner": {
1971 "name": "John Doe"
1972 }
1973 }
1974----
1975
1976If the change cannot be submitted because the submit rule doesn't allow
1977submitting the change, the response is "`409 Conflict`" and the error
1978message is contained in the response body.
1979
1980.Response
1981----
1982 HTTP/1.1 409 Conflict
1983 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001984 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001985
1986 blocked by Verified
1987----
1988
David Pursehouse025c1af2015-11-20 17:02:50 +09001989[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001990=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07001991--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001992'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001993--
1994
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001995Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001996link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07001997including the current change itself.
1998
Stefan Bellera7ad6612015-06-26 10:05:43 -07001999The list consists of:
2000
2001* The given change.
2002* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
Gal Paikine7a208d2021-11-30 12:08:27 +01002003 is enabled OR if the `o=TOPIC_CLOSURE` query parameter is passed, include all
2004 open changes with the same topic.
Stefan Bellera7ad6612015-06-26 10:05:43 -07002005* For each change whose submit type is not CHERRY_PICK, include unmerged
2006 ancestors targeting the same branch.
2007
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002008As a special case, the list is empty if this change would be
2009submitted by itself (without other changes).
2010
2011.Request
2012----
2013 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
2014 Content-Type: application/json; charset=UTF-8
2015----
2016
2017As a response a link:#submitted-together-info[SubmittedTogetherInfo]
2018entity is returned that describes what would happen if the change were
2019submitted. This response contains a list of changes and a count of
2020changes that are not visible to the caller that are part of the set of
2021changes to be merged.
2022
2023The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002024link:#list-changes[Query Changes] with the
2025link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Patrick Hiesel6fbbdaa2018-04-05 15:10:13 +02002026link:#current-revision[`CURRENT_REVISION`],and
Jonathan Niedercb51d742016-09-23 11:37:57 -07002027link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002028
Shawn Pearce8080c3d2016-09-19 19:15:04 -07002029Standard link:#query-options[formatting options] can be specified
2030with the `o` parameter, as well as the `submitted_together` specific
Gal Paikine7a208d2021-11-30 12:08:27 +01002031options `NON_VISIBLE_CHANGES` and `TOPIC_CLOSURE`.
Shawn Pearce8080c3d2016-09-19 19:15:04 -07002032
Stefan Bellera7ad6612015-06-26 10:05:43 -07002033.Response
2034----
2035 HTTP/1.1 200 OK
2036 Content-Disposition: attachment
2037 Content-Type: application/json; charset=UTF-8
2038
2039)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002040{
2041 "changes": [
2042 {
2043 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
2044 "project": "gerrit",
2045 "branch": "master",
2046 "hashtags": [],
2047 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
2048 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
2049 "status": "NEW",
2050 "created": "2015-05-01 15:39:57.979000000",
2051 "updated": "2015-05-20 19:25:21.592000000",
2052 "mergeable": true,
2053 "insertions": 303,
2054 "deletions": 210,
2055 "_number": 1779,
2056 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07002057 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002058 },
2059 "labels": {
2060 "Code-Review": {
2061 "approved": {
2062 "_account_id": 1000000
2063 },
2064 "all": [
2065 {
2066 "value": 2,
2067 "date": "2015-05-20 19:25:21.592000000",
2068 "_account_id": 1000000
2069 }
2070 ],
2071 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01002072 "-2": "This shall not be submitted",
2073 "-1": "I would prefer this is not submitted as is",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002074 " 0": "No score",
2075 "+1": "Looks good to me, but someone else must approve",
2076 "+2": "Looks good to me, approved"
2077 },
2078 "default_value": 0
2079 },
2080 "Verified": {
2081 "approved": {
2082 "_account_id": 1000000
2083 },
2084 "all": [
2085 {
2086 "value": 1,
2087 "date": "2015-05-20 19:25:21.592000000",
2088 "_account_id": 1000000
2089 }
2090 ],
2091 "values": {
2092 "-1": "Fails",
2093 " 0": "No score",
2094 "+1": "Verified"
2095 },
2096 "default_value": 0
2097 }
2098 },
2099 "permitted_labels": {
2100 "Code-Review": [
2101 "-2",
2102 "-1",
2103 " 0",
2104 "+1",
2105 "+2"
2106 ],
2107 "Verified": [
2108 "-1",
2109 " 0",
2110 "+1"
2111 ]
2112 },
2113 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08002114 {
2115 "_account_id": 1000000
2116 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002117 ],
2118 "reviewers": {
2119 "REVIEWER": [
2120 {
2121 "_account_id": 1000000
2122 }
2123 ]
2124 },
2125 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
2126 "revisions": {
2127 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09002128 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002129 "_number": 1,
2130 "created": "2015-05-01 15:39:57.979000000",
2131 "uploader": {
2132 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07002133 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002134 "ref": "refs/changes/79/1779/1",
2135 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07002136 }
2137 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07002138 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002139 {
2140 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
2141 "project": "gerrit",
2142 "branch": "master",
2143 "hashtags": [],
2144 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
2145 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
2146 "status": "NEW",
2147 "created": "2015-05-01 15:39:57.979000000",
2148 "updated": "2015-05-20 19:25:21.546000000",
2149 "mergeable": true,
2150 "insertions": 15,
2151 "deletions": 6,
2152 "_number": 1780,
2153 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07002154 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002155 },
2156 "labels": {
2157 "Code-Review": {
2158 "approved": {
2159 "_account_id": 1000000
2160 },
2161 "all": [
2162 {
2163 "value": 2,
2164 "date": "2015-05-20 19:25:21.546000000",
2165 "_account_id": 1000000
2166 }
2167 ],
2168 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01002169 "-2": "This shall not be submitted",
2170 "-1": "I would prefer this is not submitted as is",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002171 " 0": "No score",
2172 "+1": "Looks good to me, but someone else must approve",
2173 "+2": "Looks good to me, approved"
2174 },
2175 "default_value": 0
2176 },
2177 "Verified": {
2178 "approved": {
2179 "_account_id": 1000000
2180 },
2181 "all": [
2182 {
2183 "value": 1,
2184 "date": "2015-05-20 19:25:21.546000000",
2185 "_account_id": 1000000
2186 }
2187 ],
2188 "values": {
2189 "-1": "Fails",
2190 " 0": "No score",
2191 "+1": "Verified"
2192 },
2193 "default_value": 0
2194 }
2195 },
2196 "permitted_labels": {
2197 "Code-Review": [
2198 "-2",
2199 "-1",
2200 " 0",
2201 "+1",
2202 "+2"
2203 ],
2204 "Verified": [
2205 "-1",
2206 " 0",
2207 "+1"
2208 ]
2209 },
2210 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08002211 {
2212 "_account_id": 1000000
2213 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002214 ],
2215 "reviewers": {
2216 "REVIEWER": [
2217 {
2218 "_account_id": 1000000
2219 }
2220 ]
2221 },
2222 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
2223 "revisions": {
2224 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09002225 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002226 "_number": 1,
2227 "created": "2015-05-01 15:39:57.979000000",
2228 "uploader": {
2229 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07002230 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002231 "ref": "refs/changes/80/1780/1",
2232 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07002233 }
2234 }
2235 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002236 ],
2237 "non_visible_changes": 0
2238}
Stefan Bellera7ad6612015-06-26 10:05:43 -07002239----
2240
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002241If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
2242instead of a link:#submitted-together-info[SubmittedTogetherInfo]
2243entity, the response is a list of changes, or a 403 response with a
2244message if the set of changes to be submitted with this change
2245includes changes the caller cannot read.
2246
Stefan Bellera7ad6612015-06-26 10:05:43 -07002247
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02002248[[delete-change]]
2249=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002250--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002251'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002252--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002253
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02002254Deletes a change.
2255
Paladox none580ae0e2017-02-12 18:15:48 +00002256New or abandoned changes can be deleted by their owner if the user is granted
2257the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
2258otherwise only by administrators.
2259
David Ostrovsky0d69c232013-09-10 23:10:23 +02002260.Request
2261----
2262 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002263 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02002264----
2265
2266.Response
2267----
2268 HTTP/1.1 204 No Content
2269----
2270
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03002271[[apply-patch]]
2272=== Create patch-set from patch
2273--
2274'POST /changes/link:#change-id[\{change-id\}]/patch:apply'
2275--
2276
2277Creates a new patch set on a destination change from the provided patch.
2278
2279The patch must be provided in the request body, inside a
2280link:#applypatchpatchset-input[ApplyPatchPatchSetInput] entity.
2281
2282If a base commit is given, the patch is applied on top of it. Otherwise, the
Nitzan Gur-Furman0f0b2d82023-02-22 15:31:23 +01002283patch is applied on top of the target change's original parent.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03002284
2285Applying the patch will fail if the destination change is closed, or in case of any conflicts.
2286
2287.Request
2288----
2289 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/patch:apply HTTP/1.0
2290 Content-Type: application/json; charset=UTF-8
2291
2292 {
2293 "patch": {
2294 "patch": "new file mode 100644\n--- /dev/null\n+++ b/a_new_file.txt\n@@ -0,0 +1,2 @@ \
2295+Patch compatible `git diff` output \
2296+For example: `link:#get-patch[<gerrit patch>] | base64 -d | sed -z 's/\n/\\n/g'`"
2297 }
2298 }
2299----
2300
2301As response a link:#change-info[ChangeInfo] entity is returned that
2302describes the destination change after applying the patch.
2303
2304.Response
2305----
2306 HTTP/1.1 200 OK
2307 Content-Disposition: attachment
2308 Content-Type: application/json; charset=UTF-8
2309
2310 )]}'
2311 {
2312 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
2313 "project": "myProject",
2314 "branch": "release-branch",
2315 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
2316 "subject": "Original change subject",
2317 "status": "NEW",
2318 "created": "2013-02-01 09:59:32.126000000",
2319 "updated": "2013-02-21 11:16:36.775000000",
2320 "mergeable": true,
2321 "insertions": 12,
2322 "deletions": 11,
2323 "_number": 3965,
2324 "owner": {
2325 "name": "John Doe"
2326 },
2327 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c"
2328 }
2329----
2330
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002331[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002332=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002333--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002334'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002335--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002336
2337Retrieves the branches and tags in which a change is included. As result
2338an link:#included-in-info[IncludedInInfo] entity is returned.
2339
2340.Request
2341----
2342 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
2343----
2344
2345.Response
2346----
2347 HTTP/1.1 200 OK
2348 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002349 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002350
2351 )]}'
2352 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002353 "branches": [
2354 "master"
2355 ],
2356 "tags": []
2357 }
2358----
2359
David Pursehouse4e38b972014-05-30 10:36:40 +09002360[[index-change]]
2361=== Index Change
2362--
2363'POST /changes/link:#change-id[\{change-id\}]/index'
2364--
2365
2366Adds or updates the change in the secondary index.
2367
2368.Request
2369----
2370 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
2371----
2372
2373.Response
2374----
2375 HTTP/1.1 204 No Content
2376----
2377
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002378[[list-change-comments]]
2379=== List Change Comments
2380--
2381'GET /changes/link:#change-id[\{change-id\}]/comments'
2382--
2383
2384Lists the published comments of all revisions of the change.
2385
2386Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2387entries. The entries in the map are sorted by file path, and the
2388comments for each path are sorted by patch set number. Each comment has
2389the `patch_set` and `author` fields set.
2390
Youssef Elghareeb68e87b62021-01-11 13:20:03 +01002391If the `enable-context` request parameter is set to true, the comment entries
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02002392will contain a list of link:#context-line[ContextLine] containing the lines of
2393the source file where the comment was written.
2394
Youssef Elghareeb87b74502021-02-05 18:53:05 +01002395The `context-padding` request parameter can be used to specify an extra number
2396of context lines to be added before and after the comment range. This parameter
2397only works if `enable-context` is set to true.
2398
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002399.Request
2400----
2401 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
2402----
2403
2404.Response
2405----
2406 HTTP/1.1 200 OK
2407 Content-Disposition: attachment
2408 Content-Type: application/json; charset=UTF-8
2409
2410 )]}'
2411 {
2412 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2413 {
2414 "patch_set": 1,
2415 "id": "TvcXrmjM",
2416 "line": 23,
2417 "message": "[nit] trailing whitespace",
2418 "updated": "2013-02-26 15:40:43.986000000"
2419 "author": {
2420 "_account_id": 1000096,
2421 "name": "John Doe",
2422 "email": "john.doe@example.com"
2423 }
2424 },
2425 {
2426 "patch_set": 2,
2427 "id": "TveXwFiA",
2428 "line": 49,
2429 "in_reply_to": "TfYX-Iuo",
2430 "message": "Done",
2431 "updated": "2013-02-26 15:40:45.328000000"
2432 "author": {
2433 "_account_id": 1000097,
2434 "name": "Jane Roe",
2435 "email": "jane.roe@example.com"
2436 }
2437 }
2438 ]
2439 }
2440----
2441
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002442[[list-change-robot-comments]]
2443=== List Change Robot Comments
2444--
2445'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
2446--
2447
2448Lists the robot comments of all revisions of the change.
2449
2450Return a map that maps the file path to a list of
2451link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
2452map are sorted by file path.
2453
2454.Request
2455----
2456 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
2457----
2458
2459.Response
2460----
2461 HTTP/1.1 200 OK
2462 Content-Disposition: attachment
2463 Content-Type: application/json; charset=UTF-8
2464
2465 )]}'
2466 {
2467 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2468 {
2469 "id": "TvcXrmjM",
2470 "line": 23,
2471 "message": "unused import",
2472 "updated": "2016-02-26 15:40:43.986000000",
2473 "author": {
2474 "_account_id": 1000110,
2475 "name": "Code Analyzer",
2476 "email": "code.analyzer@example.com"
2477 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002478 "robot_id": "importChecker",
2479 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002480 },
2481 {
2482 "id": "TveXwFiA",
2483 "line": 49,
2484 "message": "wrong indention",
2485 "updated": "2016-02-26 15:40:45.328000000",
2486 "author": {
2487 "_account_id": 1000110,
2488 "name": "Code Analyzer",
2489 "email": "code.analyzer@example.com"
2490 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002491 "robot_id": "styleChecker",
2492 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002493 }
2494 ]
2495 }
2496----
2497
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002498[[list-change-drafts]]
2499=== List Change Drafts
2500--
2501'GET /changes/link:#change-id[\{change-id\}]/drafts'
2502--
2503
2504Lists the draft comments of all revisions of the change that belong to
2505the calling user.
2506
2507Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2508entries. The entries in the map are sorted by file path, and the
2509comments for each path are sorted by patch set number. Each comment has
2510the `patch_set` field set, and no `author`.
2511
Youssef Elghareeb59580cb2021-03-17 15:02:49 +01002512The `enable-context` and `context-padding` request parameters can be used to
2513request comment context. See link:#list-change-comments[List Change Comments]
2514for more details.
2515
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002516.Request
2517----
2518 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
2519----
2520
2521.Response
2522----
2523 HTTP/1.1 200 OK
2524 Content-Disposition: attachment
2525 Content-Type: application/json; charset=UTF-8
2526
2527 )]}'
2528 {
2529 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2530 {
2531 "patch_set": 1,
2532 "id": "TvcXrmjM",
2533 "line": 23,
2534 "message": "[nit] trailing whitespace",
2535 "updated": "2013-02-26 15:40:43.986000000"
2536 },
2537 {
2538 "patch_set": 2,
2539 "id": "TveXwFiA",
2540 "line": 49,
2541 "in_reply_to": "TfYX-Iuo",
2542 "message": "Done",
2543 "updated": "2013-02-26 15:40:45.328000000"
2544 }
2545 ]
2546 }
2547----
2548
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002549[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002550=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002551--
2552'GET /changes/link:#change-id[\{change-id\}]/check'
2553--
2554
2555Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002556link:#change-info[ChangeInfo] entity with the `problems` field set to a
2557list of link:#problem-info[ProblemInfo] entities.
2558
2559Depending on the type of problem, some fields not marked optional may be
2560missing from the result. At least `id`, `project`, `branch`, and
2561`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002562
2563.Request
2564----
2565 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2566----
2567
2568.Response
2569----
2570 HTTP/1.1 200 OK
2571 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002572 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002573
2574 )]}'
2575 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002576 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2577 "project": "myProject",
2578 "branch": "master",
2579 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2580 "subject": "Implementing Feature X",
2581 "status": "NEW",
2582 "created": "2013-02-01 09:59:32.126000000",
2583 "updated": "2013-02-21 11:16:36.775000000",
2584 "mergeable": true,
2585 "insertions": 34,
2586 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002587 "_number": 3965,
2588 "owner": {
2589 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002590 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002591 "problems": [
2592 {
2593 "message": "Current patch set 1 not found"
2594 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002595 ]
2596 }
2597----
2598
Dave Borowitz3be39d02014-12-03 17:57:38 -08002599[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002600=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002601--
2602'POST /changes/link:#change-id[\{change-id\}]/check'
2603--
2604
2605Performs consistency checks on the change as with link:#check-change[GET
2606/check], and additionally fixes any problems that can be fixed
2607automatically. The returned field values reflect any fixes.
2608
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002609Some fixes have options controlling their behavior, which can be set in the
2610link:#fix-input[FixInput] entity body.
2611
Dave Borowitz3be39d02014-12-03 17:57:38 -08002612Only the change owner, a project owner, or an administrator may fix changes.
2613
2614.Request
2615----
2616 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2617----
2618
2619.Response
2620----
2621 HTTP/1.1 200 OK
2622 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002623 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002624
2625 )]}'
2626 {
2627 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2628 "project": "myProject",
2629 "branch": "master",
2630 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2631 "subject": "Implementing Feature X",
2632 "status": "MERGED",
2633 "created": "2013-02-01 09:59:32.126000000",
2634 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002635 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002636 "mergeable": true,
2637 "insertions": 34,
2638 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002639 "_number": 3965,
2640 "owner": {
2641 "name": "John Doe"
2642 },
2643 "problems": [
2644 {
2645 "message": "Current patch set 2 not found"
2646 },
2647 {
2648 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2649 "status": FIXED,
2650 "outcome": "Marked change as merged"
2651 }
2652 ]
2653 }
2654----
2655
Alan Tokaev392cfca2017-04-28 11:11:31 +02002656[[set-work-in-pogress]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002657=== Set Work-In-Progress
Alan Tokaev392cfca2017-04-28 11:11:31 +02002658--
2659'POST /changes/link:#change-id[\{change-id\}]/wip'
2660--
2661
David Ostrovsky44242452018-06-09 20:25:13 +02002662Marks the change as not ready for review yet. Changes may only be marked not
2663ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002664
2665The request body does not need to include a
2666link:#work-in-progress-input[WorkInProgressInput] entity if no review comment
2667is added. Actions that create a new patch set in a WIP change default to
2668notifying *OWNER* instead of *ALL*.
2669
Gal Paikinc326de42020-06-16 18:49:00 +03002670Marking a change work in progress also removes all users from the
2671link:#attention-set[attention set].
2672
Alan Tokaev392cfca2017-04-28 11:11:31 +02002673.Request
2674----
2675 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0
2676 Content-Type: application/json; charset=UTF-8
2677
2678 {
2679 "message": "Refactoring needs to be done before we can proceed here."
2680 }
2681----
2682
2683.Response
2684----
2685 HTTP/1.1 200 OK
2686----
2687
2688[[set-ready-for-review]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002689=== Set Ready-For-Review
Alan Tokaev392cfca2017-04-28 11:11:31 +02002690--
2691'POST /changes/link:#change-id[\{change-id\}]/ready'
2692--
2693
David Ostrovsky44242452018-06-09 20:25:13 +02002694Marks the change as ready for review (set WIP property to false). Changes may
2695only be marked ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002696
2697Activates notifications of reviewer. The request body does not need
2698to include a link:#work-in-progress-input[WorkInProgressInput] entity
2699if no review comment is added.
2700
Gal Paikinc326de42020-06-16 18:49:00 +03002701Marking a change ready for review also adds all of the reviewers of the change
2702to the link:#attention-set[attention set].
2703
Alan Tokaev392cfca2017-04-28 11:11:31 +02002704.Request
2705----
2706 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0
2707 Content-Type: application/json;charset=UTF-8
2708
2709 {
2710 "message": "Refactoring is done."
2711 }
2712
2713----
2714
2715.Response
2716----
2717 HTTP/1.1 200 OK
2718----
2719
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002720[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002721=== Mark Private
2722--
Edwin Kempin364a86b2017-04-27 12:34:00 +02002723'POST /changes/link:#change-id[\{change-id\}]/private'
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002724--
2725
Patrick Hiesel707e61a2019-02-13 18:28:48 +01002726Marks the change to be private. Only open changes can be marked private.
2727Changes may only be marked private by the owner or site administrators.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002728
Edwin Kempin364a86b2017-04-27 12:34:00 +02002729A message can be specified in the request body inside a
2730link:#private-input[PrivateInput] entity.
2731
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002732.Request
2733----
Edwin Kempin364a86b2017-04-27 12:34:00 +02002734 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2735 Content-Type: application/json; charset=UTF-8
2736
2737 {
2738 "message": "After this security fix has been released we can make it public now."
2739 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002740----
2741
2742.Response
2743----
2744 HTTP/1.1 201 Created
2745----
2746
2747If the change was already private the response is "`200 OK`".
2748
2749[[unmark-private]]
2750=== Unmark Private
2751--
2752'DELETE /changes/link:#change-id[\{change-id\}]/private'
2753--
2754
2755Marks the change to be non-private. Note users can only unmark own private
2756changes.
2757
2758.Request
2759----
2760 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2761----
2762
2763.Response
2764----
2765 HTTP/1.1 204 No Content
2766----
2767
2768If the change was already not private, the response is "`409 Conflict`".
2769
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002770A message can be specified in the request body inside a
2771link:#private-input[PrivateInput] entity. Historically, this method allowed
2772a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01002773link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002774In this case, use a POST request instead:
Edwin Kempin364a86b2017-04-27 12:34:00 +02002775
2776.Request
2777----
2778 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0
2779 Content-Type: application/json; charset=UTF-8
2780
2781 {
2782 "message": "This is a security fix that must not be public."
2783 }
2784----
2785
David Pursehouse7c79b682017-08-25 13:18:32 +09002786[[get-hashtags]]
2787=== Get Hashtags
2788--
2789'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2790--
2791
2792Gets the hashtags associated with a change.
2793
David Pursehouse7c79b682017-08-25 13:18:32 +09002794.Request
2795----
2796 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2797----
2798
2799As response the change's hashtags are returned as a list of strings.
2800
2801.Response
2802----
2803 HTTP/1.1 200 OK
2804 Content-Disposition: attachment
2805 Content-Type: application/json; charset=UTF-8
2806
2807 )]}'
2808 [
2809 "hashtag1",
2810 "hashtag2"
2811 ]
2812----
2813
2814[[set-hashtags]]
2815=== Set Hashtags
2816--
2817'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2818--
2819
2820Adds and/or removes hashtags from a change.
2821
David Pursehouse7c79b682017-08-25 13:18:32 +09002822The hashtags to add or remove must be provided in the request body inside a
2823link:#hashtags-input[HashtagsInput] entity.
2824
2825.Request
2826----
2827 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2828 Content-Type: application/json; charset=UTF-8
2829
2830 {
2831 "add" : [
2832 "hashtag3"
2833 ],
2834 "remove" : [
2835 "hashtag2"
2836 ]
2837 }
2838----
2839
2840As response the change's hashtags are returned as a list of strings.
2841
2842.Response
2843----
2844 HTTP/1.1 200 OK
2845 Content-Disposition: attachment
2846 Content-Type: application/json; charset=UTF-8
2847
2848 )]}'
2849 [
2850 "hashtag1",
2851 "hashtag3"
2852 ]
2853----
2854
Chris Poucetf5e68292023-04-03 16:21:39 +02002855[[get-custom-keyed-values]]
2856=== Get Custom Keyed Values
2857--
2858'GET /changes/link:#change-id[\{change-id\}]/custom-keyed-values'
2859--
2860
2861Gets the custom keyed values associated with a change.
2862
2863.Request
2864----
2865 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/custom-keyed-values HTTP/1.0
2866----
2867
2868As response the change's custom keyed values are returned as a map of strings.
2869
2870.Response
2871----
2872 HTTP/1.1 200 OK
2873 Content-Disposition: attachment
2874 Content-Type: application/json; charset=UTF-8
2875
2876 )]}'
2877 {
2878 "key1": "value1",
2879 "key2": "value2"
2880 }
2881----
2882
2883[[set-custom-keyed-values]]
2884=== Set Custom Keyed Values
2885--
2886'POST /changes/link:#change-id[\{change-id\}]/custom-keyed-values'
2887--
2888
2889Adds and/or removes custom keyed values from a change.
2890
2891The custom keyed values to add or remove must be provided in the request body
2892inside a link:#custom-keyed-values-input[CustomKeyedValuesInput] entity.
2893
2894.Request
2895----
2896 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/custom-keyed-values HTTP/1.0
2897 Content-Type: application/json; charset=UTF-8
2898
2899 {
2900 "add" : {
2901 "key1": "value1"
2902 },
2903 "remove" : [
2904 "key2"
2905 ]
2906 }
2907----
2908
2909As response the change's custom keyed values are returned as a map of strings to strings.
2910
2911.Response
2912----
2913 HTTP/1.1 200 OK
2914 Content-Disposition: attachment
2915 Content-Type: application/json; charset=UTF-8
2916
2917 )]}'
2918 {
2919 "key1": "value1",
2920 "key3": "value3"
2921 }
2922----
2923
2924
Changcheng Xiao7fb73292018-04-25 11:43:19 +02002925[[list-change-messages]]
2926=== List Change Messages
2927--
2928'GET /changes/link:#change-id[\{change-id\}]/messages'
2929--
2930
2931Lists all the messages of a change including link:#detailed-accounts[detailed account information].
2932
2933.Request
2934----
2935 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages
2936----
2937
2938As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned.
2939
2940.Response
2941----
2942 HTTP/1.1 200 OK
2943 Content-Disposition: attachment
2944 Content-Type: application/json; charset=UTF-8
2945
2946 )]}'
2947 [
2948 {
2949 "id": "YH-egE",
2950 "author": {
2951 "_account_id": 1000096,
2952 "name": "John Doe",
2953 "email": "john.doe@example.com",
2954 "username": "jdoe"
2955 },
2956 "date": "2013-03-23 21:34:02.419000000",
2957 "message": "Patch Set 1:\n\nThis is the first message.",
2958 "_revision_number": 1
2959 },
2960 {
2961 "id": "WEEdhU",
2962 "author": {
2963 "_account_id": 1000097,
2964 "name": "Jane Roe",
2965 "email": "jane.roe@example.com",
2966 "username": "jroe"
2967 },
2968 "date": "2013-03-23 21:36:52.332000000",
2969 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
2970 "_revision_number": 1
2971 }
2972 ]
2973----
David Pursehousec32050d2017-08-25 16:27:47 +09002974
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002975[[get-change-message]]
2976=== Get Change Message
2977
2978Retrieves a change message including link:#detailed-accounts[detailed account information].
2979
2980--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002981'GET /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]'
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002982--
2983
2984As response a link:#change-message-info[ChangeMessageInfo] entity is returned.
2985
2986.Response
2987----
2988 HTTP/1.1 200 OK
2989 Content-Disposition: attachment
2990 Content-Type: application/json; charset=UTF-8
2991
2992 )]}'
2993 {
2994 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
2995 "author": {
2996 "_account_id": 1000096,
2997 "name": "John Doe",
2998 "email": "john.doe@example.com",
2999 "username": "jdoe"
3000 },
3001 "date": "2013-03-23 21:34:02.419000000",
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02003002 "message": "a change message",
3003 "_revision_number": 1
3004 }
3005----
3006
3007[[delete-change-message]]
3008=== Delete Change Message
3009--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07003010'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' +
3011'POST /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]/delete'
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02003012--
3013
3014Deletes a change message by replacing the change message with a new message,
3015which contains the name of the user who deleted the change message and the
3016reason why it was deleted. The reason can be provided in the request body as a
3017link:#delete-change-message-input[DeleteChangeMessageInput] entity.
3018
3019Note that only users with the
3020link:access-control.html#capability_administrateServer[Administrate Server]
3021global capability are permitted to delete a change message.
3022
3023To delete a change message, send a DELETE request:
3024
3025.Request
3026----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07003027 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02003028----
3029
3030To provide a reason for the deletion, use a POST request:
3031
3032.Request
3033----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07003034 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02003035 Content-Type: application/json; charset=UTF-8
3036
3037 {
3038 "reason": "spam"
3039 }
3040----
3041
3042As response a link:#change-message-info[ChangeMessageInfo] entity is returned that
3043describes the updated change message.
3044
3045.Response
3046----
3047 HTTP/1.1 200 OK
3048 Content-Disposition: attachment
3049 Content-Type: application/json; charset=UTF-8
3050
3051 )]}'
3052 {
3053 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
3054 "author": {
3055 "_account_id": 1000096,
3056 "name": "John Doe",
3057 "email": "john.doe@example.com",
3058 "username": "jdoe"
3059 },
3060 "date": "2013-03-23 21:34:02.419000000",
3061 "message": "Change message removed by: Administrator\nReason: spam",
Changcheng Xiaod61590f2018-04-30 10:59:14 +02003062 "_revision_number": 1
3063 }
3064----
Gustaf Lundhe8647c62017-04-28 06:51:26 +02003065
Youssef Elghareebd5986932021-10-15 11:45:23 +02003066[[check-submit-requirement]]
3067=== Check Submit Requirement
3068--
3069'POST /changes/link:#change-id[\{change-id\}]/check.submit_requirement'
3070--
3071
3072Tests a submit requirement and returns the result as a
Youssef Elghareeb1a24df62022-06-24 17:52:28 +02003073link:#submit-requirement-result-info[SubmitRequirementResultInfo].
3074
3075The submit requirement can be specified in one of the following ways:
3076
3077 * In the request body as a link:#submit-requirement-input[SubmitRequirementInput].
3078 * By passing the two request parameters `sr-name` and
3079 `refs-config-change-id`. The submit requirement will then be loaded from
3080 the project config pointed to by the latest patchset of this change ID.
3081 The `sr-name` should point to an existing submit-requirement and the
3082 `refs-config-change-id` must be a valid change identifier for a change in the
3083 refs/meta/config branch, otherwise the request would fail with
3084 `400 Bad Request`.
Youssef Elghareebd5986932021-10-15 11:45:23 +02003085
3086Note that this endpoint does not modify the change resource.
3087
3088.Request
3089----
3090 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check.submit_requirement HTTP/1.0
3091 Content-Type: application/json; charset=UTF-8
3092
3093 {
3094 "name": "Code-Review",
3095 "submittability_expression": "label:Code-Review=+2"
3096 }
3097----
3098
3099As response a link:#submit-requirement-result-info[SubmitRequirementResultInfo]
3100entity is returned that describes the submit requirement result.
3101
3102.Response
3103----
3104 HTTP/1.1 200 OK
3105 Content-Disposition: attachment
3106 Content-Type: application/json; charset=UTF-8
3107
3108 )]}'
3109 {
3110 "name": "Code-Review",
3111 "status": "SATISFIED",
3112 "submittability_expression_result": {
3113 "expression": "label:Code-Review=+2",
3114 "fulfilled": true,
3115 "passingAtoms": [
3116 "label:Code-Review=+2"
3117 ]
3118 },
3119 "is_legacy": false
3120 }
3121----
3122
David Ostrovsky1a49f622014-07-29 00:40:02 +02003123[[edit-endpoints]]
3124== Change Edit Endpoints
3125
David Ostrovsky1a49f622014-07-29 00:40:02 +02003126[[get-edit-detail]]
3127=== Get Change Edit Details
3128--
3129'GET /changes/link:#change-id[\{change-id\}]/edit
3130--
3131
Nitzan Gur-Furmancbf9a8f2023-03-08 13:21:18 +01003132Retrieves the details of the change edit done by the caller to the given change.
David Ostrovsky1a49f622014-07-29 00:40:02 +02003133
3134.Request
3135----
3136 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3137----
3138
3139As response an link:#edit-info[EditInfo] entity is returned that
3140describes the change edit, or "`204 No Content`" when change edit doesn't
3141exist for this change. Change edits are stored on special branches and there
3142can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02003143When request parameter `list` is provided the response also includes the file
3144list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02003145against this base revision. When request parameter `download-commands` is
3146provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02003147
3148.Response
3149----
3150 HTTP/1.1 200 OK
3151 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003152 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02003153
3154 )]}'
3155 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003156 "commit": {
3157 "parents": [
David Ostrovsky1a49f622014-07-29 00:40:02 +02003158 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003159 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
David Ostrovsky1a49f622014-07-29 00:40:02 +02003160 }
3161 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01003162 "author": {
3163 "name": "Shawn O. Pearce",
3164 "email": "sop@google.com",
3165 "date": "2012-04-24 18:08:08.000000000",
3166 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02003167 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01003168 "committer": {
3169 "name": "Shawn O. Pearce",
3170 "email": "sop@google.com",
3171 "date": "2012-04-24 18:08:08.000000000",
3172 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02003173 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01003174 "subject": "Use an EventBus to manage star icons",
3175 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
David Ostrovsky1a49f622014-07-29 00:40:02 +02003176 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01003177 "base_patch_set_number": 1,
3178 "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3",
3179 "ref": "refs/users/01/1000001/edit-76482/1"
David Ostrovsky1a49f622014-07-29 00:40:02 +02003180 }
3181----
David Pursehouse4e38b972014-05-30 10:36:40 +09003182
David Ostrovskya5ab8292014-08-01 02:11:39 +02003183[[put-edit-file]]
3184=== Change file content in Change Edit
3185--
3186'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
3187--
3188
3189Put content of a file to a change edit.
3190
3191.Request
3192----
3193 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3194----
3195
Paladox none28920b42020-02-22 19:28:21 +00003196To upload a file as binary data in the request body:
3197
3198.Request
3199----
3200 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3201 Content-Type: application/json; charset=UTF-8
3202
3203 {
jtrinh4ca10412022-10-04 10:05:34 -07003204 "binary_content": "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==",
3205 "file_mode": 100755
Paladox none28920b42020-02-22 19:28:21 +00003206 }
3207----
3208
3209Note that it must be base-64 encoded data uri.
3210
jtrinh4ca10412022-10-04 10:05:34 -07003211The "file_mode" field is optional, and if provided must be in octal format. The field
3212indicates whether the file is executable or not and has a value of either 100755
3213(executable) or 100644 (not executable). If it's unset, this indicates no change
3214has been made. New files default to not being executable if this parameter is not
3215provided
3216
David Ostrovskya5ab8292014-08-01 02:11:39 +02003217When change edit doesn't exist for this change yet it is created. When file
3218content isn't provided, it is wiped out for that file. As response
3219"`204 No Content`" is returned.
3220
3221.Response
3222----
3223 HTTP/1.1 204 No Content
3224----
3225
Gal Paikin68d217b2019-10-07 21:01:22 +02003226When the change edit is a no-op, for example when providing the same file
3227content that the file already has, '409 no changes were made' is returned.
3228
3229.Response
3230----
3231 HTTP/1.1 409 no changes were made
3232----
3233
David Ostrovsky138edb42014-08-15 21:31:43 +02003234[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01003235=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02003236--
3237'POST /changes/link:#change-id[\{change-id\}]/edit
3238--
3239
David Ostrovskya00c9532015-01-21 00:17:49 +01003240Creates empty change edit, restores file content or renames files in change
3241edit. The request body needs to include a
3242link:#change-edit-input[ChangeEditInput] entity when a file within change
3243edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02003244
3245.Request
3246----
3247 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003248 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02003249
3250 {
David Ostrovskybd12e172014-08-21 23:08:15 +02003251 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02003252 }
3253----
3254
David Ostrovskya00c9532015-01-21 00:17:49 +01003255or for rename:
3256
3257.Request
3258----
3259 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3260 Content-Type: application/json; charset=UTF-8
3261
3262 {
3263 "old_path": "foo",
3264 "new_path": "bar"
3265 }
3266----
3267
David Ostrovsky138edb42014-08-15 21:31:43 +02003268When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01003269and restore flag are provided in request body, this file is restored. When
3270old and new file names are provided, the file is renamed. As response
3271"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02003272
3273.Response
3274----
3275 HTTP/1.1 204 No Content
3276----
3277
David Ostrovskyc967e152014-10-24 17:36:16 +02003278[[put-change-edit-message]]
3279=== Change commit message in Change Edit
3280--
3281'PUT /changes/link:#change-id[\{change-id\}]/edit:message
3282--
3283
3284Modify commit message. The request body needs to include a
3285link:#change-edit-message-input[ChangeEditMessageInput]
3286entity.
3287
3288.Request
3289----
3290 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003291 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02003292
3293 {
3294 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
3295 }
3296----
3297
3298If a change edit doesn't exist for this change yet, it is created. As
3299response "`204 No Content`" is returned.
3300
3301.Response
3302----
3303 HTTP/1.1 204 No Content
3304----
3305
David Ostrovsky2830c292014-08-01 02:24:31 +02003306[[delete-edit-file]]
3307=== Delete file in Change Edit
3308--
3309'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
3310--
3311
3312Deletes a file from a change edit. This deletes the file from the repository
3313completely. This is not the same as reverting or restoring a file to its
3314previous contents.
3315
3316.Request
3317----
3318 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3319----
3320
3321When change edit doesn't exist for this change yet it is created.
3322
3323.Response
3324----
3325 HTTP/1.1 204 No Content
3326----
3327
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003328[[get-edit-file]]
3329=== Retrieve file content from Change Edit
3330--
3331'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
3332--
3333
3334Retrieves content of a file from a change edit.
3335
3336.Request
3337----
3338 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3339----
3340
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003341The content of the file is returned as text encoded inside base64.
3342The Content-Type header will always be `text/plain` reflecting the
3343outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
3344can be examined to find the server detected content type of the file.
3345
3346When the specified file was deleted in the change edit
3347"`204 No Content`" is returned.
3348
3349If only the content type is required, callers should use HEAD to
3350avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003351
Michael Zhou551ad0c2016-04-26 01:21:42 -04003352If the `base` parameter is set to true, the returned content is from the
3353revision that the edit is based on.
3354
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003355.Response
3356----
3357 HTTP/1.1 200 OK
3358 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003359 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003360 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003361 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003362
3363 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
3364----
3365
David Ostrovskyd0078672015-02-06 21:51:04 +01003366Alternatively, if the only value of the Accept request header is
3367`application/json` the content is returned as JSON string and
3368`X-FYI-Content-Encoding` is set to `json`.
3369
David Ostrovsky9ea9c112015-01-25 00:12:38 +01003370[[get-edit-meta-data]]
3371=== Retrieve meta data of a file from Change Edit
3372--
3373'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
3374--
3375
3376Retrieves meta data of a file from a change edit. Currently only
3377web links are returned.
3378
3379.Request
3380----
3381 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
3382----
3383
3384This REST endpoint retrieves additional information for a file in a
3385change edit. As result an link:#edit-file-info[EditFileInfo] entity is
3386returned.
3387
3388.Response
3389----
3390 HTTP/1.1 200 OK
3391 Content-Disposition: attachment
3392 Content-Type: application/json; charset=UTF-8
3393
3394 )]}'
3395 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003396 "web_links": [
David Ostrovsky9ea9c112015-01-25 00:12:38 +01003397 {
3398 "show_on_side_by_side_diff_view": true,
3399 "name": "side-by-side preview diff",
3400 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
3401 "url": "#/x/xdocs/c/42/1..0/README.md",
3402 "target": "_self"
3403 },
3404 {
3405 "show_on_unified_diff_view": true,
3406 "name": "unified preview diff",
3407 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
3408 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
3409 "target": "_self"
3410 }
3411 ]}
3412----
3413
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003414[[get-edit-message]]
3415=== Retrieve commit message from Change Edit or current patch set of the change
3416--
3417'GET /changes/link:#change-id[\{change-id\}]/edit:message
3418--
3419
David Ostrovsky25ad15e2014-12-15 21:18:59 +01003420Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003421
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02003422If the `base` parameter is set to true, the returned message is from the
3423revision that the edit is based on.
3424
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003425.Request
3426----
3427 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
3428----
3429
3430The commit message is returned as base64 encoded string.
3431
3432.Response
3433----
3434 HTTP/1.1 200 OK
3435
3436 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
3437M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
3438----
3439
David Ostrovskyd0078672015-02-06 21:51:04 +01003440Alternatively, if the only value of the Accept request header is
3441`application/json` the commit message is returned as JSON string:
3442
3443.Response
3444----
3445 HTTP/1.1 200 OK
3446
3447)]}'
3448"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
3449----
3450
3451
David Ostrovskye9988f92014-08-01 09:56:34 +02003452[[publish-edit]]
3453=== Publish Change Edit
3454--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003455'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02003456--
3457
3458Promotes change edit to a regular patch set.
3459
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003460Options can be provided in the request body as a
3461link:#publish-change-edit-input[PublishChangeEditInput] entity.
3462
David Ostrovskye9988f92014-08-01 09:56:34 +02003463.Request
3464----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003465 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003466 Content-Type: application/json; charset=UTF-8
3467
3468 {
3469 "notify": "NONE"
3470 }
David Ostrovskye9988f92014-08-01 09:56:34 +02003471----
3472
3473As response "`204 No Content`" is returned.
3474
3475.Response
3476----
3477 HTTP/1.1 204 No Content
3478----
3479
David Ostrovsky46999d22014-08-16 02:19:13 +02003480[[rebase-edit]]
3481=== Rebase Change Edit
3482--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003483'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02003484--
3485
3486Rebases change edit on top of latest patch set.
3487
3488.Request
3489----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003490 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02003491----
3492
3493When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09003494"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02003495based on top of the latest patch set, the response
3496"`409 Conflict`" is returned.
3497
3498.Response
3499----
3500 HTTP/1.1 204 No Content
3501----
3502
David Ostrovsky8e75f502014-08-10 00:36:31 +02003503[[delete-edit]]
3504=== Delete Change Edit
3505--
3506'DELETE /changes/link:#change-id[\{change-id\}]/edit'
3507--
3508
3509Deletes change edit.
3510
3511.Request
3512----
3513 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3514----
3515
3516As response "`204 No Content`" is returned.
3517
3518.Response
3519----
3520 HTTP/1.1 204 No Content
3521----
3522
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01003523
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003524[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003525== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003526
3527[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003528=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003529--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003530'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003531--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003532
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003533Lists the reviewers of a change.
3534
3535As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
3536
3537.Request
3538----
3539 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
3540----
3541
3542.Response
3543----
3544 HTTP/1.1 200 OK
3545 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003546 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003547
3548 )]}'
3549 [
3550 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003551 "approvals": {
3552 "Verified": "+1",
3553 "Code-Review": "+2"
3554 },
3555 "_account_id": 1000096,
3556 "name": "John Doe",
3557 "email": "john.doe@example.com"
3558 },
3559 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003560 "approvals": {
3561 "Verified": " 0",
3562 "Code-Review": "-1"
3563 },
3564 "_account_id": 1000097,
3565 "name": "Jane Roe",
3566 "email": "jane.roe@example.com"
3567 }
3568 ]
3569----
3570
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003571[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003572=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003573--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003574'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003575--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003576
3577Suggest the reviewers for a given query `q` and result limit `n`. If result
3578limit is not passed, then the default 10 is used.
3579
Edwin Kempin2639eaa2019-08-27 09:47:27 +02003580This REST endpoint only suggests accounts that
3581
3582* are active
3583* can see the change
3584* are visible to the calling user
3585* are not already reviewer on the change
3586* don't own the change
Edwin Kempinad55dde2021-09-28 11:30:55 +02003587* are not service users (unless
3588 link:config.html#suggest.skipServiceUsers[skipServiceUsers] is set to `false`)
Edwin Kempin2639eaa2019-08-27 09:47:27 +02003589
Edwin Kempinec02a552019-08-27 09:30:15 +02003590Groups can be excluded from the results by specifying the 'exclude-groups'
3591request parameter:
3592
3593--
3594'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups'
3595--
Patrick Hieselc79ae0e2017-06-28 14:50:53 +02003596
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003597As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
3598
3599.Request
3600----
3601 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
3602----
3603
3604.Response
3605----
3606 HTTP/1.1 200 OK
3607 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003608 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003609
3610 )]}'
3611 [
3612 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003613 "account": {
3614 "_account_id": 1000097,
3615 "name": "Jane Roe",
3616 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003617 },
3618 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003619 },
3620 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003621 "group": {
3622 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
3623 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003624 },
3625 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003626 }
3627 ]
3628----
3629
Edwin Kempin0ca3f722019-08-27 09:43:31 +02003630To suggest CCs `reviewer-state=CC` can be specified as additional URL
3631parameter. This includes existing reviewers in the result, but excludes
3632existing CCs.
3633
3634--
3635'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC'
3636--
3637
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003638[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003639=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003640--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003641'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 -08003642--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003643
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003644Retrieves a reviewer of a change.
3645
3646As response a link:#reviewer-info[ReviewerInfo] entity is returned that
3647describes the reviewer.
3648
3649.Request
3650----
3651 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
3652----
3653
3654.Response
3655----
3656 HTTP/1.1 200 OK
3657 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003658 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003659
3660 )]}'
3661 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003662 "approvals": {
3663 "Verified": "+1",
3664 "Code-Review": "+2"
3665 },
3666 "_account_id": 1000096,
3667 "name": "John Doe",
3668 "email": "john.doe@example.com"
3669 }
3670----
3671
Edwin Kempin392328e2013-02-25 12:50:03 +01003672[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003673=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003674--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003675'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003676--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003677
Edwin Kempin392328e2013-02-25 12:50:03 +01003678Adds one user or all members of one group as reviewer to the change.
3679
3680The reviewer to be added to the change must be provided in the request
3681body as a link:#reviewer-input[ReviewerInput] entity.
3682
Edwin Kempinf9f19412019-08-28 09:28:51 +02003683Users can be moved from reviewer to CC and vice versa. This means if a
3684user is added as CC that is already a reviewer on the change, the
3685reviewer state of that user is updated to CC. If a user that is already
3686a CC on the change is added as reviewer, the reviewer state of that
3687user is updated to reviewer.
3688
Gal Paikinc326de42020-06-16 18:49:00 +03003689Adding a new reviewer also adds that reviewer to the attention set, unless
3690the change is work in progress.
3691Also, moving a reviewer to CC removes that user from the attention set.
3692
Edwin Kempin392328e2013-02-25 12:50:03 +01003693.Request
3694----
3695 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003696 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003697
3698 {
3699 "reviewer": "john.doe@example.com"
3700 }
3701----
3702
Gal Paikin721a40b2021-04-15 09:30:00 +02003703As response an link:#reviewer-result[ReviewerResult] entity is
Edwin Kempin392328e2013-02-25 12:50:03 +01003704returned that describes the newly added reviewers.
3705
3706.Response
3707----
3708 HTTP/1.1 200 OK
3709 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003710 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003711
3712 )]}'
3713 {
Aaron Gable8c650212017-04-25 12:03:37 -07003714 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01003715 "reviewers": [
3716 {
Aaron Gable8c650212017-04-25 12:03:37 -07003717 "_account_id": 1000096,
3718 "name": "John Doe",
3719 "email": "john.doe@example.com"
Edwin Kempin392328e2013-02-25 12:50:03 +01003720 "approvals": {
3721 "Verified": " 0",
3722 "Code-Review": " 0"
3723 },
Edwin Kempin392328e2013-02-25 12:50:03 +01003724 }
3725 ]
3726 }
3727----
3728
3729If a group is specified, adding the group members as reviewers is an
3730atomic operation. This means if an error is returned, none of the
3731members are added as reviewer.
3732
3733If a group with many members is added as reviewer a confirmation may be
3734required.
3735
Edwin Kempinf9f19412019-08-28 09:28:51 +02003736If a group is added as CC and members of this group are already
3737reviewers on the change, these members stay reviewers on the change
3738(they are not downgraded to CC). However if a group is added as
3739reviewer, all group members become reviewer of the change, even if they
3740have been added as CC before.
3741
Edwin Kempin392328e2013-02-25 12:50:03 +01003742.Request
3743----
3744 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003745 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003746
3747 {
3748 "reviewer": "MyProjectVerifiers"
3749 }
3750----
3751
3752.Response
3753----
3754 HTTP/1.1 200 OK
3755 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003756 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003757
3758 )]}'
3759 {
Logan Hanks23e70282016-07-06 14:31:56 -07003760 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01003761 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3762 "confirm": true
3763 }
3764----
3765
3766To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01003767`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01003768
3769.Request
3770----
3771 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003772 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003773
3774 {
Logan Hanks23e70282016-07-06 14:31:56 -07003775 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01003776 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01003777 }
3778----
3779
Patrick Hiesel11873ef2017-03-17 17:36:05 +01003780If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
3781for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
3782an email address of a reviewer or CC then, they will be added to the change even if they
3783don't have a Gerrit account.
3784
3785If this option is disabled, the request would fail with `400 Bad Request` if the email
3786address can't be resolved to an active Gerrit account.
3787
3788Note that the name is optional so both "un.registered@reviewer.com" and
3789"John Doe <un.registered@reviewer.com>" are valid inputs.
3790
3791Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
3792
3793.Request
3794----
3795 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
3796 Content-Type: application/json; charset=UTF-8
3797
3798 {
3799 "reviewer": "John Doe <un.registered@reviewer.com>"
3800 }
3801----
3802
3803.Response
3804----
3805 HTTP/1.1 200 OK
3806 Content-Disposition: attachment
3807 Content-Type: application/json; charset=UTF-8
3808
3809 )]}'
3810 {
3811 "input": "John Doe <un.registered@reviewer.com>"
3812 }
3813----
3814
Logan Hanksf03040e2017-05-03 09:40:56 -07003815.Notifications
3816
3817An email will be sent using the "newchange" template.
3818
3819[options="header",cols="1,1,1"]
3820|=============================
3821|WIP State |Default|notify=ALL
3822|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3823|Work in progress|not sent|owner, reviewers, CCs
3824|=============================
3825
Edwin Kempin53301072013-02-25 12:57:07 +01003826[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003827=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003828--
Edwin Kempin407fca32016-08-29 12:01:00 +02003829'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
3830'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 -08003831--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003832
Edwin Kempin53301072013-02-25 12:57:07 +01003833Deletes a reviewer from a change.
Gal Paikinc326de42020-06-16 18:49:00 +03003834Deleting a reviewer also removes that user from the attention set.
Edwin Kempin53301072013-02-25 12:57:07 +01003835
3836.Request
3837----
3838 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02003839 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3840----
3841
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003842Options can be provided in the request body as a
3843link:#delete-reviewer-input[DeleteReviewerInput] entity.
3844Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003845link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003846In this case, use a POST request instead:
Edwin Kempin407fca32016-08-29 12:01:00 +02003847
3848.Request
3849----
3850 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3851 Content-Type: application/json; charset=UTF-8
3852
3853 {
3854 "notify": "NONE"
3855 }
Edwin Kempin53301072013-02-25 12:57:07 +01003856----
3857
3858.Response
3859----
3860 HTTP/1.1 204 No Content
3861----
3862
Logan Hanks87607412017-05-30 13:49:04 -07003863.Notifications
3864
3865An email will be sent using the "deleteReviewer" template. If deleting the
3866reviewer resulted in one or more approvals being removed, then the deleted
3867reviewer will also receive a notification (unless notify=NONE).
3868
3869[options="header",cols="1,5"]
3870|=============================
3871|WIP State |Default Recipients
3872|Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers
3873|Work in progress|notify=NONE: deleted reviewer (if voted)
3874|=============================
3875
David Ostrovskybeb0b842014-12-13 00:24:29 +01003876[[list-votes]]
3877=== List Votes
3878--
3879'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
3880--
3881
3882Lists the votes for a specific reviewer of the change.
3883
3884.Request
3885----
Edwin Kempin314f10a2016-07-11 11:39:05 +02003886 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01003887----
3888
3889As result a map is returned that maps the label name to the label value.
3890The entries in the map are sorted by label name.
3891
3892.Response
3893----
3894 HTTP/1.1 200 OK
3895 Content-Disposition: attachment
3896 Content-Type: application/json;charset=UTF-8
3897
3898 )]}'
3899 {
3900 "Code-Review": -1,
3901 "Verified": 1
3902 "Work-In-Progress": 1,
3903 }
3904----
3905
3906[[delete-vote]]
3907=== Delete Vote
3908--
Edwin Kempin5488dc12016-08-29 11:13:31 +02003909'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 +02003910'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 +01003911--
3912
3913Deletes a single vote from a change. Note, that even when the last vote of
3914a reviewer is removed the reviewer itself is still listed on the change.
3915
Gal Paikin6ce56dc2021-03-29 12:28:43 +02003916If another user removed a user's vote, the user with the deleted vote will be
3917added to the attention set.
3918
Dmitrii Filippov3e0bbb72023-02-22 12:57:00 +01003919The request returns:
3920 * '204 No Content' if the vote is deleted successfully;
3921 * '404 Not Found' when the vote to be deleted is zero or not present.
3922
David Ostrovskybeb0b842014-12-13 00:24:29 +01003923.Request
3924----
3925 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003926 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3927----
3928
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003929Options can be provided in the request body as a
3930link:#delete-vote-input[DeleteVoteInput] entity.
3931Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003932link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003933In this case, use a POST request instead:
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003934
3935.Request
3936----
3937 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3938 Content-Type: application/json; charset=UTF-8
3939
3940 {
3941 "notify": "NONE"
3942 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01003943----
3944
3945.Response
3946----
3947 HTTP/1.1 204 No Content
3948----
3949
Logan Hanksa1e68dc2017-06-29 15:13:27 -07003950
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003951[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003952== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003953
Shawn Pearce728ba882013-07-08 23:13:08 -07003954[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003955=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003956--
Shawn Pearce728ba882013-07-08 23:13:08 -07003957'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003958--
Shawn Pearce728ba882013-07-08 23:13:08 -07003959
3960Retrieves a parsed commit of a revision.
3961
3962.Request
3963----
3964 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
3965----
3966
3967As response a link:#commit-info[CommitInfo] entity is returned that
3968describes the revision.
3969
3970.Response
3971----
3972 HTTP/1.1 200 OK
3973 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003974 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07003975
3976 )]}'
3977 {
Edwin Kempinc8237402015-07-15 18:27:55 +02003978 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07003979 "parents": [
3980 {
3981 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3982 "subject": "Migrate contributor agreements to All-Projects."
3983 }
3984 ],
3985 "author": {
3986 "name": "Shawn O. Pearce",
3987 "email": "sop@google.com",
3988 "date": "2012-04-24 18:08:08.000000000",
3989 "tz": -420
3990 },
3991 "committer": {
3992 "name": "Shawn O. Pearce",
3993 "email": "sop@google.com",
3994 "date": "2012-04-24 18:08:08.000000000",
3995 "tz": -420
3996 },
3997 "subject": "Use an EventBus to manage star icons",
3998 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3999 }
4000----
4001
Sven Selbergd26bd542014-11-21 16:28:10 +01004002Adding query parameter `links` (for example `/changes/.../commit?links`)
4003returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07004004
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08004005[[get-description]]
4006=== Get Description
4007--
4008'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
4009--
4010
4011Retrieves the description of a patch set.
4012
4013.Request
4014----
4015 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
4016----
4017
4018.Response
4019----
4020 HTTP/1.1 200 OK
4021 Content-Disposition: attachment
4022 Content-Type: application/json; charset=UTF-8
4023
4024 )]}'
4025 "Added Documentation"
4026----
4027
4028If the patch set does not have a description an empty string is returned.
4029
4030[[set-description]]
4031=== Set Description
4032--
4033'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
4034--
4035
4036Sets the description of a patch set.
4037
4038The new description must be provided in the request body inside a
4039link:#description-input[DescriptionInput] entity.
4040
4041.Request
4042----
4043 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
4044 Content-Type: application/json; charset=UTF-8
4045
4046 {
4047 "description": "Added Documentation"
4048 }
4049----
4050
4051As response the new description is returned.
4052
4053.Response
4054----
4055 HTTP/1.1 200 OK
4056 Content-Disposition: attachment
4057 Content-Type: application/json; charset=UTF-8
4058
4059 )]}'
4060 "Added Documentation"
4061----
4062
Edwin Kempin0f229442016-09-09 13:06:12 +02004063[[get-merge-list]]
4064=== Get Merge List
4065--
4066'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
4067--
4068
4069Returns the list of commits that are being integrated into a target
4070branch by a merge commit. By default the first parent is assumed to be
4071uninteresting. By using the `parent` option another parent can be set
4072as uninteresting (parents are 1-based).
4073
4074The list of commits is returned as a list of
4075link:#commit-info[CommitInfo] entities. Web links are only included if
4076the `links` option was set.
4077
4078.Request
4079----
4080 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
4081----
4082
4083.Response
4084----
4085HTTP/1.1 200 OK
4086 Content-Disposition: attachment
4087 Content-Type: application/json; charset=UTF-8
4088
4089 )]}'
4090 [
4091 {
4092 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
4093 "parents": [
4094 {
4095 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
4096 "subject": "Migrate contributor agreements to All-Projects."
4097 }
4098 ],
4099 "author": {
4100 "name": "Shawn O. Pearce",
4101 "email": "sop@google.com",
4102 "date": "2012-04-24 18:08:08.000000000",
4103 "tz": -420
4104 },
4105 "committer": {
4106 "name": "Shawn O. Pearce",
4107 "email": "sop@google.com",
4108 "date": "2012-04-24 18:08:08.000000000",
4109 "tz": -420
4110 },
4111 "subject": "Use an EventBus to manage star icons",
4112 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
4113 }
4114 ]
4115----
4116
Stefan Bellerc7259662015-02-12 17:23:05 -08004117[[get-revision-actions]]
4118=== Get Revision Actions
4119--
4120'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
4121--
4122
4123Retrieves revision link:#action-info[actions] of the revision of a change.
4124
4125.Request
4126----
4127 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
4128----
4129
4130.Response
4131----
4132 HTTP/1.1 200 OK
4133 Content-Disposition: attachment
4134 Content-Type: application/json; charset=UTF-8
4135
4136 )]}'
4137
4138{
4139 "submit": {
4140 "method": "POST",
4141 "label": "Submit",
4142 "title": "Submit patch set 1 into master",
4143 "enabled": true
4144 },
4145 "cherrypick": {
4146 "method": "POST",
4147 "label": "Cherry Pick",
4148 "title": "Cherry pick change to a different branch",
4149 "enabled": true
4150 }
4151}
4152----
4153
Han-Wen Nienhuys86db7672021-08-10 12:45:58 +02004154The response is a flat map of possible revision REST endpoint names
4155mapped to their link:#action-info[ActionInfo].
Stefan Bellerc7259662015-02-12 17:23:05 -08004156
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004157[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004158=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004159--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004160'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004161--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004162
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004163Retrieves a review of a revision.
4164
4165.Request
4166----
4167 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
4168----
4169
4170As response a link:#change-info[ChangeInfo] entity with
4171link:#detailed-labels[detailed labels] and link:#detailed-accounts[
4172detailed accounts] is returned that describes the review of the
4173revision. The revision for which the review is retrieved is contained
4174in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05004175set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004176revision of the change. Please note that the returned labels are always
4177for the current patch set.
4178
4179.Response
4180----
4181 HTTP/1.1 200 OK
4182 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004183 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004184
4185 )]}'
4186 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004187 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
4188 "project": "myProject",
4189 "branch": "master",
4190 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
4191 "subject": "Implementing Feature X",
4192 "status": "NEW",
4193 "created": "2013-02-01 09:59:32.126000000",
4194 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004195 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004196 "insertions": 34,
4197 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004198 "_number": 3965,
4199 "owner": {
4200 "_account_id": 1000096,
4201 "name": "John Doe",
4202 "email": "john.doe@example.com"
4203 },
4204 "labels": {
4205 "Verified": {
4206 "all": [
4207 {
4208 "value": 0,
4209 "_account_id": 1000096,
4210 "name": "John Doe",
4211 "email": "john.doe@example.com"
4212 },
4213 {
4214 "value": 0,
4215 "_account_id": 1000097,
4216 "name": "Jane Roe",
4217 "email": "jane.roe@example.com"
4218 }
4219 ],
4220 "values": {
4221 "-1": "Fails",
4222 " 0": "No score",
4223 "+1": "Verified"
4224 }
4225 },
4226 "Code-Review": {
4227 "all": [
4228 {
4229 "value": -1,
4230 "_account_id": 1000096,
4231 "name": "John Doe",
4232 "email": "john.doe@example.com"
4233 },
4234 {
4235 "value": 1,
4236 "_account_id": 1000097,
4237 "name": "Jane Roe",
4238 "email": "jane.roe@example.com"
4239 }
4240 ]
4241 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01004242 "-2": "This shall not be submitted",
4243 "-1": "I would prefer this is not submitted as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004244 " 0": "No score",
4245 "+1": "Looks good to me, but someone else must approve",
4246 "+2": "Looks good to me, approved"
4247 }
4248 }
4249 },
4250 "permitted_labels": {
4251 "Verified": [
4252 "-1",
4253 " 0",
4254 "+1"
4255 ],
4256 "Code-Review": [
4257 "-2",
4258 "-1",
4259 " 0",
4260 "+1",
4261 "+2"
4262 ]
4263 },
4264 "removable_reviewers": [
4265 {
4266 "_account_id": 1000096,
4267 "name": "John Doe",
4268 "email": "john.doe@example.com"
4269 },
4270 {
4271 "_account_id": 1000097,
4272 "name": "Jane Roe",
4273 "email": "jane.roe@example.com"
4274 }
4275 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08004276 "reviewers": {
4277 "REVIEWER": [
4278 {
4279 "_account_id": 1000096,
4280 "name": "John Doe",
4281 "email": "john.doe@example.com"
4282 },
4283 {
4284 "_account_id": 1000097,
4285 "name": "Jane Roe",
4286 "email": "jane.roe@example.com"
4287 }
4288 ]
4289 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004290 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
4291 "revisions": {
4292 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09004293 "kind": "REWORK",
4294 "_number": 2,
4295 "ref": "refs/changes/65/3965/2",
4296 "fetch": {
4297 "http": {
4298 "url": "http://gerrit/myProject",
4299 "ref": "refs/changes/65/3965/2"
4300 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004301 }
4302 }
4303 }
4304 }
4305----
4306
David Pursehouse669f2512014-07-18 11:41:42 +09004307[[get-related-changes]]
4308=== Get Related Changes
4309--
4310'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
4311--
4312
4313Retrieves related changes of a revision. Related changes are changes that either
4314depend on, or are dependencies of the revision.
4315
Joerg Zieren75e95382022-07-08 11:30:35 +02004316Additional fields can be obtained by adding `o` parameters. Since these may slow
4317down processing they are disabled by default. Currently a single parameter is
4318supported:
4319
4320[[get-related-changes-submittable]]
4321--
4322* `SUBMITTABLE`: Compute the `submittable` field in the returned
4323 link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities.
4324--
4325
David Pursehouse669f2512014-07-18 11:41:42 +09004326.Request
4327----
4328 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
4329----
4330
4331As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
4332describing the related changes.
4333
4334.Response
4335----
4336 HTTP/1.1 200 OK
4337 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004338 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09004339
4340 )]}'
4341 {
4342 "changes": [
4343 {
Patrick Hieselcab63512017-07-28 10:25:42 +02004344 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09004345 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
4346 "commit": {
4347 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
4348 "parents": [
4349 {
4350 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
4351 }
4352 ],
4353 "author": {
4354 "name": "David Ostrovsky",
4355 "email": "david@ostrovsky.org",
4356 "date": "2014-07-12 15:04:24.000000000",
4357 "tz": 120
4358 },
4359 "subject": "Remove Solr"
4360 },
4361 "_change_number": 58478,
4362 "_revision_number": 2,
4363 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07004364 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09004365 },
4366 {
Patrick Hieselcab63512017-07-28 10:25:42 +02004367 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09004368 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
4369 "commit": {
4370 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
4371 "parents": [
4372 {
4373 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
4374 }
4375 ],
4376 "author": {
4377 "name": "David Pursehouse",
4378 "email": "david.pursehouse@sonymobile.com",
4379 "date": "2014-06-24 02:01:28.000000000",
4380 "tz": 540
4381 },
4382 "subject": "Add support for secondary index with Elasticsearch"
4383 },
4384 "_change_number": 58081,
4385 "_revision_number": 10,
4386 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07004387 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09004388 }
4389 ]
4390 }
4391----
4392
4393
Edwin Kempin67498de2013-02-25 16:15:34 +01004394[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004395=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004396--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004397'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004398--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004399
Logan Hanksf03040e2017-05-03 09:40:56 -07004400Sets a review on a revision, optionally also publishing draft comments, setting
Logan Hanks53c36012017-06-30 13:47:54 -07004401labels, adding reviewers or CCs, and modifying the work in progress property.
Edwin Kempin67498de2013-02-25 16:15:34 +01004402
4403The review must be provided in the request body as a
4404link:#review-input[ReviewInput] entity.
4405
Youssef Elghareeb12add162019-12-18 18:43:23 +01004406If the labels are set, the user sending the request will automatically be
4407added as a reviewer, otherwise (if they only commented) they are added to
4408the CC list.
4409
Gal Paikinc326de42020-06-16 18:49:00 +03004410Some updates to the attention set occur here. If more than one update should
4411occur, only the first update in the order of the below documentation occurs:
4412
4413If a user is part of remove_from_attention_set, the user will be explicitly
4414removed from the attention set.
4415
4416If a user is part of add_to_attention_set, the user will be explicitly
4417added to the attention set.
4418
4419If the boolean ignore_default_attention_set_rules is set to true, all
4420other rules below will be ignored:
4421
4422The user who created the review is removed from the attention set.
4423
4424If the change is ready for review, the following also apply:
4425
4426When the uploader replies, the owner is added to the attention set.
4427
4428When the owner or uploader replies, all the reviewers are added to
4429the attention set.
4430
4431When neither the owner nor the uploader replies, add the owner and the
4432uploader to the attention set.
4433
4434Then, new reviewers are added to the attention set, and removed reviewers
4435(by becoming CC) are removed from the attention set.
4436
Aaron Gable8c650212017-04-25 12:03:37 -07004437A review cannot be set on a change edit. Trying to post a review for a
4438change edit fails with `409 Conflict`.
4439
Logan Hanksf03040e2017-05-03 09:40:56 -07004440Here is an example of using this method to set labels:
Aaron Gable8c650212017-04-25 12:03:37 -07004441
Edwin Kempin67498de2013-02-25 16:15:34 +01004442.Request
4443----
4444 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004445 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01004446
4447 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004448 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01004449 "message": "Some nits need to be fixed.",
4450 "labels": {
4451 "Code-Review": -1
4452 },
4453 "comments": {
4454 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4455 {
4456 "line": 23,
4457 "message": "[nit] trailing whitespace"
4458 },
4459 {
4460 "line": 49,
4461 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09004462 },
4463 {
4464 "range": {
4465 "start_line": 50,
4466 "start_character": 0,
4467 "end_line": 55,
4468 "end_character": 20
4469 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09004470 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01004471 }
4472 ]
4473 }
4474 }
4475----
4476
Aaron Gable843b0c12017-04-21 08:25:27 -07004477As response a link:#review-result[ReviewResult] entity is returned that
Aaron Gable8c650212017-04-25 12:03:37 -07004478describes the applied labels and any added reviewers (e.g. yourself,
4479if you set a label but weren't previously a reviewer on this CL).
Edwin Kempin67498de2013-02-25 16:15:34 +01004480
4481.Response
4482----
4483 HTTP/1.1 200 OK
4484 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004485 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01004486
4487 )]}'
4488 {
4489 "labels": {
4490 "Code-Review": -1
4491 }
4492 }
4493----
4494
Aaron Gable8c650212017-04-25 12:03:37 -07004495It is also possible to add one or more reviewers or CCs
Logan Hanksf03040e2017-05-03 09:40:56 -07004496to a change simultaneously with a review:
Logan Hanks5f1c7592016-07-06 14:39:33 -07004497
4498.Request
4499----
4500 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
4501 Content-Type: application/json; charset=UTF-8
4502
4503 {
Aaron Gable8c650212017-04-25 12:03:37 -07004504 "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 -07004505 "reviewers": [
4506 {
4507 "reviewer": "jane.roe@example.com"
4508 },
4509 {
Aaron Gable8c650212017-04-25 12:03:37 -07004510 "reviewer": "john.doe@example.com",
4511 "state": "CC"
4512 }
4513 {
4514 "reviewer": "MyProjectVerifiers",
Logan Hanks5f1c7592016-07-06 14:39:33 -07004515 }
4516 ]
4517 }
4518----
4519
4520Each element of the `reviewers` list is an instance of
4521link:#reviewer-input[ReviewerInput]. The corresponding result of
Aaron Gable8c650212017-04-25 12:03:37 -07004522adding each reviewer will be returned in a map of inputs to
Gal Paikin721a40b2021-04-15 09:30:00 +02004523link:#reviewer-result[ReviewerResult]s.
Logan Hanks5f1c7592016-07-06 14:39:33 -07004524
4525.Response
4526----
4527 HTTP/1.1 200 OK
4528 Content-Disposition: attachment
4529 Content-Type: application/json; charset=UTF-8
4530
4531 )]}'
4532 {
Aaron Gable8c650212017-04-25 12:03:37 -07004533 "reviewers": {
4534 "jane.roe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004535 "input": "jane.roe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004536 "reviewers": [
4537 {
4538 "_account_id": 1000097,
4539 "name": "Jane Roe",
4540 "email": "jane.roe@example.com"
4541 "approvals": {
4542 "Verified": " 0",
4543 "Code-Review": " 0"
4544 },
4545 },
4546 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004547 },
Aaron Gable8c650212017-04-25 12:03:37 -07004548 "john.doe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004549 "input": "john.doe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004550 "ccs": [
4551 {
4552 "_account_id": 1000096,
4553 "name": "John Doe",
4554 "email": "john.doe@example.com"
4555 "approvals": {
4556 "Verified": " 0",
4557 "Code-Review": " 0"
4558 },
4559 }
4560 ]
4561 },
4562 "MyProjectVerifiers": {
4563 "input": "MyProjectVerifiers",
4564 "reviewers": [
4565 {
4566 "_account_id": 1000098,
4567 "name": "Alice Ansel",
4568 "email": "alice.ansel@example.com"
4569 "approvals": {
4570 "Verified": " 0",
4571 "Code-Review": " 0"
4572 },
4573 },
4574 {
4575 "_account_id": 1000099,
4576 "name": "Bob Bollard",
4577 "email": "bob.bollard@example.com"
4578 "approvals": {
4579 "Verified": " 0",
4580 "Code-Review": " 0"
4581 },
4582 },
4583 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004584 }
Aaron Gable8c650212017-04-25 12:03:37 -07004585 }
Logan Hanks5f1c7592016-07-06 14:39:33 -07004586 }
4587----
4588
Logan Hankse2aacef2016-07-22 15:54:52 -07004589If there are any errors returned for reviewers, the entire review request will
Aaron Gable8c650212017-04-25 12:03:37 -07004590be rejected with `400 Bad Request`. None of the entries will have the
4591`reviewers` or `ccs` field set, and those which specifically failed will have
4592the `errors` field set containing details of why they failed.
Logan Hankse2aacef2016-07-22 15:54:52 -07004593
4594.Error Response
4595----
4596 HTTP/1.1 400 Bad Request
4597 Content-Disposition: attachment
4598 Content-Type: application/json; charset=UTF-8
4599
4600 )]}'
4601 {
4602 "reviewers": {
Aaron Gable8c650212017-04-25 12:03:37 -07004603 "jane.roe@example.com": {
4604 "input": "jane.roe@example.com",
4605 "error": "Account of jane.roe@example.com is inactive."
4606 },
4607 "john.doe@example.com": {
4608 "input": "john.doe@example.com"
4609 },
Logan Hankse2aacef2016-07-22 15:54:52 -07004610 "MyProjectVerifiers": {
4611 "input": "MyProjectVerifiers",
4612 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
4613 "confirm": true
4614 }
4615 }
4616 }
4617----
4618
Dave Borowitzd2e41452017-10-26 08:06:23 -04004619[[set-review-notifications]]
Logan Hanksfc055962017-06-12 14:20:53 -07004620.Notifications
4621
4622An email will be sent using the "comment" template.
4623
4624If the top-level notify property is null or not set, then notification behavior
4625depends on whether the change is WIP, whether it has started review, and whether
4626the tag property is null.
4627
4628NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*.
4629Use the notify property of the top-level link:#review-input[ReviewInput] instead.
4630
4631For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS
4632watchers*.
4633
Logan Hanksea3e3b72017-06-12 14:21:47 -07004634[options="header",cols="2,1,1,2,2"]
Logan Hanksfc055962017-06-12 14:20:53 -07004635|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004636|WIP State |Review Started|Tag Given|Default |notify=ALL
4637|Ready for review|N/A |N/A |everyone|everyone
4638|Work in progress|no |no |not sent|everyone
4639|Work in progress|no |yes |owner |everyone
4640|Work in progress|yes |no |everyone|everyone
4641|Work in progress|yes |yes |owner |everyone
4642
Logan Hanksfc055962017-06-12 14:20:53 -07004643|=============================
4644
4645If reviewers are added, then a second email will be sent using the "newchange"
4646template. The notification logic for this email is the same as for
4647link:#add-reviewer[Add Reviewer].
4648
Logan Hanksea3e3b72017-06-12 14:21:47 -07004649[options="header",cols="1,1,1"]
Logan Hanksfc055962017-06-12 14:20:53 -07004650|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004651|WIP State |Default |notify=ALL
4652|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
4653|Work in progress|not sent |owner, reviewers, CCs
Logan Hanksfc055962017-06-12 14:20:53 -07004654|=============================
4655
4656
Edwin Kempincdae63b2013-03-15 15:06:59 +01004657[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004658=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004659--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004660'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004661--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004662
4663Rebases a revision.
4664
Zalan Blenessy874aed72015-01-12 13:26:18 +01004665Optionally, the parent revision can be changed to another patch set through the
4666link:#rebase-input[RebaseInput] entity.
4667
Edwin Kempincdae63b2013-03-15 15:06:59 +01004668.Request
4669----
4670 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01004671 Content-Type: application/json;charset=UTF-8
4672
4673 {
4674 "base" : "1234",
4675 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01004676----
4677
4678As response a link:#change-info[ChangeInfo] entity is returned that
4679describes the rebased change. Information about the current patch set
4680is included.
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
Edwin Kempincdae63b2013-03-15 15:06:59 +01004687
4688 )]}'
4689 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01004690 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4691 "project": "myProject",
4692 "branch": "master",
4693 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4694 "subject": "Implement Feature X",
4695 "status": "NEW",
4696 "created": "2013-02-01 09:59:32.126000000",
4697 "updated": "2013-02-21 11:16:36.775000000",
4698 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004699 "insertions": 21,
4700 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01004701 "_number": 4799,
4702 "owner": {
4703 "name": "John Doe"
4704 },
4705 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
4706 "revisions": {
4707 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09004708 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004709 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01004710 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004711 "fetch": {
4712 "http": {
4713 "url": "http://gerrit:8080/myProject",
4714 "ref": "refs/changes/99/4799/2"
4715 }
4716 },
4717 "commit": {
4718 "parents": [
4719 {
4720 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
4721 "subject": "Implement Feature A"
4722 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00004723 ],
4724 "author": {
4725 "name": "John Doe",
4726 "email": "john.doe@example.com",
4727 "date": "2013-05-07 15:21:27.000000000",
4728 "tz": 120
4729 },
4730 "committer": {
4731 "name": "Gerrit Code Review",
4732 "email": "gerrit-server@example.com",
4733 "date": "2013-05-07 15:35:43.000000000",
4734 "tz": 120
4735 },
4736 "subject": "Implement Feature X",
4737 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01004738 }
4739 }
4740 }
4741----
4742
4743If the revision cannot be rebased, e.g. due to conflicts, the response is
4744"`409 Conflict`" and the error message is contained in the response
4745body.
4746
4747.Response
4748----
4749 HTTP/1.1 409 Conflict
4750 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004751 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004752
4753 The change could not be rebased due to a path conflict during merge.
4754----
4755
Edwin Kempin14b58112013-02-26 16:30:19 +01004756[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004757=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004758--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004759'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004760--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004761
Edwin Kempin14b58112013-02-26 16:30:19 +01004762Submits a revision.
Gal Paikinc85d3522021-04-19 13:34:54 +02004763Submitting a change also removes all users from the link:#attention-set[attention set].
Edwin Kempin14b58112013-02-26 16:30:19 +01004764
Edwin Kempin14b58112013-02-26 16:30:19 +01004765.Request
4766----
4767 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
Edwin Kempin14b58112013-02-26 16:30:19 +01004768----
4769
Gal Paikin3d6cdec2021-04-19 13:32:13 +02004770As response a link:#change-info[ChangeInfo] entity is returned that
4771describes the submitted/merged change.
4772
Gal Paikine2849a82021-04-19 13:41:10 +02004773Submission may submit multiple changes, but we still only return one ChangeInfo
4774object. To query for all submitted changes, please use the submission_id that is
4775part of the response.
4776
4777Changes that will also be submitted:
47781. All changes of the same topic if
4779link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
4780configuration is set to true.
47812. All dependent changes.
47823. The closure of the above (e.g if a dependent change has a topic, all changes
4783of *that* topic will also be submitted).
4784
Gal Paikin3d6cdec2021-04-19 13:32:13 +02004785.Response
4786----
4787 HTTP/1.1 200 OK
4788 Content-Disposition: attachment
4789 Content-Type: application/json; charset=UTF-8
4790
4791 )]}'
4792 {
4793 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
4794 "project": "myProject",
4795 "branch": "master",
4796 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
4797 "subject": "Implementing Feature X",
4798 "status": "MERGED",
4799 "created": "2013-02-01 09:59:32.126000000",
4800 "updated": "2013-02-21 11:16:36.775000000",
4801 "submitted": "2013-02-21 11:16:36.615000000",
4802 "_number": 3965,
4803 "owner": {
4804 "name": "John Doe"
4805 }
4806 }
4807----
4808
Edwin Kempin14b58112013-02-26 16:30:19 +01004809If the revision cannot be submitted, e.g. because the submit rule
4810doesn't allow submitting the revision or the revision is not the
4811current revision, the response is "`409 Conflict`" and the error
4812message is contained in the response body.
4813
4814.Response
4815----
4816 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004817 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004818
4819 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
4820----
4821
Edwin Kempin257d70f2013-03-28 14:31:14 +01004822[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004823=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004824--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004825'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004826--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004827
4828Gets the formatted patch for one revision.
4829
4830.Request
4831----
4832 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
4833----
4834
Shawn Pearce98361f72013-05-10 16:27:36 -07004835The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01004836
4837.Response
4838----
4839 HTTP/1.1 200 OK
4840 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004841 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07004842 X-FYI-Content-Encoding: base64
4843 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01004844
Shawn Pearce98361f72013-05-10 16:27:36 -07004845 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01004846----
4847
David Ostrovsky973f38b2013-08-22 00:24:51 -07004848Adding query parameter `zip` (for example `/changes/.../patch?zip`)
4849returns the patch as a single file inside of a ZIP archive. Clients
4850can expand the ZIP to obtain the plain text patch, avoiding the
4851need for a base64 decoding step. This option implies `download`.
4852
4853Query parameter `download` (e.g. `/changes/.../patch?download`)
4854will suggest the browser save the patch as `commitsha1.diff.base64`,
4855for later processing by command line tools.
4856
Kasper Nilsson81448072016-10-17 15:04:33 -07004857If the `path` parameter is set, the returned content is a diff of the single
4858file that the path refers to.
4859
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004860[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004861=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004862--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004863'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004864--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004865
4866Gets the method the server will use to submit (merge) the change and
4867an indicator if the change is currently mergeable.
4868
4869.Request
4870----
4871 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
4872----
4873
Saša Živkov499873f2014-05-05 13:34:18 +02004874As response a link:#mergeable-info[MergeableInfo] entity is returned.
4875
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004876.Response
4877----
4878 HTTP/1.1 200 OK
4879 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004880 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004881
4882 )]}'
4883 {
4884 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004885 strategy: "recursive",
4886 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004887 }
4888----
4889
Saša Živkov697cab22014-04-29 16:46:50 +02004890If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08004891checked for all other branches which are listed in the
4892link:config-project-config.html#branchOrder-section[branchOrder] section in the
4893project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02004894
4895.Request
4896----
4897 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
4898----
4899
4900The response will then contain a list of all other branches where this changes
4901could merge cleanly.
4902
4903.Response
4904----
4905 HTTP/1.1 200 OK
4906 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004907 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02004908
4909 )]}'
4910 {
4911 submit_type: "MERGE_IF_NECESSARY",
4912 mergeable: true,
4913 mergeable_into: [
4914 "refs/heads/stable-2.7",
4915 "refs/heads/stable-2.8",
4916 ]
4917 }
4918----
4919
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004920[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004921=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004922--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004923'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004924--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004925
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004926Gets the method the server will use to submit (merge) the change.
4927
4928.Request
4929----
4930 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
4931----
4932
4933.Response
4934----
4935 HTTP/1.1 200 OK
4936 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004937 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004938
4939 )]}'
4940 "MERGE_IF_NECESSARY"
4941----
4942
4943[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004944=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004945--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004946'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004947--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004948
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004949Tests the submit_type Prolog rule in the project, or the one given.
4950
4951Request body may be either the Prolog code as `text/plain` or a
4952link:#rule-input[RuleInput] object. The query parameter `filters`
4953may be set to `SKIP` to bypass parent project filters while testing
4954a project-specific rule.
4955
4956.Request
4957----
4958 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09004959 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004960
4961 submit_type(cherry_pick).
4962----
4963
4964.Response
4965----
4966 HTTP/1.1 200 OK
4967 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004968 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004969
4970 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07004971 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004972----
4973
4974[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004975=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004976--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004977'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004978--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004979
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004980Tests the submit_rule Prolog rule in the project, or the one given.
4981
4982Request body may be either the Prolog code as `text/plain` or a
4983link:#rule-input[RuleInput] object. The query parameter `filters`
4984may be set to `SKIP` to bypass parent project filters while testing
4985a project-specific rule.
4986
4987.Request
4988----
Shawn Pearcea3cce712014-03-21 08:16:11 -07004989 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09004990 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004991
4992 submit_rule(submit(R)) :-
4993 R = label('Any-Label-Name', reject(_)).
4994----
4995
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004996The response is a link:#submit-record[SubmitRecord] describing the
4997permutations that satisfy the tested submit rule.
4998
David Pursehouse87a3fb02019-10-29 16:01:27 +09004999If the submit rule was a no-op, the response is "`204 No Content`".
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005000
5001.Response
5002----
5003 HTTP/1.1 200 OK
5004 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005005 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005006
5007 )]}'
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02005008 {
5009 "status": "NOT_READY",
5010 "reject": {
5011 "Any-Label-Name": {}
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005012 }
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02005013 }
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005014----
5015
Shawn Pearceb42e3032015-04-02 10:28:10 -07005016When testing with the `curl` command line client the
5017`--data-binary @rules.pl` flag should be used to ensure
5018all LFs are included in the Prolog code:
5019
5020----
5021 curl -X POST \
5022 -H 'Content-Type: text/plain; charset=UTF-8' \
5023 --data-binary @rules.pl \
5024 http://.../test.submit_rule
5025----
5026
Edwin Kempincb6724a2013-02-26 16:58:51 +01005027[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005028=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005029--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005030'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005031--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005032
Edwin Kempin3ca57192013-02-27 07:44:01 +01005033Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01005034user.
5035
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005036Returns a map of file paths to lists of link:#comment-info[CommentInfo]
5037entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005038
5039.Request
5040----
5041 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
5042----
5043
5044.Response
5045----
5046 HTTP/1.1 200 OK
5047 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005048 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01005049
5050 )]}'
5051 {
5052 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5053 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01005054 "id": "TvcXrmjM",
5055 "line": 23,
5056 "message": "[nit] trailing whitespace",
5057 "updated": "2013-02-26 15:40:43.986000000"
5058 },
5059 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01005060 "id": "TveXwFiA",
5061 "line": 49,
5062 "in_reply_to": "TfYX-Iuo",
5063 "message": "Done",
5064 "updated": "2013-02-26 15:40:45.328000000"
5065 }
5066 ]
5067 }
5068----
5069
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005070[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005071=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005072--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005073'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005074--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005075
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005076Creates a draft comment on a revision.
5077
5078The new draft comment must be provided in the request body inside a
5079link:#comment-input[CommentInput] entity.
5080
5081.Request
5082----
5083 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005084 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005085
5086 {
5087 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5088 "line": 23,
5089 "message": "[nit] trailing whitespace"
5090 }
5091----
5092
5093As response a link:#comment-info[CommentInfo] entity is returned that
5094describes the draft comment.
5095
5096.Response
5097----
5098 HTTP/1.1 200 OK
5099 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005100 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005101
5102 )]}'
5103 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005104 "id": "TvcXrmjM",
5105 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5106 "line": 23,
5107 "message": "[nit] trailing whitespace",
5108 "updated": "2013-02-26 15:40:43.986000000"
5109 }
5110----
5111
Edwin Kempin3ca57192013-02-27 07:44:01 +01005112[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005113=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005114--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005115'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 -08005116--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005117
Edwin Kempin3ca57192013-02-27 07:44:01 +01005118Retrieves a draft comment of a revision that belongs to the calling
5119user.
5120
5121.Request
5122----
5123 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
5124----
5125
5126As response a link:#comment-info[CommentInfo] entity is returned that
5127describes the draft comment.
5128
5129.Response
5130----
5131 HTTP/1.1 200 OK
5132 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005133 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01005134
5135 )]}'
5136 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01005137 "id": "TvcXrmjM",
5138 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5139 "line": 23,
5140 "message": "[nit] trailing whitespace",
5141 "updated": "2013-02-26 15:40:43.986000000"
5142 }
5143----
5144
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005145[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005146=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005147--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005148'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 -08005149--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005150
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005151Updates a draft comment on a revision.
5152
5153The new draft comment must be provided in the request body inside a
5154link:#comment-input[CommentInput] entity.
5155
5156.Request
5157----
5158 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005159 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005160
5161 {
5162 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5163 "line": 23,
5164 "message": "[nit] trailing whitespace"
5165 }
5166----
5167
5168As response a link:#comment-info[CommentInfo] entity is returned that
5169describes the draft comment.
5170
5171.Response
5172----
5173 HTTP/1.1 200 OK
5174 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005175 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005176
5177 )]}'
5178 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005179 "id": "TvcXrmjM",
5180 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5181 "line": 23,
5182 "message": "[nit] trailing whitespace",
5183 "updated": "2013-02-26 15:40:43.986000000"
5184 }
5185----
5186
5187[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005188=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005189--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005190'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 -08005191--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005192
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005193Deletes a draft comment from a revision.
5194
5195.Request
5196----
5197 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
5198----
5199
5200.Response
5201----
5202 HTTP/1.1 204 No Content
5203----
5204
John Spurlock5e402f02013-03-24 11:35:04 -04005205[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005206=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005207--
John Spurlock5e402f02013-03-24 11:35:04 -04005208'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005209--
John Spurlock5e402f02013-03-24 11:35:04 -04005210
5211Lists the published comments of a revision.
5212
5213As result a map is returned that maps the file path to a list of
5214link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07005215sorted by file path and only include file (or inline) comments. Use
5216the link:#get-change-detail[Get Change Detail] endpoint to retrieve
5217the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04005218
5219.Request
5220----
5221 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
5222----
5223
5224.Response
5225----
5226 HTTP/1.1 200 OK
5227 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005228 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04005229
5230 )]}'
5231 {
5232 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5233 {
John Spurlock5e402f02013-03-24 11:35:04 -04005234 "id": "TvcXrmjM",
5235 "line": 23,
5236 "message": "[nit] trailing whitespace",
5237 "updated": "2013-02-26 15:40:43.986000000",
5238 "author": {
5239 "_account_id": 1000096,
5240 "name": "John Doe",
5241 "email": "john.doe@example.com"
5242 }
5243 },
5244 {
John Spurlock5e402f02013-03-24 11:35:04 -04005245 "id": "TveXwFiA",
5246 "line": 49,
5247 "in_reply_to": "TfYX-Iuo",
5248 "message": "Done",
5249 "updated": "2013-02-26 15:40:45.328000000",
5250 "author": {
5251 "_account_id": 1000097,
5252 "name": "Jane Roe",
5253 "email": "jane.roe@example.com"
5254 }
5255 }
5256 ]
5257 }
5258----
5259
5260[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005261=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005262--
John Spurlock5e402f02013-03-24 11:35:04 -04005263'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 -08005264--
John Spurlock5e402f02013-03-24 11:35:04 -04005265
5266Retrieves a published comment of a revision.
5267
5268.Request
5269----
5270 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
5271----
5272
5273As response a link:#comment-info[CommentInfo] entity is returned that
5274describes the published comment.
5275
5276.Response
5277----
5278 HTTP/1.1 200 OK
5279 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005280 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04005281
5282 )]}'
5283 {
John Spurlock5e402f02013-03-24 11:35:04 -04005284 "id": "TvcXrmjM",
5285 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5286 "line": 23,
5287 "message": "[nit] trailing whitespace",
5288 "updated": "2013-02-26 15:40:43.986000000",
5289 "author": {
5290 "_account_id": 1000096,
5291 "name": "John Doe",
5292 "email": "john.doe@example.com"
5293 }
5294 }
5295----
5296
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005297[[delete-comment]]
5298=== Delete Comment
5299--
5300'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' +
5301'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete'
5302--
5303
5304Deletes a published comment of a revision. Instead of deleting the
5305whole comment, this endpoint just replaces the comment's message
5306with a new message, which contains the name of the user who deletes
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005307the comment and the reason why it's deleted.
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005308
Gal Paikin8d027232021-12-09 12:39:19 +01005309This endpoint also marks the comment as resolved since deleted comments are not
5310actionable.
5311
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005312Note that only users with the
5313link:access-control.html#capability_administrateServer[Administrate Server]
5314global capability are permitted to delete a comment.
5315
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005316Deletion reason can be provided in the request body as a
5317link:#delete-comment-input[DeleteCommentInput] entity.
5318Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01005319link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005320In this case, use a POST request instead:
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005321
5322.Request
5323----
5324 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0
5325 Content-Type: application/json; charset=UTF-8
5326
5327 {
5328 "reason": "contains confidential information"
5329 }
5330----
5331
5332As response a link:#comment-info[CommentInfo] entity is returned that
5333describes the updated comment.
5334
5335.Response
5336----
5337 HTTP/1.1 200 OK
5338 Content-Disposition: attachment
5339 Content-Type: application/json; charset=UTF-8
5340
5341 )]}'
5342 {
5343 "id": "TvcXrmjM",
5344 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5345 "line": 23,
5346 "message": "Comment removed by: Administrator; Reason: contains confidential information",
5347 "updated": "2013-02-26 15:40:43.986000000",
5348 "author": {
5349 "_account_id": 1000096,
5350 "name": "John Doe",
5351 "email": "john.doe@example.com"
5352 }
5353 }
5354----
5355
Edwin Kempinb050a482016-12-01 09:11:19 +01005356[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005357=== List Robot Comments
5358--
5359'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
5360--
5361
5362Lists the link:config-robot-comments.html[robot comments] of a
5363revision.
5364
5365As result a map is returned that maps the file path to a list of
5366link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
5367map are sorted by file path.
5368
5369.Request
5370----
5371 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
5372----
5373
5374.Response
5375----
5376 HTTP/1.1 200 OK
5377 Content-Disposition: attachment
5378 Content-Type: application/json; charset=UTF-8
5379
5380 )]}'
5381 {
5382 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5383 {
5384 "id": "TvcXrmjM",
5385 "line": 23,
5386 "message": "unused import",
5387 "updated": "2016-02-26 15:40:43.986000000",
5388 "author": {
5389 "_account_id": 1000110,
5390 "name": "Code Analyzer",
5391 "email": "code.analyzer@example.com"
5392 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005393 "robot_id": "importChecker",
5394 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005395 },
5396 {
5397 "id": "TveXwFiA",
5398 "line": 49,
5399 "message": "wrong indention",
5400 "updated": "2016-02-26 15:40:45.328000000",
5401 "author": {
5402 "_account_id": 1000110,
5403 "name": "Code Analyzer",
5404 "email": "code.analyzer@example.com"
5405 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005406 "robot_id": "styleChecker",
5407 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005408 }
5409 ]
5410 }
5411----
5412
5413[[get-robot-comment]]
5414=== Get Robot Comment
5415--
5416'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
5417--
5418
5419Retrieves a link:config-robot-comments.html[robot comment] of a
5420revision.
5421
5422.Request
5423----
5424 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
5425----
5426
5427As response a link:#robot-comment-info[RobotCommentInfo] entity is
5428returned that describes the robot comment.
5429
5430.Response
5431----
5432 HTTP/1.1 200 OK
5433 Content-Disposition: attachment
5434 Content-Type: application/json; charset=UTF-8
5435
5436 )]}'
5437 {
5438 "id": "TvcXrmjM",
5439 "line": 23,
5440 "message": "unused import",
5441 "updated": "2016-02-26 15:40:43.986000000",
5442 "author": {
5443 "_account_id": 1000110,
5444 "name": "Code Analyzer",
5445 "email": "code.analyzer@example.com"
5446 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005447 "robot_id": "importChecker",
5448 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005449 }
5450----
5451
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005452[[list-ported-comments]]
5453=== List Ported Comments
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005454--
5455'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_comments'
5456--
5457
5458Ports comments of other revisions to the requested revision.
5459
5460Only comments added on earlier patchsets are ported. That set of comments is filtered even further
5461due to some additional rules. Callers of this endpoint shouldn't rely on the exact logic of which
5462comments are ported as that logic might change in the future. Instead, callers must be able to
5463handle any smaller/larger set of comments returned by this endpoint.
5464
5465Typically, a comment thread is returned fully or excluded fully. However, draft comments and
5466robot comments are ignored and not returned via this endpoint. Hence, it's possible to get ported
5467comments from this endpoint which are a reply to a non-ported robot comment. Callers must be
5468able to deal with this situation.
5469
5470The returned comments are organized in a map of file path to link:#comment-info[CommentInfo] entries
5471in the same fashion as for the link:#list-comments[List Revision Comments] endpoint.
5472The map is filled with the original comment attributes except for these attributes: `path`, `line`,
5473and `range` point to the computed position in the target revision. If the exactly correct position
5474can't be determined, those fields will be filled with the next best position. That can also mean
5475not filling the `line` or `range` attribute anymore and thus converting the comment to a file
5476comment (or even moving the comment to a different file or the patchset level). Callers of this
5477endpoint must be able to deal with this and not rely on the original comment position.
5478
5479It's possible that this endpoint returns different link:#comment-info[CommentInfo] entries with
5480the same comment UUID. This is not a bug but a feature. If a comment appears on a file which Gerrit
5481recognizes as copied between patchsets, the ported version of this comment consists of two ported
5482instances having the same UUID but different `file`/`line`/`range` positions. Callers must be able
5483to handle this situation.
5484
5485Repeated calls of this endpoint might produce different results. Internal errors during the
5486position computation are mapped to fallback locations for affected comments. Those errors might
5487have vanished on later calls, upon which this endpoint returns the actually mapped position. In
5488addition, comments can be deleted and draft comments can be published, upon which the set of ported
5489comments may change.
5490
5491.Request
5492----
5493 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/4/ported_comments/ HTTP/1.0
5494----
5495
5496.Response
5497----
5498 HTTP/1.1 200 OK
5499 Content-Disposition: attachment
5500 Content-Type: application/json; charset=UTF-8
5501
5502 )]}'
5503 {
5504 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5505 {
5506 "id": "TvcXrmjM",
5507 "patch_set": 2,
5508 "line": 23,
5509 "message": "[nit] trailing whitespace",
5510 "updated": "2013-02-26 15:40:43.986000000",
5511 "author": {
5512 "_account_id": 1000096,
5513 "name": "John Doe",
5514 "email": "john.doe@example.com"
5515 },
5516 "unresolved": true
5517 },
5518 {
5519 "id": "TveXwFiA",
5520 "patch_set": 2,
5521 "line": 23,
5522 "in_reply_to": "TvcXrmjM",
5523 "message": "Done",
5524 "updated": "2013-02-26 15:40:45.328000000",
5525 "author": {
5526 "_account_id": 1000097,
5527 "name": "Jane Roe",
5528 "email": "jane.roe@example.com"
5529 },
5530 "unresolved": true
5531 }
5532 ]
5533 }
5534----
5535
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005536[[list-ported-drafts]]
5537=== List Ported Drafts
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005538--
5539'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_drafts'
5540--
5541
5542Ports draft comments of other revisions to the requested revision.
5543
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005544This endpoint behaves similarly to the link:#list-ported-comments[List Ported Comments] endpoint.
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005545With this endpoint, only draft comments of the calling user are ported, though. If a draft comment
5546is a reply to a published comment, only the ported draft comment is returned.
5547
5548Depending on the filtering rules, it's possible that this endpoint returns a draft comment which is
5549a reply to a comment thread which is not returned by the
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005550link:#list-ported-comments[List Ported Comments] endpoint. That's intended behavior. Callers must be
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005551able to handle this situation. The same holds for drafts which are a reply to a robot comment.
5552
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005553Different than the link:#list-ported-comments[List Ported Comments] endpoint, the `author` of the
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005554returned comments is not filled for this endpoint as only comments of the calling user are returned.
5555
Patrick Hieselafd6c702020-11-06 10:21:47 +01005556This endpoint requires authentication.
5557
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005558.Request
5559----
5560 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/ported_drafts/ HTTP/1.0
5561----
5562
5563.Response
5564----
5565 HTTP/1.1 200 OK
5566 Content-Disposition: attachment
5567 Content-Type: application/json; charset=UTF-8
5568
5569 )]}'
5570 {
5571 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5572 {
5573 "id": "TveXwFiA",
5574 "patch_set": 2,
5575 "line": 23,
5576 "in_reply_to": "TvcXrmjM",
5577 "message": "Done",
5578 "updated": "2013-02-26 15:40:45.328000000",
5579 "unresolved": true
5580 }
5581 ]
5582 }
5583----
5584
Sharad Bagri3f6ed642022-06-06 12:41:57 -07005585[[apply-stored-fix]]
5586=== Apply Stored Fix
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005587--
5588'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
5589--
5590
5591Applies a suggested fix by creating a change edit which includes the
5592modifications indicated by the fix suggestion. If a change edit already exists,
5593it will be updated accordingly. A fix can only be applied if no change edit
5594exists and the fix refers to the current patch set, or the fix refers to the
5595patch set on which the change edit is based.
5596
5597.Request
5598----
5599 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
5600----
5601
5602If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
5603resulting change edit is returned.
5604
5605.Response
5606----
5607 HTTP/1.1 200 OK
5608 Content-Disposition: attachment
5609 Content-Type: application/json; charset=UTF-8
5610
5611 )]}'
5612 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005613 "commit": {
5614 "parents": [
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005615 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005616 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005617 }
5618 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01005619 "author": {
5620 "name": "John Doe",
5621 "email": "john.doe@example.com",
5622 "date": "2013-05-07 15:21:27.000000000",
5623 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005624 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005625 "committer": {
5626 "name": "Jane Doe",
5627 "email": "jane.doe@example.com",
5628 "date": "2013-05-07 15:35:43.000000000",
5629 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005630 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005631 "subject": "Implement feature X",
5632 "message": "Implement feature X\n\nWith this feature ..."
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005633 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005634 "base_patch_set_number": 1,
5635 "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1"
5636 "ref": "refs/users/01/1000001/edit-42622/1"
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005637 }
5638----
5639
5640If the application failed e.g. due to conflicts with an existing change edit,
5641the response "`409 Conflict`" including an error message in the response body
5642is returned.
5643
5644.Response
5645----
5646 HTTP/1.1 409 Conflict
5647 Content-Disposition: attachment
5648 Content-Type: text/plain; charset=UTF-8
5649
5650 The existing change edit could not be merged with another tree.
5651----
5652
Sharad Bagribdb582d2022-03-26 01:32:35 -07005653[[apply-provided-fix]]
5654==== Apply Provided Fix
5655--
5656'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:apply'
5657--
5658Applies a list of <<fix-replacement-info,FixReplacementInfo>> loaded from the
5659<<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the request body. The
5660application of the fixes creates a new change edit. `Apply Provided Fix` can only be applied on the current
5661patchset.
5662
5663.Request
5664----
5665 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fix:apply HTTP/1.0
5666 Content-Type: application/json; charset=UTF-8
5667
5668 {
5669 "fix_replacement_infos": [
5670 {
5671 "path": "abcd.txt",
5672 "range": {
5673 "start_line": 2,
5674 "start_character": 2,
5675 "end_line": 2,
5676 "end_character": 5
5677 },
5678 "replacement": "abcdefg"
5679 }
5680 ]
5681 }
5682----
5683
5684If the `ApplyProvidedFixInput` was successfully applied, an link:#edit-info[EditInfo] describing the
5685resulting change edit is returned.
5686
5687.Response
5688----
5689 HTTP/1.1 200 OK
5690 Content-Disposition: attachment
5691 Content-Type: application/json; charset=UTF-8
5692
5693 )]}'
5694 {
5695 "commit": {
5696 "commit": "bd43e48c33d2b1a03485040eba38cefc505f7997",
5697 "parents": [
5698 {
5699 "commit": "9825962f8ab6da89afebad3f5034db05fb4b7560"
5700 }
5701 ],
5702 "author": {
5703 "name": "John Doe",
5704 "email": "john.doe@example.com",
5705 "date": "2022-05-07 15:21:27.000000000",
5706 "tz": 120
5707 },
5708 "committer": {
5709 "name": "Jane Doe",
5710 "email": "jane.doe@example.com",
5711 "date": "2022-05-07 15:35:43.000000000",
5712 "tz": 120
5713 },
5714 "subject": "Implement feature X",
5715 "message": "Implement feature X\n\nWith this feature ..."
5716 },
5717 "base_patch_set_number": 1,
5718 "base_revision": "86d87686ce0ef7f7c536bfc7e9a66f5a6fa5d658",
5719 "ref": "refs/users/01/1000001/edit-1/1"
5720 }
5721----
5722
5723If the application failed due to presence of an existing change edit,
5724the response "`400 Bad Request`" including an error message in the response body
5725is returned.
5726
5727.Response
5728----
5729 HTTP/1.1 400 Bad Request
5730 Content-Disposition: attachment
5731 Content-Type: text/plain; charset=UTF-8
5732
5733 Change edit already exists. A new change edit can't be created
5734----
5735
5736If the application failed due to application on a previous patch set, the response
5737"`409 Conflict`" including an error message in the response body is returned.
5738
5739.Response
5740----
5741 HTTP/1.1 409 Conflict
5742 Content-Disposition: attachment
5743 Content-Type: text/plain; charset=UTF-8
5744
5745 A change edit may only be created for the current patch set 1,2 (and not for 1,1)
5746----
5747
Edwin Kempin682ac712013-05-14 13:40:46 +02005748[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005749=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005750--
Edwin Kempin682ac712013-05-14 13:40:46 +02005751'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005752--
Edwin Kempin682ac712013-05-14 13:40:46 +02005753
5754Lists the files that were modified, added or deleted in a revision.
5755
5756.Request
5757----
5758 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
5759----
5760
Makson Leefaf05c22018-07-26 22:42:59 +00005761As result a map is returned that maps the link:#file-id[file path] to a
5762link:#file-info[FileInfo] entry. The entries in the map are
Edwin Kempin682ac712013-05-14 13:40:46 +02005763sorted by file path.
5764
5765.Response
5766----
5767 HTTP/1.1 200 OK
5768 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005769 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02005770
5771 )]}'
5772 {
5773 "/COMMIT_MSG": {
5774 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02005775 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005776 "size_delta": 551,
5777 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02005778 },
5779 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
5780 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02005781 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005782 "size_delta": 98,
5783 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02005784 }
5785 }
5786----
5787
Shawn Pearce984747d2013-07-18 00:42:16 -07005788The request parameter `reviewed` changes the response to return a list
5789of the paths the caller has marked as reviewed. Clients that also
5790need the FileInfo should make two requests.
5791
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005792The request parameter `q` changes the response to return a list
5793of all files (modified or unmodified) that contain that substring
5794in the path name. This is useful to implement suggestion services
David Pursehousefcfb29d2019-08-01 12:55:16 +09005795finding a file by partial name. Clients that also need the FileInfo
5796should make two requests.
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005797
David Pursehouse89c00ca2019-08-03 13:47:29 +09005798For merge commits only, the integer-valued request parameter `parent`
5799changes the response to return a map of the files which are different
5800in this commit compared to the given parent commit. The value is the
Andrii Shyshkalov350a4512019-09-23 02:26:33 -070058011-based index of the parent's position in the commit object,
5802with the first parent always belonging to the target branch. If not
David Pursehouse89c00ca2019-08-03 13:47:29 +09005803specified, the response contains a map of the files different in the
5804auto merge result.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005805
David Pursehousefcfb29d2019-08-01 12:55:16 +09005806The request parameter `base` changes the response to return a map of the
5807files which are different in this commit compared to the given revision. The
5808revision must correspond to a patch set in the change.
5809
5810The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive.
5811That is, only one of them may be used at a time.
Shawn Pearce984747d2013-07-18 00:42:16 -07005812
5813.Request
5814----
5815 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
5816----
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005817
Shawn Pearce984747d2013-07-18 00:42:16 -07005818.Response
5819----
5820 HTTP/1.1 200 OK
5821 Content-Disposition: attachment
5822 Content-Type: application/json; charset=UTF-8
5823
5824 )]}'
5825 [
Edwin Kempinaef44b02013-05-07 16:15:55 +02005826 "/COMMIT_MSG",
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005827 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005828 ]
Edwin Kempinbea55a52013-05-14 13:53:39 +02005829----
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005830
Edwin Kempinaef44b02013-05-07 16:15:55 +02005831[[get-content]]
5832=== Get Content
5833--
5834'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
5835--
5836
5837Gets the content of a file from a certain revision.
5838
Patrick Hiesel38667d42017-05-02 13:12:48 +02005839The optional, integer-valued `parent` parameter can be specified to request
5840the named file from a parent commit of the specified revision. The value is
5841the 1-based index of the parent's position in the commit object. If the
5842parameter is omitted or the value is non-positive, the patch set is referenced.
5843
Edwin Kempinaef44b02013-05-07 16:15:55 +02005844.Request
5845----
5846 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
5847----
5848
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005849The content is returned as base64 encoded string. The HTTP response
5850Content-Type is always `text/plain`, reflecting the base64 wrapping.
5851A Gerrit-specific `X-FYI-Content-Type` header is returned describing
5852the server detected content type of the file.
5853
5854If only the content type is required, callers should use HEAD to
5855avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02005856
5857.Response
5858----
5859 HTTP/1.1 200 OK
5860 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005861 Content-Type: text/plain; charset=ISO-8859-1
5862 X-FYI-Content-Encoding: base64
5863 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02005864
5865 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
5866----
5867
David Ostrovskyd0078672015-02-06 21:51:04 +01005868Alternatively, if the only value of the Accept request header is
5869`application/json` the content is returned as JSON string and
5870`X-FYI-Content-Encoding` is set to `json`.
5871
David Pletcherd1efb452015-09-01 17:45:55 -07005872[[get-safe-content]]
5873=== Download Content
5874--
5875'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
5876--
5877
5878Downloads the content of a file from a certain revision, in a safe format
5879that poses no risk for inadvertent execution of untrusted code.
5880
5881If the content type is defined as safe, the binary file content is returned
5882verbatim. If the content type is not safe, the file is stored inside a ZIP
5883file, containing a single entry with a random, unpredictable name having the
5884same base and suffix as the true filename. The ZIP file is returned in
5885verbatim binary form.
5886
5887See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
5888for information about safe file type configuration.
5889
5890The HTTP resource Content-Type is dependent on the file type: the
5891applicable type for safe files, or "application/zip" for unsafe files.
5892
David Pletcherec622bf2015-09-18 14:30:05 -07005893The optional, integer-valued `parent` parameter can be specified to request
5894the named file from a parent commit of the specified revision. The value is
5895the 1-based index of the parent's position in the commit object. If the
5896parameter is omitted or the value non-positive, the patch set is referenced.
5897
5898Filenames are decorated with a suffix of `_new` for the current patch,
5899`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07005900
5901.Request
5902----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005903 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07005904----
5905
5906.Response
5907----
5908 HTTP/1.1 200 OK
5909 Content-Disposition: attachment; filename="logo.png"
5910 Content-Type: image/png
5911
5912 `[binary data for logo.png]`
5913----
5914
5915.Request
5916----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005917 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 -07005918----
5919
5920.Response
5921----
5922 HTTP/1.1 200 OK
5923 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
5924 Content-Type:application/zip
5925
5926 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
5927----
5928
David Pursehouse882aef22013-06-05 10:56:37 +09005929[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005930=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005931--
David Pursehouse882aef22013-06-05 10:56:37 +09005932'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 -08005933--
David Pursehouse882aef22013-06-05 10:56:37 +09005934
5935Gets the diff of a file from a certain revision.
5936
5937.Request
5938----
5939 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
5940----
5941
5942As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
5943
5944.Response
5945----
5946 HTTP/1.1 200 OK
5947 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005948 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005949
5950 )]
5951 {
5952 "meta_a": {
5953 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005954 "content_type": "text/x-java-source",
5955 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005956 },
5957 "meta_b": {
5958 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005959 "content_type": "text/x-java-source",
5960 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005961 },
5962 "change_type": "MODIFIED",
5963 "diff_header": [
5964 "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",
5965 "index 59b7670..9faf81c 100644",
5966 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5967 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5968 ],
5969 "content": [
5970 {
5971 "ab": [
5972 "// Copyright (C) 2010 The Android Open Source Project",
5973 "//",
5974 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
5975 "// you may not use this file except in compliance with the License.",
5976 "// You may obtain a copy of the License at",
5977 "//",
5978 "// http://www.apache.org/licenses/LICENSE-2.0",
5979 "//",
5980 "// Unless required by applicable law or agreed to in writing, software",
5981 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
5982 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
5983 "// See the License for the specific language governing permissions and",
5984 "// limitations under the License."
5985 ]
5986 },
5987 {
5988 "b": [
5989 "//",
5990 "// Add some more lines in the header."
5991 ]
5992 },
5993 {
5994 "ab": [
5995 "",
5996 "package com.google.gerrit.server.project;",
5997 "",
5998 "import com.google.common.collect.Maps;",
5999 ...
6000 ]
6001 }
6002 ...
6003 ]
6004 }
6005----
6006
6007If the `intraline` parameter is specified, intraline differences are included in the diff.
6008
6009.Request
6010----
6011 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
6012----
6013
6014.Response
6015----
6016 HTTP/1.1 200 OK
6017 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006018 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09006019
6020 )]
6021 {
6022 "meta_a": {
6023 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08006024 "content_type": "text/x-java-source",
6025 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09006026 },
6027 "meta_b": {
6028 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08006029 "content_type": "text/x-java-source",
6030 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09006031 },
6032 "change_type": "MODIFIED",
6033 "diff_header": [
6034 "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",
6035 "index 59b7670..9faf81c 100644",
6036 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
6037 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
6038 ],
6039 "content": [
6040 ...
6041 {
6042 "a": [
6043 "/** Manages access control for Git references (aka branches, tags). */"
6044 ],
6045 "b": [
6046 "/** Manages access control for the Git references (aka branches, tags). */"
6047 ],
6048 "edit_a": [],
6049 "edit_b": [
6050 [
6051 31,
6052 4
6053 ]
6054 ]
6055 }
6056 ]
6057 }
6058----
6059
6060The `base` parameter can be specified to control the base patch set from which the diff should
6061be generated.
6062
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01006063The integer-valued request parameter `parent` can be specified to control the
6064parent commit number against which the diff should be generated. This is useful
6065for supporting review of merge commits. The value is the 1-based index of the
6066parent's position in the commit object.
6067
David Pursehouse882aef22013-06-05 10:56:37 +09006068.Request
6069----
6070 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
6071----
6072
6073.Response
6074----
6075 HTTP/1.1 200 OK
6076 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006077 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09006078
6079 )]
6080 {
6081 "meta_a": {
6082 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08006083 "content_type": "text/x-java-source",
6084 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09006085 },
6086 "meta_b": {
6087 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08006088 "content_type": "text/x-java-source",
6089 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09006090 },
6091 "change_type": "MODIFIED",
6092 "content": [
6093 {
6094 "skip": 578
6095 }
6096 ]
6097 }
6098----
6099
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01006100The `whitespace` parameter can be specified to control how whitespace
6101differences are reported in the result. Valid values are `IGNORE_NONE`,
6102`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09006103
Sharad Bagri3f6ed642022-06-06 12:41:57 -07006104[[preview-stored-fix]]
6105=== Preview Stored Fix
Dmitrii Filippovbf3f08b2019-12-06 03:13:06 +01006106--
6107'GET /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/preview'
6108--
6109
6110Gets the diffs of all files for a certain <<fix-id,\{fix-id\}>>.
6111As response, a map of link:#diff-info[DiffInfo] entities is returned that describes the diffs.
6112
6113Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id and a virtual patch set with the applied fix.
6114
Sharad Bagrid1b05fd2022-05-18 13:14:17 -07006115[[preview-provided-fix]]
6116=== Preview Provided fix
6117--
6118'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:preview'
6119--
6120
6121Gets the diffs of all files for a list of <<fix-replacement-info,FixReplacementInfo>> loaded from
6122the <<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the
6123request body.
6124As response, a map of link:#diff-info[DiffInfo] is returned that describes the diffs.
6125
6126Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id
6127and a virtual patch set with the applied fix. No content on the server will be modified as part of this request.
6128
6129.Request
6130----
6131 POST /changes/myProject~master~Id6f0b9d946791f8aba90ace53074eda565983452/revisions/1/fix:preview HTTP/1.0
6132 Content-Type: application/json; charset=UTF-8
6133
6134 {
6135 "fix_replacement_infos": [
6136 {
6137 "path": "abcd.txt",
6138 "range": {
6139 "start_line": 2,
6140 "start_character": 2,
6141 "end_line": 2,
6142 "end_character": 5
6143 },
6144 "replacement": "abcdefg"
6145 }
6146 ]
6147 }
6148----
6149
6150If the `Preview Provided Fix` operation was successful, a link:#diff-info[DiffInfo] previewing the
6151change is returned.
6152
6153.Response
6154----
6155 HTTP/1.1 200 OK
6156 Content-Disposition: attachment
6157 Content-Type: application/json; charset=UTF-8
6158
6159 )]}'
6160 {
6161 "abcd.txt": {
6162 "meta_a": {
6163 "name": "abcd.txt",
6164 "content_type": "text/plain",
6165 "lines": 3
6166 },
6167 "meta_b": {
6168 "name": "abcd.txt",
6169 "content_type": "text/plain",
6170 "lines": 3
6171 },
6172 "intraline_status": "OK",
6173 "change_type": "MODIFIED",
6174 "content": [
6175 {
6176 "ab": [
6177 "ABCDEFGHI"
6178 ]
6179 },
6180 {
6181 "a": [
6182 "JKLMNOPQR"
6183 ],
6184 "b": [
6185 "JKabcdefgOPQR"
6186 ],
6187 "edit_a": [
6188 [
6189 2,
6190 3
6191 ]
6192 ],
6193 "edit_b": [
6194 [
6195 2,
6196 7
6197 ]
6198 ]
6199 },
6200 {
6201 "ab": [
6202 ""
6203 ]
6204 }
6205 ]
6206 }
6207 }
6208----
6209
6210
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006211[[get-blame]]
6212=== Get Blame
6213--
6214'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
6215--
6216
6217Gets the blame of a file from a certain revision.
6218
6219.Request
6220----
6221 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
6222----
6223
6224As response a link:#blame-info[BlameInfo] entity is returned that describes the
6225blame.
6226
6227.Response
6228----
6229 HTTP/1.1 200 OK
6230 Content-Disposition: attachment
6231 Content-Type: application/json; charset=UTF-8
6232
6233 )]
6234 {
6235 [
6236 {
6237 "author": "Joe Daw",
6238 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
6239 "time": 1421441349,
6240 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
6241 "ranges": [
6242 {
6243 "start": 1,
6244 "end": 10
6245 },
6246 {
6247 "start": 16,
6248 "end": 296
6249 }
6250 ]
6251 },
6252 {
6253 "author": "Jane Daw",
6254 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
6255 "time": 1421825421,
6256 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
6257 "ranges": [
6258 {
6259 "start": 13,
6260 "end": 13
6261 }
6262 ]
6263 }
6264 ]
6265 }
6266----
6267
6268The `base` parameter can be specified to control the base patch set from which
6269the blame should be generated.
6270
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006271[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006272=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006273--
Edwin Kempinbea55a52013-05-14 13:53:39 +02006274'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 -08006275--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01006276
Edwin Kempinbea55a52013-05-14 13:53:39 +02006277Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006278
6279.Request
6280----
6281 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
6282----
6283
6284.Response
6285----
6286 HTTP/1.1 201 Created
6287----
6288
Edwin Kempinbea55a52013-05-14 13:53:39 +02006289If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006290response is "`200 OK`".
6291
6292[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006293=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006294--
Edwin Kempinbea55a52013-05-14 13:53:39 +02006295'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 -08006296--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01006297
Edwin Kempinbea55a52013-05-14 13:53:39 +02006298Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006299
6300.Request
6301----
6302 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
6303----
6304
6305.Response
6306----
6307 HTTP/1.1 204 No Content
6308----
6309
Gustaf Lundh019fb262012-11-28 14:20:22 +01006310[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006311=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006312--
Gustaf Lundh019fb262012-11-28 14:20:22 +01006313'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006314--
Gustaf Lundh019fb262012-11-28 14:20:22 +01006315
6316Cherry picks a revision to a destination branch.
6317
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02006318To cherry pick a commit with no change-id associated with it, see
6319link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit].
6320
Gustaf Lundh019fb262012-11-28 14:20:22 +01006321The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02006322link:#cherrypick-input[CherryPickInput] entity. If the commit message
6323does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01006324
Gal Paikin8dadd422021-05-07 10:21:54 +02006325When cherry-picking a change into a branch that already contains the Change-Id
6326that we want to cherry-pick, the cherry-pick will create a new patch-set on the
6327destination's branch's appropriate Change-Id. If the change is closed on the
6328destination branch, the cherry-pick will fail.
6329
Gustaf Lundh019fb262012-11-28 14:20:22 +01006330.Request
6331----
6332 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006333 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01006334
6335 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01006336 "message" : "Implementing Feature X",
6337 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01006338 }
6339----
6340
Edwin Kempinaab27d32020-01-29 13:17:04 +01006341As response a link:#change-info[ChangeInfo] entity is returned that
6342describes the resulting cherry-pick change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01006343
6344.Response
6345----
6346 HTTP/1.1 200 OK
6347 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006348 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01006349
6350 )]}'
6351 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01006352 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
6353 "project": "myProject",
6354 "branch": "release-branch",
6355 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
6356 "subject": "Implementing Feature X",
6357 "status": "NEW",
6358 "created": "2013-02-01 09:59:32.126000000",
6359 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01006360 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01006361 "insertions": 12,
6362 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01006363 "_number": 3965,
6364 "owner": {
6365 "name": "John Doe"
6366 }
6367 }
6368----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006369
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006370[[revision-reviewer-endpoints]]
6371== Revision Reviewer Endpoints
6372
6373[[list-revision-reviewers]]
6374=== List Revision Reviewers
6375--
6376'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
6377--
6378
6379Lists the reviewers of a revision.
6380
6381Please note that only the current revision is supported.
6382
6383As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
6384
6385.Request
6386----
6387 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
6388----
6389
6390.Response
6391----
6392 HTTP/1.1 200 OK
6393 Content-Disposition: attachment
6394 Content-Type: application/json; charset=UTF-8
6395
6396 )]}'
6397 [
6398 {
6399 "approvals": {
6400 "Verified": "+1",
6401 "Code-Review": "+2"
6402 },
6403 "_account_id": 1000096,
6404 "name": "John Doe",
6405 "email": "john.doe@example.com"
6406 },
6407 {
6408 "approvals": {
6409 "Verified": " 0",
6410 "Code-Review": "-1"
6411 },
6412 "_account_id": 1000097,
6413 "name": "Jane Roe",
6414 "email": "jane.roe@example.com"
6415 }
6416 ]
6417----
6418
6419[[list-revision-votes]]
6420=== List Revision Votes
6421--
6422'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
6423--
6424
6425Lists the votes for a specific reviewer of the revision.
6426
6427Please note that only the current revision is supported.
6428
6429.Request
6430----
6431 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
6432----
6433
6434As result a map is returned that maps the label name to the label value.
6435The entries in the map are sorted by label name.
6436
6437.Response
6438----
6439 HTTP/1.1 200 OK
6440 Content-Disposition: attachment
6441 Content-Type: application/json;charset=UTF-8
6442
6443 )]}'
6444 {
6445 "Code-Review": -1,
6446 "Verified": 1,
6447 "Work-In-Progress": 1
6448 }
6449----
6450
6451[[delete-revision-vote]]
6452=== Delete Revision Vote
6453--
6454'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
6455/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
6456'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
6457/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
6458--
6459
6460Deletes a single vote from a revision. The deletion will be possible only
6461if the revision is the current revision. By using this endpoint you can prevent
6462deleting the vote (with same label) from a newer patch set by mistake.
6463
6464Note, that even when the last vote of a reviewer is removed the reviewer itself
6465is still listed on the change.
6466
Gal Paikin6ce56dc2021-03-29 12:28:43 +02006467If another user removed a user's vote, the user with the deleted vote will be
6468added to the attention set.
6469
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006470.Request
6471----
6472 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
6473 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
6474----
6475
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02006476Options can be provided in the request body as a
6477link:#delete-vote-input[DeleteVoteInput] entity.
6478Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01006479link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02006480In this case, use a POST request instead:
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006481
6482.Request
6483----
6484 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
6485 Content-Type: application/json; charset=UTF-8
6486
6487 {
6488 "notify": "NONE"
6489 }
6490----
6491
6492.Response
6493----
6494 HTTP/1.1 204 No Content
6495----
6496
Gal Paikinc326de42020-06-16 18:49:00 +03006497[[attention-set-endpoints]]
6498== Attention Set Endpoints
6499
6500[[get-attention-set]]
6501=== Get Attention Set
6502--
6503'GET /changes/link:#change-id[\{change-id\}]/attention'
6504--
6505
6506Returns all users that are currently in the attention set.
6507As response a list of link:#attention-set-info[AttentionSetInfo]
6508entity is returned.
6509
6510.Request
6511----
6512 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6513----
6514
6515.Response
6516----
6517 HTTP/1.1 200 OK
6518 Content-Disposition: attachment
6519 Content-Type: application/json; charset=UTF-8
6520
6521 )]}'
6522 [
6523 {
6524 "account": {
6525 "_account_id": 1000096,
6526 "name": "John Doe",
6527 "email": "john.doe@example.com",
6528 "username": "jdoe"
6529 },
6530 "last_update": "2013-02-01 09:59:32.126000000",
6531 "reason": "reviewer or cc replied"
6532 },
6533 {
6534 "account": {
6535 "_account_id": 1000097,
6536 "name": "Jane Doe",
6537 "email": "jane.doe@example.com",
6538 "username": "janedoe"
6539 },
6540 "last_update": "2013-02-01 09:59:32.126000000",
6541 "reason": "Reviewer was added"
6542 }
6543 ]
6544----
6545
6546[[add-to-attention-set]]
6547=== Add To Attention Set
6548--
6549'POST /changes/link:#change-id[\{change-id\}]/attention'
6550--
6551
6552Adds a single user to the attention set of a change.
6553
6554A user can only be added if they are not in the attention set.
6555If a user is added while already in the attention set, the
6556request is silently ignored.
6557
Gal Paikine631de22020-10-29 12:19:11 +01006558The user must be a reviewer, cc, uploader, or owner on the change.
6559
Gal Paikinc326de42020-06-16 18:49:00 +03006560.Request
6561----
6562 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6563----
6564
6565Details should be provided in the request body as an
6566link:#attention-set-input[AttentionSetInput] entity.
6567
6568.Request
6569----
6570 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6571 Content-Type: application/json; charset=UTF-8
6572
6573 {
6574 "user": "John Doe",
6575 "reason": "reason"
6576 }
6577----
6578
6579.Response
6580----
6581 HTTP/1.1 200 OK
6582 Content-Disposition: attachment
6583 Content-Type: application/json; charset=UTF-8
6584
6585 )]}'
6586 {
6587 "_account_id": 1000096,
6588 "name": "John Doe",
6589 "email": "john.doe@example.com",
6590 "username": "jdoe"
6591 }
6592----
6593
6594[[remove-from-attention-set]]
6595=== Remove from Attention Set
6596--
6597'DELETE /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]' +
6598'POST /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]/delete'
6599--
6600
6601Deletes a single user from the attention set of a change.
6602
6603A user can only be removed from the attention set if they
6604are currently in the attention set. Otherwise, the request
6605is silently ignored.
6606
6607.Request
6608----
6609 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe HTTP/1.0
6610 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
6611----
6612
6613Reason can be provided in the request body as an
6614link:#attention-set-input[AttentionSetInput] entity.
6615
6616User must be left empty, or the user must be exactly
6617the same user as in the request header.
6618
6619.Request
6620----
6621 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
6622 Content-Type: application/json; charset=UTF-8
6623
6624 {
6625 "reason": "reason"
6626 }
6627----
6628
6629.Response
6630----
6631 HTTP/1.1 204 No Content
6632----
6633
6634[[attention-set]]
6635== Attention Set
6636Attention Set is the set of users that should perform some action on the
6637change. E.g, reviewers should review the change, owner/uploader should
6638add a new patchset or respond to comments.
6639
6640Users are added to the attention set if one the following apply:
6641
6642* They are manually added in link:#review-input[ReviewInput] in
6643 add_to_attention_set.
6644* They are added as reviewers.
6645* The change is marked ready for review.
6646* As an owner/uploader, when someone replies on your change.
6647* As a reviewer, when the owner/uploader replies.
Gal Paikin6ce56dc2021-03-29 12:28:43 +02006648* When the user's vote is deleted by another user.
Gal Paikin102f6d82021-04-13 15:21:51 +02006649* The rules above (except manually adding to the attention set) don't apply
6650 for changes that are work in progress.
Gal Paikinc326de42020-06-16 18:49:00 +03006651
6652Users are removed from the attention set if one the following apply:
6653
6654* They are manually removed in link:#review-input[ReviewInput] in
6655 remove_from_attention_set.
6656* They are removed from reviewers.
6657* The change is marked work in progress, abandoned, or submitted.
6658* When the user replies on a change.
6659
6660If the ignore_default_attention_set_rules in link:#review-input[ReviewInput]
6661is set to true, no other changes to the attention set will occur during the
6662link:#set-review[set-review].
6663Also, users specified in the list will occur instead of any of the implicit
6664changes to the attention set. E.g, if a user is added by add_to_attention_set
6665in link:#review-input[ReviewInput], but also the change is marked work in
6666progress, the user will still be added.
6667
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006668[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006669== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006670
Edwin Kempina3d02ef2013-02-22 16:31:53 +01006671[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006672=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01006673--
6674--
6675
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006676[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006677=== \{change-id\}
Patrick Hiesel18da0452017-12-21 14:02:05 +01006678Identifier that uniquely identifies one change. It contains the URL-encoded
Edwin Kempin00ecc022023-07-26 06:49:09 +00006679project name as well as the change number: "<project>~<changeNumber>"
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006680
Sven Selberg78ce9f42023-01-05 14:41:04 +01006681==== Alternative identifiers
6682Gerrit also supports an array of other change identifiers.
6683
6684[NOTE]
Sven Selbergaaf8ed82023-01-11 11:44:08 +00006685Even though these identifiers will work in the majority of cases it is highly
Edwin Kempin00ecc022023-07-26 06:49:09 +00006686recommended to use "<project>~<changeNumber>" whenever possible.
Sven Selbergaaf8ed82023-01-11 11:44:08 +00006687Since these identifiers require additional lookups from index and caches, to
Edwin Kempin00ecc022023-07-26 06:49:09 +00006688be translated to the "<project>~<changeNumber>" identifier, they
Sven Selbergaaf8ed82023-01-11 11:44:08 +00006689may result in both false-positives and false-negatives.
6690Furthermore the additional lookup mean that they come with a performance penalty.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006691
Edwin Kempin00ecc022023-07-26 06:49:09 +00006692* an ID of the change in the format "<project>~<branch>~<Change-Id>",
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006693 where for the branch the `refs/heads/` prefix can be omitted
Edwin Kempin00ecc022023-07-26 06:49:09 +00006694 ("myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006695* a Change-Id if it uniquely identifies one change
6696 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
Sven Selberg45ca1782023-01-09 08:32:27 +00006697* a change number if it uniquely identifies one change ("4247")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006698
Changcheng Xiaod61590f2018-04-30 10:59:14 +02006699[[change-message-id]]
6700=== \{change-message-id\}
6701ID of a change message returned in a link:#change-message-info[ChangeMessageInfo].
6702
John Spurlock5e402f02013-03-24 11:35:04 -04006703[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006704=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04006705UUID of a published comment.
6706
Edwin Kempin3ca57192013-02-27 07:44:01 +01006707[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006708=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01006709UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006710
David Ostrovskybeb0b842014-12-13 00:24:29 +01006711[[label-id]]
6712=== \{label-id\}
6713The name of the label.
6714
Edwin Kempinbea55a52013-05-14 13:53:39 +02006715[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09006716=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02006717The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006718
David Pursehouse11badbb2017-03-27 10:58:05 +09006719The following magic paths are supported:
6720
6721* `/COMMIT_MSG`:
6722+
6723The commit message and headers with the parent commit(s), the author
6724information and the committer information.
6725
6726* `/MERGE_LIST` (for merge commits only):
6727+
6728The list of commits that are being integrated into the destination
6729branch by submitting the merge commit.
6730
Gal Paikin3edc1422020-03-19 12:04:52 +01006731* `/PATCHSET_LEVEL`:
6732+
6733This file path is used exclusively for posting and indicating
6734patchset-level comments, thus not relevant for other use-cases.
6735
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006736[[fix-id]]
6737=== \{fix-id\}
6738UUID of a suggested fix.
6739
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006740[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006741=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006742Identifier that uniquely identifies one revision of a change.
6743
6744This can be:
6745
Shawn Pearce9c0722a2013-03-02 15:30:31 -08006746* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006747* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
6748* an abbreviated commit ID that uniquely identifies one revision of the
6749 change ("674ac754"), at least 4 digits are required
Edwin Kempin2582c982022-12-27 15:47:59 +01006750* a numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02006751* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006752
Edwin Kempine3446292013-02-19 16:40:14 +01006753[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006754== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01006755
Edwin Kempined5364b2013-02-22 10:39:33 +01006756[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006757=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01006758The `AbandonInput` entity contains information for abandoning a change.
6759
David Pursehouseae367192014-11-25 17:24:47 +09006760[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006761|=============================
6762|Field Name ||Description
6763|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01006764Message to be added as review comment to the change when abandoning the
6765change.
Edwin Kempincd07df42016-12-01 09:10:09 +01006766|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07006767Notify handling that defines to whom email notifications should be sent after
6768the change is abandoned. +
6769Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6770If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006771|`notify_details`|optional|
6772Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006773of link:user-notify.html#recipient-types[recipient type] to
6774link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01006775|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01006776
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006777[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006778=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006779The `ActionInfo` entity describes a REST API call the client can
6780make to manipulate a resource. These are frequently implemented by
6781plugins and may be discovered at runtime.
6782
David Pursehouseae367192014-11-25 17:24:47 +09006783[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006784|====================================
6785|Field Name ||Description
6786|`method` |optional|
6787HTTP method to use with the action. Most actions use `POST`, `PUT`
6788or `DELETE` to cause state changes.
6789|`label` |optional|
6790Short title to display to a user describing the action. In the
6791Gerrit web interface the label is used as the text on the button
6792presented in the UI.
6793|`title` |optional|
6794Longer text to display describing the action. In a web UI this
6795should be the title attribute of the element, displaying when
6796the user hovers the mouse.
6797|`enabled` |optional|
6798If true the action is permitted at this time and the caller is
6799likely allowed to execute it. This may change if state is updated
6800at the server or permissions are modified. Not present if false.
Edwin Kempinccc9da02023-01-23 17:57:15 +01006801|`enabled_options` |optional|
6802Optional list of enabled options. +
Edwin Kempinb7c80b52023-03-02 12:30:20 +01006803See the list of suppported options link:#action-options[below].
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006804|====================================
6805
Edwin Kempinccc9da02023-01-23 17:57:15 +01006806[[action-options]]
6807==== Action Options
6808
6809Options that are returned via the `enabled_options` field of
6810link:#action-info[ActionInfo].
6811
6812[options="header",cols="1,^1,5"]
Edwin Kempin3d082a82023-02-23 16:33:12 +01006813|===================================
6814|REST view |Option |Description
6815|`rebase` |`rebase`|
Edwin Kempinccc9da02023-01-23 17:57:15 +01006816Present if the user can rebase the change. +
6817This is the case for the change owner and users with the
6818link:access-control.html#category_submit[Submit] or
6819link:access-control.html#category_rebase[Rebase] permission if they
6820have the link:access-control.html#category_push[Push] permission.
Edwin Kempinc8e0a062023-03-16 11:04:13 +01006821|`rebase` |`rebase_on_behalf_of_uploader`|
Edwin Kempinccc9da02023-01-23 17:57:15 +01006822Present if the user can rebase the change on behalf of the uploader. +
6823This is the case for the change owner and users with the
6824link:access-control.html#category_submit[Submit] or
6825link:access-control.html#category_rebase[Rebase] permission.
Edwin Kempin3d082a82023-02-23 16:33:12 +01006826|`rebase:chain`|`rebase`|
6827Present if the user can rebase the chain. +
6828This is the case if the calling user can rebase each change in the
Edwin Kempinf40b1f82023-03-31 09:40:08 +00006829chain.
Edwin Kempin3d082a82023-02-23 16:33:12 +01006830Rebasing a change is allowed for the change owner and users with the
6831link:access-control.html#category_submit[Submit] or
6832link:access-control.html#category_rebase[Rebase] permission if they
6833have the link:access-control.html#category_push[Push] permission.
Edwin Kempinc8e0a062023-03-16 11:04:13 +01006834|`rebase:chain`|`rebase_on_behalf_of_uploader`|
Edwin Kempin3d082a82023-02-23 16:33:12 +01006835Present if the user can rebase the chain on behalf of the uploader. +
6836This is the case if the calling user can rebase each change in the
Edwin Kempinf40b1f82023-03-31 09:40:08 +00006837chain on behalf of the uploader.
Edwin Kempin3d082a82023-02-23 16:33:12 +01006838Rebasing a change on behalf of the uploader is allowed for the change
6839owner and users with the link:access-control.html#category_submit[Submit]
6840or link:access-control.html#category_rebase[Rebase] permission.
6841|===================================
Edwin Kempinccc9da02023-01-23 17:57:15 +01006842
6843For all other REST views no options are returned.
6844
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006845[[applypatch-input]]
6846=== ApplyPatchInput
6847The `ApplyPatchInput` entity contains information about a patch to apply.
6848
6849A new commit will be created from the patch, and saved as a new patch set.
6850
6851[options="header",cols="1,^1,5"]
6852|=================================
6853|Field Name ||Description
6854|`patch` |required|
6855The patch to be applied. Must be compatible with `git diff` output.
6856For example, link:#get-patch[Get Patch] output.
Nitzan Gur-Furmancf722f62023-02-15 20:40:33 +01006857The patch must be provided as UTF-8 text, either directly or base64-encoded.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006858|=================================
6859
6860[[applypatchpatchset-input]]
6861=== ApplyPatchPatchSetInput
6862The `ApplyPatchPatchSetInput` entity contains information for creating a new patch set from a
6863given patch.
6864
6865[options="header",cols="1,^1,5"]
6866|=================================
6867|Field Name ||Description
6868|`patch` |required|
6869The details of the patch to be applied as a link:#applypatch-input[ApplyPatchInput] entity.
6870|`commit_message` |optional|
Nitzan Gur-Furman90398482023-02-23 09:48:24 +01006871The commit message for the new patch set. If not specified, the latest patch-set message will be
6872used.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006873|`base` |optional|
687440-hex digit SHA-1 of the commit which will be the parent commit of the newly created patch set.
6875If set, it must be a merged commit or a change revision on the destination branch.
6876Otherwise, the target change's branch tip will be used.
6877|`author` |optional|
6878The author of the commit to create. Must be an
6879link:rest-api-accounts.html#account-input[AccountInput] entity with at least
6880the `name` and `email` fields set.
6881The caller needs "Forge Author" permission when using this field, unless specifies their own details.
6882This field does not affect the owner of the change, which will continue to use the identity of the
6883caller.
Patrick Hiesele6759d52023-02-21 15:24:15 +01006884|`response_format_options` |optional|
6885List of link:#query-options[query options] to format the response.
Patrick Hiesel257539f2023-06-23 13:36:05 +02006886|`amend` |optional|
6887If true, the revision from the URL will be amended by the patch. This will use the tree of the
6888revision, apply the patch and create a new commit whose tree is the resulting tree of the operation
6889and whose parent(s) are the parent(s) of the revision. Cannot be used together with `base`.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006890|=================================
6891
6892
Edwin Kempine3446292013-02-19 16:40:14 +01006893[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006894=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006895The `ApprovalInfo` entity contains information about an approval from a
6896user for a label on a change.
6897
Edwin Kempin963dfd02013-02-27 12:39:32 +01006898`ApprovalInfo` has the same fields as
6899link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01006900In addition `ApprovalInfo` has the following fields:
6901
David Pursehouseae367192014-11-25 17:24:47 +09006902[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006903|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006904|Field Name ||Description
6905|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07006906The vote that the user has given for the label. If present and zero, the
6907user is permitted to vote on the label. If absent, the user is not
6908permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006909|`permitted_voting_range` |optional|
6910The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
6911on that label. If present, the user is permitted to vote on the label
6912regarding the range values. If absent, the user is not permitted to vote
6913on that label.
6914|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01006915The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006916|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006917Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006918while posting the review. Votes/comments that contain `tag` with
6919'autogenerated:' prefix can be filtered out in the web UI.
6920NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006921invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04006922|`post_submit` |not set if `false`|
6923If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01006924|===========================
6925
Gal Paikinc326de42020-06-16 18:49:00 +03006926[[attention-set-info]]
6927=== AttentionSetInfo
6928The `AttentionSetInfo` entity contains details of users that are in
6929the link:#attention-set[attention set].
6930
6931[options="header",cols="1,^1,5"]
6932|===========================
6933|Field Name ||Description
6934|`account` || link:rest-api-accounts.html#account-info[AccountInfo] entity.
6935|`last_update` || The link:rest-api.html#timestamp[timestamp] of the last update.
Marija Savtchouk25a5fd5a2021-08-06 17:26:24 +01006936|`reason` ||
6937The reason for adding or removing the user.
6938If the update was caused by another user, that account is represented by
6939account ID in reason as `<GERRIT_ACCOUNT_18419>` and the corresponding
6940link:rest-api-accounts.html#account-info[AccountInfo] can be found in `reason_account` field.
6941|`reason_account` ||
6942link:rest-api-accounts.html#account-info[AccountInfo] of the user who caused the update.
Gal Paikinc326de42020-06-16 18:49:00 +03006943
6944|===========================
6945[[attention-set-input]]
6946=== AttentionSetInput
6947The `AttentionSetInput` entity contains details for adding users to the
6948link:#attention-set[attention set] and removing them from it.
6949
6950[options="header",cols="1,^1,5"]
6951|===========================
Gal Paikinf2b1b332020-07-06 16:34:36 +03006952|Field Name ||Description
6953|`user` |optional| link:rest-api-accounts.html#account-id[ID]
Gal Paikinc326de42020-06-16 18:49:00 +03006954of the account that should be added to the attention set. For removals,
6955this field should be empty or the same as the field in the request header.
Gal Paikinf2b1b332020-07-06 16:34:36 +03006956|`reason` || The reason of for adding or removing the user.
6957|`notify` |optional|
6958Notify handling that defines to whom email notifications should be sent
6959after the change is created. +
6960Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6961If not set, the default is `OWNER`.
6962|`notify_details` |optional|
6963Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03006964as a map of link:user-notify.html#recipient-types[recipient type] to
6965link:#notify-info[NotifyInfo] entity.
Gal Paikinc326de42020-06-16 18:49:00 +03006966|===========================
6967
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006968[[blame-info]]
6969=== BlameInfo
6970The `BlameInfo` entity stores the commit metadata with the row coordinates where
6971it applies.
6972
6973[options="header",cols="1,6"]
6974|===========================
6975|Field Name | Description
6976|`author` | The author of the commit.
6977|`id` | The id of the commit.
6978|`time` | Commit time.
6979|`commit_msg` | The commit message.
6980|`ranges` |
6981The blame row coordinates as link:#range-info[RangeInfo] entities.
6982|===========================
6983
Edwin Kempin521c1242015-01-23 12:44:44 +01006984[[change-edit-input]]
6985=== ChangeEditInput
6986The `ChangeEditInput` entity contains information for restoring a
6987path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02006988
Edwin Kempin521c1242015-01-23 12:44:44 +01006989[options="header",cols="1,^1,5"]
6990|===========================
6991|Field Name ||Description
6992|`restore_path`|optional|Path to file to restore.
6993|`old_path` |optional|Old path to file to rename.
6994|`new_path` |optional|New path to file to rename.
6995|===========================
6996
6997[[change-edit-message-input]]
6998=== ChangeEditMessageInput
6999The `ChangeEditMessageInput` entity contains information for changing
7000the commit message within a change edit.
7001
7002[options="header",cols="1,^1,5"]
7003|===========================
7004|Field Name ||Description
7005|`message` ||New commit message.
7006|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02007007
Edwin Kempine3446292013-02-19 16:40:14 +01007008[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007009=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007010The `ChangeInfo` entity contains information about a change.
7011
David Pursehouseae367192014-11-25 17:24:47 +09007012[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007013|==================================
7014|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01007015|`id` ||
Marija Savtchouk50735252023-04-27 12:22:44 +02007016The ID of the change. Subject to a 'GerritBackendFeature__return_new_change_info_id'
7017 experiment, the format is either "'<project>\~<_number>'" (new format),
7018or `triplet_id`. The experiment is needed to allow callers to migrate.
7019'project' and '_number' are URL encoded. The callers must not rely on the format.
7020|`triplet_id` ||
Edwin Kempine3446292013-02-19 16:40:14 +01007021The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
Alon Bar-Lev921085b2023-05-18 21:16:48 +03007022where 'project' and 'branch' are URL encoded. For 'branch' the
Marija Savtchouk50735252023-04-27 12:22:44 +02007023`refs/heads/` prefix is omitted.
Edwin Kempine3446292013-02-19 16:40:14 +01007024|`project` ||The name of the project.
7025|`branch` ||
7026The name of the target branch. +
7027The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01007028|`topic` |optional|The topic to which this change belongs.
Gal Paikinc326de42020-06-16 18:49:00 +03007029|`attention_set` |optional|
7030The map that maps link:rest-api-accounts.html#account-id[account IDs]
Gal Paikin69f20462021-11-08 17:26:42 +01007031to link:#attention-set-info[AttentionSetInfo] of that account. Those are all
7032accounts that are currently in the attention set.
7033|`removed_from_attention_set` |optional|
7034The map that maps link:rest-api-accounts.html#account-id[account IDs]
7035to link:#attention-set-info[AttentionSetInfo] of that account. Those are all
7036accounts that were in the attention set but were removed. The
7037link:#attention-set-info[AttentionSetInfo] is the latest and most recent removal
7038 of the account from the attention set.
Edwin Kempin93b74fb2017-08-25 10:42:56 +02007039|`hashtags` |optional|
Gal Paikin07a580c2021-04-15 09:47:36 +02007040List of hashtags that are set on the change.
Chris Poucetc2962dc2023-03-07 17:19:25 +01007041|`custom_keyed_values` |optional|
7042A map that maps custom keys to custom values that are tied to a specific change,
7043both in the form of strings. Only set if link:#custom-keyed-values[custom keyed
7044values] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007045|`change_id` ||The Change-Id of the change.
7046|`subject` ||
7047The subject of the change (header line of the commit message).
7048|`status` ||
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01007049The status of the change (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempine3446292013-02-19 16:40:14 +01007050|`created` ||
7051The link:rest-api.html#timestamp[timestamp] of when the change was
7052created.
7053|`updated` ||
7054The link:rest-api.html#timestamp[timestamp] of when the change was last
7055updated.
Khai Do96a7caf2016-01-07 14:07:54 -08007056|`submitted` |only set for merged changes|
7057The link:rest-api.html#timestamp[timestamp] of when the change was
7058submitted.
Dave Borowitz8ec31f92017-08-23 10:28:34 -04007059|`submitter` |only set for merged changes|
7060The user who submitted the change, as an
7061link:rest-api-accounts.html#account-info[ AccountInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01007062|`starred` |not set if `false`|
Nitzan Gur-Furman70933e52023-06-30 13:36:41 +02007063Whether the calling user has starred this change.
Youssef Elghareebf4f49482023-04-26 18:02:33 +02007064Only set if link:#star[requested].
Edwin Kempine3446292013-02-19 16:40:14 +01007065|`reviewed` |not set if `false`|
7066Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07007067Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05007068|`submit_type` |optional|
Changcheng Xiao21885982019-01-15 18:16:51 +01007069The link:config-project-config.html#submit-type[submit type] of the change. +
Dave Borowitzace32102015-12-17 13:08:25 -05007070Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01007071|`mergeable` |optional|
7072Whether the change is mergeable. +
Patrick Hiesela4824db2019-12-20 10:55:26 +01007073Only set for open changes if
7074link:config-gerrit.html#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior]
7075is `API_REF_UPDATED_AND_CHANGE_REINDEX`.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07007076|`submittable` |optional|
7077Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07007078Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01007079|`insertions` ||
7080Number of inserted lines.
7081|`deletions` ||
7082Number of deleted lines.
Dave Borowitzc001f322018-10-31 14:31:08 -07007083|`total_comment_count` |optional|
7084Total number of inline comments across all patch sets. Not set if the current
7085change index doesn't have the data.
Changcheng Xiao81c48092017-02-08 13:04:07 +01007086|`unresolved_comment_count` |optional|
Dave Borowitzc001f322018-10-31 14:31:08 -07007087Number of unresolved inline comment threads across all patch sets. Not set if
7088the current change index doesn't have the data.
Ben Rohlfsb56e3552021-09-10 09:04:19 +02007089|`_number` ||
Sven Selberg45ca1782023-01-09 08:32:27 +00007090The change number. (The underscore is just a relict of a prior
7091attempt to deprecate the change number.)
Edwin Kempine3446292013-02-19 16:40:14 +01007092|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01007093The owner of the change as an link:rest-api-accounts.html#account-info[
7094AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07007095|`actions` |optional|
7096Actions the caller might be able to perform on this revision. The
7097information is a map of view name to link:#action-info[ActionInfo]
7098entities.
Youssef Elghareeb02d33aa2021-10-04 13:24:52 +02007099|`submit_records` ||
7100List of the link:rest-api-changes.html#submit-record-info[SubmitRecordInfo]
7101containing the submit records for the change at the latest patchset.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01007102|`requirements` |optional|
7103List of the link:rest-api-changes.html#requirement[requirements] to be met before this change
Youssef Elghareeb79f473622021-05-26 18:58:40 +02007104can be submitted. This field is deprecated in favour of `submit_requirements`.
7105|`submit_requirements` |optional|
7106List of the link:#submit-requirement-result-info[SubmitRequirementResultInfo]
7107containing the evaluated submit requirements for the change.
7108Only set if link:#submit-requirements[`SUBMIT_REQUIREMENTS`] is requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007109|`labels` |optional|
7110The labels of the change as a map that maps the label names to
7111link:#label-info[LabelInfo] entries. +
7112Only set if link:#labels[labels] or link:#detailed-labels[detailed
7113labels] are requested.
7114|`permitted_labels` |optional|
7115A map of the permitted labels that maps a label name to the list of
7116values that are allowed for that label. +
7117Only set if link:#detailed-labels[detailed labels] are requested.
Nitzan Gur-Furmand1223572023-01-16 12:07:46 +00007118|`removable_labels` |optional|
7119A map of the removable labels that maps a label name to the map of
7120values and reviewers (
7121link:rest-api-accounts.html#account-info[AccountInfo] entities)
7122that are allowed to be removed from the change. +
7123Only set if link:#labels[labels] or
7124link:#detailed-labels[detailed labels] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007125|`removable_reviewers`|optional|
7126The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01007127link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01007128Only set if link:#labels[labels] or
7129link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07007130|`reviewers` |optional|
Edwin Kempin66af3d82015-11-10 17:38:40 -08007131The reviewers as a map that maps a reviewer state to a list of
7132link:rest-api-accounts.html#account-info[AccountInfo] entities.
7133Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
7134`REVIEWER`: Users with at least one non-zero vote on the change. +
7135`CC`: Users that were added to the change, but have not voted. +
7136`REMOVED`: Users that were previously reviewers on the change, but have
7137been removed. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01007138Only set if link:#labels[labels] or
7139link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07007140|`pending_reviewers` |optional|
7141Updates to `reviewers` that have been made while the change was in the
7142WIP state. Only present on WIP changes and only if there are pending
7143reviewer updates to report. These are reviewers who have not yet been
7144notified about being added to or removed from the change. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01007145Only set if link:#labels[labels] or
7146link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07007147|`reviewer_updates`|optional|
7148Updates to reviewers set for the change as
7149link:#review-update-info[ReviewerUpdateInfo] entities.
Han-Wen Nienhuys3c670be2020-06-30 19:17:07 +02007150Only set if link:#reviewer-updates[reviewer updates] are requested.
John Spurlock74a70cc2013-03-23 16:41:50 -04007151|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07007152Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04007153link:#change-message-info[ChangeMessageInfo] entities. +
7154Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007155|`current_revision` |optional|
7156The commit ID of the current patch set of this change. +
7157Only set if link:#current-revision[the current revision] is requested
7158or if link:#all-revisions[all revisions] are requested.
7159|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05007160All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01007161patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08007162Only set if link:#current-revision[the current revision] is requested
7163(in which case it will only contain a key for the current revision) or
7164if link:#all-revisions[all revisions] are requested.
Han-Wen Nienhuys4ec526a2021-02-16 19:20:26 +01007165|`meta_rev_id` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02007166The SHA-1 of the NoteDb meta ref.
Makson Lee3568a932017-08-28 17:12:03 +08007167|`tracking_ids` |optional|
7168A list of link:#tracking-id-info[TrackingIdInfo] entities describing
7169references to external tracking systems. Only set if
7170link:#tracking-ids[tracking ids] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007171|`_more_changes` |optional, not set if `false`|
7172Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08007173Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05007174|`problems` |optional|
7175A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08007176problems with this change. Only set if link:#check[CHECK] is set.
David Ostrovskycb19cec2017-04-28 11:55:45 +02007177|`is_private` |optional, not set if `false`|
7178When present, change is marked as private.
David Ostrovsky258849b2017-03-09 23:21:03 +01007179|`work_in_progress` |optional, not set if `false`|
7180When present, change is marked as Work In Progress.
Logan Hanks724b24c2017-07-14 10:01:05 -07007181|`has_review_started` |optional, not set if `false`|
Logan Hanks296cd892017-05-03 15:14:41 -07007182When present, change has been marked Ready at some point in time.
Patrick Hiesel828f3222017-07-13 14:18:38 +02007183|`revert_of` |optional|
Sven Selberg45ca1782023-01-09 08:32:27 +00007184The change number of the change that this change reverts.
Gal Paikinf57225a2019-11-13 12:39:12 -08007185|`submission_id` |optional|
7186ID of the submission of this change. Only set if the status is `MERGED`.
Sven Selberg45ca1782023-01-09 08:32:27 +00007187This ID is equal to the change number of the change that triggered the
7188submission. If the change that triggered the submission also has a topic,
7189it will be "<id>-<topic>" of the change that triggered the submission.
Gal Paikindd31db92019-12-06 14:43:35 +01007190The callers must not rely on the format of the submission ID.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007191|`cherry_pick_of_change` |optional|
Sven Selberg45ca1782023-01-09 08:32:27 +00007192The change number of the change that this change was cherry-picked from.
Edwin Kempin4529d642021-02-01 13:03:08 +01007193Only set if the cherry-pick has been done through the Gerrit REST API (and
7194not if a cherry-picked commit was pushed).
Edwin Kempinaab27d32020-01-29 13:17:04 +01007195|`cherry_pick_of_patch_set`|optional|
Kaushik Lingarkar73bcb412020-01-29 13:00:46 -08007196The patchset number of the change that this change was cherry-picked from.
Edwin Kempin4529d642021-02-01 13:03:08 +01007197Only set if the cherry-pick has been done through the Gerrit REST API (and
7198not if a cherry-picked commit was pushed).
Edwin Kempinaab27d32020-01-29 13:17:04 +01007199|`contains_git_conflicts` |optional, not set if `false`|
7200Whether the change contains conflicts. +
7201If `true`, some of the file contents of the change contain git conflict
7202markers to indicate the conflicts. +
7203Only set if this change info is returned in response to a request that
7204creates a new change or patch set and conflicts are allowed. In
7205particular this field is only populated if the change info is returned
7206by one of the following REST endpoints: link:#create-change[Create
7207Change], link:#create-merge-patch-set-for-change[Create Merge Patch Set
7208For Change], link:#cherry-pick[Cherry Pick Revision],
Edwin Kempin269a9502022-05-11 12:28:22 +02007209link:rest-api-project.html#cherry-pick-commit[Cherry Pick Commit],
7210link:#rebase-change[Rebase Change]
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007211|==================================
7212
7213[[change-input]]
7214=== ChangeInput
7215The `ChangeInput` entity contains information about creating a new change.
7216
7217[options="header",cols="1,^1,5"]
7218|==================================
7219|Field Name ||Description
7220|`project` ||The name of the project.
7221|`branch` ||
7222The name of the target branch. +
7223The `refs/heads/` prefix is omitted.
7224|`subject` ||
Edwin Kempinba8388c2020-03-06 08:46:59 +01007225The commit message of the change. Comment lines (beginning with `#`)
7226will be removed. If the commit message contains a Change-Id (as a
7227"Change-Id: I..." footer) that Change-Id will be used for the newly
7228created changed. If a change with this Change-Id already exists for
7229same repository and branch, the request is rejected since Change-Ids
7230must be unique per repository and branch. If the commit message doesn't
7231contain a Change-Id, a newly generated Change-Id is automatically
7232inserted into the commit message.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007233|`topic` |optional|The topic to which this change belongs.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02007234Topic can't contain quotation marks.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007235|`status` |optional, default to `NEW`|
David Ostrovsky4b44bdc2017-07-27 08:05:43 +02007236The status of the change (only `NEW` accepted here).
Edwin Kempin14d50ed2017-05-03 13:26:30 +02007237|`is_private` |optional, default to `false`|
7238Whether the new change should be marked as private.
7239|`work_in_progress` |optional, default to `false`|
7240Whether the new change should be set to work in progress.
David Ostrovsky9d8ec422014-12-24 00:52:09 +01007241|`base_change` |optional|
7242A link:#change-id[\{change-id\}] that identifies the base change for a create
Nitzan Gur-Furman6799a832023-01-13 12:20:25 +01007243change operation. +
7244Mutually exclusive with `base_commit`. +
7245If neither `base_commit` nor `base_change` are set, the target branch tip will
7246be used as the parent commit.
Aaron Gablee8e73282018-04-26 11:09:30 -07007247|`base_commit` |optional|
7248A 40-digit hex SHA-1 of the commit which will be the parent commit of the newly
Nitzan Gur-Furman6799a832023-01-13 12:20:25 +01007249created change. If set, it must be a merged commit on the destination branch. +
7250Mutually exclusive with `base_change`. +
7251If neither `base_commit` nor `base_change` are set, the target branch tip will
7252be used as the parent commit.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007253|`new_branch` |optional, default to `false`|
Edwin Kempine94bb872019-10-08 13:47:41 +02007254Allow creating a new branch when set to `true`. Using this option is
7255only possible for non-merge commits (if the `merge` field is not set).
Edwin Kempined8a6bf2021-06-15 14:00:31 +02007256|`validation_options` |optional|
7257Map with key-value pairs that are forwarded as options to the commit validation
7258listeners (e.g. can be used to skip certain validations). Which validation
7259options are supported depends on the installed commit validation listeners.
7260Gerrit core doesn't support any validation options, but commit validation
7261listeners that are implemented in plugins may. Please refer to the
7262documentation of the installed plugins to learn whether they support validation
7263options. Unknown validation options are silently ignored.
Chris Poucetf5e68292023-04-03 16:21:39 +02007264|`custom_keyed_values`|optional|Custom keyed values as a
7265map from custom keys to values.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007266|`merge` |optional|
7267The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempine94bb872019-10-08 13:47:41 +02007268If set, the target branch (see `branch` field) must exist (it is not
7269possible to create it automatically by setting the `new_branch` field
7270to `true`.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03007271|`patch` |optional|
7272The detail of a patch to be applied as an link:#applypatch-input[ApplyPatchInput] entity.
Han-Wen Nienhuys2a1029e2020-01-30 18:52:45 +01007273|`author` |optional|
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03007274The author of the commit to create. Must be an
7275link:rest-api-accounts.html#account-input[AccountInput] entity with at least
7276the `name` and `email` fields set.
Han-Wen Nienhuys2a1029e2020-01-30 18:52:45 +01007277The caller needs "Forge Author" permission when using this field.
7278This field does not affect the owner of the change, which will
7279continue to use the identity of the caller.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01007280|`notify` |optional|
7281Notify handling that defines to whom email notifications should be sent
7282after the change is created. +
7283Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7284If not set, the default is `ALL`.
7285|`notify_details` |optional|
7286Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03007287as a map of link:user-notify.html#recipient-types[recipient type] to
7288link:#notify-info[NotifyInfo] entity.
Patrick Hiesele6759d52023-02-21 15:24:15 +01007289|`response_format_options` |optional|
7290List of link:#query-options[query options] to format the response.
Edwin Kempine3446292013-02-19 16:40:14 +01007291|==================================
7292
John Spurlock74a70cc2013-03-23 16:41:50 -04007293[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007294=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04007295The `ChangeMessageInfo` entity contains information about a message
7296attached to a change.
7297
David Pursehouseae367192014-11-25 17:24:47 +09007298[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04007299|==================================
7300|Field Name ||Description
7301|`id` ||The ID of the message.
7302|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07007303Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04007304link:rest-api-accounts.html#account-info[AccountInfo] entity. +
7305Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01007306|`real_author` |optional|
7307Real author of the message as an
7308link:rest-api-accounts.html#account-info[AccountInfo] entity. +
Edwin Kempine03de5f2023-01-31 14:54:51 +01007309Only set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04007310|`date` ||
7311The link:rest-api.html#timestamp[timestamp] this message was posted.
Marija Savtchouke40dc1a2021-04-07 09:56:12 +01007312|`message` ||
7313The text left by the user or Gerrit system. Accounts are served as account IDs
7314inlined in the text as `<GERRIT_ACCOUNT_18419>`.
7315All accounts, used in message, can be found in `accountsInMessage`
7316field.
7317|`accountsInMessage` ||Accounts, used in `message`.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007318|`tag` |optional|
7319Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00007320while posting the review. Votes/comments that contain `tag` with
7321'autogenerated:' prefix can be filtered out in the web UI.
7322NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007323invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04007324|`_revision_number` |optional|
7325Which patchset (if any) generated this message.
7326|==================================
7327
Gustaf Lundh019fb262012-11-28 14:20:22 +01007328[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007329=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01007330The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
7331
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02007332[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01007333|===========================
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007334|Field Name ||Description
7335|`message` |optional|
Edwin Kempin159804b2019-09-23 11:09:39 +02007336Commit message for the cherry-pick change. If not set, the commit message of
7337the cherry-picked commit is used.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007338|`destination` ||Destination branch
7339|`base` |optional|
Changcheng Xiaoe3332582017-05-26 15:29:41 +0200734040-hex digit SHA-1 of the commit which will be the parent commit of the newly created change.
7341If set, it must be a merged commit or a change revision on the destination branch.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007342|`parent` |optional, defaults to 1|
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02007343Number of the parent relative to which the cherry-pick should be considered.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007344|`notify` |optional|
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02007345Notify handling that defines to whom email notifications should be sent
7346after the cherry-pick. +
7347Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Saša Živkov357e2bd2020-06-12 12:06:07 +02007348If not set, the default is `ALL`.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007349|`notify_details` |optional|
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02007350Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007351of link:user-notify.html#recipient-types[recipient type] to
7352link:#notify-info[NotifyInfo] entity.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007353|`keep_reviewers` |optional, defaults to false|
Edwin Kempin5ac370d2018-10-05 13:39:34 +02007354If `true`, carries reviewers and ccs over from original change to newly created one.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007355|`allow_conflicts` |optional, defaults to false|
Edwin Kempin5ac370d2018-10-05 13:39:34 +02007356If `true`, the cherry-pick uses content merge and succeeds also if
7357there are conflicts. If there are conflicts the file contents of the
7358created change contain git conflict markers to indicate the conflicts.
7359Callers can find out if there were conflicts by checking the
Edwin Kempinaab27d32020-01-29 13:17:04 +01007360`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. If
7361there are conflicts the cherry-pick change is marked as
Edwin Kempin3c4113a2018-10-12 10:49:33 +02007362work-in-progress.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007363|`topic` |optional|
Gal Paikinf3abd3c2020-03-24 16:39:20 +01007364The topic of the created cherry-picked change. If not set, the default depends
7365on the source. If the source is a change with a topic, the resulting topic
7366of the cherry-picked change will be {source_change_topic}-{destination_branch}.
7367Otherwise, if the source change has no topic, or the source is a commit,
7368the created change will have no topic.
Gal Paikin1f83c202020-03-31 16:23:41 +02007369If the change already exists, the topic will not change if not set. If set, the
7370topic will be overridden.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007371|`allow_empty` |optional, defaults to false|
Gal Paikin626abe02020-04-07 12:21:26 +02007372If `true`, the cherry-pick succeeds also if the created commit will be empty.
7373If `false`, a cherry-pick that would create an empty commit fails without creating
7374the commit.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007375|`validation_options`|optional|
7376Map with key-value pairs that are forwarded as options to the commit validation
7377listeners (e.g. can be used to skip certain validations). Which validation
7378options are supported depends on the installed commit validation listeners.
7379Gerrit core doesn't support any validation options, but commit validation
7380listeners that are implemented in plugins may. Please refer to the
7381documentation of the installed plugins to learn whether they support validation
7382options. Unknown validation options are silently ignored.
Gustaf Lundh019fb262012-11-28 14:20:22 +01007383|===========================
7384
Edwin Kempincb6724a2013-02-26 16:58:51 +01007385[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007386=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05007387The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007388
David Pursehouseae367192014-11-25 17:24:47 +09007389[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01007390|===========================
7391|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07007392|`patch_set` |optional|
7393The patch set number for the comment; only set in contexts where +
7394comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04007395|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007396|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01007397link:#file-id[The file path] for which the inline comment was done. +
Edwin Kempincb6724a2013-02-26 16:58:51 +01007398Not set if returned in a map where the key is the file path.
7399|`side` |optional|
7400The side on which the comment was added. +
7401Allowed values are `REVISION` and `PARENT`. +
7402If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01007403|`parent` |optional|
7404The 1-based parent number. Used only for merge commits when `side == PARENT`.
7405When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007406|`line` |optional|
7407The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04007408If range is set, this equals the end line of the range. +
7409If neither line nor range is set, it's a file comment.
7410|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09007411The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04007412entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007413|`in_reply_to` |optional|
7414The URL encoded UUID of the comment to which this comment is a reply.
7415|`message` |optional|The comment message.
7416|`updated` ||
7417The link:rest-api.html#timestamp[timestamp] of when this comment was
7418written.
John Spurlock5e402f02013-03-24 11:35:04 -04007419|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09007420The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04007421link:rest-api-accounts.html#account-info[AccountInfo] entity. +
7422Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007423|`tag` |optional|
7424Value of the `tag` field from link:#review-input[ReviewInput] set
7425while posting the review.
Sven Selberg1a6728d2018-09-28 12:30:12 +02007426NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007427invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08007428|`unresolved` |optional|
7429Whether or not the comment must be addressed by the user. The state of
7430resolution of a comment thread is stored in the last comment in that thread
7431chronologically.
Youssef Elghareeb7fdfa442020-02-03 12:00:52 +01007432|`change_message_id` |optional|
Youssef Elghareeb5bd4e4e2020-08-13 17:09:42 +02007433Available with the link:#list-change-comments[list change comments] endpoint.
7434Contains the link:rest-api-changes.html#change-message-info[id] of the change
7435message that this comment is linked to.
Youssef Elghareebb5e42082020-07-09 15:24:01 +02007436|`commit_id` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02007437Hex commit SHA-1 (40 characters string) of the commit of the patchset to which
Youssef Elghareebb5e42082020-07-09 15:24:01 +02007438this comment applies.
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007439|`context_lines` |optional|
7440A list of link:#context-line[ContextLine] containing the lines of the source
Youssef Elghareeb68e87b62021-01-11 13:20:03 +01007441file where the comment was written. Available only if the "enable-context"
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007442parameter (see link:#list-change-comments[List Change Comments]) is set.
Youssef Elghareeb27d62012021-02-23 18:21:46 +01007443|`source_content_type` |optional|
7444Mime type of the file where the comment is written. Available only if the
7445"enable-context" parameter (see link:#list-change-comments[List Change Comments])
7446is set.
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007447
Edwin Kempincb6724a2013-02-26 16:58:51 +01007448|===========================
7449
Edwin Kempin67498de2013-02-25 16:15:34 +01007450[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007451=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03007452The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01007453comment.
7454
David Pursehouseae367192014-11-25 17:24:47 +09007455[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01007456|===========================
7457|Field Name ||Description
7458|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01007459The URL encoded UUID of the comment if an existing draft comment should
7460be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01007461|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01007462link:#file-id[The file path] for which the inline comment should be added. +
Edwin Kempin7faf41e2013-02-27 08:17:02 +01007463Doesn't need to be set if contained in a map where the key is the file
7464path.
Edwin Kempin67498de2013-02-25 16:15:34 +01007465|`side` |optional|
7466The side on which the comment should be added. +
7467Allowed values are `REVISION` and `PARENT`. +
7468If not set, the default is `REVISION`.
7469|`line` |optional|
7470The number of the line for which the comment should be added. +
7471`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04007472If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09007473If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04007474|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09007475The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04007476entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01007477|`in_reply_to` |optional|
7478The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01007479|`updated` |optional|
7480The link:rest-api.html#timestamp[timestamp] of this comment. +
7481Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01007482|`message` |optional|
7483The comment message. +
7484If not set and an existing draft comment is updated, the existing draft
7485comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04007486|`tag` |optional, drafts only|
7487Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
7488inputs; for published comments, use the `tag` field in +
Gal Paikinb2b81f22020-02-26 13:14:08 +01007489link:#review-input[ReviewInput]. Votes/comments that contain `tag` with
Vitaliy Lotorevea882812018-06-28 20:16:39 +00007490'autogenerated:' prefix can be filtered out in the web UI.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08007491|`unresolved` |optional|
7492Whether or not the comment must be addressed by the user. This value will
7493default to false if the comment is an orphan, or the value of the `in_reply_to`
7494comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01007495|===========================
7496
Michael Zhou596c7682013-08-25 05:43:34 -04007497[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007498=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04007499The `CommentRange` entity describes the range of an inline comment.
7500
Quinten Yearsley31786712018-07-16 13:44:33 -07007501The comment range is a range from the start position, specified by `start_line`
7502and `start_character`, to the end position, specified by `end_line` and
7503`end_character`. The start position is *inclusive* and the end position is
7504*exclusive*.
7505
7506So, a range over part of a line will have `start_line` equal to
7507`end_line`; however a range with `end_line` set to 5 and `end_character` equal
7508to 0 will not include any characters on line 5,
7509
David Pursehouseae367192014-11-25 17:24:47 +09007510[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04007511|===========================
Quinten Yearsley31786712018-07-16 13:44:33 -07007512|Field Name ||Description
7513|`start_line` ||The start line number of the range. (1-based)
7514|`start_character` ||The character position in the start line. (0-based)
7515|`end_line` ||The end line number of the range. (1-based)
7516|`end_character` ||The character position in the end line. (0-based)
Michael Zhou596c7682013-08-25 05:43:34 -04007517|===========================
7518
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007519[[context-line]]
7520=== ContextLine
7521The `ContextLine` entity contains the line number and line text of a single
7522line of the source file content.
7523
7524[options="header",cols="1,6"]
7525|===========================
7526|Field Name |Description
7527|`line_number` |The line number of the source line.
7528|`context_line` |String containing the line text.
7529|===========================
7530
Edwin Kempine3446292013-02-19 16:40:14 +01007531[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007532=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007533The `CommitInfo` entity contains information about a commit.
7534
Edwin Kempinf0c57152015-07-15 18:18:24 +02007535[options="header",cols="1,^1,5"]
7536|===========================
7537|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02007538|`commit` |Optional|
7539The commit ID. Not set if included in a link:#revision-info[
7540RevisionInfo] entity that is contained in a map which has the commit ID
7541as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007542|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01007543The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02007544link:#commit-info[CommitInfo] entities. In each parent
7545only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007546|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01007547link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007548|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01007549link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007550|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01007551The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02007552|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01007553|`web_links` |optional|
Frank Bordendf69edb2021-05-05 17:00:15 +02007554Links to the patch set in external sites as a list of
7555link:#web-link-info[WebLinkInfo] entities.
7556|`resolve_conflicts_web_links` |optional|
7557Links to the commit in external sites for resolving conflicts as a list of
Sven Selbergd26bd542014-11-21 16:28:10 +01007558link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007559|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01007560
Patrick Hieselfda96452017-06-14 16:44:54 +02007561[[commit-message-input]]
7562=== CommitMessageInput
7563The `CommitMessageInput` entity contains information for changing
7564the commit message of a change.
7565
7566[options="header",cols="1,^1,5"]
7567|=============================
7568|Field Name ||Description
7569|`message` ||New commit message.
7570|`notify` |optional|
7571Notify handling that defines to whom email notifications should be sent
7572after the commit message was updated. +
7573Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Logan Hanksa1e68dc2017-06-29 15:13:27 -07007574If not set, the default is `OWNER` for WIP changes and `ALL` otherwise.
Patrick Hieselfda96452017-06-14 16:44:54 +02007575|`notify_details`|optional|
7576Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007577of link:user-notify.html#recipient-types[recipient type] to
7578link:#notify-info[NotifyInfo] entity.
Patrick Hieselfda96452017-06-14 16:44:54 +02007579|=============================
7580
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02007581[[delete-change-message-input]]
7582=== DeleteChangeMessageInput
7583The `DeleteChangeMessageInput` entity contains the options for deleting a change message.
7584
7585[options="header",cols="1,^1,5"]
7586|=============================
7587|Field Name ||Description
7588|`reason` |optional|
7589The reason why the change message should be deleted. +
7590If set, the change message will be replaced with
7591"Change message removed by: `name`\nReason: `reason`",
7592or just "Change message removed by: `name`." if not set.
7593|=============================
7594
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01007595[[delete-comment-input]]
7596=== DeleteCommentInput
7597The `DeleteCommentInput` entity contains the option for deleting a comment.
7598
7599[options="header",cols="1,^1,5"]
7600|=============================
7601|Field Name ||Description
7602|`reason` |optional|
7603The reason why the comment should be deleted. +
7604If set, the comment's message will be replaced with
7605"Comment removed by: `name`; Reason: `reason`",
7606or just "Comment removed by: `name`." if not set.
7607|=============================
7608
Edwin Kempin407fca32016-08-29 12:01:00 +02007609[[delete-reviewer-input]]
7610=== DeleteReviewerInput
7611The `DeleteReviewerInput` entity contains options for the deletion of a
7612reviewer.
7613
7614[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007615|=============================
7616|Field Name ||Description
7617|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02007618Notify handling that defines to whom email notifications should be sent
7619after the reviewer is deleted. +
7620Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7621If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007622|`notify_details`|optional|
7623Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007624of link:user-notify.html#recipient-types[recipient type] to
7625link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007626|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02007627
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007628[[delete-vote-input]]
7629=== DeleteVoteInput
7630The `DeleteVoteInput` entity contains options for the deletion of a
7631vote.
7632
7633[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007634|=============================
7635|Field Name ||Description
7636|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007637The label for which the vote should be deleted. +
7638If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01007639|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007640Notify handling that defines to whom email notifications should be sent
7641after the vote is deleted. +
7642Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7643If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007644|`notify_details`|optional|
7645Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007646of link:user-notify.html#recipient-types[recipient type] to
7647link:#notify-info[NotifyInfo] entity.
Gal Paikinbd7575d2021-11-11 14:42:53 +01007648|`ignore_automatic_attention_set_rules`|optional|
7649If set to true, ignore all automatic attention set rules described in the
7650link:#attention-set[attention set]. When not set, the default is false.
Patrick Hiesel8c5568a2022-05-31 08:33:52 +02007651|`reason` |optional|
7652The reason why this vote is deleted. Will +
7653go into the change message.
Edwin Kempincd07df42016-12-01 09:10:09 +01007654|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007655
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08007656[[description-input]]
7657=== DescriptionInput
7658The `DescriptionInput` entity contains information for setting a description.
7659
7660[options="header",cols="1,6"]
7661|===========================
7662|Field Name |Description
7663|`description` |The description text.
7664|===========================
7665
David Pursehouse882aef22013-06-05 10:56:37 +09007666[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007667=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09007668The `DiffContent` entity contains information about the content differences
7669in a file.
7670
David Pursehouseae367192014-11-25 17:24:47 +09007671[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007672|==========================
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007673|Field Name ||Description
7674|`a` |optional|Content only in the file on side A (deleted in B).
7675|`b` |optional|Content only in the file on side B (added in B).
7676|`ab` |optional|Content in the file on both sides (unchanged).
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007677|`edit_a` |only present when the `intraline` parameter is set and the
7678DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09007679Text sections deleted from side A as a
7680link:#diff-intraline-info[DiffIntralineInfo] entity.
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007681|`edit_b` |only present when the `intraline` parameter is set and the
7682DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09007683Text sections inserted in side B as a
7684link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007685|`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a
7686rebase.
Renan Oliveirac5077aa2020-09-25 18:11:54 +02007687|`due_to_move`|not set if `false`|Indicates whether this entry was introduced by a
7688move operation.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007689|`skip` |optional|count of lines skipped on both sides when the file is
David Pursehouse882aef22013-06-05 10:56:37 +09007690too large to include all common lines.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007691|`common` |optional|Set to `true` if the region is common according
Shawn Pearce425a2be2014-01-02 16:00:58 -08007692to the requested ignore-whitespace parameter, but a and b contain
7693differing amounts of whitespace. When present and true a and b are
7694used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09007695|==========================
7696
7697[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007698=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007699The `DiffFileMetaInfo` entity contains meta information about a file diff.
7700
David Pursehouseae367192014-11-25 17:24:47 +09007701[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007702|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007703|Field Name ||Description
7704|`name` ||The name of the file.
Youssef Elghareeb20a91dd2022-02-03 13:46:44 +01007705|`content_type`||The content type of the file. For the commit message and merge
7706list the value is `text/x-gerrit-commit-message` and `text/x-gerrit-merge-list`
7707respectively. For git links the value is `x-git/gitlink`. For symlinks the value
7708is `x-git/symlink`. For regular files the value is the file mime type (e.g.
7709`text/x-java`, `text/x-c++src`, etc...).
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007710|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01007711|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007712Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07007713link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09007714|==========================
7715
7716[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007717=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007718The `DiffInfo` entity contains information about the diff of a file
7719in a revision.
7720
Edwin Kempin8cdce502014-12-06 10:55:38 +01007721If the link:#weblinks-only[weblinks-only] parameter is specified, only
7722the `web_links` field is set.
7723
David Pursehouseae367192014-11-25 17:24:47 +09007724[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007725|==========================
7726|Field Name ||Description
7727|`meta_a` |not present when the file is added|
7728Meta information about the file on side A as a
7729link:#diff-file-meta-info[DiffFileMetaInfo] entity.
7730|`meta_b` |not present when the file is deleted|
7731Meta information about the file on side B as a
7732link:#diff-file-meta-info[DiffFileMetaInfo] entity.
7733|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
7734`COPIED`, `REWRITE`).
7735|`intraline_status`|only set when the `intraline` parameter was specified in the request|
7736Intraline status (`OK`, `ERROR`, `TIMEOUT`).
7737|`diff_header` ||A list of strings representing the patch set diff header.
7738|`content` ||The content differences in the file as a list of
7739link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01007740|`web_links` |optional|
7741Links to the file diff in external sites as a list of
7742link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
Frank Borden19524922021-05-04 11:40:44 +02007743|`edit_web_links` |optional|
7744Links to edit the file in external sites as a list of
7745link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01007746|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09007747|==========================
7748
7749[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007750=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007751The `DiffIntralineInfo` entity contains information about intraline edits in a
7752file.
7753
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007754The information consists of a list of `<skip length, edit length>` pairs, where
David Pursehouse31203f52013-06-08 17:05:45 +09007755the skip length is the number of characters between the end of the previous edit
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007756and the start of this edit, and the edit length is the number of edited characters
David Pursehouse31203f52013-06-08 17:05:45 +09007757following the skip. The start of the edits is from the beginning of the related
Tao Zhou42430482019-09-13 11:26:01 +02007758diff content lines. If the list is empty, the entire DiffContent should be considered
7759as unedited.
David Pursehouse882aef22013-06-05 10:56:37 +09007760
David Pursehouse31203f52013-06-08 17:05:45 +09007761Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07007762the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09007763
Edwin Kempin8cdce502014-12-06 10:55:38 +01007764[[diff-web-link-info]]
7765=== DiffWebLinkInfo
Ben Rohlfs25c478112023-03-16 16:06:40 +01007766The `DiffWebLinkInfo` entity extends link:#web-link-info[WebLinkInfo] and
7767describes a link on a diff screen to an external site.
Edwin Kempin8cdce502014-12-06 10:55:38 +01007768
Ben Rohlfs25c478112023-03-16 16:06:40 +01007769[options="header",cols="1,^1,5"]
Edwin Kempin8cdce502014-12-06 10:55:38 +01007770|=======================
Ben Rohlfs25c478112023-03-16 16:06:40 +01007771|Field Name||Description
7772|`name` ||See link:#web-link-info[WebLinkInfo]
7773|`tooltip` |optional|See link:#web-link-info[WebLinkInfo]
7774|`url` ||See link:#web-link-info[WebLinkInfo]
7775|`image_url`|optional|See link:#web-link-info[WebLinkInfo]
7776|show_on_side_by_side_diff_view||
Edwin Kempin8cdce502014-12-06 10:55:38 +01007777Whether the web link should be shown on the side-by-side diff screen.
Ben Rohlfs25c478112023-03-16 16:06:40 +01007778|show_on_unified_diff_view||
Edwin Kempin8cdce502014-12-06 10:55:38 +01007779Whether the web link should be shown on the unified diff screen.
7780|=======================
7781
Sharad Bagribdb582d2022-03-26 01:32:35 -07007782[[apply-provided-fix-input]]
7783=== ApplyProvidedFixInput
7784The `ApplyProvidedFixInput` entity contains the fixes to be applied on a review.
7785
Chris Poucetf5e68292023-04-03 16:21:39 +02007786[[custom-keyed-values-input]]
7787=== CustomKeyedValuesInput
7788
7789The `CustomKeyedValuesInput` entity contains information about custom keyed values
7790to add to, and/or remove from, a change.
7791
7792[options="header",cols="1,^1,5"]
7793|=======================
7794|Field Name||Description
7795|`add` |optional|The map of custom keyed values to be added to the change.
7796|`remove` |optional|The list of custom keys to be removed from the change.
7797|=======================
7798
Sharad Bagribdb582d2022-03-26 01:32:35 -07007799[options="header",cols="1,6"]
7800|=======================
7801|Field Name |Description
7802|`fix_replacement_infos` |A list of <<fix-replacement-info,FixReplacementInfo>>.
7803|=======================
7804
David Ostrovsky9ea9c112015-01-25 00:12:38 +01007805[[edit-file-info]]
7806=== EditFileInfo
7807The `EditFileInfo` entity contains additional information
7808of a file within a change edit.
7809
7810[options="header",cols="1,^1,5"]
7811|===========================
7812|Field Name ||Description
7813|`web_links` |optional|
7814Links to the diff info in external sites as a list of
7815link:#web-link-info[WebLinkInfo] entities.
7816|===========================
7817
Edwin Kempin521c1242015-01-23 12:44:44 +01007818[[edit-info]]
7819=== EditInfo
7820The `EditInfo` entity contains information about a change edit.
7821
7822[options="header",cols="1,^1,5"]
7823|===========================
David Pursehouse5934d3f2019-01-07 15:23:49 +09007824|Field Name ||Description
7825|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01007826link:#commit-info[CommitInfo] entity.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007827|`base_patch_set_number`||The patch set number of the patch set the change edit is based on.
7828|`base_revision` ||The revision of the patch set the change edit is based on.
David Pursehouse1bb55ff2019-01-07 15:28:22 +09007829|`ref` ||The ref of the change edit.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007830|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01007831Information about how to fetch this patch set. The fetch information is
7832provided as a map that maps the protocol name ("`git`", "`http`",
7833"`ssh`") to link:#fetch-info[FetchInfo] entities.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007834|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01007835The files of the change edit as a map that maps the file names to
7836link:#file-info[FileInfo] entities.
7837|===========================
7838
Edwin Kempine3446292013-02-19 16:40:14 +01007839[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007840=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007841The `FetchInfo` entity contains information about how to fetch a patch
7842set via a certain protocol.
7843
David Pursehouseae367192014-11-25 17:24:47 +09007844[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007845|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02007846|Field Name ||Description
7847|`url` ||The URL of the project.
7848|`ref` ||The ref of the patch set.
7849|`commands` |optional|
7850The download commands for this patch set as a map that maps the command
7851names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09007852Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007853|==========================
7854
7855[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007856=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007857The `FileInfo` entity contains information about a file in a patch set.
7858
David Pursehouseae367192014-11-25 17:24:47 +09007859[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007860|=============================
7861|Field Name ||Description
7862|`status` |optional|
7863The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
7864"`C`"=Copied, "`W`"=Rewritten). +
7865Not set if the file was Modified ("`M`").
7866|`binary` |not set if `false`|Whether the file is binary.
7867|`old_path` |optional|
7868The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05007869Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01007870|`lines_inserted`|optional|
7871Number of inserted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02007872Not set for binary files or if no lines were inserted. +
7873An empty last line is not included in the count and hence this number can
Sharad Bagri6fc48982022-06-25 14:11:50 -07007874differ by one from details provided in <<diff-info,DiffInfo>>.
Edwin Kempine3446292013-02-19 16:40:14 +01007875|`lines_deleted` |optional|
7876Number of deleted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02007877Not set for binary files or if no lines were deleted. +
7878An empty last line is not included in the count and hence this number can
Sharad Bagri6fc48982022-06-25 14:11:50 -07007879differ by one from details provided in <<diff-info,DiffInfo>>.
Edwin Kempin640f9842015-10-08 15:53:20 +02007880|`size_delta` ||
7881Number of bytes by which the file size increased/decreased.
Youssef Elghareeb1ae12c02022-06-28 13:49:18 +02007882|`size` || File size in bytes.
7883|`old_mode` |optional|File mode in octal (e.g. 100644) at the old commit.
7884The first three digits indicate the file type and the last three digits contain
7885the file permission bits. For added files, this field will not be present.
7886|`new_mode` |optional|File mode in octal (e.g. 100644) at the new commit.
7887The first three digits indicate the file type and the last three digits contain
7888the file permission bits. For deleted files, this field will not be present.
Edwin Kempine3446292013-02-19 16:40:14 +01007889|=============================
7890
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007891[[fix-input]]
7892=== FixInput
7893The `FixInput` entity contains options for fixing commits using the
7894link:#fix-change[fix change] endpoint.
7895
7896[options="header",cols="1,6"]
7897|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07007898|Field Name |Description
7899|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007900database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07007901|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07007902merged into the destination branch as this exact SHA-1. If not, insert
7903a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007904|==========================
7905
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007906[[fix-suggestion-info]]
7907=== FixSuggestionInfo
7908The `FixSuggestionInfo` entity represents a suggested fix.
7909
7910[options="header",cols="1,^1,5"]
7911|==========================
7912|Field Name ||Description
7913|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
7914fix. It will be generated automatically and hence will be ignored if it's set
7915for input objects.
7916|`description` ||A description of the suggested fix.
7917|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01007918entities indicating how the content of one or several files should be modified.
7919Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007920|==========================
7921
7922[[fix-replacement-info]]
7923=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01007924The `FixReplacementInfo` entity describes how the content of a file should be
7925replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007926
7927[options="header",cols="1,6"]
7928|==========================
7929|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01007930|`path` |The path of the file which should be modified. Any file in
Alice Kober-Sotzek368547f2020-03-13 22:00:41 +01007931the repository may be modified. The commit message can be modified via the
7932magic file `/COMMIT_MSG` though only the part below the generated header of
7933that magic file can be modified. References to the header lines will result in
7934errors when the fix is applied.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007935|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01007936of the file should be replaced. Lines in the file are assumed to be separated
Alice Kober-Sotzekf0a3f342020-09-24 14:16:06 +02007937by the line feed character.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007938|`replacement` |The content which should be used instead of the current one.
7939|==========================
7940
Edwin Kempine3446292013-02-19 16:40:14 +01007941[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007942=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007943The `GitPersonInfo` entity contains information about the
7944author/committer of a commit.
7945
David Pursehouseae367192014-11-25 17:24:47 +09007946[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01007947|==========================
7948|Field Name |Description
7949|`name` |The name of the author/committer.
7950|`email` |The email address of the author/committer.
7951|`date` |The link:rest-api.html#timestamp[timestamp] of when
7952this identity was constructed.
7953|`tz` |The timezone offset from UTC of when this identity was
7954constructed.
7955|==========================
7956
Edwin Kempin521c1242015-01-23 12:44:44 +01007957[[group-base-info]]
7958=== GroupBaseInfo
7959The `GroupBaseInfo` entity contains base information about the group.
7960
7961[options="header",cols="1,6"]
7962|==========================
7963|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01007964|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01007965|`name` |The name of the group.
7966|==========================
7967
David Pursehoused9dac372016-11-24 19:41:10 +09007968[[hashtags-input]]
7969=== HashtagsInput
7970
7971The `HashtagsInput` entity contains information about hashtags to add to,
7972and/or remove from, a change.
7973
7974[options="header",cols="1,^1,5"]
7975|=======================
7976|Field Name||Description
7977|`add` |optional|The list of hashtags to be added to the change.
Mike Frysinger136ecbd2021-02-09 14:26:02 -05007978|`remove` |optional|The list of hashtags to be removed from the change.
David Pursehoused9dac372016-11-24 19:41:10 +09007979|=======================
7980
Edwin Kempin521c1242015-01-23 12:44:44 +01007981[[included-in-info]]
7982=== IncludedInInfo
7983The `IncludedInInfo` entity contains information about the branches a
Xinan Lindc40ff12021-07-26 23:26:28 -07007984change was merged into and tags it was tagged with. The branch or tag
7985must have 'refs/head/' or 'refs/tags/' prefix respectively.
Edwin Kempin521c1242015-01-23 12:44:44 +01007986
Edwin Kempin78279ba2015-05-22 15:22:41 +02007987[options="header",cols="1,^1,5"]
7988|=======================
7989|Field Name||Description
7990|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01007991Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007992|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01007993Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007994|`external`|optional|A map that maps a name to a list of external
7995systems that include this change, e.g. a list of servers on which this
7996change is deployed.
7997|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01007998
Edwin Kempine3446292013-02-19 16:40:14 +01007999[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008000=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07008001The `LabelInfo` entity contains information about a label on a change, always
8002corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01008003
Dave Borowitz88159512013-06-14 14:21:50 -07008004There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07008005link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07008006
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +01008007* Using `LABELS` will skip the `all.permitted_voting_range` attribute.
8008* Using `DETAILED_LABELS` will include the `all.permitted_voting_range`
8009 attribute.
Dave Borowitz88159512013-06-14 14:21:50 -07008010
David Pursehouseae367192014-11-25 17:24:47 +09008011[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01008012|===========================
8013|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01008014|`optional` |not set if `false`|
8015Whether the label is optional. Optional means the label may be set, but
8016it's neither necessary for submission nor does it block submission if
8017set.
Youssef Elghareeb261691a2021-11-17 13:01:08 +01008018|`description` |optional| The description of the label.
Dave Borowitz88159512013-06-14 14:21:50 -07008019|`approved` |optional|One user who approved this label on the change
8020(voted the maximum value) as an
8021link:rest-api-accounts.html#account-info[AccountInfo] entity.
8022|`rejected` |optional|One user who rejected this label on the change
8023(voted the minimum value) as an
8024link:rest-api-accounts.html#account-info[AccountInfo] entity.
8025|`recommended` |optional|One user who recommended this label on the
8026change (voted positively, but not the maximum value) as an
8027link:rest-api-accounts.html#account-info[AccountInfo] entity.
8028|`disliked` |optional|One user who disliked this label on the change
8029(voted negatively, but not the minimum value) as an
8030link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01008031|`blocking` |optional|If `true`, the label blocks submit operation.
8032If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07008033|`value` |optional|The voting value of the user who
8034recommended/disliked this label on the change if it is not
8035"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07008036|`default_value`|optional|The default voting value for the label.
8037This value may be outside the range specified in permitted_labels.
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +01008038|votes|optional|A list of integers containing the vote values applied to this
8039label at the latest patchset.
Edwin Kempine3446292013-02-19 16:40:14 +01008040|`all` |optional|List of all approvals for this label as a list
Aaron Gableea8a2112017-04-25 14:18:16 -07008041of link:#approval-info[ApprovalInfo] entities. Items in this list may
8042not represent actual votes cast by users; if a user votes on any label,
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +01008043a corresponding ApprovalInfo will appear in this list for all labels. +
8044The `permitted_voting_range` attribute is only set if the `DETAILED_LABELS`
8045option is requested.
Edwin Kempine3446292013-02-19 16:40:14 +01008046|`values` |optional|A map of all values that are allowed for this
8047label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07008048to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01008049|===========================
8050
Saša Živkov499873f2014-05-05 13:34:18 +02008051[[mergeable-info]]
8052=== MergeableInfo
8053The `MergeableInfo` entity contains information about the mergeability of a
8054change.
8055
David Pursehouseae367192014-11-25 17:24:47 +09008056[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02008057|============================
Saša Živkov697cab22014-04-29 16:46:50 +02008058|Field Name ||Description
8059|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02008060Submit type used for this change, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02008061`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Saša Živkov499873f2014-05-05 13:34:18 +02008062`CHERRY_PICK`.
Edwin Kempinfad66bc2020-01-29 10:26:00 +01008063|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008064The strategy of the merge, can be `recursive`, `resolve`,
8065`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02008066|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02008067`true` if this change is cleanly mergeable, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01008068|`commit_merged` |optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07008069`true` if this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01008070|`content_merged`|optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07008071`true` if the content of this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01008072|`conflicts` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008073A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02008074|`mergeable_into`|optional|
8075A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02008076|============================
Dave Borowitz88159512013-06-14 14:21:50 -07008077
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008078[[merge-input]]
8079=== MergeInput
8080The `MergeInput` entity contains information about the merge
8081
8082[options="header",cols="1,^1,5"]
Edwin Kempinaab27d32020-01-29 13:17:04 +01008083|==============================
8084|Field Name ||Description
8085|`source` ||
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008086The source to merge from, e.g. a complete or abbreviated commit SHA-1,
David Pursehouse4abaef932018-03-18 15:05:08 +09008087a complete reference name, a short reference name under `refs/heads`, `refs/tags`,
8088or `refs/remotes` namespace, etc.
Edwin Kempinaab27d32020-01-29 13:17:04 +01008089|`source_branch` |optional|
Han-Wen Nienhuys9ec1f6a2020-01-07 17:32:08 +01008090A branch from which `source` is reachable. If specified,
8091`source` is checked for visibility and reachability against only this
8092branch. This speeds up the operation, especially for large repos with
8093many branches.
Edwin Kempinaab27d32020-01-29 13:17:04 +01008094|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008095The strategy of the merge, can be `recursive`, `resolve`,
8096`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
Edwin Kempinaab27d32020-01-29 13:17:04 +01008097|`allow_conflicts`|optional, defaults to false|
8098If `true`, creating the merge succeeds also if there are conflicts. +
8099If there are conflicts the file contents of the created change contain
8100git conflict markers to indicate the conflicts. +
8101Callers can find out whether there were conflicts by checking the
8102`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. +
8103If there are conflicts the change is marked as work-in-progress. +
8104This option is not supported for all merge strategies (e.g. it's
8105supported for `recursive` and `resolve`, but not for
8106`simple-two-way-in-core`).
8107|==============================
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008108
Zhen Chenb1e07e52016-09-23 12:59:48 -07008109[[merge-patch-set-input]]
8110=== MergePatchSetInput
8111The `MergePatchSetInput` entity contains information about updating a new
8112change by creating a new merge commit.
8113
8114[options="header",cols="1,^1,5"]
8115|==================================
8116|Field Name ||Description
8117|`subject` |optional|
8118The new subject for the change, if not specified, will reuse the current patch
8119set's subject
Han-Wen Nienhuysbd2af0c2020-01-09 16:39:26 +01008120|`inherit_parent` |optional, default to `false`|
Zhen Chenb1e07e52016-09-23 12:59:48 -07008121Use the current patch set's first parent as the merge tip when set to `true`.
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02008122|`base_change` |optional|
Han-Wen Nienhuys69917fe2020-01-09 16:39:26 +01008123A link:#change-id[\{change-id\}] that identifies a change. When `inherit_parent`
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02008124is `false`, the merge tip will be the current patch set of the `base_change` if
8125it's set. Otherwise, the current branch tip of the destination branch will be used.
Zhen Chenb1e07e52016-09-23 12:59:48 -07008126|`merge` ||
8127The detail of the source commit for merge as a link:#merge-input[MergeInput]
8128entity.
Patrick Hiesele8fc7972020-10-06 13:22:07 +02008129|`author` |optional|
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03008130The author of the commit to create. Must be an
8131link:rest-api-accounts.html#account-input[AccountInput] entity with at least
8132the `name` and `email` fields set.
Patrick Hiesele8fc7972020-10-06 13:22:07 +02008133The caller needs "Forge Author" permission when using this field.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03008134This field does not affect the owner or the committer of the change, which will
Patrick Hiesele8fc7972020-10-06 13:22:07 +02008135continue to use the identity of the caller.
Zhen Chenb1e07e52016-09-23 12:59:48 -07008136|==================================
8137
Raviteja Sunkara791f3392015-11-03 13:24:50 +05308138[[move-input]]
8139=== MoveInput
8140The `MoveInput` entity contains information for moving a change to a new branch.
8141
8142[options="header",cols="1,^1,5"]
8143|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04008144|Field Name ||Description
8145|`destination_branch`||Destination branch
8146|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05308147A message to be posted in this change's comments
Marija Savtchoukd89fefc2020-12-15 06:46:15 +00008148|`keep_all_votes` |optional, defaults to false|
Marija Savtchoukcee6a8f2020-12-03 12:58:04 +00008149By default, only veto votes that are blocking the change from submission are moved to
8150the destination branch. Using this option is only allowed for administrators,
8151because it can affect the submission behaviour of the change (depending on the label access
8152configuration and submissions rules).
Raviteja Sunkara791f3392015-11-03 13:24:50 +05308153|===========================
8154
Edwin Kempincd07df42016-12-01 09:10:09 +01008155[[notify-info]]
8156=== NotifyInfo
8157The `NotifyInfo` entity contains detailed information about who should
8158be notified about an update. These notifications are sent out even if a
8159`notify` option in the request input disables normal notifications.
8160`NotifyInfo` entities are normally contained in a `notify_details` map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008161in the request input where the key is the
8162link:user-notify.html#recipient-types[recipient type].
Edwin Kempincd07df42016-12-01 09:10:09 +01008163
8164[options="header",cols="1,^1,5"]
8165|=======================
8166|Field Name||Description
8167|`accounts`|optional|
8168A list of link:rest-api-accounts.html#account-id[account IDs] that
8169identify the accounts that should be should be notified.
8170|=======================
8171
Youssef Elghareeba1121442023-06-14 14:53:59 +02008172[[parent-info]]
8173=== ParentInfo
8174The `ParentInfo` entity contains information about the parent commit of a
8175patch-set.
8176
8177[options="header",cols="1,^1,5"]
8178|=======================
8179|Field Name||Description
8180|`branch_name` |optional|Name of the target branch into which the parent commit
8181is merged.
8182|`commit_id` |optional|The commit SHA-1 of the parent commit, or null if the
8183current commit is root.
8184|`is_merged_in_target_branch` |optional, default to false| Set to true if the
8185parent commit is merged into the target branch.
8186|`change_id` |optional| If the parent commit is a patch-set of another gerrit
8187change, this field will hold the change ID of the parent change. Otherwise,
8188will be null.
8189|`change_number` |optional|If the parent commit is a patch-set of another gerrit
8190change, this field will hold the change number of the parent change. Otherwise,
8191will be null.
8192|`patch_set_number` |optional|If the parent commit is a patch-set of another gerrit
8193change, this field will hold the patch-set number of the parent change. Otherwise,
8194will be null.
8195|`change_status` |optional|If the parent commit is a patch-set of another gerrit
8196change, this field will hold the change status of the parent change. Otherwise,
8197will be null.
8198|=======================
8199
Edwin Kempin364a86b2017-04-27 12:34:00 +02008200[[private-input]]
8201=== PrivateInput
8202The `PrivateInput` entity contains information for changing the private
8203flag on a change.
8204
8205[options="header",cols="1,^1,5"]
8206|=======================
8207|Field Name||Description
8208|`message` |optional|Message describing why the private flag was changed.
8209|=======================
8210
Edwin Kempin521c1242015-01-23 12:44:44 +01008211[[problem-info]]
8212=== ProblemInfo
8213The `ProblemInfo` entity contains a description of a potential consistency problem
8214with a change. These are not related to the code review process, but rather
8215indicate some inconsistency in Gerrit's database or repository metadata related
8216to the enclosing change.
8217
8218[options="header",cols="1,^1,5"]
8219|===========================
8220|Field Name||Description
8221|`message` ||Plaintext message describing the problem with the change.
8222|`status` |optional|
8223The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
8224fix was attempted.
8225|`outcome` |optional|
8226If `status` is set, an additional plaintext message describing the
8227outcome of the fix.
8228|===========================
8229
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02008230[[publish-change-edit-input]]
8231=== PublishChangeEditInput
8232The `PublishChangeEditInput` entity contains options for the publishing of
8233change edit.
8234
8235[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008236|=============================
8237|Field Name ||Description
8238|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02008239Notify handling that defines to whom email notifications should be sent
8240after the change edit is published. +
8241Allowed values are `NONE` and `ALL`. +
8242If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008243|`notify_details`|optional|
8244Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008245of link:user-notify.html#recipient-types[recipient type] to
8246link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008247|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02008248
Patrick Hieselbb84fd72017-08-23 11:11:22 +02008249[[pure-revert-info]]
8250=== PureRevertInfo
8251The `PureRevertInfo` entity describes the result of a pure revert check.
8252
8253[options="header",cols="1,6"]
8254|======================
8255|Field Name |Description
8256|`is_pure_revert` |Outcome of the check as boolean.
8257|======================
8258
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04008259[[push-certificate-info]]
8260=== PushCertificateInfo
8261The `PushCertificateInfo` entity contains information about a push
8262certificate provided when the user pushed for review with `git push
8263--signed HEAD:refs/for/<branch>`. Only used when signed push is
8264link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
8265
8266[options="header",cols="1,6"]
8267|===========================
8268|Field Name|Description
8269|`certificate`|Signed certificate payload and GPG signature block.
8270|`key` |
8271Information about the key that signed the push, along with any problems
8272found while checking the signature or the key itself, as a
8273link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
8274|===========================
8275
Gabor Somossyb72d4c62015-10-20 23:40:07 +01008276[[range-info]]
8277=== RangeInfo
8278The `RangeInfo` entity stores the coordinates of a range.
8279
8280[options="header",cols="1,6"]
8281|===========================
8282|Field Name | Description
8283|`start` | First index.
8284|`end` | Last index.
8285|===========================
8286
Zalan Blenessy874aed72015-01-12 13:26:18 +01008287[[rebase-input]]
8288=== RebaseInput
8289The `RebaseInput` entity contains information for changing parent when rebasing.
8290
Edwin Kempin2f47eb42022-02-10 12:48:45 +01008291[options="header",cols="1,^1,5"]
Edwin Kempinccc9da02023-01-23 17:57:15 +01008292|====================================
8293|Field Name ||Description
8294|`base` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02008295The new parent revision. This can be a ref or a SHA-1 to a concrete patchset. +
Zalan Blenessy874aed72015-01-12 13:26:18 +01008296Alternatively, a change number can be specified, in which case the current
8297patch set is inferred. +
8298Empty string is used for rebasing directly on top of the target branch,
8299which effectively breaks dependency towards a parent change.
Michael Kelly6d5c9f62023-04-20 23:09:19 -07008300|`strategy` |optional|
8301The strategy of the merge, can be `recursive`, `resolve`,
8302`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
Edwin Kempinccc9da02023-01-23 17:57:15 +01008303|`allow_conflicts` |optional, defaults to false|
Edwin Kempin9a6f0542021-01-13 13:51:42 +01008304If `true`, the rebase also succeeds if there are conflicts. +
8305If there are conflicts the file contents of the rebased patch set contain
8306git conflict markers to indicate the conflicts. +
8307Callers can find out whether there were conflicts by checking the
8308`contains_git_conflicts` field in the returned link:#change-info[ChangeInfo]. +
Edwin Kempinccc9da02023-01-23 17:57:15 +01008309If there are conflicts the change is marked as work-in-progress. +
8310Cannot be combined with the `on_behalf_of_uploader` option.
8311|`on_behalf_of_uploader`|optional, defaults to false|
8312If `true`, the rebase is done on behalf of the uploader. +
8313This means the uploader of the current patch set will also be the uploader of
8314the rebased patch set. The calling user will be recorded as the real user. +
8315Rebasing on behalf of the uploader is only supported for trivial rebases.
8316This means this option cannot be combined with the `allow_conflicts` option. +
8317In addition, rebasing on behalf of the uploader is only supported for the
Edwin Kempin8bf2d862023-03-10 08:48:02 +01008318current patch set of a change. +
Edwin Kempinccc9da02023-01-23 17:57:15 +01008319If the caller is the uploader this flag is ignored and a normal rebase is done.
8320|`validation_options` |optional|
Edwin Kempine5ec9212022-02-11 13:37:35 +01008321Map with key-value pairs that are forwarded as options to the commit validation
8322listeners (e.g. can be used to skip certain validations). Which validation
8323options are supported depends on the installed commit validation listeners.
8324Gerrit core doesn't support any validation options, but commit validation
8325listeners that are implemented in plugins may. Please refer to the
8326documentation of the installed plugins to learn whether they support validation
8327options. Unknown validation options are silently ignored.
Edwin Kempinccc9da02023-01-23 17:57:15 +01008328|====================================
Zalan Blenessy874aed72015-01-12 13:26:18 +01008329
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01008330[[rebase-chain-info]]
8331=== RebaseChainInfo
8332
8333The `RebaseChainInfo` entity contains information about a chain of changes
8334that were rebased.
8335
8336[options="header",cols="1,^1,5"]
8337|===========================
8338|Field Name ||Description
8339|`rebased_changes` ||List of the unsubmitted ancestors, as link:#change-info[ChangeInfo]
8340entities. Includes both rebased changes, and previously up-to-date ancestors. The list is ordered by
8341ancestry, where the oldest ancestor is the first.
8342|`contains_git_conflicts` ||Whether any of the rebased changes has conflicts
8343due to rebasing.
Nitzan Gur-Furmanca0c55c2023-01-11 09:33:38 +01008344|===========================
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01008345
Edwin Kempin521c1242015-01-23 12:44:44 +01008346[[related-change-and-commit-info]]
8347=== RelatedChangeAndCommitInfo
8348
8349The `RelatedChangeAndCommitInfo` entity contains information about
8350a related change and commit.
8351
8352[options="header",cols="1,^1,5"]
8353|===========================
8354|Field Name ||Description
Patrick Hieselcab63512017-07-28 10:25:42 +02008355|`project` ||The project of the change or commit.
Edwin Kempin521c1242015-01-23 12:44:44 +01008356|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01008357|`commit` ||The commit as a
8358link:#commit-info[CommitInfo] entity.
8359|`_change_number` |optional|The change number.
8360|`_revision_number` |optional|The revision number.
8361|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07008362|`status` |optional|The status of the change. The status of
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01008363the change is one of (`NEW`, `MERGED`, `ABANDONED`).
Joerg Zieren75e95382022-07-08 11:30:35 +02008364|`submittable` |optional|Boolean indicating whether the change is
8365submittable. +
8366Only populated if link:#get-related-changes-submittable[requested].
Edwin Kempin521c1242015-01-23 12:44:44 +01008367|===========================
8368
8369[[related-changes-info]]
8370=== RelatedChangesInfo
8371The `RelatedChangesInfo` entity contains information about related
8372changes.
8373
8374[options="header",cols="1,6"]
8375|===========================
8376|Field Name |Description
8377|`changes` |A list of
8378link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
8379describing the related changes. Sorted by git commit order, newest to
8380oldest. Empty if there are no related changes.
8381|===========================
8382
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008383
8384[[requirement]]
8385=== Requirement
8386The `Requirement` entity contains information about a requirement relative to a change.
8387
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008388[options="header",cols="1,^1,5"]
8389|===========================
8390|Field Name | |Description
8391|`status` | | Status of the requirement. Can be either `OK`, `NOT_READY` or `RULE_ERROR`.
Sven Selberge748e3f2020-09-24 13:44:56 +02008392|`fallback_text` | | A human readable reason
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008393|`type` | |
8394Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it
8395was triggered. Can be seen as a class: requirements sharing the same type were created for a similar
8396reason, and the data structure will follow one set of rules.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008397|===========================
8398
8399
Edwin Kempined5364b2013-02-22 10:39:33 +01008400[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008401=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01008402The `RestoreInput` entity contains information for restoring a change.
8403
David Pursehouseae367192014-11-25 17:24:47 +09008404[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01008405|===========================
8406|Field Name ||Description
8407|`message` |optional|
8408Message to be added as review comment to the change when restoring the
8409change.
8410|===========================
8411
Edwin Kempind2ec4152013-02-22 12:17:19 +01008412[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008413=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01008414The `RevertInput` entity contains information for reverting a change.
8415
David Pursehouseae367192014-11-25 17:24:47 +09008416[options="header",cols="1,^1,5"]
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008417|=================================
8418|Field Name ||Description
8419|`message` |optional|
Edwin Kempind2ec4152013-02-22 12:17:19 +01008420Message to be added as review comment to the change when reverting the
8421change.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008422|`notify` |optional|
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01008423Notify handling that defines to whom email notifications should be sent
8424for reverting the change. +
8425Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8426If not set, the default is `ALL`.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008427|`notify_details` |optional|
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01008428Additional information about whom to notify about the revert as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008429of link:user-notify.html#recipient-types[recipient type] to
8430link:#notify-info[NotifyInfo] entity.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008431|`topic` |optional|
Gal Paikinb81f56c2019-10-16 14:39:24 +02008432Name of the topic for the revert change. If not set, the default for Revert
8433endpoint is the topic of the change being reverted, and the default for the
8434RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02008435Topic can't contain quotation marks.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008436|`work_in_progress` |optional|
Youssef Elghareeb86095442021-08-02 18:18:22 +02008437When present, change is marked as Work In Progress. The `notify` input is
Nitzan Gur-Furman08765cb2022-10-18 13:27:34 +02008438used if it's present, otherwise it will be overridden to `NONE`. +
8439Notifications for the reverted change will only sent once the result change is
8440no longer WIP. +
Youssef Elghareebfd02dae2020-09-03 21:56:30 +02008441If not set, the default is false.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008442|`validation_options`|optional|
8443Map with key-value pairs that are forwarded as options to the commit validation
8444listeners (e.g. can be used to skip certain validations). Which validation
8445options are supported depends on the installed commit validation listeners.
8446Gerrit core doesn't support any validation options, but commit validation
8447listeners that are implemented in plugins may. Please refer to the
8448documentation of the installed plugins to learn whether they support validation
8449options. Unknown validation options are silently ignored.
8450|=================================
Gal Paikinb81f56c2019-10-16 14:39:24 +02008451
8452[[revert-submission-info]]
8453=== RevertSubmissionInfo
Gal Paikin64777c72019-12-18 14:11:13 +01008454The `RevertSubmissionInfo` entity describes the revert changes.
Gal Paikinb81f56c2019-10-16 14:39:24 +02008455
8456[options="header",cols="1,6"]
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02008457|==============================
Gal Paikinb81f56c2019-10-16 14:39:24 +02008458|Field Name | Description
8459|`revert_changes` |
Edwin Kempin6e7fb4e2019-10-24 17:20:51 +02008460A list of link:#change-info[ChangeInfo] that describes the revert changes. Each
8461entity in that list is a revert change that was created in that revert
8462submission.
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02008463|==============================
Edwin Kempind2ec4152013-02-22 12:17:19 +01008464
Edwin Kempin67498de2013-02-25 16:15:34 +01008465[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008466=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01008467The `ReviewInfo` entity contains information about a review.
8468
David Pursehouseae367192014-11-25 17:24:47 +09008469[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01008470|===========================
8471|Field Name |Description
8472|`labels` |
8473The labels of the review as a map that maps the label names to the
8474voting values.
8475|===========================
8476
Viktar Donich316bf7a2016-07-06 11:29:01 -07008477[[review-update-info]]
8478=== ReviewerUpdateInfo
8479The `ReviewerUpdateInfo` entity contains information about updates to
8480change's reviewers set.
8481
8482[options="header",cols="1,6"]
8483|===========================
8484|Field Name |Description
8485|`updated`|
8486Timestamp of the update.
8487|`updated_by`|
8488The account which modified state of the reviewer in question as
8489link:rest-api-accounts.html#account-info[AccountInfo] entity.
8490|`reviewer`|
8491The reviewer account added or removed from the change as an
8492link:rest-api-accounts.html#account-info[AccountInfo] entity.
8493|`state`|
8494The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
8495|===========================
8496
Edwin Kempin67498de2013-02-25 16:15:34 +01008497[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008498=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01008499The `ReviewInput` entity contains information for adding a review to a
8500revision.
8501
David Pursehouseae367192014-11-25 17:24:47 +09008502[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01008503|============================
Gal Paikin3e984c22020-07-03 16:44:40 +03008504|Field Name ||Description
8505|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008506The message to be added as review comment.
Gal Paikin3e984c22020-07-03 16:44:40 +03008507|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01008508Apply this tag to the review comment message, votes, and inline
Ben Rohlfsd9be63f2021-02-04 09:01:46 +01008509comments. Tags with an 'autogenerated:' prefix may be used by CI or other
8510automated systems to distinguish them from human reviews. If another
8511message was posted on a newer patchset, but with the same tag, then the older
8512message will be hidden in the UI. Suffixes starting with `~` are not considered,
8513so `autogenerated:my-ci-system~trigger` and `autogenerated:my-ci-system~result`
8514will be considered being the same tag with regards to the hiding rule.
Gal Paikin3e984c22020-07-03 16:44:40 +03008515|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008516The votes that should be added to the revision as a map that maps the
8517label names to the voting values.
Gal Paikin3e984c22020-07-03 16:44:40 +03008518|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008519The comments that should be added as a map that maps a file path to a
8520list of link:#comment-input[CommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03008521|`robot_comments` |optional|
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008522The robot comments that should be added as a map that maps a file path
8523to a list of link:#robot-comment-input[RobotCommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03008524|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008525Draft handling that defines how draft comments are handled that are
8526already in the database but that were not also described in this
8527input. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05008528Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values
8529except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04008530Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05008531If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value
8532besides `KEEP` is allowed.
Youssef Elghareeb3e4bf512021-05-12 18:40:27 +02008533|`draft_ids_to_publish` |optional|
8534List of draft IDs to be published. The draft IDs should belong to the current
8535user and be valid. If `drafts` is set to `PUBLISH`, then draft IDs should
8536contain drafts for the same revision that is requested for review. If `drafts`
8537is set to `KEEP`, then `draft_ids_to_publish` will be ignored and no draft
8538comments will be published. +
8539If not set, the default is to publish all drafts according to the `drafts` field.
Gal Paikin3e984c22020-07-03 16:44:40 +03008540|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008541Notify handling that defines to whom email notifications should be sent
8542after the review is stored. +
8543Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8544If not set, the default is `ALL`.
Gal Paikin3e984c22020-07-03 16:44:40 +03008545|`notify_details` |optional|
Edwin Kempincd07df42016-12-01 09:10:09 +01008546Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008547of link:user-notify.html#recipient-types[recipient type] to
8548link:#notify-info[NotifyInfo] entity.
Gal Paikin3e984c22020-07-03 16:44:40 +03008549|`omit_duplicate_comments` |optional|
Bill Wendling692b4ec2015-10-19 15:40:57 -07008550If `true`, comments with the same content at the same place will be omitted.
Gal Paikin3e984c22020-07-03 16:44:40 +03008551|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07008552link:rest-api-accounts.html#account-id[\{account-id\}] the review
8553should be posted on behalf of. To use this option the caller must
8554have been granted `labelAs-NAME` permission for all keys of labels.
Gal Paikin3e984c22020-07-03 16:44:40 +03008555|`reviewers` |optional|
Patrick Hieselcf6d9352017-04-13 10:15:42 +02008556A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
Gal Paikin0184a2b2021-04-15 08:58:34 +02008557representing reviewers that should be added/removed to/from the change.
Gal Paikin3e984c22020-07-03 16:44:40 +03008558|`ready` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07008559If true, and if the change is work in progress, then start review.
8560It is an error for both `ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03008561|`work_in_progress` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07008562If true, mark the change as work in progress. It is an error for both
8563`ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03008564|`add_to_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03008565list of link:#attention-set-input[AttentionSetInput] entities to add
Gal Paikine631de22020-10-29 12:19:11 +01008566to the link:#attention-set[attention set]. Users that are not reviewers,
8567ccs, owner, or uploader are silently ignored.
Gal Paikin3e984c22020-07-03 16:44:40 +03008568|`remove_from_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03008569list of link:#attention-set-input[AttentionSetInput] entities to remove
8570from the link:#attention-set[attention set].
Gal Paikin3e984c22020-07-03 16:44:40 +03008571|`ignore_automatic_attention_set_rules`|optional|
8572If set to true, ignore all automatic attention set rules described in the
Gal Paikinc326de42020-06-16 18:49:00 +03008573link:#attention-set[attention set]. Updates in add_to_attention_set
8574and remove_from_attention_set are not ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01008575|============================
8576
Aaron Gable843b0c12017-04-21 08:25:27 -07008577[[review-result]]
8578=== ReviewResult
8579The `ReviewResult` entity contains information regarding the updates
8580that were made to a review.
8581
8582[options="header",cols="1,^1,5"]
8583|============================
8584|Field Name ||Description
8585|`labels` |optional|
8586Map of labels to values after the review was posted. Null if any reviewer
8587additions were rejected.
8588|`reviewers` |optional|
8589Map of account or group identifier to
Gal Paikin721a40b2021-04-15 09:30:00 +02008590link:rest-api-changes.html#reviewer-result[ReviewerResult]
Gal Paikin0184a2b2021-04-15 08:58:34 +02008591representing the outcome of adding/removing a reviewer.
Aaron Gable843b0c12017-04-21 08:25:27 -07008592Absent if no reviewer additions were requested.
Logan Hankse81ad8e2017-07-18 09:45:46 -07008593|`ready` |optional|
8594If true, the change was moved from WIP to ready for review as a result of this
8595action. Not set if false.
Edwin Kempinddcf6f92022-08-02 11:21:05 +02008596|`error` |optional|
8597Error message for non-200 responses.
Aaron Gable843b0c12017-04-21 08:25:27 -07008598|============================
8599
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008600[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008601=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008602The `ReviewerInfo` entity contains information about a reviewer and its
8603votes on a change.
8604
Edwin Kempin963dfd02013-02-27 12:39:32 +01008605`ReviewerInfo` has the same fields as
8606link:rest-api-accounts.html#account-info[AccountInfo] and includes
8607link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008608In addition `ReviewerInfo` has the following fields:
8609
David Pursehouseae367192014-11-25 17:24:47 +09008610[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008611|==========================
8612|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008613|`approvals` |
8614The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09008615approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01008616|`_account_id` |
8617This field is inherited from `AccountInfo` but is optional here if an
8618unregistered reviewer was added by email. See
8619link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008620|==========================
8621
Edwin Kempin392328e2013-02-25 12:50:03 +01008622[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008623=== ReviewerInput
Gal Paikin0184a2b2021-04-15 08:58:34 +02008624The `ReviewerInput` entity contains information for adding or removing
8625reviewers to/from the change.
Edwin Kempin392328e2013-02-25 12:50:03 +01008626
David Pursehouseae367192014-11-25 17:24:47 +09008627[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008628|=============================
8629|Field Name ||Description
8630|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01008631The link:rest-api-accounts.html#account-id[ID] of one account that
Gal Paikin0184a2b2021-04-15 08:58:34 +02008632should be added/removed as reviewer or the link:rest-api-groups.html#group-id[
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01008633ID] of one internal group for which all members should be added as reviewers. +
Edwin Kempin392328e2013-02-25 12:50:03 +01008634If an ID identifies both an account and a group, only the account is
8635added as reviewer to the change.
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01008636External groups, such as LDAP groups, will be silently omitted from a
8637link:#set-review[set-review] or
Gal Paikin0184a2b2021-04-15 08:58:34 +02008638link:rest-api-changes.html#add-reviewer[add-reviewer] call. A group can only be
8639specified for adding reviewers, not for removing them.
Edwin Kempincd07df42016-12-01 09:10:09 +01008640|`state` |optional|
Gal Paikin0184a2b2021-04-15 08:58:34 +02008641Add reviewer in this state. Possible reviewer states are `REVIEWER`,
8642`CC` and `REMOVED`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008643|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01008644Whether adding the reviewer is confirmed. +
8645The Gerrit server may be configured to
8646link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
8647confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01008648|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02008649Notify handling that defines to whom email notifications should be sent
8650after the reviewer is added. +
8651Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8652If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008653|`notify_details`|optional|
8654Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008655of link:user-notify.html#recipient-types[recipient type] to
8656link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008657|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01008658
Gal Paikin721a40b2021-04-15 09:30:00 +02008659[[reviewer-result]]
8660=== ReviewerResult
Gal Paikin0184a2b2021-04-15 08:58:34 +02008661The `ReviewerResult` entity describes the result of modifying reviewers of
8662a change.
Gal Paikin721a40b2021-04-15 09:30:00 +02008663
8664[options="header",cols="1,^1,5"]
8665|===========================
8666|Field Name ||Description
8667|`input` ||
8668Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
8669set while adding the reviewer.
8670|`reviewers` |optional|
8671The newly added reviewers as a list of link:#reviewer-info[
8672ReviewerInfo] entities.
8673|`ccs` |optional|
Gal Paikinefb4ad52021-04-15 09:44:40 +02008674The newly CCed accounts as a list of
8675link:rest-api-accounts.html#account-info[AccountInfo] entities. This field will
Gal Paikin0184a2b2021-04-15 08:58:34 +02008676only appear if the requested `state` for the reviewer was `CC`.
8677|`removed` |optional|
8678The newly removed accounts as a list of
8679link:rest-api-accounts.html#account-info[AccountInfo] entities.
8680This field will only appear if the requested `state` for the reviewer was
8681`REMOVED`.
Gal Paikin721a40b2021-04-15 09:30:00 +02008682|`error` |optional|
8683Error message explaining why the reviewer could not be added. +
8684If a group was specified in the input and an error is returned, it
8685means that none of the members were added as reviewer.
8686|`confirm` |`false` if not set|
8687Whether adding the reviewer requires confirmation.
8688|===========================
8689
Edwin Kempine3446292013-02-19 16:40:14 +01008690[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008691=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01008692The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07008693Not all fields are returned by default. Additional fields can
8694be obtained by adding `o` parameters as described in
8695link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01008696
David Pursehouseae367192014-11-25 17:24:47 +09008697[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01008698|===========================
8699|Field Name ||Description
David Pursehouse4de41112016-06-28 09:24:08 +09008700|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
8701`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Kasper Nilssonbe3616d2018-01-23 14:10:36 -08008702|`_number` ||The patch set number, or `edit` if the patch set is an edit.
Edwin Kempin04cbd342015-02-19 16:31:22 +01008703|`created` ||
8704The link:rest-api.html#timestamp[timestamp] of when the patch set was
8705created.
8706|`uploader` ||
8707The uploader of the patch set as an
8708link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempinccc9da02023-01-23 17:57:15 +01008709|`real_uploader`|optional|
8710The real uploader of the patch set as an
8711link:rest-api-accounts.html#account-info[AccountInfo] entity. +
8712Only set if the upload was done on behalf of another user.
Edwin Kempin4569ced2014-11-25 16:45:05 +01008713|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01008714|`fetch` ||
8715Information about how to fetch this patch set. The fetch information is
8716provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07008717"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
8718only included if a plugin implementing the
8719link:intro-project-owner.html#download-commands[download commands]
8720interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07008721|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01008722link:#commit-info[CommitInfo] entity.
Youssef Elghareeba1121442023-06-14 14:53:59 +02008723|`parents_data` |optional|
8724The parent commits of this patch-set commit as a list of
8725link:#parent-info[ParentInfo] entities. In each parent, we include the target
8726branch name if the parent is a merged commit in the target branch. Otherwise,
8727we include the change and patch-set numbers of the parent change. +
8728Only set if the `PARENTS` option is set.
Youssef Elghareeb4c115442023-06-15 18:16:42 +02008729|`branch` | optional|The name of the target branch that this revision is
8730set to be merged into. +
8731Note that if the change is moved with the link:#move-change[Move Change]
8732endpoint, this field can be different for different patchsets. For example,
8733if the change is moved and a new patchset is uploaded afterwards, the
8734link:#revision-info[RevisionInfo] of the previous patchset will contain the old
8735`branch`, but the newer patchset will contain the new `branch`.
Shawn Pearce12e51592013-07-13 22:08:40 -07008736|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01008737The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07008738link:#file-info[FileInfo] entities. Only set if
8739link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
8740option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07008741|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07008742Actions the caller might be able to perform on this revision. The
8743information is a map of view name to link:#action-info[ActionInfo]
8744entities.
Khai Dob3139b7532014-09-19 15:13:04 -07008745|`reviewed` |optional|
8746Indicates whether the caller is authenticated and has commented on the
8747current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Quinten Yearsley28cd2122019-06-10 14:41:13 -07008748|`commit_with_footers` |optional|
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07008749If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
8750this is the current patch set, contains the full commit message with
8751Gerrit-specific commit footers, as if this revision were submitted
8752using the link:project-configuration.html#cherry_pick[Cherry Pick]
8753submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04008754|`push_certificate` |optional|
8755If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
8756contains the push certificate provided by the user when uploading this
8757patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
8758This field is always set if the option is requested; if no push
8759certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07008760|`description` |optional|
8761The description of this patchset, as displayed in the patchset
8762selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01008763|===========================
8764
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008765[[robot-comment-info]]
8766=== RobotCommentInfo
8767The `RobotCommentInfo` entity contains information about a robot inline
8768comment.
8769
Alice Kober-Sotzek7d890be2020-10-01 17:41:56 +02008770`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>
8771except for the `unresolved` field which doesn't exist for robot comments.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008772In addition `RobotCommentInfo` has the following fields:
8773
8774[options="header",cols="1,^1,5"]
8775|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01008776|Field Name ||Description
8777|`robot_id` ||The ID of the robot that generated this comment.
8778|`robot_run_id` ||An ID of the run of the robot.
8779|`url` |optional|URL to more information.
8780|`properties` |optional|Robot specific properties as map that maps arbitrary
8781keys to values.
8782|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
8783<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008784|===========================
8785
8786[[robot-comment-input]]
8787=== RobotCommentInput
8788The `RobotCommentInput` entity contains information for creating an inline
8789robot comment.
8790
Alice Kober-Sotzek7d890be2020-10-01 17:41:56 +02008791[options="header",cols="1,^1,5"]
8792|===========================
8793|Field Name ||Description
8794|`path` ||
8795link:#file-id[The file path] for which the inline comment should be added.
8796|`side` |optional|
8797The side on which the comment should be added. +
8798Allowed values are `REVISION` and `PARENT`. +
8799If not set, the default is `REVISION`.
8800|`line` |optional|
8801The number of the line for which the comment should be added. +
8802`0` if it is a file comment. +
8803If neither line nor range is set, a file comment is added. +
8804If range is set, this value is ignored in favor of the `end_line` of the range.
8805|`range` |optional|
8806The range of the comment as a link:#comment-range[CommentRange]
8807entity.
8808|`in_reply_to` |optional|
8809The URL encoded UUID of the comment to which this comment is a reply.
8810|`message` |optional|
8811The comment message.
8812|`robot_id` ||The ID of the robot that generated this comment.
8813|`robot_run_id` ||An ID of the run of the robot.
8814|`url` |optional|URL to more information.
8815|`properties` |optional|Robot specific properties as map that maps arbitrary
8816keys to values.
8817|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
8818<<fix-suggestion-info,FixSuggestionInfo>> entities.
8819|===========================
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008820
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008821[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008822=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008823The `RuleInput` entity contains information to test a Prolog rule.
8824
David Pursehouseae367192014-11-25 17:24:47 +09008825[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008826|===========================
8827|Field Name ||Description
8828|`rule`||
8829Prolog code to execute instead of the code in `refs/meta/config`.
8830|`filters`|`RUN` if not set|
8831When `RUN` filter rules in the parent projects are called to
8832post-process the results of the project specific rule. This
8833behavior matches how the rule will execute if installed. +
8834If `SKIP` the parent filters are not called, allowing the test
8835to return results from the input rule.
8836|===========================
8837
Edwin Kempin0eddba02013-02-22 15:30:12 +01008838[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008839=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01008840The `SubmitInput` entity contains information for submitting a change.
8841
David Pursehouseae367192014-11-25 17:24:47 +09008842[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008843|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01008844|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01008845|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05008846If set, submit the change on behalf of the given user. The value may take any
8847format link:rest-api-accounts.html#account-id[accepted by the accounts REST
8848API]. Using this option requires
8849link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
8850permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01008851|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07008852Notify handling that defines to whom email notifications should be sent after
8853the change is submitted. +
8854Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Nitzan Gur-Furman9da317c2022-10-07 11:19:53 +02008855If not set, the default is `ALL`.+
8856Ignored if a post approval diff is present (i.e. if the change is submitted
8857with copied approvals), because in this case everyone should be informed
8858about the non-reviewed diff which has been applied after the change has been
8859approved so that they can take action if the post approval diff looks
8860unexpected. In other words if a post approval diff is present `ALL` is
8861enforced.
Edwin Kempincd07df42016-12-01 09:10:09 +01008862|`notify_details`|optional|
8863Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008864of link:user-notify.html#recipient-types[recipient type] to
8865link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008866|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01008867
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008868[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008869=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008870The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02008871Fields in this entity roughly correspond to the fields set by `LABELS`
8872in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008873
David Pursehouseae367192014-11-25 17:24:47 +09008874[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008875|===========================
8876|Field Name ||Description
8877|`status`||
8878`OK`, the change can be submitted. +
8879`NOT_READY`, additional labels are required before submit. +
8880`CLOSED`, closed changes cannot be submitted. +
8881`RULE_ERROR`, rule code failed with an error.
8882|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01008883Map of labels that are approved; an
8884link:rest-api-accounts.html#account-info[AccountInfo] identifies the
8885voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008886|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01008887Map of labels that are preventing submit;
8888link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008889|`need`|optional|
8890Map of labels that need to be given to submit. The value is
8891currently an empty object.
8892|`may`|optional|
8893Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01008894link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
8895if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008896|`impossible`|optional|
8897Map of labels that should have been in `need` but cannot be
8898used by any user because of access restrictions. The value
8899is currently an empty object.
8900|`error_message`|optional|
8901When status is RULE_ERROR this message provides some text describing
8902the failure of the rule predicate.
8903|===========================
8904
Youssef Elghareeb02d33aa2021-10-04 13:24:52 +02008905[[submit-record-info]]
8906=== SubmitRecordInfo
8907The `SubmitRecordInfo` entity describes results from a submit_rule.
8908
8909[options="header",cols="1,^1,5"]
8910|===========================
8911|Field Name ||Description
8912|`rule_name`||
8913The name of the submit rule that created this submit record. The submit rule is
8914specified in the form of "$plugin~$rule" where `$plugin` is the plugin name
8915and `$rule` is the name of the class that implemented the submit rule.
8916|`status`||
8917`OK`, the change can be submitted. +
8918`NOT_READY`, additional labels are required before submit. +
8919`CLOSED`, closed changes cannot be submitted. +
8920`FORCED`, the change was submitted bypassing the submit rule. +
8921`RULE_ERROR`, rule code failed with an error.
8922|`labels`|optional|
8923A list of labels, each containing the following fields. +
8924 * `label`: the label name. +
8925 * `status`: the label status: {`OK`, `REJECT`, `MAY`, `NEED`, `IMPOSSIBLE`}. +
8926 * `appliedBy`: the link:rest-api-accounts.html#account-info[AccountInfo]
8927 that applied the vote to the label.
8928|`requirements`|optional|
8929List of the link:rest-api-changes.html#requirement[requirements] to be met
8930before this change can be submitted.
8931|`error_message`|optional|
8932When status is RULE_ERROR this message provides some text describing
8933the failure of the rule predicate.
8934|===========================
8935
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008936[[submit-requirement-expression-info]]
8937=== SubmitRequirementExpressionInfo
8938The `SubmitRequirementExpressionInfo` describes the result of evaluating a
8939single submit requirement expression, for example `label:code-review=+2`.
8940
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008941[options="header",cols="1,^1,5"]
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008942|===========================
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008943|Field Name ||Description
8944|`expression`|optional|
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008945The submit requirement expression as a string, for example
8946`branch:refs/heads/foo and label:verified=+1`.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008947|`fulfilled`||
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008948True if the submit requirement is fulfilled for the change.
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02008949|`status`||
8950A string containing the status of evaluating the expression which can be one
8951of the following: +
8952 * `PASS` - expression was evaluated and result is true. +
8953 * `FAIL` - expression was evaluated and result is false. +
8954 * `ERROR` - an error occurred while evaluating the expression. +
8955 * `NOT_EVALUATED` - expression was not evaluated.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008956|`passing_atoms`|optional|
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008957A list of passing atoms as strings. For the above expression,
8958`passing_atoms` can contain ["branch:refs/heads/foo"] if the branch predicate is
8959fulfilled for the change.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008960|`failing_atoms`|optional|
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008961A list of failing atoms. This is similar to `passing_atoms` except that it
8962contains the list of predicates that are not fulfilled for the change.
Youssef Elghareeb393be612021-11-16 13:39:33 +01008963|`error_message`|optional|
8964If the submit requirement fails during evaluation, this string will contain
8965an error message describing why it failed.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008966|===========================
8967
Youssef Elghareebd5986932021-10-15 11:45:23 +02008968[[submit-requirement-input]]
8969=== SubmitRequirementInput
8970The `SubmitRequirementInput` entity describes a submit requirement.
8971
8972[options="header",cols="1,^1,5"]
8973|===========================
8974|Field Name ||Description
8975|`name`||
8976The submit requirement name.
8977|`description`|optional|
8978Description of the submit requirement.
8979|`applicability_expression`|optional|
8980Query expression that can be evaluated on any change. If evaluated to true on a
8981change, the submit requirement is then applicable for this change.
8982If not specified, the submit requirement is applicable for all changes.
8983|`submittability_expression`||
8984Query expression that can be evaluated on any change. If evaluated to true on a
8985change, the submit requirement is fulfilled and not blocking change submission.
8986|`override_expression`|optional|
8987Query expression that can be evaluated on any change. If evaluated to true on a
8988change, the submit requirement is overridden and not blocking change submission.
8989|`allow_override_in_child_projects`|optional|
8990Whether this submit requirement can be overridden in child projects. Default is
8991`true`.
8992|===========================
8993
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008994[[submit-requirement-result-info]]
8995=== SubmitRequirementResultInfo
8996The `SubmitRequirementResultInfo` describes the result of evaluating a
8997submit requirement on a change.
8998
8999[options="header",cols="1,^1,5"]
9000|===========================
9001|Field Name ||Description
9002|`name`||
9003The submit requirement name.
9004|`description`|optional|
9005Description of the submit requirement.
9006|`status`||
9007Status describing the result of evaluating the submit requirement. The status
Youssef Elghareebf592ed12021-11-26 15:52:06 +01009008is one of (`SATISFIED`, `UNSATISFIED`, `OVERRIDDEN`, `NOT_APPLICABLE`, `ERROR`,
9009`FORCED`).
Youssef Elghareeb024103e2021-09-06 14:41:04 +02009010|`is_legacy`||
9011If true, this submit requirement result was created from a legacy
9012link:#submit-record[SubmitRecord]. Otherwise, it was created by evaluating a
9013submit requirement.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02009014|`applicability_expression_result`|optional|
9015A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
9016containing the result of evaluating the applicability expression. Not set if the
9017submit requirement did not define an applicability expression.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02009018Note that fields `expression`, `passing_atoms` and `failing_atoms` are always
9019omitted for the `applicability_expression_result`.
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02009020|`submittability_expression_result`||
Youssef Elghareeb79f473622021-05-26 18:58:40 +02009021A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
Marija Savtchouk6d87bae2022-01-20 17:06:22 +00009022containing the result of evaluating the submittability expression. +
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02009023If the submit requirement does not apply, the `status` field of the result
9024will be set to `NOT_EVALUATED`.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02009025|`override_expression_result`|optional|
9026A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
Marija Savtchouk6d87bae2022-01-20 17:06:22 +00009027containing the result of evaluating the override expression. +
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02009028Not set if the submit requirement did not define an override expression. If the
9029submit requirement does not apply, the `status` field of the result will be set
9030to `NOT_EVALUATED`.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02009031|===========================
9032
Jonathan Nieder2a629b02016-06-16 15:15:25 -07009033[[submitted-together-info]]
9034=== SubmittedTogetherInfo
9035The `SubmittedTogetherInfo` entity contains information about a
9036collection of changes that would be submitted together.
9037
9038[options="header",cols="1,6"]
9039|===========================
9040|Field Name |Description
9041|`changes` |
9042A list of ChangeInfo entities representing the changes to be submitted together.
9043|`non_visible_changes`|
9044The number of changes to be submitted together that the current user
9045cannot see. (This count includes changes that are visible to the
9046current user when their reason for being submitted together involves
9047changes the user cannot see.)
9048|===========================
9049
Edwin Kempin521c1242015-01-23 12:44:44 +01009050[[suggested-reviewer-info]]
9051=== SuggestedReviewerInfo
9052The `SuggestedReviewerInfo` entity contains information about a reviewer
9053that can be added to a change (an account or a group).
9054
9055`SuggestedReviewerInfo` has either the `account` field that contains
9056the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
9057the `group` field that contains the
9058link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
9059
Logan Hanksab3c81e2016-07-20 15:42:52 -07009060[options="header",cols="1,^1,5"]
9061|===========================
9062|Field Name ||Description
9063|`account` |optional|
9064An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
9065suggestion is an account.
9066|`group` |optional|
9067A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
9068suggestion is a group.
9069|`count` ||
9070The total number of accounts in the suggestion. This is `1` if `account` is
9071present. If `group` is present, the total number of accounts that are
9072members of the group is returned (this count includes members of nested
9073groups).
9074|`confirm` |optional|
9075True if `group` is present and `count` is above the threshold where the
9076`confirmed` flag must be passed to add the group as a reviewer.
9077|===========================
9078
Edwin Kempin64006bb2013-02-22 08:17:04 +01009079[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08009080=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01009081The `TopicInput` entity contains information for setting a topic.
9082
David Pursehouseae367192014-11-25 17:24:47 +09009083[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01009084|===========================
9085|Field Name ||Description
9086|`topic` |optional|The topic. +
9087The topic will be deleted if not set.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02009088Topic can't contain quotation marks.
Edwin Kempin64006bb2013-02-22 08:17:04 +01009089|===========================
9090
Makson Lee3568a932017-08-28 17:12:03 +08009091[[tracking-id-info]]
9092=== TrackingIdInfo
9093The `TrackingIdInfo` entity describes a reference to an external tracking system.
9094
9095[options="header",cols="1,6"]
9096|======================
9097|Field Name|Description
9098|`system` |The name of the external tracking system.
9099|`id` |The tracking id.
9100|======================
9101
Oleg Aravinbf313bb2016-10-24 12:28:56 -07009102[[voting-range-info]]
9103=== VotingRangeInfo
9104The `VotingRangeInfo` entity describes the continuous voting range from min
9105to max values.
9106
9107[options="header",cols="1,6"]
9108|======================
9109|Field Name|Description
9110|`min` |The minimum voting value.
9111|`max` |The maximum voting value.
9112|======================
9113
Edwin Kempinbd885ff2014-04-11 16:11:56 +02009114[[web-link-info]]
9115=== WebLinkInfo
Ben Rohlfs25c478112023-03-16 16:06:40 +01009116The `WebLinkInfo` entity describes a link to an external site. Depending on the
9117context and the provided data the UI may decide to show the link as a text link,
9118a linkified icon, or both.
9119
9120If the `tooltip` is not provided, then the UI may fall back to showing something
9121like "Open in External Tool".
9122
9123Weblinks will always be opened in a new tab.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02009124
Edwin Kempinaf35ce42021-01-29 13:50:04 +01009125[options="header",cols="1,^1,5"]
9126|========================
9127|Field Name ||Description
Ben Rohlfs25c478112023-03-16 16:06:40 +01009128|`name` ||The text to be linkified.
9129|`tooltip` |optional|Tooltip to show when hovering over the link. Using "Open
9130in $NAME_OF_EXTERNAL_TOOL" is a good option here.
Edwin Kempinaf35ce42021-01-29 13:50:04 +01009131|`url` ||The link URL.
9132|`image_url`|optional|URL to the icon of the link.
Edwin Kempinaf35ce42021-01-29 13:50:04 +01009133|========================
Edwin Kempinbd885ff2014-04-11 16:11:56 +02009134
Alan Tokaev392cfca2017-04-28 11:11:31 +02009135[[work-in-progress-input]]
9136=== WorkInProgressInput
9137The `WorkInProgressInput` entity contains additional information for a change
9138set to WorkInProgress/ReadyForReview.
9139
9140[options="header",cols="1,^1,5"]
9141|=============================
9142|Field Name ||Description
9143|`message` |optional|
9144Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview.
9145|=============================
9146
Edwin Kempind0a63922013-01-23 16:32:59 +01009147GERRIT
9148------
9149Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07009150
9151SEARCHBOX
9152---------